Maximum matching by Edmonds: Difference between revisions
No edit summary |
|||
Line 3: | Line 3: | ||
'''Algo''' | '''Algo''' | ||
'''Type of algorithm:''' recursion | '''Type of algorithm:''' recursion. | ||
'''Invariant:''' | '''Invariant:''' | ||
Each recursive step returns a cardinality-maximal matching. | |||
'''Variant:''' | '''Variant:''' | ||
The number of nodes decreases. | |||
'''Break condition:''' | '''Break condition:''' |
Revision as of 09:39, 22 November 2014
Abstract view
Algo
Type of algorithm: recursion.
Invariant: Each recursive step returns a cardinality-maximal matching.
Variant: The number of nodes decreases.
Break condition: There is no more augmenting path.
Induction basis
Abstract view: Start with some matching, for example, the empty matching.
Induction step
Abstract view:
- Apply the modified repeated graph search from the classical algorithm for the restriction to bipartite graphs.
- However, in addition:
- Choose a BFS or another grah traversal strategy that will never return to the start node (this requirement excludes DFS)
- The search maintains a boolean flag even/odd, which indicates the parity of the distance of the current node from the start node of the current search.
- Also, each node has a boolean label even/odd. Whenever this node is seen (not only the first time when it is seen), its label is set according to the flag.
- If a labeled node is seen again, but with another distance parity than before:
- The repeated graph search is terminated.
- A blossom [math]\displaystyle{ B }[/math] is identified.
- [math]\displaystyle{ C }[/math] is shrunken, giving [math]\displaystyle{ G'=(V',E') }[/math] and the restriction [math]\displaystyle{ M' }[/math] of [math]\displaystyle{ M }[/math] to [math]\displaystyle{ G' }[/math].
- The procedure is called recursively with [math]\displaystyle{ G' }[/math] and [math]\displaystyle{ M' }[/math].
- Exactly one node of [math]\displaystyle{ C }[/math] is matched by [math]\displaystyle{ M' }[/math], so extend [math]\displaystyle{ M' }[/math] in the obvious, unique way by [math]\displaystyle{ \lfloor|C|/2\rfloor }[/math] edges of [math]\displaystyle{ C }[/math].
- Return this extension of [math]\displaystyle{ M' }[/math].
Remark: In typical formulations of this algorithm, the graph search is not left open but the search strategy applied in Hopcroft-Karp is hard-coded.
Implementation of step 3.2: Let [math]\displaystyle{ w }[/math] be the node on which the two different parities occur, and let [math]\displaystyle{ v }[/math] be the node from which [math]\displaystyle{ w }[/math] is seen at that moment. In the arborescence constructed so far, let [math]\displaystyle{ u }[/math] denote the node such that the paths from the start node to [math]\displaystyle{ v }[/math] and [math]\displaystyle{ w }[/math] coincide up to [math]\displaystyle{ u }[/math] and part at [math]\displaystyle{ u }[/math]. Note that the incoming edge of [math]\displaystyle{ u }[/math] in the arborescence is matched because, otherwise, the arborescence could mot branch at [math]\displaystyle{ u }[/math]. Therefore, the concatenation of the two branches from [math]\displaystyle{ u }[/math] to [math]\displaystyle{ v }[/math] an [math]\displaystyle{ w }[/math], respectively, with [math]\displaystyle{ \{v,w\} }[/math] is a blossom, and the search entered this blossom via its stem.
Proof: Basically, we have to show: If [math]\displaystyle{ M }[/math] is not maximum, the graph search will either find an augmenting path or run into a blossom via its stem. Suppose the search does not find an augmenting path. Due to the proof in the induction step of the classical bipartite cardinality algorithm, the graph search runs into an odd cycle. Since we chose a graph search strategy that never returns to the start node, the remark on that proof implies that this odd cycle is a blossom, and that the search entered this blossom via its stem.
Correctness
When the recursion terminates, Berge's theorem implies that the