Why the dynamic solution to vertex cover does not prove anything?

27 Views Asked by At

The dynamic programming solution implemented here runs in polynomial time, as discussed here on slide 18. My question is, why does this algorithm not hold value? Why cannot it be reduced to all other NP-complete problems?

1

There are 1 best solutions below

3
On BEST ANSWER

This solution is only for binary trees, not general graphs. The problem for general graphs is NP-complete, but for binary trees it is not.

Suppose that $A$ is an instance of an NP problem. Since vertex cover is NP-complete, you know that you can map $A$ to an instance of vertex cover (i.e. an undirected graph $G$) in polynomial time. However, there is no guarantee that $G$ will be a binary tree, so the algorithm you have might not work on $G$. So, you will not be able to use this reduction to solve the instance $A$ of your original problem.