Edmond Matching Algorithm
Edmond Matching Algorithm
The blossom algorithm, sometimes called the Edmonds’ matching algorithm, can be
used on any graph to construct a maximum matching. The blossom algorithm improves
upon the Hungarian algorithm by shrinking cycles in the graph to reveal augmenting
paths. Additionally, the Hungarian algorithm only works on weighted bipartite graphs but
the blossom algorithm will work on any graph. The blossom algorithm is a polynomial
time maximum graph matching algorithm. This algorithm has many applications, for
example, assignment problems such as the Hall's marriage theorem, and path problems
such as the Hamiltonian path problem.
The blossom algorithm takes a general graph G=(V,E) and finds a maximum
matchingM. The algorithm starts with an empty matching and then iteratively improves it
by adding edges, one at a time, to build augmenting paths in the matching M. Adding to
an augmenting path can grow a matching since every other edge in an augmenting path
is an edge in the matching; as more edges are added to the augmenting path, more
matching edges are discovered.
The blossom algorithm has three possible results after each iteration:
- Either the algorithm finds no augmenting paths, in which case it has found a maximum
matching;
- a blossom can be found in order to manipulate it and discover a new augmenting path.
Augmenting Paths
An augmenting path is an odd length path that has unmatched nodes for endpoints. The
edges in an augmenting path alternate: one segment will be in the matching, the next
segment is not in the matching, the next segment is in the matching, and so on.
The algorithm works by finding augmenting paths so it can increase the size of the
matching by one each iteration. To do this, it starts by finding unmatched vertices
(vertices that are not connected to an edge that is in the matching). Then, it builds up an
alternating path from these nodes. This means that the path begins at a node not in the
matching — to be an augmenting path, it must start and end with unmatched nodes.
The algorithm continues to build on the augmenting path until it can’t anymore. When it
stops building an augmenting path, it is either the case that the graph has run out of
edges that are not already in the augmenting path, in which case, there is no maximum
matching, or the algorithm gets to a point where an augmenting path cannot be made, at
which point the algorithm returns a maximum matching.
Blossoms
The idea behind blossoms is that an odd-length cycle in the graph can be contracted to
a single vertex so that the search can continue iteratively in the now contracted graph [3].
Here, these odd-length cycles are the blossoms.
The algorithm can just go on through the graph and treat the tricky cycle as if it were
only a single node — fooling the algorithm into thinking there is an even number of
nodes in the graph (it has explored so far) so that it can run the Hungarian algorithm on
it.
The advantage is given due to the ease at which the stem part can be toggled between
edges in the blossom.
[1]
The goal of the algorithm is to shrinks a blossom into a single node in order to reveal
augmenting paths. It works by running the Hungarian algorithm until it runs into a
blossom, which it then shrinks down into a single vertex. Then, it begins the Hungarian
algorithm again. If another blossom is found, it shrinks the blossom and starts the
Hungarian algorithm, and so on. [4]
Notice
the toggling in edges to make another matched edge the stem of the blossom[5].
[6]
Pseudocode
a. Put v in ODD, M(v) in EVEN, and (u,v) and (v,M(v)) in Ef, where M(v) is
the vertex matched to v.
6. Else, if v ϵ EVEN and u,v are connected in F, then:
c. In H, put b in EVEN.
d. Go to step 4.
7. Else, if v ϵ EVEN and u,v are not connected in F, then:
c. Augment M.
d. Go to step 2.
8. End algorithm when no more conditionals are satisfied.
In the pseudocode above, a blossom can be easily spotted if two vertices connected by
an edge are EVEN vertices, implying that the cycle is odd.
Complexity
The blossom algorithm has three outcomes contributing to the runtime complexity: it may
find a maximum matching, an augmenting path, or a blossom. In the worst case, this
algorithm has a total runtime of O(∣E∣∣V∣2), where each iteration takes O(∣E∣) as each
edge is scanned in hopes of asserting a perfect matching. If an augmenting path is
found, the matching can be reconfigured in O(∣V∣) time, taking O(∣E∣∣V∣) time.
Lastly, if a blossom is found, the smaller graph has to be recursed, which can occur
repeatedly for a maximum of O(∣V∣) recursions, at which point either an augmenting
path is found, or the algorithm terminates. Since each time a blossom is recursed, there
is a new set of augmenting paths, the algorithm can take a maximum runtime of
O(∣E∣∣V∣2) [8].
This algorithm was later improved to have a runtime of O(∣V3∣), and subsequently further
reduced to O(∣E∣∣V∣).
For further details on the fast implementation refer to Micali and V. Vazirani’s paper, A
Proof of the MV Matching Algorithm.
See Also
• Matching Algorithms
References