Presentation is loading. Please wait.

Presentation is loading. Please wait.

5.3 Minimum-Weight Perfect Matchings

Similar presentations


Presentation on theme: "5.3 Minimum-Weight Perfect Matchings"β€” Presentation transcript:

1 5.3 Minimum-Weight Perfect Matchings
IP formulation of the minimum-weight perfect matching problem. Minimize (𝑐𝑒π‘₯𝑒:π‘’βˆˆπΈ) (5.5) subject to π‘₯((𝑣))=1, for all π‘£βˆˆπ‘‰ (5.6) π‘₯π‘’βˆˆ{0, 1}, for all π‘’βˆˆπΈ. (5.7) LP relaxation of the problem (gives lower bound on the min value) Minimize (𝑐𝑒π‘₯𝑒:π‘’βˆˆπΈ) (5.8) subject to π‘₯((𝑣))=1, for all π‘£βˆˆπ‘‰ π‘₯𝑒β‰₯0, for all π‘’βˆˆπΈ. Generally, the lower bound from (5.8) is not equal to the desired optimum. But it gives the true optimal value for the case of bipartite graphs. (Same statement as the Birkhoff’s Theorem) It also implies that the extreme points of the polyhedron defined by (5.8) are integral vectors. Combinatorial Optimization 2016

2 Minimum Weight Perfect Matching in Bipartite Graphs
Thm 5.12 (Birkhoff): Let 𝐺 be a bipartite graph, and let π‘βˆˆ 𝑅 𝐸 . Then 𝐺 has a perfect matching ⇔ (5.8) has a feasible solution. Moreover, if 𝐺 has a perfect matching, then the minimum weight of a perfect matching is equal to the optimal value of (5.8). Consider primal-dual pair: (P) Minimize (𝑐𝑒π‘₯𝑒:π‘’βˆˆπΈ) (5.8) subject to π‘₯((𝑣))=1, for all π‘£βˆˆπ‘‰ π‘₯𝑒β‰₯0, for all π‘’βˆˆπΈ. (D) Maximize ( 𝑦 𝑣 :π‘£βˆˆπ‘‰) (5.9) subject to 𝑦𝑒+𝑦𝑣≀ 𝑐 𝑒 , for all 𝑒=π‘’π‘£βˆˆπΈ. Devise a primal-dual algorithm to find a solution that satisfies CS conditions and show that the optimal solution is integer. Combinatorial Optimization 2016

3 Given π‘¦βˆˆπ‘…π‘‰, and 𝑒=𝑒𝑣, denote by 𝑐 𝑒 = 𝑐 𝑒 (𝑦) as π‘π‘’βˆ’(𝑦𝑒+𝑦𝑣).
Hence 𝑦 is feasible to dual iff 𝑐 𝑒 β‰₯0 for all π‘’βˆˆπΈ. Let 𝐸 = (or 𝐸 = (𝑦))≑ π‘’βˆˆπΈ: 𝑐 𝑒 =0 CS conditions β‡’ π‘₯𝑒>0 implies 𝑐 𝑒 =0, for all π‘’βˆˆπΈ. If we can find a perfect matching on 𝐸 = , it is optimal to (5.8). If procedure stuck, have 𝑀-alternating tree using edges in 𝐸 = such that nodes of 𝐡(𝑇) are joined by equality edges only to nodes in 𝐴(𝑇) Change 𝑦 to increase 𝐸 = , let 𝑦𝑣 ← 𝑦𝑣+ο₯ for 𝑣 οƒŽπ΅(𝑇) π‘¦π‘£βˆ’ο₯ for π‘£βˆˆπ΄(𝑇) while maintaining the feasibility of 𝑦. Added edge will be joining 𝑣 to a node not in 𝑉(𝑇) since 𝐺 is bipartite. β‡’ "Hungarian Algorithm" (Kuhn[1955], Munkres[1957]) Combinatorial Optimization 2016

4 1 2 3 6 𝑔 2 β„Ž π‘Ž 𝑏 5 π‘Ÿ 3 2 4 1 6 𝑑 𝑓 4 4 2 3 1 5 𝑖 Let ο₯=1 (for edge 𝑓𝑔) 3 3 6 𝑔 2 β„Ž π‘Ž 𝑏 5 π‘Ÿ 3 2 4 2 6 𝑑 𝑓 4 4 2 2 2 5 𝑖 Combinatorial Optimization 2016

5 Minimum-Weight Perfect Matching Algorithm for Bipartite Graphs
Let 𝑦 be a feasible solution to (5.9), 𝑀 a matching of 𝐺 = ; Set 𝑇=({π‘Ÿ}, βˆ…), where π‘Ÿ is an 𝑀-exposed node of 𝐺; Loop: While there exists π‘£π‘€βˆˆ 𝐸 = with π‘£βˆˆπ΅(𝑇), π‘€βˆ‰π‘‰(𝑇) If 𝑀 is 𝑀-exposed Use 𝑣𝑀 to augment 𝑀 ; If there is no 𝑀-exposed node in 𝐺 Return the perfect matching 𝑀 and stop ; Else Replace 𝑇 by ({π‘Ÿ}, βˆ…), where π‘Ÿ is 𝑀-exposed; Use 𝑣𝑀 to extend 𝑇; If every π‘£π‘€βˆˆπΈ with π‘£βˆˆπ΅(𝑇) has π‘€βˆˆπ΄(𝑇) Stop, 𝐺 has no perfect matching ; Let ο₯= min { 𝑐 𝑣𝑀 :π‘£βˆˆπ΅(𝑇), π‘€βˆ‰π‘‰(𝑇)} Replace 𝑦𝑣 by 𝑦𝑣+ο₯ for π‘£βˆˆπ΅(𝑇), π‘¦π‘£βˆ’ο₯ for π‘£βˆˆπ΄(𝑇) ; Combinatorial Optimization 2016

6 May need dual change at each tree extension step
β‡’ 𝑂(𝑛2) total dual changes Straightforward implementation needs examining of all edges β‡’ 𝑂(𝑛2π‘š) Idea used in Prim's algorithm for minimum spanning trees β‡’ 𝑂(𝑛3) Question: Do the previous results provide a proof of Birkhoff’s theorem? Combinatorial Optimization 2016

7 Minimum Weight Perfect Matching in General
(5.8) not enough to obtain an integer optimal solution. 9 3 6 8 1 5 2 4 7 π‘₯𝑒=1/2 for edges of two triangles is optimal solution to LP relaxation with value But value of a minimum weight perfect matching is 14. We call a cut 𝐷 of 𝐺 odd if it is of the form 𝛿(𝑆) where 𝑆 is an odd-cardinality set of nodes. β‡’ π‘₯(𝐷)β‰₯1 for all odd cut 𝐷 of 𝐺. (blossom (odd set) inequality) Combinatorial Optimization 2016

8 Minimize (𝑐𝑒π‘₯𝑒:π‘’βˆˆπΈ) (5.13) subject to π‘₯(𝛿(𝑣))=1, for all π‘£βˆˆπ‘‰ (5.14)
Let π’ž be the set of odd cuts of 𝐺 that are not of the form 𝛿(𝑣) for some 𝑣. Minimize (𝑐𝑒π‘₯𝑒:π‘’βˆˆπΈ) (5.13) subject to π‘₯(𝛿(𝑣))=1, for all π‘£βˆˆπ‘‰ (5.14) π‘₯(𝐷)β‰₯1, for all π·βˆˆπ’ž (5.15) π‘₯𝑒 β‰₯0, for all π‘’βˆˆπΈ. (5.16) Thm 5.13: Let 𝐺 be a graph, and let π‘βˆˆπ‘…πΈ. Then 𝐺 has a perfect matching ⇔ (5.13) has a feasible solution Moreover, if 𝐺 has a perfect matching, then the minimum weight of a perfect matching is equal to the optimal value of (5.13). Combinatorial Optimization 2016

9 (P) Minimize (𝑐𝑒π‘₯𝑒:π‘’βˆˆπΈ) (5.13)
Also, devise an algorithm to find a primal, dual feasible solution that satisfies CS conditions and show that the optimal solution is integer. (P) Minimize (𝑐𝑒π‘₯𝑒:π‘’βˆˆπΈ) (5.13) subject to π‘₯(𝛿(𝑣))=1, for all π‘£βˆˆπ‘‰ (5.14) π‘₯(𝐷)β‰₯1, for all π·βˆˆπ’ž (5.15) π‘₯𝑒β‰₯0, for all π‘’βˆˆπΈ. (5.16) (D) Maximize 𝑦 𝑣 :π‘£βˆˆπ‘‰ π‘Œ 𝐷 :π·βˆˆπ’ž (5.17) subject to 𝑦𝑒+𝑦𝑣+ π‘Œ 𝐷 :π‘’βˆˆπ·βˆˆπ’ž ≀ 𝑐 𝑒 , for all 𝑒=π‘£π‘€βˆˆπΈ. (5.18) π‘Œπ·β‰₯0, for all π·βˆˆπ’ž (5.19) ( 𝑦 𝑣 free, for all π‘£βˆˆπ‘‰) Let 𝑐 𝑒 = 𝑐 𝑒 𝑦,π‘Œ be π‘π‘’βˆ’(𝑦𝑒+𝑦𝑣+( π‘Œ 𝐷 :π‘’βˆˆπ·βˆˆπ’ž)) CS conditions β‡’ π‘₯𝑒>0 implies 𝑐 𝑒 =0, for all π‘’βˆˆπΈ (5.20) π‘Œπ·>0 implies π‘₯(𝐷)=1, for all π·βˆˆπ’ž (5.21) Combinatorial Optimization 2016

10 In terms of matching, the conditions are
π‘’βˆˆπ‘€ implies 𝑐 𝑒 =0, for all π‘’βˆˆπΈ (5.22) π‘Œπ·>0 implies |π‘€βˆ©π·|=1, for all π·βˆˆπ’ž (5.23) To handle π‘Œπ·, work on the derived graph 𝐺′ of 𝐺. Note that every odd cut of 𝐺′ is an odd cut of 𝐺. Particularly, every cut of the form 𝛿 𝐺 β€² (𝑣) for a pseudonode 𝑣 of 𝐺′ is an odd cut of 𝐺. We let only odd cuts for each pseudonode in 𝐺′ may take on positive value for π‘Œπ· (Each node π‘€βˆˆπ‘†(𝑣) for pseudonode 𝑣 also has its respective 𝑦𝑀 value). So replace π‘Œπ· by 𝑦𝑣β‰₯0 in the derived graph (may be recursively) Algorithm tries to find a perfect matching in 𝐺 = using tree extension and augmentation steps. When stuck, we change 𝑦. (Existence of edges joining two nodes in 𝐡(𝑇) should be considered when we determine ο₯) Combinatorial Optimization 2016

11 We also set 𝑦𝐢=0 for the new pseudonode.
If there appears an equality edge joining two nodes in 𝐡(𝑇), we shrink the odd circuit. To reflect the 𝑦 values of the nodes in the shrunk pseudonode, we replace 𝑐𝑣𝑀 by π‘π‘£π‘€βˆ’π‘¦π‘£ for each edge 𝑣𝑀 with π‘£βˆˆπ‘‰(𝐢) and π‘€βˆ‰π‘‰(𝐢). We also set 𝑦𝐢=0 for the new pseudonode. The reduced costs 𝑐 𝑒 are the same for edges of 𝐺×𝐢 as they were for those edges in 𝐺. Updated weights denoted by 𝑐′. Get derived pair (𝐺′, 𝑐′) 1 9 1 1 8 3 6 6 8 6 1 2 5 5 2 4 4 7 4 4 7 (Shrinking and updating weights) Combinatorial Optimization 2016

12 For π‘£βˆˆπ‘‰\V(𝐢), 𝑦𝑣= 𝑦 𝑣 β€² (For π‘£βˆˆπ‘‰(𝐢), 𝑦𝑣 is already defined)
If we have solved the problem on a derived graph, then we have solved the problem on the original graph. Prop 5.14: Let 𝐺′, 𝑐′ be obtained from 𝐺, 𝑐 by shrinking the odd circuit 𝐢 of equality edges with respect to the dual-feasible solution 𝑦. Let 𝑀′ be a perfect matching of 𝐺′ and, w.r.t. 𝐺′, 𝑐′, let (𝑦′, π‘Œβ€²) be a feasible solution to (5.17) such that 𝑀′, (𝑦′, π‘Œβ€²) satisfy conditions (5.22), (5.23) and such that 𝑦 𝐢 β€² β‰₯0. Let 𝑀 be a perfect matching of 𝐺 obtained by extending 𝑀′ with edges from 𝐸(𝐢). Let (𝑦, π‘Œ) be defined as follows. For π‘£βˆˆπ‘‰\V(𝐢), 𝑦𝑣= 𝑦 𝑣 β€² (For π‘£βˆˆπ‘‰(𝐢), 𝑦𝑣 is already defined) For π·βˆˆπ’ž, we put π‘Œπ·= π‘Œ 𝐷 β€² if π‘Œ 𝐷 β€² >0; we put π‘Œ 𝐷 = 𝑦 𝐢 β€² if 𝐷=𝛿′(𝐢); otherwise, we put π‘Œπ·=0. Then w.r.t. 𝐺, 𝑐, (𝑦, π‘Œ) is a feasible solution to (5.17) and 𝑀, (𝑦, π‘Œ) satisfy the conditions (5.22), (5.23). Combinatorial Optimization 2016

13 Dual variable changes:
Need to consider edges 𝑒=𝑒𝑣 with 𝑒, π‘£βˆˆπ΅(𝑇) when choosing ο₯, β‡’ ο₯≀ 𝑐 𝑒 /2 for such edges. Need 𝑦𝑣 remains nonnegative if 𝑣 is a pseudonode, β‡’ ο₯≀𝑦𝑣 for such nodes ( only need to consider pseudonodes in 𝐴(𝑇) since they only decrease in value) 1 2 3 6 𝑔 2 β„Ž π‘Ž 𝑏 5 4 π‘Ÿ 3 2 4 1 6 𝑑 𝑓 4 4 2 3 1 5 𝑖 (Take ο₯=1/2 because of edge 𝑏𝑓 ) Then 𝑏𝑓 becomes equality edge and we can shrink the odd circuit. Combinatorial Optimization 2016

14 ο₯2= min ( 𝑐 𝑒 /2 : 𝑒 joins in 𝐺′ two nodes in 𝐡(𝑇)) ;
Change π’š Input: A derived pair (𝐺′, 𝑐′), a feasible solution 𝑦 of (5.17) for this pair, a matching 𝑀′ of 𝐺′ consisting of equality edges, and an 𝑀′-alternating tree 𝑇 consisting of equality edges in 𝐺′. Action: Let ο₯1= min ( 𝑐 𝑒 : 𝑒 joins in 𝐺′ a node in 𝐡(𝑇) to a node not in 𝑉(𝑇)) ; ο₯2= min ( 𝑐 𝑒 /2 : 𝑒 joins in 𝐺′ two nodes in 𝐡(𝑇)) ; ο₯3= min ( 𝑦𝑣 : π‘£βˆˆπ΄(𝑇), 𝑣 is a pseudonode of 𝐺′). ο₯= min (ο₯1, ο₯2, ο₯3 ). Replace 𝑦𝑣 by 𝑦𝑣+ο₯, if π‘£βˆˆπ΅(𝑇) ; π‘¦π‘£βˆ’ο₯, if π‘£βˆˆπ΄(𝑇) ; 𝑦𝑣 , otherwise. Combinatorial Optimization 2016

15 Expansion of pseudonodes:
Recall that we expanded all pseudonodes after an augmentation occur in the cardinality matching algorithm. However, for weighted problem, this can't be done arbitrarily since expanding a pseudonode with 𝑦𝑣>0 will result in having π‘Œπ·>0 in the expanded graph. We cannot carry such information about π‘Œπ· in subsequent iterations using node potentials. So we need to maintain some pseudonodes unexpanded in subsequent iterations. Therefore, only pseudonodes with 𝑦𝑣=0 may be expanded. (Q: Does pseudonodes expansion after augmentation really needed in cardinality problem?) As we grow 𝑀-alternating tree again after an augmentation (without pseudonode expansion), we may encounter the situation that a pseudonode is in 𝐴(𝑇). Its node potential will eventually drop to 0 if none of augmentation, extension, or shrinking occurs. Then we need to expand the pseudonode since otherwise we may miss some augmenting paths. (If it is in 𝐡(𝑇), we don't need to expand it.) Combinatorial Optimization 2016

16 Note that, after augmentation, the odd circuit is not tight.
π‘Ÿ 𝑣 π‘Ÿ 𝐢 Note that, after augmentation, the odd circuit is not tight. Combinatorial Optimization 2016

17 Tree update after pseudonode expansion
π‘Ÿ 𝑒 𝑀 𝑓 𝑔 𝐢 Tree update after pseudonode expansion Combinatorial Optimization 2016

18 Expand odd pseudonode 𝒗 and update 𝑴′, 𝑻, and 𝒄′
Input: A matching 𝑀′ consisting of equality edges of a derived graph 𝐺′, an 𝑀′-alternating tree 𝑇 consisting of equality edges, and an odd pseudonode 𝑣 of 𝐺′ such that 𝑦𝑣=0 Action: Let 𝑓, 𝑔 be the edges of 𝑇 incident with 𝑣, let 𝐢 be the circuit that was shrunk to form 𝑣, let 𝑒, 𝑀 be the ends of 𝑓, 𝑔 in 𝑉(𝐢), and let 𝑃 be the even-length path in 𝐢 joining 𝑒 to 𝑀. Replace 𝐺′ by the graph obtained by expanding 𝐢. Replace 𝑀′ by the matching obtained by extending 𝑀′ to a matching of 𝐺′. Replace 𝑇 by the tree having edge-set 𝐸(𝑇)βˆͺ𝐸(𝑃). For each edge 𝑠𝑑 with π‘ βˆˆπ‘‰(𝐢) and π‘‘βˆ‰π‘‰(𝐢), replace 𝑐 𝑠𝑑 β€² by 𝑐 𝑠𝑑 β€² + 𝑦 𝑠 . Prop 5.15: After the application of the expand subroutine, 𝑀′ is a matching contained in 𝐸 = , and 𝑇 is an 𝑀′-alternating tree whose edges are all contained in 𝐸 = . Combinatorial Optimization 2016

19 Blossom Algorithm for Minimum-Weight Perfect Matching
Let 𝑦 be a feasible solution to (5.9), 𝑀′ a matching of 𝐺 = , 𝐺′=𝐺 ; Set 𝑇=({π‘Ÿ}, βˆ…), where π‘Ÿ is an 𝑀′-exposed node of 𝐺′ ; Loop Case: There exists π‘’βˆˆ 𝐸 = whose ends in 𝐺′ are π‘£βˆˆπ΅(𝑇) and an 𝑀′-exposed node π‘€βˆ‰π‘‰(𝑇) Use 𝑣𝑀 to augment 𝑀′ ; If there is no 𝑀′-exposed node in 𝐺′ Extend 𝑀′ to perfect matching 𝑀 of 𝐺 and stop ; Else Replace 𝑇 by ({π‘Ÿ}, βˆ…), where π‘Ÿ is 𝑀′-exposed ; Case: There exists π‘’βˆˆ 𝐸 = whose ends in 𝐺′ are π‘£βˆˆπ΅(𝑇) and an 𝑀′-covered node π‘€βˆ‰π‘‰(𝑇) Use 𝑣𝑀 to extend 𝑇 ; Combinatorial Optimization 2016

20 Case: There exists π‘’βˆˆ 𝐸 = whose ends in 𝐺′ are 𝑣, π‘€βˆˆπ΅(𝑇)
(Continued) Case: There exists π‘’βˆˆ 𝐸 = whose ends in 𝐺′ are 𝑣, π‘€βˆˆπ΅(𝑇) Use 𝑣𝑀 to shrink and update 𝑀′, 𝑇, and 𝑐′ ; Case: There is a pseudonode π‘£βˆˆπ΄(𝑇) with 𝑦𝑣=0 Expand 𝑣 and update 𝑀′, 𝑇, and 𝑐′ ; Case: None of the above If every π‘’βˆˆπΈ incident in 𝐺′ with π‘£βˆˆπ΅(𝑇) has its other end in 𝐴(𝑇) and 𝐴(𝑇) contains no pseudonode Stop, 𝐺 has no perfect matching ; Else Change 𝑦. Combinatorial Optimization 2016

21 The algorithm provides a proof of Thm 5.13 except that
𝐺 has a perfect matching  (5.13) has a feasible solution. (HW) Thm 5.16: The blossom algorithm terminates after performing 𝑂(𝑛) augmentation steps, and 𝑂(𝑛2) tree-extension, shrinking, expanding, and dual change steps. Moreover, it returns a minimum-weight perfect matching, or determines correctly that 𝐺 has no perfect matching. (Pf) see text. Combinatorial Optimization 2016

22 Optimal Dual Solutions of Matching Problems
By algorithm, if consider the family β„‹ of sets 𝑆 such that π‘Œ 𝛿(𝑆) >0, can choose each such 𝑆 to be 𝑆(𝑣) for a pseudonode 𝑣 of a derived graph 𝐺′ of 𝐺, moreover, the final derived graph 𝐺′′ is a derived graph of 𝐺′. Thm 5.17: If the dual linear programming problem (5.17) has an optimal solution, then it has one that is nested ( 𝑆 with π‘Œ 𝛿(𝑆) >0 are disjoint or one is contained in the other). (Pf) By algorithm. Q: Does dual problem (5.17) have integral optimal solution? Motivation : Chapter 6. Integrality of Polyhedra Consider strong duality equation for primal-dual LP max {𝑀𝑇π‘₯ :𝐴π‘₯≀𝑏} = min {𝑦𝑇𝑏 :𝑦𝑇𝐴=𝑀𝑇, 𝑦β‰₯0} A rational linear system 𝐴π‘₯≀𝑏 is called totally dual integral if the minimum of dual LP can be achieved by an integral vector 𝑦 for each integral 𝑀 for which the optima exist. Thm 6.29: Let 𝐴π‘₯≀𝑏 be a totally dual integral system such that 𝑃={π‘₯:𝐴π‘₯≀𝑏} is a rational polytope and 𝑏 is integral. Then P is an integral polytope. Combinatorial Optimization 2016

23 π‘₯((𝑆))≀(|𝑆|βˆ’1)/2, for all π‘†βŠ†π‘‰, |𝑆|β‰₯3, |𝑆| odd
Thm 6.29: Let 𝐴π‘₯≀𝑏 be a totally dual integral system such that 𝑃={π‘₯:𝐴π‘₯≀𝑏} is a rational polytope and 𝑏 is integral. Then P is an integral polytope. (Pf) Since 𝑏 is integral, the duality equation implies that max {𝑀𝑇π‘₯ :π‘₯βˆˆπ‘ƒ} is an integer for all integral vectors 𝑀. By Thm 6.22, 𝑃 is integral. οƒΏ Thm 5.18: If π‘βˆˆπ‘πΈ, 𝑐(𝐸(𝐢)) is an even integer for every circuit 𝐢 of 𝐺, and (5.17) has an optimal solution, then it has an optimal solution that is nested and integral. (Pf) see text. Cor 5.19: If π‘βˆˆπ‘πΈ and (5.17) has an optimal solution, then it has an optimal solution that is nested and half-integral. (Pf) 2𝑐 has the property that its sum on every circuit is an even integer. By Thm 5.18, (5.17) has an integral nested optimal solution (𝑦, π‘Œ) when 𝑐 is replaced by 2𝑐. Now 1 2 (𝑦, π‘Œ) is the required solution. Cor 5.19 says that (5.17) is not TDI. However, if we use the inequalities π‘₯((𝑆))≀(|𝑆|βˆ’1)/2, for all π‘†βŠ†π‘‰, |𝑆|β‰₯3, |𝑆| odd instead of (5.15), it becomes TDI. (The inequalities are used in the maximum matching formulation (5.24)) Combinatorial Optimization 2016

24 The Triangle Inequality
If 𝐺=(𝑉, 𝐸) is a complete graph and π‘βˆˆπ‘…πΈ, we say that 𝑐 satisfies the triangle inequality, if 𝑐𝑒𝑣+𝑐𝑣𝑀β‰₯𝑐𝑒𝑀 for all 𝑒, 𝑣, π‘€βˆˆπ‘‰. Thm 5.20: Let 𝐺=(𝑉, 𝐸) be a complete graph having an even number of nodes and let π‘βˆˆπ‘…πΈ such that 𝑐β‰₯0 and 𝑐 satisfies the triangle inequality. If the perfect matching algorithm is started with (𝑦, π‘Œ)=0, then the optimal dual solution at termination of the algorithm will satisfy 𝑦β‰₯0. Combinatorial Optimization 2016

25 Implementation of the Weighted Matching Algorithm
Thm 5.21: The blossom algorithm for finding a minimum-weight perfect matching can be implemented to run in time 𝑂(𝑛2π‘š). Combinatorial Optimization 2016

26 Price and repair Practical technique to improve the performance of the weighted matching algorithm. (for dense graph) Start with sparse subgraph 𝐺 βˆ— of 𝐺. Find an optimal perfect matching in 𝐺 βˆ— . Then we compute reduced costs of edges in 𝐺 and not in 𝐺 βˆ— . Add a negative edge to 𝐺 βˆ— and reoptimize. Continue until no more negative edges exist in 𝐺. With more refinements, could solve problems up to 5 million nodes. Combinatorial Optimization 2016

27 Maximum-Weight Matching Problem
Maximum Weight Matchings Maximum-Weight Matching Problem Given: A graph 𝐺=(𝑉, 𝐸) and π‘βˆˆπ‘…πΈ. Objective: To find a matching 𝑀 of 𝐺 such that 𝑐(𝑀) is maximum. Aspects to consider: max-weight matching prob. ο‚΅ max(or min)-weight perfect matching prob. modification of weighted perfect matching algorithm to solve max-weight matching problem directly. linear programming description of solution set. Combinatorial Optimization 2016

28 (1) reduction to max-weight perfect matching problem.
(Let 𝑓 be the value of a maximum weight matching of 𝐺, and 𝑔 be the value of a maximum weight perfect matching of 𝐺 . Then 𝑔β‰₯2𝑓, 𝑔≀2𝑓) 𝑄 2 2 2 1 1 1 3 3 3 1 1 1 𝐺 𝐺 Combinatorial Optimization 2016

29 (2), (3) LP formulation and algorithm (𝑃) Maximize (𝑐𝑒π‘₯𝑒:π‘’βˆˆπΈ) (5.24)
subject to π‘₯(𝛿(𝑣))≀1, for all π‘£βˆˆπ‘‰ π‘₯(𝛾(𝑆))≀(|𝑆|βˆ’1)/2, for all π‘†βŠ†π‘‰, |𝑆|β‰₯3, |𝑆| odd π‘₯𝑒β‰₯0, for all π‘’βˆˆπΈ. Thm 5.22: The maximum weight of a matching of 𝐺 is equal to the optimal value of (5.24). See Integer and Combinatorial Optimization, Nemhauser and Wolsey, 1988 for somewhat different presentation. We try to modify the min-weight perfect matching algorithm as much as possible (maintain node labels). Let π’ͺ={π‘†βŠ†π‘‰ :|𝑆| odd and at least 3}. (𝐷) Minimize 𝑦 𝑣 :π‘£βˆˆπ‘‰ + ( 𝑆 βˆ’1 𝑧 𝑆 :π‘†βˆˆπ’ͺ) (5.25) subject to 𝑦𝑒+𝑦𝑣+ 𝑧 𝑆 :π‘’βˆˆπ›Ύ 𝑆 ,π‘†βˆˆπ’ͺ β‰₯ 𝑐 𝑒 , for all π‘’βˆˆπΈ. 𝑦𝑣β‰₯0 for all π‘£βˆˆπ‘‰ 𝑧𝑆β‰₯0 for all π‘†βˆˆπ’ͺ. Combinatorial Optimization 2016

30 CS optimality conditions: π‘€βŠ† 𝐸 = (5.26)
π‘€βŠ† 𝐸 = (5.26) for all π‘†βˆˆπ’ͺ, 𝑧𝑆>0 implies |π‘€βˆ©ο§(𝑆)|= 1 2 (|𝑆|βˆ’1) (5.27) for all π‘£βˆˆπ‘‰, 𝑦𝑣>0 implies 𝑣 is 𝑀-covered (5.28) Needed modifications: Define 𝑐 𝑒 = 𝑐 𝑒 (𝑦,𝑧) as π‘π‘’βˆ’(𝑦𝑒+𝑦𝑣+ 𝑧 𝑆 :π‘’βˆˆπ›Ύ 𝑆 ,π‘†βˆˆπ’ͺ Dual feasibility is 𝑐 𝑒 ≀0 For dual changes, make sure that 𝑦𝑣 , 𝑧𝑆β‰₯0 Also 𝑦𝑣 ← π‘¦π‘£βˆ’ο₯ if π‘£βˆˆπ΅(𝑇), 𝑦𝑣 ← 𝑦𝑣+ο₯ if π‘£βˆˆπ΄(𝑇) Combinatorial Optimization 2016

31 (5.28) implies that we don't need to care about any exposed original node with 𝑦𝑣=0
For an exposed pseudonode, if it includes an original node having 𝑦𝑣=0, it can be expanded so that the node with 𝑦𝑣=0 is exposed. Hence we don't need to worry about such exposed pseudonode. A node in 𝐺′ is called bad if either it is an 𝑀′-exposed original node with 𝑦𝑣>0 or it is an 𝑀′-exposed pseudonode 𝑆 such that 𝑦𝑣>0 for every π‘£βˆˆπ‘†. Hence we choose a bad node π‘Ÿ as the root and grow the 𝑀′-alternating tree to achieve augmentation. If there are no bad node in 𝐺′, the current solution is optimal and we extend 𝑀′ to a matching in 𝐺. Combinatorial Optimization 2016

32 Note that CS conditions (5
Note that CS conditions (5.27) dictates that if 𝑧𝑆>0, the odd-set constraint must be tight. Hence we cannot expand pseudonode with 𝑧𝑆>0 since if it is expanded, the odd set may not be tight after some augmentations. Note that the expression of the reduced cost for edge π‘’βˆˆπΈ is different between the weighted perfect matching and the weighted maximum matching problem. For perfect matching problem, for pseudonode 𝑆, the node label 𝑦𝑆 in 𝐺′ is the current dual value for the odd-cut represented by 𝛿(𝑆). The reduced cost of the edges in 𝛿(𝑆) can be found in the form π‘π‘’βˆ’(𝑦𝑒+𝑦𝑣) in 𝐺′. Combinatorial Optimization 2016

33 However, for the weighted maximum matching problem, the node label of a pseudonode in 𝐺′ does not actually give dual value for the odd-set constraint. Suppose we have a pseudonode π‘†βˆˆπ΅(𝑇) and the dual variable 𝑧𝑆 corresponding to (𝑆) are changed from 0 to 2ο₯. Then we need to maintain the equality edges in (𝑆) and other edges in (𝑆) should remain dual feasible. This can be achieved by subtracting ο₯ from 𝑦𝑣 (π‘¦π‘£βˆ’ο₯) for all original nodes in 𝑆. Now the reduced cost of edges 𝑒 in 𝛿(𝑆) changes to 𝑐 𝑒 +ο₯. Above operations can be achieved by making the node label of pseudonode π‘†βˆˆπ΅(𝑇) in 𝐺′ as 𝑦𝑆 ← π‘¦π‘†βˆ’ο₯. Combinatorial Optimization 2016

34 Similarly, for pseudonode π‘†βˆˆπ΄(𝑇), 𝑦𝑆 ← 𝑦𝑆+ο₯ in 𝐺′ means that we make dual value 𝑧𝑆 ← π‘§π‘†βˆ’2ο₯ and 𝑦𝑣 ← 𝑦𝑣+ο₯ for π‘£βˆˆπ‘†. In summary, we have For pseudonode π‘†βˆˆπ΅(𝑇), 𝑦𝑆 ← π‘¦π‘†βˆ’ο₯ in 𝐺′ means 𝑧𝑆 ← 𝑧𝑆+2ο₯ and 𝑦𝑣 ← π‘¦π‘£βˆ’ο₯ for π‘£βˆˆπ‘†. For pseudonode π‘†βˆˆπ΄(𝑇), 𝑦𝑆 ← 𝑦𝑆+ο₯ in 𝐺′ means 𝑧𝑆 ← π‘§π‘†βˆ’2ο₯ and 𝑦𝑣 ← 𝑦𝑣+ο₯ for π‘£βˆˆπ‘†. We need to maintain nonnegativity of dual variables, hence the node labels for pseudonodes should be ≀ 0. We also need to keep information of the 𝑦𝑣 values for π‘£βˆˆπ‘‰ to check 𝑦𝑣β‰₯0. Combinatorial Optimization 2016

35 Now determining ο₯ becomes:
Let ο₯1= min ( 𝑐 𝑒 : 𝑒 joins in 𝐺′ a node in 𝐡(𝑇) to a node not in 𝑉(𝑇)) ; ο₯2= min ( 𝑐 𝑒 /2 : 𝑒 joins in 𝐺′ two nodes in 𝐡(𝑇)) ; ο₯3= min ( |𝑦𝑣| (or 𝑧 𝑣 /2) : π‘£βˆˆπ΄(𝑇), 𝑣 is a pseudonode of 𝐺′). ο₯4= min ( 𝑦𝑣 : π‘£βˆˆπ΅(𝑇), 𝑣 is an original node of 𝐺′ or π‘£βˆˆπ‘†(𝑀) for a pseudonode π‘€βˆˆπ΅(𝑇) ). ο₯ = min (ο₯1, ο₯2, ο₯3, ο₯4 ) Replace 𝑦𝑣 by π‘¦π‘£βˆ’ο₯, if π‘£βˆˆπ΅(𝑇) ; 𝑦𝑣+ο₯, if π‘£βˆˆπ΄(𝑇) ; 𝑦𝑣 , otherwise. Combinatorial Optimization 2016

36 last change in the algorithm:
If there is a node π‘£βˆˆπ΅(𝑇) that is not bad, we use the even-length 𝑀′-alternating path from 𝑣 to π‘Ÿ to change 𝑀′. This does not increase the cardinality of 𝑀′, but it decreases the number of bad nodes. Note that, if we are stuck when expending 𝑀′-alternating tree, at least one of the node labels for original node π‘£βˆˆπ΅(𝑇) will drop to 0. Then we can use the above procedure to decrease the number of bad nodes. For pseudonode π‘€βˆˆπ΅(𝑇), the dual value of at least one node π‘£βˆˆπ‘†(𝑀) will drop to 0, which makes the pseudonode as not bad, hence we can use the above procedure. Note that our purpose is not to find a perfect matching in 𝐺 = , but to find a matching covering all nodes with 𝑦𝑣>0 and satisfying CS conditions for odd-set constraints in 𝐺 = . Combinatorial Optimization 2016

37 The matching LP may be solved using simplex method.
We first solve (5.24) without the odd-set constraints. Let π‘₯0 be the current optimal solution. Then we try to find an odd-set constraint that is violated by π‘₯0 (separation problem). If such a constraint is identified, it is added to the current formulation and the LP is reoptimized using dual simplex method. This procedure is repeated until there exists no violated odd-set constraints, in which moment we have found an optimal solution. Since simplex method finds an extreme point optimal solution if one exists, we can obtain an optimal matching. Identifying a violated odd-set constraint can be done in polynomial time (using a slight variation of Gomory-Hu procedure, see Padberg and Rao, 1982, Odd Minimum Cut-Sets and b-Matchings, Mathematics of Operations Research 7, 67-80). More robust approach to deal with matching problems with some variations. Edmond's matching algorithm was the starting point to investigate the polyhedral structure of many combinatorial optimization problems (polyhedral combinatorics). Combinatorial Optimization 2016


Download ppt "5.3 Minimum-Weight Perfect Matchings"

Similar presentations


Ads by Google