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 difference
removes 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]
For an explicit repair, let the path graph have vertices in that order and start with
The 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.
Figure 1.
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 is
which 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.
Greedy matching 2026-10-14
A greedy matching starts with the empty matching in a graph, scans all edges in some order, and selects an edge exactly when both endpoints are unmatched vertices in a matching. For a finite graph, a complete scan returns a maximal matching: a rejected edge had a matched endpoint, which stays matched thereafter. Stopping before all edges have been considered need not give maximality. Changing the order can change the result; on P₄, middle-first gives one pair, whereas outer-first gives two. A greedy algorithm of this form never revisits its choices, while an augmenting path in a matching does.
Matching (graph theory) Created 2026-10-14 Updated 2026-10-31
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]
For a finite simple graph , write when is selected and otherwise. The vertex capacity constraint is exactly
These 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.
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.
Figure 1.
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-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.
The vertex cover decision problem takes a finite simple graph and a nonnegative integer , and asks whether there is a vertex cover of cardinality at most . The optimization problem asks for a minimum vertex cover, with cost equal to its cardinality.
For the decision problem, if there are no edges, accept; if there is an edge but , reject. Otherwise choose an edge and branch: either include and recurse on with budget , or include and recurse on with budget . Accept if either branch accepts. Every vertex cover contains at least one endpoint of , so every possible solution is retained by at least one branch. Conversely, adding the selected endpoint to a vertex cover returned by the smaller instance covers all original edges. This proves correctness by induction on the remaining budget.
The search tree has depth at most and at most leaves. Processing each node in time gives running time, establishing fixed-parameter tractability.
For optimization, greedily build a maximal matching : repeatedly select an edge and discard every edge touching either endpoint. Return the set of all endpoints of . Any edge with neither endpoint in could be added to , contradicting maximality; thus is a vertex cover. Since the edges of a matching in a graph have pairwise disjoint endpoint sets, every vertex cover must contain at least one different vertex for each of them. Therefore
The greedy construction takes polynomial time, and can be implemented in with adjacency lists. It needs only a maximal matching, not a maximum matching.
Write . The Erdős-Stone theorem states that, for a fixed graph with chromatic number ,
Here is the extremal number, and copies are subgraphs, not necessarily induced subgraphs. We write for the balanced complete multipartite blow-up with classes of vertices each. All asymptotic errors below concern with the forbidden graphs fixed.
The stability subgraph. We prove the high-minimum-degree multipartite stability subgraph assertion directly from the Erdős-Stone theorem. For , the edgeless spanning subgraph suffices. Suppose .
First repeatedly remove a vertex whose degree of a vertex is less than times the current order, where sufficiently slowly. The Erdős-Stone theorem gives, uniformly for every -free subgraph of order at most ,
Indeed, apply the asymptotic bound at large orders; the contribution from bounded or sufficiently small orders is negligible relative to . If vertices survive, the removed edges number at most
Comparing with shows that , provided dominates , the initial relative error, and . Consequently . The surviving induced subgraph satisfies and .
By the Erdős-Stone theorem, contains for some as slowly as necessary. This follows because exceeds the extremal number density for each fixed by the positive gap . Choose so slowly that and , and denote its root classes by .
An outside vertex having at least neighbours of a vertex in every determines one choice of a -subset in each . At most outside vertices can determine any fixed choice, since otherwise these vertices and the chosen root sets form . Thus at most outside vertices have this property. Exclude those vertices and the root classes; put each remaining vertex in a class for which it has fewer than neighbours of a vertex in .
Write , with . Counting missing incidences with gives
Since , it follows that for every . The total missing incidences from all root vertices to assigned vertices are at most . At least of them are incidences with a vertex's own assigned root class. Hence only missing incidences go to other root classes.
Choose slowly and discard the assigned vertices with more than missing incidences to other root classes. Each remaining vertex of is adjacent to all but at most vertices of every , . If its class contained a complete bipartite graph , the vertices of this copy would have at least common neighbours of a vertex in each other root class. These sets extend the copy to , a contradiction. By the bipartite case of the Erdős-Stone theorem, the number of internal edges in each surviving class is .
The surviving graph still has edges, whereas the total possible cross-class edges, with these balanced classes, is . Thus only cross-class edges are missing. Discard the vertices missing more than cross-class edges, with slowly, and delete all internal edges. The resulting -partite subgraph has classes of size and
For the lower bound, every surviving vertex misses only vertices outside its class; the upper bound follows from the class sizes. This also records the uniform cross-class error that we need next.
Minimum degree in an extremal graph. Fix with . Choose large enough that embeds in . An extremal -free graph is therefore -free, and its edge count has the required asymptotics by the Erdős-Stone theorem. For take as above.
For any vertex , remove and introduce a new vertex whose vertex neighbourhood consists precisely of the vertices in other than . The new degree of a vertex is . This new graph remains -free. Indeed, a new copy of must use , and all its neighbours of a vertex in that copy lie in the other classes of . There are only boundedly many of them. Each misses only vertices in , so an unused vertex is adjacent to all of them. Replacing by would give in , which is impossible.
Extremality now forces , uniformly in . The upper bound for the minimum degree of a graph follows from . For , already gives . Thus
This is the minimum degree of an extremal forbidden-subgraph graph principle.
The exact extremal graph for disjoint cliques. Define
The plus sign denotes the join of graphs. The Turán graph contains no , so every such clique in uses a vertex of . Therefore contains no vertex-disjoint such cliques, and the extremal number is at least .
Induct on , with supplied by the Turan theorem, including its equality characterization. Let and let be extremal for . The preceding results give and the -partite subgraph . Keep its classes fixed and assign each of the remaining vertices to a class in which it has fewest neighbours of a vertex in . Write the resulting classes as ; all have size . Choose a positive so slowly that dominates the outside count, every cross-class error in , and every error in the minimum degree of a graph bound.
Suppose some vertex has at least internal neighbours of a vertex. If , the assignment rule shows that has at least neighbours of a vertex in every . If , it has this many in and in the other . If contained disjoint , we could choose one vertex in each , successively avoiding those copies and the missing cross-neighbours of the already chosen vertices. This produces a further through . For , this just chooses an unused neighbour of . Hence is -free, and induction gives
Since the candidate attains , equality holds throughout: is a universal vertex and is the inductively unique extremal graph. Thus is isomorphic to .
It remains to show that this case must occur. Otherwise all internal vertex degrees are less than . Together with the lower bound on and , this implies that every vertex misses only vertices outside its own class. If some contains a matching in a graph of edges, extend its edges one by one to , choosing one vertex from each other class. At every step only cross-neighbours and boundedly many used vertices are excluded. This gives disjoint forbidden cliques, a contradiction.
A maximal matching in each class therefore has at most edges, and its at most endpoints form a vertex cover of the internal edges. Their internal vertex degrees are all , so the total internal edge count is . The cross-class edge count is at most , whence
But the balanced part sizes of the Turán graph give
contradicting extremality for . This argument also works for . Consequently, for all sufficiently large ,
The uniqueness is up to isomorphic graphs, as usual for an extremal graph for disjoint cliques.
Vertex cover Created 2026-10-05 Updated 2026-10-14
A vertex cover chooses vertices that collectively touch every edge of a graph. Think of placing monitors at junctions: if a monitor watches every connection incident to its junction, a vertex cover watches all connections. The minimum vertex cover asks how few monitors suffice. This is a model of covering connections through their endpoints, rather than of monitoring distances in the drawing.
For a finite simple graph , a vertex cover is a subset satisfying
Both endpoints may be selected; the condition requires at least one. An isolated vertex covers no edge, so a minimum vertex cover never needs it.[ref]
Take the cycle graph with vertices and edges . The set is a vertex cover: vertex covers and , vertex covers and , and vertex covers as well as . In particular, the closing edge is covered even though vertex is unselected.
The unselected vertices form an independent set. This is the key connection: an edge missed by would have both endpoints in , precisely what an independent set forbids. For every subset ,
Here is the complement of a set within ; the graph itself keeps all its edges. The complement graph is a different construction.[ref]
Figure 1.
A minimum vertex cover and its maximum independent complement on the same five-cycle
. Details.
The endpoints of any maximal matching form a vertex cover: an edge avoiding all endpoints would enlarge that matching in a graph. Consequently a graph with no matching in a graph of size has a vertex cover of size at most . This supplies a convenient vertex cover, but it need not be a minimum vertex cover.