 A subgraph M of G is a matching if the edges in M are non-adjacent. This leads to two questions. Can we find a maximum matching where the number of edges in this maximum matching is greater than or equal to the number of edges in any other matching? And can we find a perfect matching that includes all vertices in our original graph? We'll look at the first one first. Our key tool is the following idea. An M-augmented path is a path that alternates between edges in M and edges in G minus M, beginning and ending with edges in G minus M. And remember the reason this is important is that if we have a M-augmented path, we can always find a new matching M' with more edges by selecting what we can think about as the complementary edges. But could we find an even larger matching that doesn't require a M-augmented path? In 1957 the French mathematician Claude Baerge proved a matching is maximal if and only if no M-augmented path exists. In other words, we only need to worry if we can find a M-augmented path. If we can't, then we have a maximal matching. So let's prove this. Suppose M is maximal. If a M-augmented path existed, there would be a larger matching, which we could form as we did before by replacing the edges in M in the path with the complementary edges in the path. So in the picture, the thick edges represent some original matching M. And if we combine these with the dotted edges, we get our M-augmented path. If we take the dotted edges alone, we have a larger matching with three edges instead of two. So suppose our graph has matching M, and also suppose that no M-augmented paths exist. Suppose N is a larger matching, in other words, it has more edges. We'll consider the edge-induced symmetric difference subgraph M delta N, which will consist of all edges in M that are not in N, and all edges in N that are not in M. In other words, it's all the edges in N and M together, except we're going to omit any that were common in both. Since this subgraph is limited to the originally disconnected edges of N and M, then every vertex has degree at most two. However, there's a theorem that is the maximum degree of any vertex in the graph is less than or equal to two, then our graph consists of either a path or a cycle. And consequently, every connected component of this edge-induced symmetric difference is either a path or a cycle. Since the edges from N and the edges from M are disconnected, in other words, none of the edges of N connect to each other, and none of the edges in M connect to each other, then any path or cycle in the symmetric difference has to alternate between edges in N and edges in M. And, by assumption, since N is larger, then at least one connected component will have one more edge from N than from M. But this will be an M-augmented path, which contradicts our assumption that there were not. Alternatively, we can alternate which edges are in our matching and get a larger matching. Baer's theorem provides a way to create a maximal matching as follows. Start with any matching. Attempt to augment it will use a depth-first search. Plather, rinse, repeat. With some modifications, this is the basis for Kuhn's algorithm invented in 1955 by Harold Kuhn. For example, let's try to find a maximal matching for this graph. Although the graph shown is bipartite, the algorithm works on any graph as long as we number the vertices in some order so we can implement our depth-first search. So we go to vertex one and go to the lowest numbered neighboring vertex, which is going to be seven, and this gives us our first edge, one seven. Next, we'll go to the next higher number not already included in an edge, which is going to be vertex two. The edge two seven is not in our matching. However, it takes us to an edge that is, which means two seven could be the start of an augmenting path. So we'll implement our depth-first search. So two seven takes us to seven, seven one takes us to one, and then from one to the lowest numbered vertex is eight, which is not an edge included in our matching. So the edge is two seven, seven one one eight, form a M augmenting path, and switching out the edges, we have a new matching two seven one eight. The next vertex not included is three. The lowest numbered vertex adjacent to three is nine via the edge three nine, which is not included in our matching, so we include it. The edge four seven is not in our matching, but it is adjacent to an edge that is. So again, this might be the start of a M augmented path. The edge seven two takes us to two. The edge two nine, again to the lowest number, takes us to another edge in our matching, which takes us to a new vertex. And so four seven, seven two, two nine, nine three, three ten is M augmenting. So we swap the edges out and get a larger matching set. The edge five eleven is not in our matching, so we include it. The edge six eleven is adjacent to an edge in our matching. So again, it could be the start of a M augmenting path, but we can't use it to get an augmenting path because it takes us to five and there's no edges away from five. Again, since it's a depth first search, going to eleven didn't work, so instead we'll go to thirteen and that gives us the last edge of our matching.