Augmenting path in a matching Created 2026-10-06 Updated 2026-10-14
An augmenting path in a matching is a nonempty alternating path in a matching with distinct endpoints that are both unmatched vertices in a matching. Its first and last edges lie outside . Thus it has unselected edges and selected edges, for some . Taking the symmetric differenceremoves the selected edges on and inserts its unselected edges. Each internal vertex exchanges one selected edge for another; each endpoint gains its first selected edge. All choices away from stay in place, so is a matching in a graph with .[ref]
Graph Theory by Reinhard Diestel. Matching, Covering and Packing, §2.1, printed p. 2: alternating paths, augmenting paths and symmetric difference
For an explicit repair, let the path graph have vertices in that order and start withThe endpoints and are initially unmatched vertices in a matching. Along the edges are outside, inside, outside, inside, outside . Remove and , then add together:This raises the cardinality from two to three and gives a perfect matching. Six vertices allow at most three disjoint pairs, so it is also a maximum cardinality matching. The initial is already a maximal matching: every unused edge touches a matched vertex. Augmentation succeeds because it can replace earlier choices instead of only adding to them.
The augmenting path in a matching on P₆ replaces two selected edges by three using symmetric difference
. Details. One unused edge joining two unmatched vertices in a matching is the shortest possible augmenting path in a matching. Longer augmenting paths in a matching reassign several partners, explaining why a stalled greedy matching need not be optimal. For edge benefits , the change in total benefit iswhich need not be positive even though the cardinality increases. A maximum-weight matching therefore needs a different optimality test. In an assignment equality graph an augmenting path in a matching moves toward a perfect matching while preserving zero reduced costs on matched edges; this is the setting used by the Hungarian algorithm.
Berge's theorem 2026-10-14
For a finite simple graph and a matching in a graph , is a maximum cardinality matching if and only if has no augmenting path in a matching relative to . The graph need not be a bipartite graph, and the assertion concerns cardinality, not edge benefits.[ref]
Two theorems in graph theory by Claude Berge. Claude Berge, Two theorems in graph theory, printed p. 842: finite unoriented graph and Problem 3; printed p. 843, Theorem 1: maximum matching and absence of an alternating chain between neutral points
The criterion turns a global comparison with every competing matching in a graph into a search for one repair. Starting from any matching in a graph, repeatedly find and toggle an augmenting path in a matching. Each step adds one selected edge, so finiteness gives termination after at most steps; absence of any further augmenting path in a matching certifies maximum cardinality. This is an optimality criterion, not by itself a bound on the work needed to find each graph path.
For a short proof outline, an augmenting path in a matching immediately contradicts maximum cardinality. Conversely, if another matching in a graph has , consider the subgraph whose set of edges is . Its vertices have degree of a vertex at most two; its nontrivial connected components are graph paths and even cycles in a graph, alternating between the two matchings in a graph. A cycle in a graph contributes equal numbers from each. Hence some graph path contributes one more edge from than from and starts and ends with edges from . Its endpoints are unmatched vertices in a matching relative to , yielding the required augmenting path in a matching.
Matching (graph theory) Created 2026-10-14 Updated 2026-10-14
A matching in a graph is a set of edges of an undirected graph with no shared endpoints: each vertex has capacity for at most one selected edge. It describes simultaneous compatible pairs, such as jobs assigned to distinct available workers, or tasks each occupying two resources that cannot be shared. The empty set is a valid matching in a graph.[ref]
Graph Theory by Reinhard Diestel. Matching, Covering and Packing, opening paragraph, printed p. 1: independent edges and matchings
For a finite simple graph , write when is selected and otherwise. The vertex capacity constraint is exactlyThese are constraints on a discrete selection, not a requirement that every vertex be used. A matching in a graph with matching saturation of all vertices is a perfect matching; an unmatched vertex in a matching uses none of its capacity.
The objective must be specified separately. A maximum cardinality matching selects as many edges as possible; a maximum-weight matching selects the greatest total benefit; a minimum-weight perfect matching minimizes cost while requiring every vertex to be paired. A maximal matching only says that no additional edge fits alongside the current choices. The four-vertex path graph below separates these notions: choosing the middle edge blocks both outer edges, yet replacing it by those two edges pairs more vertices.
This model is useful because conflicts are local at vertices, while the quality of a selection can depend on coordinated changes along a whole augmenting path in a matching. A greedy matching gives a quick feasible selection; Berge's theorem explains when searching for such changes has reached a maximum cardinality matching. Repeating the pairing problem over time leads instead to proper edge colouring, where each time slot is a matching in a graph.
Matching number Created 2026-09-24 Updated 2026-10-14
For a finite graph , the matching number isIt is the cardinality of a maximum cardinality matching. The vertex capacity constraint gives . The worked path graph examples have and . A perfect matching reaches ; the empty graph has matching number zero.
Maximal matching Created 2026-09-24 Updated 2026-10-14
A maximal matching is a matching in a graph to which no extra edge can be added while retaining all current selected edges. Equivalently, no edge joins two unmatched vertices in a matching; those vertices form an independent set. Every maximum cardinality matching is a maximal matching, but the converse fails.
Take the path graph with vertices and edges . A greedy algorithm that first selects the middle edge produces . Both remaining edges touch a matched vertex, so this size-one matching in a graph is maximal. Yet has two edges. No matching in a graph on four vertices has more than two edges, so is a maximum cardinality matching. The two remaining free vertices of , namely and , are not adjacent; that does not prevent a longer augmenting path in a matching from joining them.
Choosing the middle edge of P₄ gives a maximal matching of size one; the outer edges give a maximum cardinality matching of size two
. Details. Maximality is useful as a quick stopping rule and a modest guarantee. For any maximal matching and maximum cardinality matching in a finite simple graph, every edge of touches an endpoint of an edge of . Assign it to one such edge of . Since has disjoint endpoints, each edge of receives at most two assignments, proving . The P₄ example reaches equality. Thus maximality guarantees at least half the largest cardinality, but says nothing comparable about arbitrary edge benefits. Its selected endpoints also form a vertex cover, as explained under vertex cover.
Maximum cardinality matching 2026-10-14
A maximum cardinality matching is a matching in a graph with as many edges as any matching in a graph of the same graph. It has cardinality , the matching number, and need not be unique or be a perfect matching. For example, any single edge of a triangle in a graph is a maximum cardinality matching, but leaves one vertex unmatched. Berge's theorem characterizes these optima by the absence of an augmenting path in a matching.
Maximum-weight matching 2026-10-14
Assign each edge a real benefit . A maximum-weight matching maximizes over all matchings in a graph ; the empty matching in a graph is allowed. Setting every recovers a maximum cardinality matching, but otherwise the objectives can disagree.
On the same path graph , give the middle edge benefit and each outer edge benefit . The matching in a graph has total benefit , while the two-edge matching in a graph has total benefit . Thus the smaller choice is the unique maximum-weight matching. If instead the requirement is to find a maximum cardinality matching and then maximize benefit among those, the outer edges must be chosen. Requiring a perfect matching before optimizing cost is another distinct problem, covered by minimum-weight perfect matching. With negative benefits a maximum-weight matching can even be empty, so it need not be a maximal matching.

