Question

Take example:-

Connections:

1 - 1"

1 - 2"

2 - 2"

2 - 3"

3 - 3"

3 - 4"

4 - 4"

According to konigs theorem maximal matching gives minimum vertex cover but here:

(1-1",2-3",4-4") gives answer 3 with minimum vertex cover while (1-1",2-2",3-3",4-4") maximum matching gives answer 4.

What am i doing wrong in this.... Please help....

Was it helpful?

Solution

In the vertex cover problem, you want to pick set of vertices V in such a way that every edge in the graph has at least one endpoint in V.

Konig's theorem is the following:

In any bipartite graph, the number of edges in a maximum matching equals the number of vertices in a minimum vertex cover.

In your example, maximum matching is of course 4, but also minimum vertex cover is 4 because you can cover all edges by picking vertices {1, 2, 3, 4} and you cannot do better than that.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top