370 likes | 742 Vues
Primal Dual Method. found x, succeed!. primal. dual. restricted primal. restricted dual. Lecture 20: March 28. y. z. Construct a better dual. Primal Dual Program. Primal Program. Dual Program. If there is a feasible primal solution x and a feasible dual solution y,
E N D
Primal Dual Method found x, succeed! primal dual restricted primal restricted dual Lecture 20: March 28 y z Construct a better dual
Primal Dual Program Primal Program Dual Program If there is a feasible primal solution x and a feasible dual solution y, then both are optimal solutions. Primal-Dual Method: An algorithm to construct such a pair of solutions.
Optimality Condition Suppose there is a feasible primal solution x, and a feasible dual solution y. How do we check that they are optimal solutions? Avoid strict inequality
Optimality Condition Avoid strict inequality
Complementary Slackness Conditions Primal complementary slackness condition: Dual complementary slackness condition:
Primal Dual Method Start from a feasible dual solution. Search for a feasible primal solution satisfying complementary slackness conditions. If not, improve the objective value of dual solution. repeat
Restricted Primal Given a feasible dual solution y, how do we search for a feasible primal solution x that satisfies complementary slackness conditions? Formulate this as an LP itself! Primal complementary slackness condition: Dual complementary slackness condition:
Restricted Primal If j not in J, then we need x(j) to be zero. If i not in I, then we need If zero, we are done Restricted primal
Restricted Dual Suppose the objective of the restricted primal is not zero, what do we do? Then we want to find a better dual solution. nonzero Restricted primal Restricted dual
Restricted Dual Consider y+єz as the new dual solution. nonzero Restricted dual Dual Program Larger value Still feasible
General Framework found x, succeed! primal dual restricted primal restricted dual y z Construct a better dual
Bipartite Matching Primal complementary slackness condition:
Hungarian Method Start from a feasible vertex cover Consider y- єz, a better dual Find a perfect matching using tight edges non-zero
Remarks It is not a polynomial time method. It reduces the weighted problem to the unweighted problem, so that the restricted primal linear program is easier to solve, and often there are combinatorial algorithms to solve it. Many combinatorial algorithms, like max-flow, matching, min-cost flow, shortest path, spanning tree, …, can be derived within this framework.
Approximation Algorithm How do we adapt the primal-dual method for approximation algorithms? We want to construct a primal feasible solution x and a dual feasible solution y so that cx and by are “close”. Avoid losing too much
Approximate Optimality Condition Avoid strict inequality
Approximate Complementary Slackness Condition Primal complementary slackness condition: Dual complementary slackness condition: Only a sufficient condition
Vertex Cover Primal complementary slackness condition: Dual complementary slackness condition:
Approximate Optimality Conditions Primal complementary slackness condition: Just focus on this! Pick only vertices that go tight. Dual complementary slackness condition: Pick only edge with one vertex in the vertex cover. This is nothing! This would imply a 2-approximation.
Algorithm Pick only vertices that go tight. Algorithm (2-approximation for vertex cover) Initially, x=0, y=0 When there is an uncovered edge Pick an uncovered edge, and raise y(e) until some vertices go tight. Add all tight vertices to the vertex cover. Output the vertex cover x. This is the greedy matching 2-approximation when every vertex has the same cost. Familiar?
Multicut Given k source-sink pairs {(s1,t1), (s2,t2), ...,(sk,tk)}, a multicut is a set of edges whose removal disconnects each source-sink pair. The multicut problem asks for the minimum weight multicut. Today we only consider a tree! s2 t1 t2 s1
Hardness Why would this problem is hard? Vertex cover.
Primal Dual Programs Primal complementary slackness condition: Dual complementary slackness condition:
Approximate Optimality Conditions Primal complementary slackness condition: Only pick saturated edges. Dual complementary slackness condition: two At most one edge can be picked from a path carrying nonzero flow. Relaxed dual complementary slackness condition:
Algorithmic Idea We want to construct flow and cut so that: Only pick saturated edges. At most two edges can be picked from a path carrying nonzero flow. How to choose the flow? We should avoid sending flow along a long path…
Algorithm Multicut in Tree (2-approximation algorithm) Initially, f=0, D=0 Flow routing: Find a pair (si,ti) with lowest lowest common ancestor, Greedily send flow from si to ti. Add all the saturated edges to D. Let e1, e2,…, el be the ordered list of edges in D. Reverse delete: In reverse order, delete an edge e from D if D-e is still a multicut. Output the flow and the cut.
Reverse Delete At most two edges can be picked from a path carrying nonzero flow. Lemma. After reverse delete, the above condition is satisfied. v i can send a flow, so e is added after e*. e’ u there exists j where e is the only edge. e* j is processed earlier than i. Idea? e tj sj si ti
Bonus Question Bouns Question 5 (50%): Show that a basic solution of the linear program for multicut in tree has an edge of value at least 1/2. Bouns Question 6 (50%): Show that a basic solution of the linear program for multiway cut has an edge of value at least 1/2.
Remarks • Network design • Facility location • Online primal dual A unify primal-dual method for exact and approximation algorithm?