In the
mathematical
Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented in modern mathematics ...
area of
graph theory
In mathematics, graph theory is the study of ''graphs'', which are mathematical structures used to model pairwise relations between objects. A graph in this context is made up of '' vertices'' (also called ''nodes'' or ''points'') which are conne ...
, Kőnig's theorem, proved by , describes an equivalence between the
maximum matching
Maximum cardinality matching is a fundamental problem in graph theory.
We are given a graph , and the goal is to find a matching containing as many edges as possible; that is, a maximum cardinality subset of the edges such that each vertex is adj ...
problem and the minimum
vertex cover problem
In graph theory, a vertex cover (sometimes node cover) of a graph is a set of vertices that includes at least one endpoint of every edge of the graph.
In computer science, the problem of finding a minimum vertex cover is a classical optimiza ...
in
bipartite graphs. It was discovered independently, also in 1931, by
Jenő Egerváry
Jenő Elek Egerváry (April 16, 1891 – November 30, 1958) was a Hungarian mathematician.
Biography
Egerváry was born in Debrecen in 1891. In 1914, he received his doctorate at the Pázmány Péter University in Budapest, where he studied und ...
in the more general case of
weighted graph
This is a glossary of graph theory. Graph theory is the study of graphs, systems of nodes or vertices connected in pairs by lines or edges.
Symbols
A
B
...
s.
Setting
A
vertex cover
In graph theory, a vertex cover (sometimes node cover) of a graph is a set of vertices that includes at least one endpoint of every edge of the graph.
In computer science, the problem of finding a minimum vertex cover is a classical optimiza ...
in a graph is a set of vertices that includes at least one endpoint of every edge, and a vertex cover is ''minimum'' if no other vertex cover has fewer vertices. A
matching in a graph is a set of edges no two of which share an endpoint, and a matching is ''maximum'' if no other matching has more edges.
It is obvious from the definition that any vertex-cover set must be at least as large as any matching set (since for every edge in the matching, at least one vertex is needed in the cover). In particular, the
minimum vertex cover set is at least as large as the
maximum matching
Maximum cardinality matching is a fundamental problem in graph theory.
We are given a graph , and the goal is to find a matching containing as many edges as possible; that is, a maximum cardinality subset of the edges such that each vertex is adj ...
set. Kőnig's theorem states that, in any
bipartite graph, the minimum vertex cover set and the maximum matching set have in fact the same size.
[, Theorem 5.3, p. 74; .]
Statement of the theorem
''In any bipartite graph, the number of edges in a maximum matching
Maximum cardinality matching is a fundamental problem in graph theory.
We are given a graph , and the goal is to find a matching containing as many edges as possible; that is, a maximum cardinality subset of the edges such that each vertex is adj ...
equals the number of vertices in a minimum vertex cover.''
Example
The bipartite graph shown in the above illustration has 14 vertices; a matching with six edges is shown in blue, and a vertex cover with six vertices is shown in red. There can be no smaller vertex cover, because any vertex cover has to include at least one endpoint of each matched edge (as well as of every other edge), so this is a minimum vertex cover. Similarly, there can be no larger matching, because any matched edge has to include at least one endpoint in the vertex cover, so this is a maximum matching. Kőnig's theorem states that the equality between the sizes of the matching and the cover (in this example, both numbers are six) applies more generally to any bipartite graph.
Proofs
Constructive proof
The following proof provides a way of constructing a minimum vertex cover from a maximum matching. Let
be a bipartite graph and let
be the two parts of the vertex set
. Suppose that
is a maximum matching for
.
Let's construct the
flow network
In graph theory, a flow network (also known as a transportation network) is a directed graph where each edge has a capacity and each edge receives a flow. The amount of flow on an edge cannot exceed the capacity of the edge. Often in operations re ...
derived from
in such way that there are edges of capacity
from the source
to every vertex
and from every vertex
to the sink
, and of capacity
from
to
for any
.
The size
of the maximum matching in
is the size of a
maximum flow
In optimization theory, maximum flow problems involve finding a feasible flow through a flow network that obtains the maximum possible flow rate.
The maximum flow problem can be seen as a special case of more complex network flow problems, such ...
in
, which, in turn, is the size of a
minimum cut
In graph theory, a minimum cut or min-cut of a graph is a cut (a partition of the vertices of a graph into two disjoint subsets) that is minimal in some metric.
Variations of the minimum cut problem consider weighted graphs, directed graphs, ter ...
in the network
, as follows from the
max-flow min-cut theorem
In computer science and optimization theory, the max-flow min-cut theorem states that in a flow network, the maximum amount of flow passing from the ''source'' to the ''sink'' is equal to the total weight of the edges in a minimum cut, i.e., the ...
.
Let
be a minimum cut. Let
and
, such that
and
. Then the minimum cut is composed only of edges going from
to
or from
to
, as any edge from
to
would make the size of the cut infinite.
Therefore, the size of the minimum cut is equal to
. On the other hand,
is a vertex cover, as any edge that is not incident to vertices from
and
must be incident to a pair of vertices from
and
, which would contradict the fact that there are no edges between
and
.
Thus,
is a minimum vertex cover of
.
Constructive proof without flow concepts
No vertex in a vertex cover can cover more than one edge of
(because the edge half-overlap would prevent
from being a matching in the first place), so if a vertex cover with
vertices can be constructed, it must be a minimum cover.
To construct such a cover, let
be the set of unmatched vertices in
(possibly empty), and let
be the set of vertices that are either in
or are connected to
by alternating paths (paths that alternate between edges that are in the matching and edges that are not in the matching). Let
:
Every edge
in
either belongs to an alternating path (and has a right endpoint in
), or it has a left endpoint in
. For, if
is matched but not in an alternating path, then its left endpoint cannot be in an alternating path (because two matched edges can not share a vertex) and thus belongs to
. Alternatively, if
is unmatched but not in an alternating path, then its left endpoint cannot be in an alternating path, for such a path could be extended by adding
to it. Thus,
forms a vertex cover.
[, pp. 74–75.]
Additionally, every vertex in
is an endpoint of a matched edge.
For, every vertex in
is matched because
is a superset of
, the set of unmatched left vertices.
And every vertex in
must also be matched, for if there existed an alternating path to an unmatched vertex then changing the matching by removing the matched edges from this path and adding the unmatched edges in their place would increase the size of the matching. However, no matched edge can have both of its endpoints in
. Thus,
is a vertex cover of cardinality equal to
, and must be a minimum vertex cover.
Proof using linear programming duality
To explain this proof, we first have to extend the notion of a matching to that of a
fractional matching In graph theory, a fractional matching is a generalization of a matching in which, intuitively, each vertex may be broken into fractions that are matched to different neighbor vertices.
Definition
Given a graph ''G'' = (''V'', ''E''), a fraction ...
- an assignment of a weight in
,1to each edge, such that the sum of weights near each vertex is at most 1 (an integral matching is a special case of a fractional matching in which the weights are in ). Similarly we define a fractional vertex-cover - an assignment of a non-negative weight to each vertex, such that the sum of weights in each edge is at least 1 (an integral vertex-cover is a special case of a fractional vertex-cover in which the weights are in ).
The maximum fractional matching size in a graph
is the solution of the following
linear program
Linear programming (LP), also called linear optimization, is a method to achieve the best outcome (such as maximum profit or lowest cost) in a mathematical model whose requirements are represented by linear relationships. Linear programming i ...
:
Maximize 1''E'' ''·'' x
Subject to: x ≥ 0''E''
__________ A''G'' · x ''≤ 1V.''
where x is a vector of size , ''E'', in which each element represents the weight of an edge in the fractional matching. 1
E is a vector of , ''E'', ones, so the first line indicates the size of the matching. 0''
E'' is a vector of , ''E'', zeros, so the second line indicates the constraint that the weights are non-negative. 1
V is a vector of , ''V'', ones and A
''G'' is the
incidence matrix
In mathematics, an incidence matrix is a logical matrix that shows the relationship between two classes of objects, usually called an incidence relation. If the first class is ''X'' and the second is ''Y'', the matrix has one row for each element ...
of ''G,'' so the third line indicates the constraint that the sum of weights near each vertex is at most 1.
Similarly, the minimum fractional vertex-cover size in
is the solution of the following LP:
Minimize 1''V'' ''·'' y
Subject to: y ≥ 0''V''
__________ A''G''T · y ≥ ''1E.''
where y is a vector of size , V, in which each element represents the weight of a vertex in the fractional cover. Here, the first line is the size of the cover, the second line represents the non-negativity of the weights, and the third line represents the requirement that the sum of weights near each edge must be at least 1.
Now, the minimum fractional cover LP is exactly the
dual linear program The dual of a given linear program (LP) is another LP that is derived from the original (the primal) LP in the following schematic way:
* Each variable in the primal LP becomes a constraint in the dual LP;
* Each constraint in the primal LP becomes ...
of the maximum fractional matching LP. Therefore, by the LP duality theorem, both programs have the same solution. This fact is true not only in bipartite graphs but in arbitrary graphs:
''In any graph, the largest size of a fractional matching equals the smallest size of a fractional vertex cover.''
What makes bipartite graphs special is that, in bipartite graphs, both these linear programs have optimal solutions in which all variable values are integers. This follows from the fact that in the
fractional matching polytope of a bipartite graph, all extreme points have only integer coordinates, and the same is true for the fractional vertex-cover polytope. Therefore the above theorem implies:
''In any bipartite graph, the largest size of a matching equals the smallest size of a vertex cover.''
Algorithm
The constructive proof described above provides an algorithm for producing a minimum vertex cover given a maximum matching. Thus, the
Hopcroft–Karp algorithm
In computer science, the Hopcroft–Karp algorithm (sometimes more accurately called the Hopcroft–Karp–Karzanov algorithm) is an algorithm that takes a bipartite graph as input and produces a maximum cardinality matching as output – a set of ...
for finding maximum matchings in bipartite graphs may also be used to solve the vertex cover problem efficiently in these graphs.
Despite the equivalence of the two problems from the point of view of exact solutions, they are not equivalent for
approximation algorithm
In computer science and operations research, approximation algorithms are efficient algorithms that find approximate solutions to optimization problems (in particular NP-hard problems) with provable guarantees on the distance of the returned solu ...
s. Bipartite maximum matchings can be approximated arbitrarily accurately in constant time by
distributed algorithm A distributed algorithm is an algorithm designed to run on computer hardware constructed from interconnected processors. Distributed algorithms are used in different application areas of distributed computing, such as telecommunications, scientific ...
s; in contrast, approximating the minimum vertex cover of a bipartite graph requires at least logarithmic time.
Example
In the graph shown in the introduction take
to be the set of vertices in the bottom layer of the diagram and
to be the set of vertices in the top layer of the diagram. From left to right label the vertices in the bottom layer with the numbers 1, …, 7 and label the vertices in the top layer with the numbers 8, …, 14. The set
of unmatched vertices from
is . The alternating paths starting from
are 1–10–3–13–7, 1–10–3–11–5–13–7, 1–11–5–13–7, 1–11–5–10–3–13–7, and all subpaths of these starting from 1. The set
is therefore , resulting in
,
and the minimum vertex cover
.
Non-bipartite graphs
For graphs that are not bipartite, the minimum vertex cover may be larger than the maximum matching. Moreover, the two problems are very different in complexity: maximum matchings can be found in
polynomial time
In computer science, the time complexity is the computational complexity that describes the amount of computer time it takes to run an algorithm. Time complexity is commonly estimated by counting the number of elementary operations performed by ...
for any graph, while minimum vertex cover is
NP-complete
In computational complexity theory, a problem is NP-complete when:
# it is a problem for which the correctness of each solution can be verified quickly (namely, in polynomial time) and a brute-force search algorithm can find a solution by tryi ...
.
The complement of a vertex cover in any graph is an
independent set, so a minimum vertex cover is complementary to a maximum independent set; finding maximum independent sets is another NP-complete problem. The equivalence between matching and covering articulated in Kőnig's theorem allows minimum vertex covers and maximum independent sets to be computed in polynomial time for bipartite graphs, despite the NP-completeness of these problems for more general graph families.
[,]
Exercise 261, p. 342
History
Kőnig's theorem is named after the Hungarian mathematician
Dénes Kőnig
Dénes Kőnig (September 21, 1884 – October 19, 1944) was a Hungarian mathematician of Jewish heritage who worked in and wrote the first textbook on the field of graph theory.
Biography
Kőnig was born in Budapest, the son of mathematician Gyu ...
. Kőnig had announced in 1914 and published in 1916 the results that every
regular bipartite graph has a
perfect matching
In graph theory, a perfect matching in a graph is a matching that covers every vertex of the graph. More formally, given a graph , a perfect matching in is a subset of edge set , such that every vertex in the vertex set is adjacent to exactl ...
, and more generally that the
chromatic index
In graph theory, an edge coloring of a graph is an assignment of "colors" to the edges of the graph so that no two incident edges have the same color. For example, the figure to the right shows an edge coloring of a graph by the colors red, blu ...
of any bipartite graph (that is, the minimum number of matchings into which it can be partitioned) equals its
maximum degree – the latter statement is known as Kőnig's line coloring theorem.
However, attribute Kőnig's theorem itself to a later paper of Kőnig (1931).
According to , Kőnig attributed the idea of studying matchings in bipartite graphs to his father, mathematician
Gyula Kőnig. In Hungarian, Kőnig's name has a
double acute accent
The double acute accent ( ˝ ) is a diacritic mark of the Latin and Cyrillic scripts. It is used primarily in Hungarian or Chuvash, and consequently it is sometimes referred to by typographers as hungarumlaut. The signs formed with a regular um ...
, but his theorem is sometimes spelled (incorrectly) in German characters, with an
umlaut.
Related theorems
Kőnig's theorem is equivalent to numerous other min-max theorems in graph theory and combinatorics, such as
Hall's marriage theorem
In mathematics, Hall's marriage theorem, proved by , is a theorem with two equivalent formulations:
* The combinatorial formulation deals with a collection of finite sets. It gives a necessary and sufficient condition for being able to select a di ...
and
Dilworth's theorem. Since bipartite matching is a special case of
maximum flow
In optimization theory, maximum flow problems involve finding a feasible flow through a flow network that obtains the maximum possible flow rate.
The maximum flow problem can be seen as a special case of more complex network flow problems, such ...
, the theorem also results from the
max-flow min-cut theorem
In computer science and optimization theory, the max-flow min-cut theorem states that in a flow network, the maximum amount of flow passing from the ''source'' to the ''sink'' is equal to the total weight of the edges in a minimum cut, i.e., the ...
.
Connections with perfect graphs
A graph is said to be
perfect if, in every
induced subgraph
In the mathematical field of graph theory, an induced subgraph of a graph is another graph, formed from a subset of the vertices of the graph and ''all'' of the edges (from the original graph) connecting pairs of vertices in that subset.
Defini ...
, the
chromatic number
In graph theory, graph coloring is a special case of graph labeling; it is an assignment of labels traditionally called "colors" to elements of a graph subject to certain constraints. In its simplest form, it is a way of coloring the vertices o ...
equals the size of the largest
clique
A clique ( AusE, CanE, or ), in the social sciences, is a group of individuals who interact with one another and share similar interests. Interacting with cliques is part of normative social development regardless of gender, ethnicity, or popular ...
. Any bipartite graph is perfect, because each of its subgraphs is either bipartite or independent; in a bipartite graph that is not independent the chromatic number and the size of the largest clique are both two while in an independent set the chromatic number and clique number are both one.
A graph is perfect if and only if its complement is perfect,
[This is the ]perfect graph theorem
In graph theory, the perfect graph theorem of states that an undirected graph is perfect if and only if its complement graph is also perfect. This result had been conjectured by , and it is sometimes called the weak perfect graph theorem to disti ...
of and Kőnig's theorem can be seen as equivalent to the statement that the complement of a bipartite graph is perfect. For, each color class in a coloring of the complement of a bipartite graph is of size at most 2 and the classes of size 2 form a matching, a clique in the complement of a graph ''G'' is an independent set in ''G'', and as we have already described an independent set in a bipartite graph ''G'' is a complement of a vertex cover in ''G''. Thus, any matching ''M'' in a bipartite graph ''G'' with ''n'' vertices corresponds to a coloring of the complement of ''G'' with ''n''-, ''M'', colors, which by the perfection of complements of bipartite graphs corresponds to an independent set in ''G'' with ''n''-, ''M'', vertices, which corresponds to a vertex cover of ''G'' with ''M'' vertices. Conversely, Kőnig's theorem proves the perfection of the complements of bipartite graphs, a result proven in a more explicit form by .
One can also connect Kőnig's line coloring theorem to a different class of perfect graphs, the
line graph
In the mathematical discipline of graph theory, the line graph of an undirected graph is another graph that represents the adjacencies between edges of . is constructed in the following way: for each edge in , make a vertex in ; for every ...
s of bipartite graphs. If ''G'' is a graph, the line graph ''L''(''G'') has a vertex for each edge of ''G'', and an edge for each pair of adjacent edges in ''G''. Thus, the chromatic number of ''L''(''G'') equals the chromatic index of ''G''. If ''G'' is bipartite, the cliques in ''L''(''G'') are exactly the sets of edges in ''G'' sharing a common endpoint. Now Kőnig's line coloring theorem, stating that the chromatic index equals the maximum vertex degree in any bipartite graph, can be interpreted as stating that the line graph of a bipartite graph is perfect.
Since line graphs of bipartite graphs are perfect, the complements of line graphs of bipartite graphs are also perfect. A clique in the complement of the line graph of ''G'' is just a matching in ''G''. And a coloring in the complement of the line graph of ''G'', when ''G'' is bipartite, is a partition of the edges of ''G'' into subsets of edges sharing a common endpoint; the endpoints shared by each of these subsets form a vertex cover for ''G''. Therefore, Kőnig's theorem itself can also be interpreted as stating that the complements of line graphs of bipartite graphs are perfect.
Weighted variants
Konig's theorem can be extended to
weighted graph
This is a glossary of graph theory. Graph theory is the study of graphs, systems of nodes or vertices connected in pairs by lines or edges.
Symbols
A
B
...
s.
Egerváry's theorem for edge-weighted graphs
Jenő Egerváry
Jenő Elek Egerváry (April 16, 1891 – November 30, 1958) was a Hungarian mathematician.
Biography
Egerváry was born in Debrecen in 1891. In 1914, he received his doctorate at the Pázmány Péter University in Budapest, where he studied und ...
(1931) considered graphs in which each edge ''e'' has a non-negative integer weight ''w
e''. The weight vector is denoted by w. The w-''weight of a matching'' is the sum of weights of the edges participating in the matching. A ''w-vertex-cover'' is a multiset of vertices ("multiset" means that each vertex may appear several times), in which each edge ''e'' is adjacent to at least ''w
e'' vertices.
Egerváry's theorem says:
''In any edge-weighted bipartite graph, the maximum w-weight of a matching equals the smallest number of vertices in a w-vertex-cover.''
The maximum ''w-''weight of a fractional matching is given by the LP:
Maximize ''w'' ''·'' x
Subject to: x ≥ 0''E''
__________ A''G'' · x ''≤ 1V.''
And the minimum number of vertices in a fractional ''w-''vertex-cover is given by the dual LP:
Minimize 1''V'' ''·'' y
Subject to: y ≥ 0''V''
__________ A''G''T · y ≥ ''w.''
As in the proof of Konig's theorem, the LP duality theorem implies that the optimal values are equal (for any graph), and the fact that the graph is bipartite implies that these programs have optimal solutions in which all values are integers.
Theorem for vertex-weighted graphs
One can consider a graph in which each vertex ''v'' has a non-negative integer weight ''b
v''. The weight vector is denoted by b. The ''b-weight'' of a vertex-cover is the sum of ''b
v'' for all ''v'' in the cover. A ''b-matching'' is an assignment of a non-negative integral weight to each edge, such that the sum of weights of edges adjacent to any vertex ''v'' is at most ''b
v''. Egervary's theorem can be extended, using a similar argument, to graphs that have both edge-weights w and vertex-weights b:
''In any edge-weighted vertex-weighted bipartite graph, the maximum w-weight of a b-matching equals the minimum b-weight of vertices in a w-vertex-cover.''
See also
*
Kőnig's property in hypergraphs
Notes
References
*.
*.
*.
*.
*
*.
*.
*.
*.
*.
{{DEFAULTSORT:Koenigs theorem
Theorems in graph theory
Articles containing proofs
Perfect graphs
Matching (graph theory)
Bipartite graphs