문제

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....

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top