Iterative improvement Bipartite matching Bipartite graph Definition: A graph that can be partitioned into two disjoint sets (not necessarily of the same size) so that all edges go between them. Equivalent: does not have any odd length cycles; or is 2-colorable V 1 2 3 4 U 5 6 7 8 G = V, U, E Checking 2-colorability a b c d Using either DFS or BFS, alternately mark vertices even or odd and check that no back or cross edges connect ones of the same parity. Matching A subset M E of edges such that no two share a common vertex. V 1 2 3 4 U 5 6 7 8 Try to achieve the largest number |M| of edges. Augmenting paths Idea: augment current matching M by a path P between two free vertices which alternates between edges in and out of M to form M P. V 1 2 3 4 5 U 6 7 8 9 10 Is perfect when all original vertices are included. Example V 1 2 3 4 5 U 6 7 8 (c) (b) (a) 9 10 Augmenting Augmenting Augmenting path: path: 3, path: 8,2,4,6, 1,9,1, 65,710 V 1 2 3 4 5 U 6 7 8 9 10 (c) (b) (d) Maximum matching Maximum matching Theorem: A matching M is maximal if and only if there is no augmenting path with respect to M. Proof: One direction is obvious: if there is an augmenting path, then apply it to increase M. For the other direction, if M* is a larger matching, then |M*−M| > |M−M*|. Each endpoint in M' = MM* is incident to no more than one edge in M and one edge in M*. So with degree two or less, every connected component of M' is either a path or an even-length cycle of alternating edges from M−M* to M*−M. Since the latter is bigger, there must be at least one such path that starts and ends with an edge in M*−M, and this is an augmenting path.
© Copyright 2026 Paperzz