Title: General Matching
1General Matching
2General Matching
Given a graph (not necessarily bipartite), find a
matching with maximum total weight.
unweighted (cardinality) version a matching
with maximum number of edges
3Todays Plan
- Min-max theorems
- Polynomial time algorithm
- Chinese postman
Follow the same structure for bipartite matching.
4Characterization of Perfect Matching
Halls Theorem 1935 A bipartite graph
G(A,BE) has a matching that saturates A if
and only if N(S) gt S for every subset S of A.
Tuttes Theorem 1947 A graph has a perfect
matching if and only if o(G-S) lt S for every
subset S of V.
5Min-Max Theorem
König 1931 In a bipartite graph, the size of
a maximum matching is equal to the size of a
minimum vertex cover.
Tutte-Berge formula 1958 The size of a
maximum matching
6Augmenting Path?
Given a matching M, an M-alternating path is a
path that alternates between edges in M and edges
not in M. An M-alternating path whose endpoints
are unmatched by M is an M-augmenting path.
Works for general graphs.
7Optimality Condition?
What if there is no more M-augmenting path?
If there is no M-augmenting path, then M is
maximum?
- Prove the contrapositive
- A bigger matching ? an M-augmenting path
- Consider
- Every vertex in has degree at most 2
- A component in is an even cycle or a path
- Since , an
M-augmenting path!
8Algorithm?
- Key M is maximum ? no M-augmenting path
How to find efficiently?
9Finding Augmenting Path in Bipartite Graphs
- Orient the edges (edges in M go up, others go
down) - edges in M having positive weights, otherwise
negative weights
In a bipartite graph, an M-augmenting path
corresponds to a directed path.
10Finding M-augmenting paths
- Dont know how to orient the edges so that
- An M-augmenting path ?
- a directed path between two
free vertices
11No repeated vertices
- Just find an alternating path without repeated
vertices?!
Either we may exclude some possibilities, Or we
need to trace the path
12Blossom
13Key idea
(Edmonds 1965) General matching algorithm
14Key Lemma
- (Edmonds) M is a maximum matching in G ?
- M/C is a maximum
matching in G/C - Key M is maximum ? no M-augmenting path
- an M-augmenting path in G ?
- an M/C-augmenting path in G/C
15An M/C-augmenting path ? an
M-augmenting path
16An M-augmenting path ? an
M/C-augmenting path
17Algorithm
- Key M is maximum ? no M-augmenting path
How to find efficiently?
18Finding an M-augmenting path
- Find an alternating walk between two free
vertices. - This can be done in linear time by a DFS or a
BFS. - Either an M-augmenting path or a blossom can be
found. - If a blossom is found, shrink it, and
(recursively) - find an M/C-augmenting path P in G/C, and
then - expand P to an M-augmenting path in G.
19Complexity
- At most augmentations.
- Each augmentation does at most
contractions. - An alternating walk can be found in
time. - Total running time is .
20Historical Remarks
- In his famous paper paths, trees, and flowers,
Jack Edmonds - Introduced the notion of a good algorithm.
- Edmonds solved weighted general matching, primal
dual. - Linear programming description, a breakthrough
in polyhedral combinatorics.
21Proving Min-Max Theorem
Tutte-Berge formula 1958 The size of a
maximum matching
22M-alternating forest
Larger forest
M-augmenting path
a blossom
We make progress in any of the above cases.
23M-alternating forest
Otherwise we find the set in Tutte-Berge formula.
24Edmonds-Gallai Decomposition
Can be obtained from M-alternating
forest. Contains a lot of information about
matching.
25Chinese Postman
Given an undirected graph, a vertex v, a length
l(e) on each edge e, find a shortest tour to
visit every edge once and come back to v.
Visit every edge exactly once if Eulerian.
Otherwise, find a minimum weighted perfect
matching between odd vertices.
26Tutte Matrix
- Skew symmetric matrix, a(u,v)x(e) and
a(v,u)-x(e) - Full rank ? perfect matching
- Randomized algorithm