The vertex cover decision problem takes a finite simple graph and a nonnegative integer , and asks whether there is a vertex cover of cardinality at most . The optimization problem asks for a minimum vertex cover, with cost equal to its cardinality.
For the decision problem, if there are no edges, accept; if there is an edge but , reject. Otherwise choose an edge and branch: either include and recurse on with budget , or include and recurse on with budget . Accept if either branch accepts. Every vertex cover contains at least one endpoint of , so every possible solution is retained by at least one branch. Conversely, adding the selected endpoint to a vertex cover returned by the smaller instance covers all original edges. This proves correctness by induction on the remaining budget.
The search tree has depth at most and at most leaves. Processing each node in time gives running time, establishing fixed-parameter tractability.
For optimization, greedily build a maximal matching : repeatedly select an edge and discard every edge touching either endpoint. Return the set of all endpoints of . Any edge with neither endpoint in could be added to , contradicting maximality; thus is a vertex cover. Since the edges of a matching in a graph have pairwise disjoint endpoint sets, every vertex cover must contain at least one different vertex for each of them. Therefore
The greedy construction takes polynomial time, and can be implemented in with adjacency lists. It needs only a maximal matching, not a maximum matching.

Articles by others on the same topic (0)

There are currently no matching articles.