Peter Pietrzyk 1
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and Complexity
Facility Location: Sequential and Distributed Approximation Algorithms
Peter Pietrzyk
04.05.2011
Peter Pietrzyk 2
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and ComplexityOverview
• Facility Location – Definition– Properties
• Sequential (and distributed) Algorithms– Greedy Algorithm– Primal-Dual Algorithm– Algorithm comprising Greedy and Primal-Dual approaches
• Relevance for our Project Group– External Dynamics– Controlled Dynamics
Peter Pietrzyk 3
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and ComplexityMetric Facility Location Problem
Facilities
Clients
1 2 3 4
1 2 4 5 63
Complete bipartite,weighted graph
• Nodes change roles:– Facilities– Clients Metric Clique
• opening costs for facility
• distance between client and facility
• are indicator variables
Peter Pietrzyk 4
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and ComplexityApplications for local Facility Location algorithms
• Computer Networks– Selected nodes provide a costly service– Latency corresponds to distance (shortest path metric)– Huge graphs require local algorithms– Changes in latency (External Dynamic)
• Mobile Sensor Networks– Some robots provide services to other robots– Distance is represented by the Euclidean distance– High numbers of simple robots require local algorithms– Mobility of the robots (External Dynamic)
Peter Pietrzyk 5
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and ComplexityProperties of the Facility Location Problem
• Inherent locality (explained later)• NP-hard• Approximation (without metric):
– • Approximation (with metric):
– factor is possible (by Byrka [APPROX 2007])– Lower bound of 1.463 (by Guha et al. [J. of Algo 1999]
(assuming NPDTIME)• Various types of algorithms:
– Greedy– Primal-Dual– LP-Rounding– PLS (Polynomial Time Local Search)
Peter Pietrzyk 6
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and ComplexityWhat‘s an intuitive way to solve the problem?
• Open cheap facilities• Open facilities with many clients close by• Do not open facilities that are close to each other
2
210
5
3
3
534
6
6
7
1
Find a balance between the properties above
Peter Pietrzyk 7
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and ComplexityOverview
• Facility Location – Definition– Properties
• Sequential (and distributed) Algorithms– Greedy Algorithm– Primal-Dual Algorithm– Algorithm comprising Greedy and Primal-Dual approaches
• Relevance for our Project Group– External Dynamics– Controlled Dynamics
Peter Pietrzyk 8
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and Complexity
Radius Definition by Mettu and Plaxton [FOCS 2000]
• Radius of node :
– Choose such that – is the radius of node
• Small radius:– many nodes close by– cheap facility
• What about nodes with small radius close to each other?– not considered in the radius value
Peter Pietrzyk 9
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and Complexity
Algorithm by Mettu and Plaxton [FOCS 2000]
• Compute the radius value for each node• Use the radius to sort the nodes (ascending order)• Iterate over the sorted list• Open node if there is no other opened node in
times the radius of
• Runtime: where is the number of nodes• Approximation factor:
Peter Pietrzyk 10
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and ComplexityAsynchronous Execution Model
• Computation at each node is free• At most one node is active at any point in time• Runtime defined by number of rounds:
– Nodes become active in an arbitrary order– A round ends when all nodes were active at least once
• Locality: Nodes „close“ to each other can communicate
Peter Pietrzyk 11
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and ComplexityThe distributed approximation algorithm
Algorithm from a node’s point of view:1. Gather information about neighbor nodes:
• How far away are they?2. Compute radius and round it to the next power of (only possible
values for the radius)3. In an endless loop:
• Wake up (become active)• Check invariant (next slide)• Change role if necessary• Go back to sleep
Peter Pietrzyk 12
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and ComplexityRestoring the Invariant
Nodes choose their role in such a way that the following two conditions are satisfied:
4ri
ri2ri
rii
• If is a client, there must be a facility with and
• If is a facility, there must not any other facility with and
• Runtime: , where is the number of nodes𝑛• Proof Idea:
• State of the nodes with the smallest radius does not change after 2 rounds
• Once all nodes with radius stop changing their state, nodes with radius will stop changing thier states within 2 rounds
• There are only different radius values
i
Peter Pietrzyk 13
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and ComplexityDistributed Execution Models
• Asynchronous Model– Computation at each node is free– At most one node is active at any point in time– Runtime defined by number of rounds:
• Nodes become active in an arbitrary order• A round ends when all nodes were active at least once
– Locality: Nodes „close“ to each other can communicate
• Synchronous Model• Computation at each node is free• All nodes become active at the same time• LOCAL (unlimited message size)• CONGEST (limited message size)
Peter Pietrzyk 14
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and Complexity-Approximation in rounds
• Each node computes its own radius radius classes (set of nodes with same radius)
• Create a graph for each radius class :– Nodes with radius belong to – Edges: and
• Compute a for each graph• All nodes not in one of the ‘s are clients• Rest of the nodes changes their roles until:
– Each client has a facility close by– For each facility there is no other facility close by
c
c
c
cc
cc
c
c
Peter Pietrzyk 15
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and ComplexityOverview
• Facility Location – Definition– Properties
• Sequential (and distributed) Algorithms– Greedy Algorithm– Primal-Dual Algorithm– Algorithm comprising Greedy and Primal-Dual approaches
• Relevance for our Project Group– External Dynamics– Controlled Dynamics
Peter Pietrzyk 16
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and ComplexityProblem Definition
Facilities
Clients
1 2 3 4
1 2 4 5 63
Complete bipartite,metric graph
Metric Clique
• opening costs for facility
• distance between client and facility
• are indicator variables
Peter Pietrzyk 17
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and ComplexityDuality (applied to the facility location problem)
• Duality Theorem: An optimal solution to the relaxed primal program has the same costs as an optimal solution to the dual program.
Primal
Dualrelaxed
primal slackness condition (1) (2)
dual slackness condition (3) (4)
min. max. s.t. s.t.
Peter Pietrzyk 18
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and ComplexityDuality & the Complemtary Slackness Condition
primal slackness condition (1) (2)
dual slackness condition (3) (4)
relaxed primal slackness condition (5) (6)
Costs
feasible primal solutionsfeasible dual solutions
optimal primal solution (relaxed)optimal dual solution
optimal primal solution
OPT 3 OPTOPT/3
solution pair that satisfies relaxed slackness condition
Peter Pietrzyk 19
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and ComplexityIntuition for the dual program
primal slackness condition (1) (2)
• Think of as the amount client is willing to pay:– (2) costs of each opened facility are covered by – (4) only clients connected to pay for its opening– (1) means that is composed of the connection costs
and the opening costs
• Assume and are optimal solutions and contains only integers
dual slackness condition (3) (4)
Peter Pietrzyk 20
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and ComplexityAlgorithm by Jain and Vazirani [FOCS 1999]
• Phase 1:– Infeasible primal solution (all and are set to )– Feasible dual solution (all and are set to )– Increase all simultaneously– Once , start increasing – Once , stop increasing and of all clients with . Also, open facility and
connect clients to it with .
• Phase 2 (explained later)
Primal
Dual
Peter Pietrzyk 21
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and ComplexityAlgorithm by Jain and Vazirani [FOCS 1999] (2)
• We (potentially) opened way too many facilities in Phase 1.• Which facilities do we close?
• Phase 2:– We need to construct the following conflict graph :
• Facilities that have more than 1 contributing client are node• If a client contributes to facility and , there is an edge between and
– Compute an maximal independent set on – Close all facility that are not in the maximal independent set– Reconnect the clients that „lost“ a facility to neighbors of in
Peter Pietrzyk 22
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and ComplexityProof Idea of Jain & Vazirani‘s algorithm
• Must show that: (since )
relaxed primal slackness condition (5) (6)
𝑖𝑖 ′
𝑗 ′𝑗𝑐 𝑖𝑗
𝑐 𝑖𝑗 ′
𝑐 𝑖 ′ 𝑗 ′𝑐 𝑖 ′ 𝑗
– resp. time resp. opened
Client was connected to in the first phase
Peter Pietrzyk 23
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and Complexity
Distributed Version of the Jain and Vazirani Algorithm [PODC 2009, Pandit & Pemmaraju]
• Executed on a complete bipartite graph using the CONGEST model
• Ensure polylogarithmic runtime by handling cheap facilities (Initialization Phase)
• 1. Phase: Increasing the variable continuously is not possible multiply by in each step
• Use Luby‘s MIS algorithm for the 2. Phase
• Proof:– Initialization Phase: can be ommited, since facility costs and distances are
limited to bits – 1. Phase: Same as the original version– 2. Phase: Need to check if Luby‘s algorithm can be computed on the
bipartite graph in the CONGEST model
Peter Pietrzyk 24
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and ComplexityOverview
• Facility Location – Definition– Properties
• Sequential (and distributed) Algorithms– Greedy Algorithm– Primal-Dual Algorithm– Algorithm comprising Greedy and Primal-Dual
approaches• Relevance for our Project Group
– External Dynamics– Controlled Dynamics
Peter Pietrzyk 25
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and Complexity
The Greedy Algorithm (with a Primal-Dual approach)
• Authors: Jain, Madhian, Marakakis, Saberi, Vazirani
• Journal of the ACM 2003• Approximation factor: • Runtime: ( is the number of edges)• Analysis: Dual-fitting with factor revealing LP
Peter Pietrzyk 26
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and ComplexityThe Greedy Algorithm (Cost efficient Stars)
• A star consists of facility and a set of clients • Cost of a star is • The cost of the cheapest star around is equal to its radius• Algorithm:
– For each compute the cheapest star – Open with the overall cheapest star and connect all to – Set and remove from – Repeat until no clients left in
• In contrast to the radius in the algorithm by Mettu and Plaxton the cost of the star is updated after a facility has been opened.
• The algorithm above can be simulated by a „kind of“ primal-dual algorithm.
Peter Pietrzyk 27
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and ComplexityThe Greedy Algorithm (Description)
• Imagine to be the amount client wants to pay• Each client increases until it is connected to an open facility• Once client starts paying for facility • Once facility is opened ( are unconnected clients) and all
contributing clients are connected to
facilities
client
1 2
j
𝛼 𝑗 𝛼 𝑗
𝛽1 𝑗 𝛽2 𝑗Solution costs:
– Only paid facilities are opened– Clients contribute only to a
single facility – Clients contribute after the
connection costs are paid
Peter Pietrzyk 28
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and ComplexityInfeasibility of the dual solution
• The computed solution is not a feasible dual:– Open if ( are unconnected clients)– should be opened earlier!
• Can not use duality to prove the appr. factor (yet!)
Dual
Peter Pietrzyk 29
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and ComplexityDual Fitting
feasible primal
solutions
feasible dual
solutions
optimal solution
cost of the primal solution ( )
∑𝑗 ∈𝐶
𝛼 𝑗
𝛾
• Find , such that is a feasible dual solution• is the approximation factor• What is the minimum that works for all possible instances?
Peter Pietrzyk 30
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and ComplexityFactor Revealing LP
Lemma 1: For every two clients and a facility we have:
Lemma 2: For every client and facility :
metric property
no facility isover-paid
• Find the minimum for which • Same as finding the maximum ratio of
– are variables– The constraints of Lemma 1 and 2 must be met
Peter Pietrzyk 31
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and ComplexityParallel Execution of the Greedy Algorithm
• CONGEST Model (synchronous, limited message size)• Each client increases in discrete time steps by muliplying
it with , • Once for facility , is increased in the same way• Once , facility is opened and all contributing clients are
connected with it…
Problem: What happens if many facilities are eligible for opening in the same step?
Peter Pietrzyk 32
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and ComplexityDealing with facility selection
Facilities that are fully paidand could be opened now
Clients paying for these facilities
1 2 3 4
1 2 4 5 63
1 2
3 4
• Compute a Maximal Independent Set in rounds with Luby’s algo.
• Open Facilities in the MIS• MIS guarantees:
1. Opened facility gets all its clients2. Client assigned to at most one facility
Facility Graph
Peter Pietrzyk 33
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and ComplexityThe Problem!
Lemma 2: For every client and facility :
Modified Version:
• Set contains fully paid facilities• Payment of is in • Need to guarantee:
– Facility is open in the next round,– or the payment for is
• That is not always the case!
1 2 3 4
1 2 4 5 63
If payment of not opened facilities , then their payment might be next round
Lemma 2 violated
no facility isover-paid
Peter Pietrzyk 34
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and ComplexityDealing with facility selection (2)
• MIS does not preseve the approximation factor• Rajagopalan & Vazirani give a 2-approximation in
[J. of Comp 1998]• Pandit & Pemmaraju give a constant factor
approximation in expectation in [PODC2010]• By computing an independent set interatively one
can get a approximation (but in time)
Peter Pietrzyk 35
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and ComplexityOverview
• Facility Location – Definition– Properties
• Sequential (and distributed) Algorithms– Greedy Algorithm– Primal-Dual Algorithm– Algorithm comprising Greedy and Primal-Dual approaches
• Relevance for our Project Group– External Dynamics– Controlled Dynamics
Peter Pietrzyk 36
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and ComplexityHow to model and deal with External Dynamics
• Modeling External Dynamics– Input Stream (distances and costs change over time)– Only small changes to the problem instance in a single step
• Analyzing External Dynamics– Competitive Analysis– Quiescence Analysis
• Stop changing the instance at time • At time the algorithm computed a good solution• What is )?• Is the entire solution or just a limited area affected?• Are all nodes affected?• …
Peter Pietrzyk 37
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and Complexity
The distributed Greedy Algorithm by Mettu and Plaxton dealing with External Dynamics
The algorithm from a node’s point of view:1. Sleep (inactive state, most of the time)2. Weak Up (active state)!3. Gather information about neighbor nodes:
• What is their radius?• What is their role (facility/client)?• How far away are they?
4. Compute radius5. Check invariant (change role if necessary)6. Go back to sleep (1.)
We can guarantee that:– Role changes take place in constant distance of an event
(violation of the invariant)– Number of affected nodes is O(log2(n)) (euclidean case)– Amount of role changes per node is limited to 2
Peter Pietrzyk 38
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and ComplexityOverview
• Facility Location – Definition– Properties
• Sequential (and distributed) Algorithms– Greedy Algorithm– Primal-Dual Algorithm– Algorithm comprising Greedy and Primal-Dual approaches
• Relevance for our Project Group– External Dynamics– Controlled Dynamics
Peter Pietrzyk 39
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and ComplexityControlled Dynamics
• Algorithms not only can change the role of nodes, but also the distances between the nodes (in a limited way)
3
3
53
46
6
7
1
• What should the costs of our new solution be compared to and how?
• Challenge: Find a reasonable quality measure for algorithms that use Controlled Dynamics.
Peter Pietrzyk 40
HEINZ NIXDORF INSTITUTEUniversity of Paderborn
Algorithms and Complexity
Heinz Nixdorf Institute& Computer Science InstituteUniversity of PaderbornFürstenallee 1133102 Paderborn, Germany
Tel.: +49 (0) 52 51/60 64 66Fax: +49 (0) 52 51/62 64 82E-Mail: [email protected]://www.upb.de/cs/ag-madh
Thank you for your attention!
Top Related