Tutorials › Graph Theory (Undergraduate) › Matching and Cover Certificates of Optimality

Bipartite Graphs and Konig's Theorem · Tutorial 272 of 799

Matching and Cover Certificates of Optimality

Use a matching and a vertex cover of equal size as short, independently checkable certificates of maximum and minimum size.

Intermediate 9 min read

What You'll Learn

  • Distinguish a maximum matching from a merely maximal matching.
  • Check directly whether an edge set is a matching and a vertex set is a cover.
  • Prove why equal certificate sizes force both objects to be optimal.
  • Apply matching-cover certificates to explicit bipartite graphs.
  • Understand how Kőnig’s theorem guarantees certificates in bipartite graphs.
  • Recognize why unequal candidate sizes do not establish optimality.

Why Two Objects Can Certify Optimality

Finding a large matching or a small vertex cover can require careful reasoning. Once found, however, their optimality can sometimes be verified with a short comparison. A matching gives a lower bound on the size of every vertex cover, and a vertex cover gives an upper bound on the size of every matching. If the two sizes agree, the bounds meet: neither object can be improved.

All graphs in this tutorial are finite and simple. A matching is a set of edges no two of which share an endpoint. A matching is maximum if it has largest size among all matchings in the graph. A matching is maximal if no edge can be added to it while keeping it a matching; maximal does not necessarily mean maximum. A vertex cover is a set of vertices containing at least one endpoint of every edge. A cover is minimum if it has smallest size among all vertex covers. A bipartite graph is one whose vertices can be partitioned into two sets so that each edge has one endpoint in each set.

Definition: A pair \((M,C)\), where \(M\) is a matching and \(C\) is a vertex cover of the same graph, is an equal-size matching-cover certificate if \(|M|=|C|\). To check the certificate, verify that the edges in \(M\) are pairwise vertex-disjoint, that every edge has an endpoint in \(C\), and that the two set sizes are equal.

These checks use only the proposed matching and cover. They do not require listing all matchings or all vertex covers, which may be numerous. The certificate proves optimality because every matching is bounded above by every cover, as the next result makes precise.

The Certificate Theorem

Theorem: Let \(G\) be a finite graph, \(M\) a matching in \(G\), and \(C\) a vertex cover in \(G\). Then \(|M|\leq |C|\). If \(|M|=|C|\), then \(M\) is a maximum matching and \(C\) is a minimum vertex cover.

Proof. Every edge of \(M\) has at least one endpoint in \(C\), since \(C\) covers every edge. Choose one such endpoint for each edge of \(M\). Distinct edges of \(M\) have disjoint endpoints, by the definition of matching, so the chosen endpoints for distinct edges are distinct vertices. This gives an injection from the edges of \(M\) into the vertices of \(C\), and hence \(|M|\leq |C|\).

Now suppose \(|M|=|C|=k\). For any matching \(M'\), the inequality just proved, applied to \(M'\) and \(C\), gives \(|M'|\leq k=|M|\). Thus no matching is larger than \(M\), so \(M\) is maximum. For any vertex cover \(C'\), applying the same inequality to \(M\) and \(C'\) gives \(k=|M|\leq |C'|\). Thus no cover is smaller than \(C\), so \(C\) is minimum. \(\square\)

The proof gives two bounds that can be used separately: a matching of size \(k\) proves that every cover has size at least \(k\), while a cover of size \(k\) proves that every matching has size at most \(k\). Equal-size certificates meet both bounds at the same integer. Notice that the theorem itself does not require bipartiteness: whenever such a pair is found, it certifies optimality in any finite graph.

Worked Example: A Matching and Cover of Size Three

Let \(G=(V,E)\), where \(V=\{a,b,c,d,x,y,z\}\) and \(E=\{ax,ay,bx,by,cz\}\). The graph is bipartite with parts \(\{a,b,c,d\}\) and \(\{x,y,z\}\). Consider \(M=\{ax,by,cz\}\) and \(C=\{a,b,c\}\).

Check the matching. The endpoints of its edges are \(a,x\), \(b,y\), and \(c,z\). All six endpoints are distinct, so \(M\) is a matching, and \(|M|=3\).

Check the cover. The edges \(ax\) and \(ay\) have endpoint \(a\in C\); \(bx\) and \(by\) have endpoint \(b\in C\); and \(cz\) has endpoint \(c\in C\). Thus every edge is covered, and \(|C|=3\).

The sizes agree, so the theorem certifies that \(M\) is maximum and \(C\) is minimum. The matching leaves only \(d\) unused; \(z\) is not unused, because it is an endpoint of \(cz\).

Check: the only edges in \(G\) are the five listed, and the cover test above accounts for each one. Also, a matching of size \(4\) would require eight distinct endpoints, but this graph has only seven vertices. The certificate gives the sharper upper bound of \(3\), agreeing with the exhibited matching.

Why Bipartite Graphs Have Equal-Size Certificates

A certificate is useful only if an optimal matching and an optimal cover of equal size can be found. For bipartite graphs, Kőnig’s matching-cover theorem guarantees this. In terms of the matching number \(\nu(G)\), the largest size of a matching, and the minimum cover size \(\tau(G)\), the theorem states that \(\nu(G)=\tau(G)\) for every finite bipartite graph. This result was established in the earlier material on Kőnig’s theorem.

Corollary: Every finite bipartite graph has an equal-size matching-cover certificate. Moreover, any maximum matching and any minimum vertex cover in that graph have the same size.

Proof. By Kőnig’s theorem, \(\nu(G)=\tau(G)\). Since \(G\) is finite, there is a matching \(M\) of size \(\nu(G)\) and a vertex cover \(C\) of size \(\tau(G)\). Therefore \(|M|=|C|\), so they form a certificate. The same equality shows that any maximum matching and any minimum cover have equal sizes. By the certificate theorem, any such equal-size pair certifies both optima. \(\square\)

This corollary separates two tasks. Kőnig’s theorem guarantees that equal-size optimal objects exist in a bipartite graph; the certificate theorem explains why a particular equal-size pair proves optimality. When checking a proposed pair, the bipartite hypothesis is not needed. It matters for the guarantee that optimal matching and cover sizes agree.

Worked Example: A Certificate with Vertices from Both Parts

Let \(G=(V,E)\), where \(V=\{a,b,c,x,y,z\}\), the bipartition is \(\{a,b,c\}\) and \(\{x,y,z\}\), and \(E=\{ax,ay,by,cy\}\). Propose the matching \(M=\{ax,by\}\) and the cover \(C=\{a,y\}\).

For \(M\), the endpoints are \(a,x,b,y\), which are distinct; hence \(M\) is a matching and \(|M|=2\). To check \(C\), inspect each edge: \(ax\) and \(ay\) meet \(a\), while \(by\) and \(cy\) meet \(y\). Thus \(C\) covers every edge and \(|C|=2\). The equal-size certificate proves that \(M\) is maximum and \(C\) is minimum.

Check: the two edges of \(M\) are present in the listed edge set, and the cover test accounts for all four listed edges. The vertices \(c,x,z\) need not all be matched or included in the cover: the conditions concern disjointness of matching edges and coverage of edges, not whether every vertex is used.

What Unequal Sizes Do—and Do Not—Tell You

If a proposed matching and cover have unequal sizes, they do not form an equal-size certificate. That failure alone does not prove that either proposed object is nonoptimal. The matching may be too small, the cover may be too large, or both may be nonoptimal. In particular, the general inequality \(|M|\leq |C|\) can hold strictly even when both objects are valid.

Worked Example: Improving a Smaller Matching

Let \(G=(V,E)\), where \(V=\{a,b,x,y\}\), the bipartition is \(\{a,b\}\) and \(\{x,y\}\), and \(E=\{ax,xb,by\}\). The proposed matching \(M_0=\{ax\}\) has size \(1\), and \(C=\{x,b\}\) is a cover of size \(2\): \(ax\) meets \(x\), \(xb\) meets both \(x\) and \(b\), and \(by\) meets \(b\). These unequal sizes do not certify optimality.

Now take \(M=\{ax,by\}\). Its edges have four distinct endpoints, so it is a matching of size \(2\). The same set \(C=\{x,b\}\) covers all three edges, as checked above, and has size \(2\). The equal-size pair certifies that \(M\) is maximum and \(C\) is minimum. In this example, the original matching \(M_0\) was not maximum, and replacing it by \(M\) creates a certificate.

Check: \(G\) has four vertices, so no matching can have more than two edges because each matching edge uses two distinct vertices. The displayed matching has two edges, confirming the upper bound independently. The certificate also proves that no cover has fewer than two vertices.

It is also important not to reverse the certificate theorem. Equal sizes are sufficient for optimality; the theorem does not say that arbitrary valid objects of unequal sizes are optimal. In bipartite graphs, Kőnig’s theorem gives equality for optimal sizes, but it does not make every matching and every cover an optimal pair.

When Equal-Size Certificates Need Not Exist

The graph condition matters for the existence guarantee. The certificate theorem remains true in non-bipartite graphs, but a maximum matching and a minimum cover need not have equal sizes there.

Worked Example: A Triangle Has No Equal-Size Optimal Pair

Let \(G=(V,E)\), where \(V=\{1,2,3\}\) and \(E=\{12,23,31\}\). Every two edges of this graph share a vertex, so a matching has at most one edge; the set \(\{12\}\) is a matching, hence the maximum matching size is \(1\).

A single vertex cannot cover all three edges: vertex \(1\) misses \(23\), vertex \(2\) misses \(31\), and vertex \(3\) misses \(12\). The set \(\{1,2\}\) covers all three edges, so the minimum cover size is \(2\). Thus the maximum matching and minimum cover sizes differ.

Check: the matching \(\{12\}\) and cover \(\{1,2\}\) are both valid, but their sizes are \(1\) and \(2\), respectively. This is consistent with \(|M|\leq |C|\), and it shows why the bipartite hypothesis is needed for Kőnig’s equality guarantee.

Using Certificates Carefully

To verify a certificate in a worked problem, do not rely only on a drawing or on the impression that the matching is large. Write down the graph’s vertex and edge sets, then check the two structural conditions against the listed edges. Finally, compare the sizes. This gives a finite, auditable argument:

  1. For a proposed matching, check that no two selected edges share an endpoint.
  2. For a proposed cover, check every edge and identify an endpoint in the cover.
  3. Count the selected edges and cover vertices; if the counts agree, invoke the certificate theorem.

The distinction between maximum and maximal is especially relevant. A matching can be maximal because no single unused edge can be added, yet still be smaller than another matching. A cover of the same size as that maximal matching would certify maximum status, but a merely maximal matching does not do so by itself. The cover must actually be checked, and the sizes must agree.

In a bipartite graph, an equal-size pair is both a proof and a concise report of the optimum value: its common size is \(\nu(G)=\tau(G)\). The matching supplies a feasible solution of that size, while the cover rules out every larger matching. In applications, this makes certificates valuable even when the process that found the objects was more involved than their verification.

Check Your Understanding

For each question, distinguish checking validity from proving optimality.

  1. State the two conditions that must be checked before a set of edges can be called a matching-cover certificate.
  2. Suppose a matching has size \(4\) and a vertex cover has size \(4\). Explain why neither a larger matching nor a smaller cover can exist.
  3. In a bipartite graph, what theorem guarantees that a maximum matching and a minimum vertex cover have equal sizes?
  4. Can unequal sizes alone show that a proposed matching is not maximum? Explain why or why not.
  5. For the graph with \(V=\{a,b,x,y\}\) and \(E=\{ax,xb,by\}\), check whether \(\{ax,by\}\) and \(\{x,b\}\) form a certificate, stating the size of each set.