On this page
Four students, four projects, and each student likes only some of them. How many can get a project they like, with none shared? König's theorem answers this and gives a short proof that the answer is best possible.
What does König's theorem say?
A bipartite graph has its vertices split into two sides, with every edge joining one side to the other. A matching is a set of edges with no vertex in common. A vertex cover is a set of vertices that touches every edge.
König's theorem: in any bipartite graph, the number of edges in a maximum matching equals the number of vertices in a minimum vertex cover (Wikipedia, Kőnig's theorem)). Dénes Kőnig proved it in 1931 in the paper "Gráfok és mátrixok" (Graphs and matrices), and Jenő Egerváry found it independently the same year, in a more general weighted form (same source).
One half is easy: matching edges share no vertex, so a cover needs a different vertex for each, and no matching is larger than any cover. The real content is that some cover is exactly as small as the largest matching. Its cousin, Hall's marriage theorem with a jobs example, tells you when everyone on one side can be matched.
How do augmenting paths find a maximum matching?
Take students A, B, C, D and projects 1, 2, 3, 4, with these edges:
A likes 1 and 2
B likes 1
C likes 2, 3 and 4
D likes 2
An augmenting path runs from an unmatched student to an unmatched project, alternating edges outside and inside the matching. Flipping every edge on it grows the matching by one.
Start greedily: match A–1 and C–2. Size 2.
B is free. B's only project, 1, belongs to A. A can move to 2, which belongs to C. C can move to 3, which is free. The path B–1–A–2–C–3 is augmenting.
Flip it: the matching becomes B–1, A–2, C–3. Size 3.
D is still free. D's only project, 2, belongs to A; A's other project, 1, belongs to B; B has nowhere else to go. No augmenting path exists.
So the matching is maximum. You can see it directly: A, B and D like only projects 1 and 2 between them, so at most two of them can be placed.
How do you read the minimum vertex cover off the matching?
Run the alternating search once more from every free student (here only D). It reaches students D, A, B and projects 2, 1. Now take:
the students the search did not reach: C
the projects it did reach: 1 and 2
The cover is {C, 1, 2}. Check it: A–1, B–1 touch 1; A–2, D–2 touch 2; C–2, C–3, C–4 touch C. Three vertices, three matching edges. The same idea, run at scale, is why the Hopcroft–Karp algorithm can also find a minimum vertex cover efficiently) in bipartite graphs.
Why does the theorem need a bipartite graph?
Take a triangle. Any two of its edges share a vertex, so a maximum matching has 1 edge. But one vertex touches only 2 of the 3 edges, so a cover needs 2 vertices. The equality breaks.
The same happens on any odd cycle: a 5-cycle has a maximum matching of 2 edges but needs 3 cover vertices. A bipartite graph has no odd cycle: each step switches sides, so getting home takes an even number of steps. For graphs that are not bipartite, the minimum vertex cover may be larger than the maximum matching, and the minimum vertex cover problem is NP-complete in general (Wikipedia, Kőnig's theorem)).
What is the matrix version of König's theorem?
Write the example as a 0-1 matrix, one row per student and one column per project:
Row A: 1 1 0 0
Row B: 1 0 0 0
Row C: 0 1 1 1
Row D: 0 1 0 0
In a 0-1 matrix, the largest number of 1s with no two in the same line equals the smallest number of lines covering all the 1s, where a line means a row or a column (PlanetMath, König–Egerváry theorem). Here the 1s at B1, A2 and C3 share no line, and column 1, column 2 and row C cover every 1: the same matching and cover as before.
H. W. Kuhn's 1955 paper "The Hungarian method for the assignment problem" built on ideas latent in the work of two Hungarian mathematicians, hence the name. The same min-equals-max pattern appears in the max-flow min-cut theorem, worked on six nodes and in Dilworth's theorem on chains and antichains.
How to practise it
Draw a bipartite graph with 4 to 6 vertices a side.
Grow a matching with augmenting paths until the search dies.
Read off the cover and check every edge.
Rewrite the graph as a matrix and find the covering lines.
If the definitions blur, the Fermi Concept Library covers every concept in mathematics and computing. When an augmenting path search goes wrong, the Fermi Problem Library has a step-by-step solver that explains the reasoning rather than printing an answer.



