Linear Programming (Optimization)

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
1
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 (𝑐𝑒π‘₯𝑒: 𝑒 ∈ 𝐸)
subject to π‘₯((𝑣)) = 1,
π‘₯𝑒 β‰₯ 0,
(D)
Maximize
subject to
(𝑦𝑣 : 𝑣 ∈ 𝑉)
𝑦𝑒 + 𝑦𝑣 ≀ 𝑐𝑒 ,
(5.8)
for all 𝑣 ∈ 𝑉
for all 𝑒 ∈ 𝐸.
(5.9)
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
2
 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
3
1
2
3
π‘Ž
2
6
𝑔
𝑏
π‘Ÿ
4
𝑑
4
3
3
6
𝑓
𝑖 2
5
1
β„Ž
2
4
1
5
Let ο₯ = 1 (for edge 𝑓𝑔)
0
2
3
π‘Ž
3
6
𝑔
𝑏
π‘Ÿ
4
𝑑
2
Combinatorial Optimization 2016
4
3
6
𝑓
2
β„Ž
2
4
2
5
5
𝑖 2
4
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;
Else
Use 𝑣𝑀 to extend 𝑇;
If every 𝑣𝑀 ∈ 𝐸 with 𝑣 ∈ 𝐡(𝑇) has 𝑀 ∈ 𝐴(𝑇)
Stop, 𝐺 has no perfect matching ;
Else
Let ο₯ = min { 𝑐𝑣𝑀 ∢ 𝑣 ∈ 𝐡(𝑇), 𝑀 βˆ‰ 𝑉(𝑇)}
Replace 𝑦𝑣 by 𝑦𝑣 + ο₯ for 𝑣 ∈ 𝐡(𝑇), 𝑦𝑣 βˆ’ ο₯ for 𝑣 ∈ 𝐴(𝑇) ;
Combinatorial Optimization 2016
5
 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
6
Minimum Weight Perfect Matching in General
 (5.8) not enough to obtain an integer optimal solution.
9
3
6
8
1
2
5
4
7
 π‘₯𝑒 = 1/2 for edges of two triangles is optimal solution to LP relaxation with
value 10.5. 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
7
 Let π’ž be the set of odd cuts of 𝐺 that are not of the form 𝛿(𝑣) for some 𝑣.

Minimize
subject to
(𝑐𝑒π‘₯𝑒: 𝑒 ∈ 𝐸)
π‘₯(𝛿(𝑣)) = 1, for all 𝑣 ∈ 𝑉
π‘₯(𝐷) β‰₯ 1, for all 𝐷 ∈ π’ž
π‘₯𝑒 β‰₯ 0,
for all 𝑒 ∈ 𝐸.
(5.13)
(5.14)
(5.15)
(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
8
 Also, devise an algorithm to find a primal, dual feasible solution that satisfies
CS conditions and show that the optimal solution is integer.
 (P)
(D)
Minimize (𝑐𝑒π‘₯𝑒: 𝑒 ∈ 𝐸)
subject to π‘₯(𝛿(𝑣)) = 1, for all 𝑣 ∈ 𝑉
π‘₯(𝐷) β‰₯ 1, for all 𝐷 ∈ π’ž
π‘₯𝑒 β‰₯ 0,
for all 𝑒 ∈ 𝐸.
Maximize
subject to
𝑦𝑒 + 𝑦𝑣 +
𝑦𝑣 : 𝑣 ∈ 𝑉 +
(5.13)
(5.14)
(5.15)
(5.16)
π‘Œπ· : 𝐷 ∈ π’ž
π‘Œπ· : 𝑒 ∈ 𝐷 ∈ π’ž ≀ 𝑐𝑒 , for all 𝑒 = 𝑣𝑀 ∈ 𝐸.
π‘Œπ· β‰₯ 0,
for all 𝐷 ∈ π’ž
(𝑦𝑣 free, for all 𝑣 ∈ 𝑉)
 Let 𝑐𝑒 = 𝑐𝑒 𝑦, π‘Œ be 𝑐𝑒 βˆ’ (𝑦𝑒 + 𝑦𝑣 + (π‘Œπ· : 𝑒 ∈ 𝐷 ∈ π’ž))
CS conditions β‡’
π‘₯𝑒 > 0 implies 𝑐𝑒 = 0, for all 𝑒 ∈ 𝐸
π‘Œπ· > 0 implies π‘₯(𝐷) = 1, for all 𝐷 ∈ π’ž
Combinatorial Optimization 2016
(5.17)
(5.18)
(5.19)
(5.20)
(5.21)
9
 In terms of matching, the conditions are
𝑒 ∈ 𝑀 implies 𝑐𝑒 = 0, for all 𝑒 ∈ 𝐸
π‘Œπ· > 0 implies |𝑀 ∩ 𝐷| = 1, for all 𝐷 ∈ π’ž
(5.22)
(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
10
 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 (𝐺′, 𝑐′)
9
1
1
3
2
1
6
8
0
2
0
1
5
0
4
6
6
0
7
4
7
8
5
4
4
(Shrinking and updating weights)
Combinatorial Optimization 2016
11
 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
12
 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
2
3
π‘Ž
6
𝑏
4
π‘Ÿ
1
4
𝑑
3
4
𝑔
5
3
2
4
6
𝑓
1
β„Ž
5
𝑖 2
(Take ο₯ = 1/2 because of edge 𝑏𝑓 )
Then 𝑏𝑓 becomes equality edge and
we can shrink the odd circuit.
Combinatorial Optimization 2016
13
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
14
 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
15
π‘Ÿ
𝑣
π‘Ÿ
𝐢
Note that, after augmentation, the odd circuit is not tight.
Combinatorial Optimization 2016
16
π‘Ÿ
𝑒
𝑓
𝑀
𝑔
𝐢
Tree update after pseudonode expansion
Combinatorial Optimization 2016
17
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 evenlength 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
18
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
19
(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
20
 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
21
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
22
 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
1
replaced by 2𝑐. Now (𝑦, π‘Œ) is the required solution.
2
 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
23
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
24
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
25
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
26
Maximum Weight Matchings
Maximum-Weight Matching Problem
Given: A graph 𝐺 = (𝑉, 𝐸) and 𝑐 ∈ 𝑅𝐸 .
Objective: To find a matching 𝑀 of 𝐺 such that 𝑐(𝑀) is maximum.
 Aspects to consider:
1. max-weight matching prob. ο‚΅ max(or min)-weight perfect matching prob.
2. modification of weighted perfect matching algorithm to solve max-weight
matching problem directly.
3. linear programming description of solution set.
Combinatorial Optimization 2016
27
 (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𝑓)
𝑄
0
2
2
2
1
1
3
3
1
3
0
1
0
1
0
1
0
0
0
𝐺
Combinatorial Optimization 2016
𝐺
28
 (2), (3) LP formulation and algorithm
(𝑃) Maximize (𝑐𝑒π‘₯𝑒: 𝑒 ∈ 𝐸)
subject to π‘₯(𝛿(𝑣)) ≀ 1,
π‘₯(𝛾(𝑆)) ≀ (|𝑆| βˆ’ 1)/2,
π‘₯𝑒 β‰₯ 0,
(5.24)
for all 𝑣 ∈ 𝑉
for all 𝑆 βŠ† 𝑉, |𝑆| β‰₯ 3, |𝑆| odd
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
subject to
𝑦𝑒 + 𝑦𝑣 +
1
2
𝑦𝑣 : 𝑣 ∈ 𝑉 + (
𝑆 βˆ’ 1 𝑧𝑆 : 𝑆 ∈ π’ͺ)
(5.25)
𝑧𝑆 : 𝑒 ∈ 𝛾 𝑆 , 𝑆 ∈ π’ͺ β‰₯ 𝑐𝑒 , for all 𝑒 ∈ 𝐸.
𝑦𝑣 β‰₯ 0 for all 𝑣 ∈ 𝑉
𝑧𝑆 β‰₯ 0 for all 𝑆 ∈ π’ͺ.
Combinatorial Optimization 2016
29
 CS optimality conditions:
𝑀 βŠ† 𝐸=
(5.26)
1
for all 𝑆 ∈ π’ͺ, 𝑧𝑆 > 0 implies |𝑀 ∩ (𝑆)| = (|𝑆| βˆ’ 1) (5.27)
2
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
30
 (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
31
 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
32
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
33
 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
34
 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
35
 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
36
 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, 6780).
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
37