Lably
Skip to content

Blossom algorithm

Algorithm for finding max graph matchings

  • 11 min read
  • 6 chapters

Related on Lably

Through Algorithm, Graph (discrete mathematics) and Big O notation

The algorithm runs in time O(|E||V|2), where |E| is the number of edges of the graph and |V| is its number of vertices. A better running time of O(|E||V|) for the same task can be achieved with the more complicated algorithm of Micali and Vazirani.

A major reason that the blossom algorithm is important is that it gave the first proof that a maximum-size matching could be found using a polynomial amount of computation time. Another reason is that it led to a linear programming polyhedral description of the matching polytope, yielding an algorithm for min-weight matching. As elaborated by Alexander Schrijver, further significance of the result comes from the fact that this was the first polytope whose proof of integrality "does not simply follow just from total unimodularity, and its description was a breakthrough in polyhedral combinatorics."

Augmenting paths

Given G = (V, E) and a matching M of G, a vertex v is exposed if no edge of M is incident with v. A path in G is an alternating path, if its edges are alternately not in M and in M (or in M and not in M). An augmenting path P is an alternating path that starts and ends at two distinct exposed vertices. Note that the number of unmatched edges in an augmenting path is greater by one than the number of matched edges, and hence the total number of edges in an augmenting path is odd. A matching augmentation along an augmenting path P is the operation of replacing M with a new matching

M1=M⊕P=(M∖P)∪(P∖M).

By Berge's lemma, matching M is maximum if and only if there is no M-augmenting path in G. Hence, either a matching is maximum, or it can be augmented. Thus, starting from an initial matching, we can compute a maximum matching by augmenting the current matching with augmenting paths as long as we can find them, and return whenever no augmenting paths are left. We can formalize the algorithm as follows:

INPUT: Graph <i id="mwXQ">G</i>, initial matching <i id="mwXg">M</i> on <i id="mwXw">G</i> OUTPUT: maximum matching <i id="mwYA">M*</i> on <i id="mwYQ">G</i> A1 <b id="mwYg">function</b> <i id="mwYw">find_maximum_matching</i>(<i id="mwZA">G</i>, <i id="mwZQ">M</i>) : <i id="mwZg">M*</i> A2 <i id="mwZw">P</i> ← <i id="mwaA">find_augmenting_path</i>(<i id="mwaQ">G</i>, <i id="mwag">M</i>) A3 <b id="mwaw">if</b> <i id="mwbA">P</i> is non-empty <b id="mwbQ">then</b> A4 <b id="mwbg">return</b> <i id="mwbw">find_maximum_matching</i>(<i id="mwcA">G</i>, augment <i id="mwcQ">M</i> along <i id="mwcg">P</i>) A5 <b id="mwcw">else</b> A6 <b id="mwdA">return</b> M A7 <b id="mwdQ">end if</b> A8 <b id="mwdg">end function</b>

We still have to describe how augmenting paths can be found efficiently. The subroutine to find them uses blossoms and contractions.

Sign in to keep reading

5 more chapters are free with a Lably account.

More in Discrete mathematics