3

I'm preparing for exams and for my algorithms course we've been needing to cover NP completeness but we never had any real tutorials for them and just got given a pile of "practice questions" for the exam. I've worked through all but the last and I'm really not sure how to solve it (and asking the internet so far has returned published papers I don't understand).

The previous 2 questions were showing that the Hamiltonian Path problem is in the class NP and then show that it was NP-complete by showing that the Hamiltonian Cycle problem reduces to it.

This then leads in to the 3rd question where I can't seem to make headway:

A degree-constrained spanning tree of a graph is a spanning tree of maximum degree k (each vertex in the tree is adjacent to at most k edges) for some fixed k. Deciding whether a graph G contains a spanning tree with degree constrained by k = 2 is the Hamiltonian Path problem, which is an NP-complete problem, as you have just shown. Show that deciding whether a graph G contains a spanning tree with degree constrained by k, for general k, is also an NP-complete problem.

My current attempt at answering this has been along the lines of:

For k = 2, for any vertex V we can split the graph in to 2 distinct sub graphs that only share vertex V and return true for a Hamiltonian Path. That, for k=3, there is a vertex V for which we can split the graph in to 3 distinct sub graphs that all have Hamiltonian Paths.

I know this isn't correct but I feel it is along the right path but not sure how to get to the end goal at all. Any help would be appreciated.

Syzorr
  • 587
  • 1
  • 5
  • 17
  • That may be right but I am still not sure I understand So, in the case of, say k <= 3, if we can reduce our graph to one that meets k <= 2 and can be answered as an instance of the Hamiltonian Path problem such that the sub graph is created by only removing k-3 nodes such that the original graph can be shown to have a spanning tree bounded by k <= 3? – Syzorr Jun 16 '15 at 05:15
  • Suppose you had a graph `G = (V,E)`and wanted to answer the question: "Does G have a degree 3 bounded spanning tree?". You could construct a new graph G' that consists of G with |V| new vertices, so that each vertex in V is adjacent to one new vertex. All those new edges must be in every spanning tree of G', since the new vertices have degree one. For the new graph to have a spanning tree of k = 3, the original graph must have had a spanning tree of degree k = 2, (the same tree with the new edges removed). – Paul Jun 16 '15 at 05:40
  • Thus, if we have a polynomial algorithm that can solve the problem for k = 2, we can also solve k = 3 in polynomial time. And since k=2 is NP-Hard, so is k=3. – Paul Jun 16 '15 at 05:41
  • You can do the same thing for general k by making k - 2 new vertices for each vertex of G. – Paul Jun 16 '15 at 05:42
  • Ah thank you. So I'm just overthinking it for proving the reduction? That, for example, if graph G can be solved for k = 2 then there is a graph G' with additional vertex V that has a single edge connecting it to G that will have a spanning tree bounded by k = 3. Therefore, the reverse can be true that for any graph G, we can remove up to k - 2 edges from any vertex to create graph G' that is solved as an instance of the Hamiltonian Path problem. About right? – Syzorr Jun 16 '15 at 05:52
  • Or am I getting it around the wrong way? That if we can show that there is a version of k = 3 then we can show that the problem of a spanning bounded tree of any k is NP complete? – Syzorr Jun 16 '15 at 05:54

0 Answers0