Abstract
Full technical details for a slightly simplified version of the minimum weight perfect matching via blossom belief propagation by Ahn, Park, Chertkov and Shin (in Advances in neural information processing systems, vol 28, Curran Associates, Inc., 2015) are provided. An example showing the necessity of a certain uniqueness assumption is given. An alternative to perturbing the edge weights to ensure the uniqueness assumption is satisfied is suggested.
Similar content being viewed by others
Data availability
This work did not generate any data.
References
Ahn SS, Park S, Chertkov M, Shin J (2015) Minimum weight perfect matching via blossom belief propagation. In: Cortes C, Lawrence N, Lee D, Sugiyama M, Garnett R, (eds) Advances in neural information processing systems, vol 28. Curran Associates, Inc. URL https://proceedings.neurips.cc/paper/2015/file/dc5689792e08eb2e219dce49e64c885b-Paper.pdf
Chandrasekaran K, Végh LA, Vempala SS (2016) The cutting plane method is polynomial for perfect matchings. Math Oper Res 41(1):23–48. https://doi.org/10.1287/moor.2015.0714. ISSN 0364-765X, 1526-5471
Chen Amber Q, Cheung Kevin KH, Kielstra PM, Winn AD (2020) Revisiting a cutting-plane method for perfect matchings. Open J Math Optim 1:2. https://doi.org/10.5802/ojmo.2. URL https://ojmo.centre-mersenne.org/articles/10.5802/ojmo.2/
Cho I, Park S, Park S, Han D, Shin J (2015) Practical message-passing framework for large-scale combinatorial optimization. In: 2015 IEEE international conference on big data (Big Data), pp 24–31. https://doi.org/10.1109/BigData.2015.7363737
Cook W, André R (1999) Computing minimum-weight perfect matchings. INFORMS J Comput 11(2):138–148. https://doi.org/10.1287/ijoc.11.2.138
Cook W, Cunningham W, Pulleyblank W, Schrijver A (1998) Combinatorial optimization. Wiley-interscience series in discrete mathematics and optimization. Wiley, New York, p 9780471558941
Edmonds J (1965a) Paths, trees, and flowers. Canad J Math 17:449–467
Edmonds J (1965b) Maximum matching and a polyhedron with \(0,1\) vertices. J Res Nat Bureau Stand 69 B:125–130
Kolmogorov V (2009) Blossom V: a new implementation of a minimum cost perfect matching algorithm. Math Program Comput 1(1):43–67. https://doi.org/10.1007/s12532-009-0002-8. URL http://link.springer.com/10.1007/s12532-009-0002-8. ISSN 1867-2949, 1867-2957
Funding
The work was supported by the Dean’s Summer Research Internship at Carleton University and a internal grant from Carleton University.
Author information
Authors and Affiliations
Contributions
The first author contributed to most of the writing of the manuscript and the second author contributed to most of the research on which the manuscript is based. Both authors read and approved the final manuscript.
Corresponding author
Ethics declarations
Conflict of interest
The authors have no relevant financial or non-financial interests to disclose.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Appendices
A Illustrative example for Algorithm 1
A naive implementation of Algorithm 1 solving the example below is publically available at https://github.com/kgovernor/BlossomLP_ex (Figs. 7, 8 and 9).
B Illustrative examples for Algorithm 2
The following figures illustrate the outcomes of the cases entered through line 5, line 9, or line 14 of Algorithm 2 (Figs. 10, 11 and 12).
Numbers next to the edges denote edge weights. The entries of y are given by the number next to the vertices (for example, in the left-most figure in Fig. 10, we have \(y_{\delta (\{g,h,i\})}=y_{\delta (k)} = y_{\delta (\{l,m,n\})}= y_{\delta (a)}=y_{\delta (b)}=y_{\delta (c)}=1\), \(y_{\delta (j)}=2\), and \(y_{\delta (\{d,e,f\})}= 0\)) as well as \(y_{\delta (d)}=y_{\delta (e)}=y_{\delta (f)}=y_{\delta (g)}=y_{\delta (h)} =y_{\delta (i)}=y_{\delta (l)}=y_{\delta (m)}=y_{\delta (n)}=1.\) Dashed lines denote non-tight edges and all the other edges are tight.
Each shaded circle denotes the root of T. Each blue circle denotes a node in \(V^-(T)\). Each red circle denotes a node in \(V^+(T)\). Each thick black or red double line denotes an edge in T.
Solid blue, red and gray lines correspond to values specified in Appendix A. Thus, red lines denote edges in M and blue lines denote edges in an odd cycle in \(\mathscr {C}\).
Through line 5:
Through line 12:
Through line 13:
C Proofs
We begin with a few intermediate results before giving the proofs for results stated in the main body of the paper.
Proposition C1
If \(S,T\subseteq V(G)\) are disjoint, then \((G/S)/T = (G/T)/S\).
Proof
By definition, \(V(G/S) = (V(G) {\setminus } S) \cup \{S\}\). Since S and T are disjoint, \(T \subseteq V(G) \setminus S\). Hence, \(V((G/S)/T) = \left( V(G) {\setminus } \{S\cup T\}\right) \cup \{S,T\}).\) By symmetry, we also have \(V((G/T)/S) = \left( V(G) {\setminus } \{S\cup T\}\right) \cup \{S,T\}).\) Hence, \(V((G/S)/T) = V((G/T)/S)\).
To complete the proof, it suffices to show that every edge of (G/S)/T is also an edge of (G/T)/S having the same ends. To this end, take an edge e of (G/S)/T. If its ends are S and T, then e is an edge of G with ends \(u \in S\) and \(v \in T\), implying that e is an edge of (G/T)/S with ends S and T as well.
If none of the ends of e is in \(\{S,T\}\), then e is an edge of G with none of the ends in \(S\cup T\), implying that e is an edge of (G/T)/S with the same ends.
If one of the ends of e is S but the other end is \(v \notin T\), then e is an edge of G/T with one end in S and the other end equal to \(v \notin S\cup T\), implying that e is an edge of (G/T)/S with ends S and v.
Finally, if one of the ends of e is T but the other end is \(u \notin S\), then e is an edge of G/T with one end equal to T and the other end equal to \(u \notin S\cup T\), implying that e is an edge of (G/T)/S with ends T and u.
In any case, we have that e is an edge of (G/T)/S with the same ends as in (G/S)/T as desired. \(\square \)
Lemma C1
Let \(e \in E(G)\) having ends u and v.
-
(i)
If \(u,v \notin \bigcup \mathscr {L}^\textsf{max}\), then \(e \in E(G/\mathscr {L})\) having ends u and v.
-
(ii)
If \(u \in S\) for some \(S\in \mathscr {L}^\textsf{max}\) and \(v \notin \bigcup \mathscr {L}^\textsf{max}\) and \(u \in S\), then \(e \in E(G/\mathscr {L})\) having ends \({\text {con}}_\mathscr {L}(S)\) and v.
-
(iii)
If \(u \in S\) and \(v \in T\) for distinct \(S,T \in \mathscr {L}^\textsf{max}\), then \(e \in E(G/\mathscr {L})\) having ends \({\text {con}}_\mathscr {L}(S)\) and \({\text {con}}_\mathscr {L}(T)\).
-
(iv)
If \(u,v \in S\) for some \(S \in \mathscr {L}^\textsf{max}\), then \(e \notin E(G/\mathscr {L})\).
Proof
We proceed by induction on \(|\mathscr {L}|\). The statements hold vacuously when \(|\mathscr {L}| = 0\). Assume that \(|\mathscr {L}| \ge 1\).
Suppose that \(u,v \notin \bigcup \mathscr {L}^\textsf{max}\). Take \(S \in \mathscr {L}^\textsf{max}\). Let \(\bar{\mathscr {L}} = \mathscr {L}{\setminus } \{S\}\). Note that \(u,v \notin \bigcup \bar{\mathscr {L}}^\textsf{max}\). It follows from the induction hypothesis that \(e \in E(G/\bar{\mathscr {L}})\) having ends u and v. Since \(G = (G/\bar{\mathscr {L}})/{\text {con}}_\mathscr {L}(S)\) and \(u,v \notin S\), we have that \(e \in E(G/\mathscr {L})\) having ends u and v. This proves (i).
Suppose that \(S \in \mathscr {L}^\textsf{max}\) contains \(u \in S\) and \(v \notin \bigcup \mathscr {L}^\textsf{max}\), Let \(\bar{\mathscr {L}} = \mathscr {L}{\setminus } \{S\}\). By the induction hypothesis, if \(u \notin \bigcup \bar{\mathscr {L}}^\textsf{max}\), then \(e \in E(G/\bar{\mathscr {L}})\) having ends u and v. Otherwise, if \(u \in S' \in \bar{\mathscr {L}}^\textsf{max}\), then \(e \in E(G/\bar{\mathscr {L}})\) having ends \({\text {con}}_{\bar{\mathscr {L}}}(S')\) and v. In either case, e has one end in \({\text {con}}_\mathscr {L}(S)\) the one end equal v which is not in \({\text {con}}_\mathscr {L}(S)\). Since \(G/\mathscr {L}= (G/\bar{\mathscr {L}})/{\text {con}}_\mathscr {L}(S)\), we have that \(e \in E(G/\mathscr {L})\) having ends \({\text {con}}_\mathscr {L}(S)\) and v. This proves (ii). The proof for (iii) is similar and is omitted.
Finally, suppose that \(u,v \in S\) for some \(S \in \mathscr {L}^\textsf{max}\). Let \(\bar{\mathscr {L}} = \mathscr {L}\setminus \{S\}\). If \(u,v \in T\) for some \(T \in \bar{\mathscr {L}}^\textsf{max}\), then e is not an edge in \(G/\bar{\mathscr {L}}\) and therefore not an edge in \(G/\mathscr {L}\). Otherwise, by the induction hypothesis, e is an edge in \(G/\bar{\mathscr {L}}\) having both ends in \({\text {con}}_\mathscr {L}(S)\). Since \(G/\mathscr {L}= (G/\bar{\mathscr {L}})/{\text {con}}_\mathscr {L}(S)\), e is not an edge in \(G/\mathscr {L}\). This proves (iv). \(\square \)
Proposition 1. The graph \(G/\mathscr {L}\) is unique and thus well-defined.
Proof
The proof is by induction on \(|\mathscr {L}|\). When \(|\mathscr {L}| = 0\), the graph \(G/\mathscr {L}\) is simply G and is uniquely determined.
Assume that \(|\mathscr {L}| \ge 1\). If there is a unique \(S \in \mathscr {L}^\textsf{max}\), then \(G/\mathscr {L}\) is given by \((G/\left( \mathscr {L}{\setminus } \{S\}\right) ) / {\text {con}}_{\mathscr {L}}(S)\) which is unique since \(G/\left( \mathscr {L}\setminus \{S\}\right) \) is unique by the induction hypothesis.
Suppose that there exist distinct \(S_1, S_2 \in \mathscr {L}^\textsf{max}\). Let \(\mathscr {L}' = \mathscr {L}\setminus \{S_1,S_2\}\). We show that
By the induction hypothesis, \(G/\mathscr {L}'\) is unique. Let \(G' = G/{\mathscr {L}'}\). Since \(S_1\) and \(S_2\) are disjoint, it follows that \({\text {con}}_{\mathscr {L}}(S_i) = {\text {con}}_{\mathscr {L}'\cup \{S_i\}}(S_i)\) for \(i = 1,2\). Hence,
and
The result now follows since \(G'/{\text {con}}_{\mathscr {L}}(S_1)/{\text {con}}_{\mathscr {L}}(S_2) = G'/{\text {con}}_{\mathscr {L}}(S_2)/{\text {con}}_{\mathscr {L}}(S_1)\) by Proposition C1. \(\square \)
Proposition 2.
Proof
The proof is by induction on \(|\mathscr {L}|\).
The statement clearly holds when \(|\mathscr {L}| = 0\).
Suppose that \(|\mathscr {L}| \ge 1\). Let \(S \in \mathscr {L}^\textsf{max}.\) With \(G' = G/(\mathscr {L}{\setminus } \{S\})\), we have \(G/\mathscr {L}= G'/{\text {con}}_\mathscr {L}(S)\). Let \(\bar{\mathscr {L}} = \mathscr {L}\setminus \{S\}\).
By the induction hypothesis,
Hence,
as desired. \(\square \)
Proposition 4. Let \(u \in V(G/\mathscr {L})\). Then \(\delta _{G/\mathscr {L}}(u) = \delta _G({\text {fl}}_\mathscr {L}(u))\).
Proof
We proceed by induction on \(|\mathscr {L}|\). The statement clearly holds when \(|\mathscr {L}| = 0\). Assume that \(|\mathscr {L}| \ge 1\).
Suppose that \(u \in V^\textsf{orig}(G/\mathscr {L})\). By Proposition 2, \(u \notin \bigcup \mathscr {L}^\textsf{max}\). By Lemma C1, every edge in \(G/\mathscr {L}\) having u as an end must come from an edge in G with u as an end. Conversely, any edge in G with u as an end does end up being an edge in \(G/\mathscr {L}\) with u as an end. Hence, \(\delta _{G/\mathscr {L}}(u) = \delta _G(u)\).
Suppose that \(u \in V^\textsf{pseudo}(G/\mathscr {L})\). Let \(S = {\text {con}}_\mathscr {L}^{-1}(u)\). Note that \(S = {\text {fl}}_\mathscr {L}(u)\). By Lemma C1, every edge in \(G/\mathscr {L}\) having \({\text {con}}_\mathscr {L}(S)\) as an end must come from an edge in G having an end in S and the other not in S. Conversely, any edge in G having an end in S and the other does end up being an edge in \(G/\mathscr {L}\) with \({\text {con}}_\mathscr {L}(S)\) as an end. Hence, \(\delta _{G/\mathscr {L}}(u) = \delta _G(S)\) as desired. \(\square \)
Proposition 5. Let \(\mathscr {L}\) be a factor-critical family. Suppose that C is an odd cycle in \(G' = G/\mathscr {L}\). Then \(\mathscr {L}' = \mathscr {L}\cup \{{\text {fl}}_\mathscr {L}(V(C))\}\) is also a factor-critical family such that \(G'/V(C) = G/\mathscr {L}'\).
Proof
Let \(U = V(C) \cap V^\textsf{pseudo}(G')\). By Proposition 2, there exist \(S_1,\ldots ,S_k \in \mathscr {L}^\textsf{max}\) such that \(U = \{ {\text {con}}_\mathscr {L}(S_1),\ldots ,{\text {con}}_\mathscr {L}(S_k)\}\). Let \(S = {\text {fl}}_\mathscr {L}(V(C))\). Then,
It follows that \(S \in \mathscr {O}\). Clearly, \(S \in {\mathscr {L}'}^\textsf{max}\). Hence, by definition, \(G/\mathscr {L}' = (G/\mathscr {L})/{\text {con}}_{\mathscr {L}'}(S) = G'/V(C).\)
Finally, we show that S is \(\mathscr {L}'\)-factor-critical.
Let \(u \in S\). Suppose that \(u \in S_t\) for some \(t \in \{1,\ldots ,k\}\). Let M be a matching in C missing just the pseudovertex \({\text {con}}_\mathscr {L}(S_t)\). Then M is a matching in G covering exactly one vertex in each \(S_i\) for all \(i \ne t\). Since \(S_i\) is \(\mathscr {L}\)-factor-critical for \(i = 1,\ldots ,k,\) we can extend M to an \((S\setminus \{u\}, \mathscr {L})\)-perfect matching.
Now, suppose that \(u \notin \displaystyle \bigcup _{i=1}^k S_i\). Let M be a matching in C missing just u. Then M is a matching in G covering exactly one vertex in each \(S_i\). Since \(S_i\) is \(\mathscr {L}\)-factor-critical for \(i = 1,\ldots ,k,\) we can again extend M to an \((S\setminus \{u\}, \mathscr {L})\)-perfect matching. \(\square \)
Lemma 1. At line 5in each iteration of Algorithm 1, there exists a factor-critical laminar family \(\mathscr {L}\) such that the following hold:
-
(i)
\(G' = G/\mathscr {L}\);
-
(ii)
\(\mathscr {F}{\setminus } \mathscr {V}(G) = \{ \delta _G(U): U \in \mathscr {L}{\setminus } \mathscr {L}^\textsf{max}\}\);
-
(iii)
\(\mathscr {F}\cap \mathscr {V}(G) = \{\delta _G(u): u \in V(G) \setminus V^\textsf{orig}(G')\}\).
Proof
We prove by induction on the number of iterations.
In the first iteration, we have \(G' = G\) and so we can set \(\mathscr {L}= \emptyset \) which is trivially a factor-critical laminar family. Hence, (i) follows. Since \(\mathscr {F}= \emptyset \), (ii) and (iii) also follow.
Assume that \(G' = G/\mathscr {L}\) at the beginning of a later iteration where \(\mathscr {L}\) is a factor-critical laminar family such that \(\mathscr {F}{\setminus } \mathscr {V}(G) = \{ \delta _G(U): U \in \mathscr {L}{\setminus } \mathscr {L}^\textsf{max}\}\) and that \(\mathscr {F}\cap \mathscr {V}(G) = \{\delta _G(u): u \in V(G) {\setminus } V^\textsf{orig}(G')\}\). We show that if the algorithm does not enter line 26, then at the end of the iteration, (i)–(iii) hold.
Suppose that the condition in line 13 is satisfied. Let \(\bar{\mathscr {L}} = \mathscr {L}\setminus {\text {fl}}_\mathscr {L}(S)\). After \(G'\) is modified by expanding S, we have \(G' = G/\bar{\mathscr {L}}\) and \(\mathscr {F}\cap \mathscr {V}(G) = \{\delta _G(u): u \in \left( V(G){\setminus } V^\textsf{orig}(G')\right) \cup \left( V(G) \cap S\right) \}\). Since \(\delta _{G'}(u)\) is removed from \(\mathscr {F}\) for all \(u \in S\), at the end of the iteration, we have \(\mathscr {F}\cap \mathscr {V}(G) = \{\delta _G(u): u \in V(G)\setminus V^\textsf{orig}(G')\}\), thus proving (iii).
Note that \(\bar{\mathscr {L}}\) is a factor-critical family since \({\text {fl}}_\mathscr {L}(S) \in \mathscr {L}^\textsf{max}\) by Corollary 1. As \({\text {con}}_{\bar{\mathscr {L}}}(U) \in V^\textsf{pseudo}(G')\) for all \(U \in \bar{\mathscr {L}}^\textsf{max}\), we see that
since \(\{\delta _{G'}(u): u \in S{\setminus } V^\textsf{pseudo}(G')\} \subseteq \mathscr {V}(G)\). Hence, after the completion of line 15, \(\mathscr {F}\) satisfies \(\mathscr {F}{\setminus } \mathscr {V}(G) = \{\delta _G(U): U \in \bar{\mathscr {L}} {\setminus } \bar{\mathscr {L}}^\textsf{max}\}.\) It follows that setting \(\mathscr {L}\) to \(\bar{\mathscr {L}}\), (i) and (ii) hold at the end of the iteration.
Suppose that the condition in line 17 is satisfied. Let \(\bar{\mathscr {L}} = \mathscr {L}\cup \{{\text {fl}}_\mathscr {L}(V(C))\}\). By Proposition 5, \(\bar{\mathscr {L}}\) is a factor-critical family. Now,
Since \(\mathscr {F}\) is modified by adding \(\delta _{G'}(u)\) for each \(u \in V(G)\), after setting \(\mathscr {L}\) to \(\bar{\mathscr {L}}\), we see that at the end of the iteration, (i)–(iii) hold. \(\square \)
Lemma 2. The output at termination of Algorithm 2is correct.
Proof
If the algorithm terminates in line 22, then the condition in line 20 guarantees that \(S = V^-(T) \subseteq V^\textsf{orig}(G')\) and has cardinality is one less than \(|V^+(T)|\). Since each vertex in \(V^+(T)\) is an odd component in \(G'\setminus S\), the output is correct.
Otherwise, the algorithm terminates with a pair \(\bar{x}, \bar{y}\). Clearly, \(\bar{x} \ge 0\). If \(\bar{x}\) is formed in either line 12 or line 18, then \(\bar{x}(\delta (v)) = 1\) for all \(v \in V(G')\) and thus \(\bar{x} \in \Xi _{G'}\). If \(\bar{x}\) is formed in line 7, then \(\bar{x}(\delta (S)) = 2 > 1\) and \(\bar{x}(\delta (v)) = 1\) for all \(v \in V(G')\) with \(v \ne S\). Again, \(\bar{x} \in \Xi _{G'}\) and we also have \(\bar{y}_{\delta (v)} = 0\) because executing line 7 requires that the condition in line 5 be satisfied.
Observe that \(\bar{y}_{\delta (v)} \ge 0\) if \(v \in V^\textsf{pseudo}(G')\) since \(\delta (v) = \delta _G({\text {fl}}(v)) \in \mathscr {D}(G)\) by Proposition 4 and line 24 never allows \(y_F\) to become negative if \(F \in \mathscr {D}\).
Let \(y'\) denote the \(y'\) at termination. For each \(e \in E(G')\), we have
if and only if
since the algorithm does not change \(y_F\) if \(F \notin \mathscr {V}(G')\) according to the observation. Note that one of these inequalities holds with equality if and only if the other does. Because of line 24 guarantees that \(y'\) is feasible to D(G), we have
and hence
implying that
Finally, since the algorithm works with only tight edges when modifying M and \(\mathscr {C}\), if \(\bar{x}_e > 0\), then \(\displaystyle \sum _{F \in \mathscr {V}\cup \mathscr {D}: e \in F} y'_F = w_e\), implying that
\(\square \)
Lemma 3. If \((\mathscr {L}, y, M, \mathscr {C}_{aux}, T)\) is a configuration for G, w compatible with line 32of Algorithm 1, then
Proof
Since y is an \(\mathscr {L}\)-critical dual solution, we have that \(y_F = 0\) for all \(F \in \mathscr {D}(G) {\setminus } \{ \delta (S):S \in \mathscr {L}{\setminus } \mathscr {L}^\textsf{max} \}.\) In particular, \(y_F = 0\) for all \(F \in \{\delta (S):S \in \mathscr {L}^\textsf{max} \}\). Let \(\mathscr {V}_p = \{ \delta (u): u \in V^\textsf{pseudo}(G')\}\). Then \(\mathscr {V}_p=\{\delta (S): S \in \mathscr {L}^\textsf{max}\}\). Hence, \(y_F = 0\) for all \(F \in \mathscr {V}_p\). Since \(\mathscr {D}(G) \setminus \mathscr {V}(G') = \mathscr {D}(G) \setminus \mathscr {V}_p\), we have that
by property (iii) of the definition of compatibility.
By (iii) of Lemma 1, we have that \(\mathscr {F}\cap \mathscr {V}(G) = \{\delta _G(U): U \in V(G){\setminus } V^\textsf{orig}(G')\} = \mathscr {V}(G) {\setminus } \mathscr {V}(G')\). Thus,
as desired. \(\square \)
Rights and permissions
Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.
About this article
Cite this article
Cheung, K.K.H., Governor, K. A detailed introduction to a minimum-cost perfect matching algorithm based on linear programming. J Comb Optim 45, 85 (2023). https://doi.org/10.1007/s10878-023-00998-8
Accepted:
Published:
DOI: https://doi.org/10.1007/s10878-023-00998-8