0

I am wondering whether the Shortest Hamiltonian Path (SHP) problem is NP-Complete, because I couldn't find a way of solving it in a polynominal time. if it is NP_Complete, it will be so kind of you to give me the proof or the relevent papers,thanks a lot

the problem explanation: Given a directed,weighted graph with n vertices, find the shortest hamiltonian path with end vertices v and u. by the way,the graph must exit a hamiltonian path from v to u.

yingwan
  • 31
  • 4

1 Answers1

2

Here's a small hint.

Let $G$ be a directed graph with unit weights, and $u$ and $v$ be two vertices. Suppose that I could solve SHP in polynomial time, say, $O(n^c)$.

Now, say that I would like to solve Hamiltonian Path on a directed graph. Let me spend $O(n^2)$ time to "guess" your vertices $u$ and $v$, and for each of them run your algorithm for SHP. Then, I would in $O(n^{c+2})$ time have either found a Hamiltonian path in $G$, or conclude that $G$ is not Hamiltonian.

That would mean that P = NP.

Now, this doesn't prove that your problem in NP-complete. For that, you need to come up with a reduction. But it does tell you that you should probably not spend too much time looking for a polynomial time algorithm.

Pål GD
  • 16,115
  • 2
  • 41
  • 65
  • thanks a lot. After looking at your answer I think that I make a mistake when I abstract this problem, the original problem is at https://cs.stackexchange.com/questions/89092/topological-sort-np-hard-prove – yingwan Mar 09 '18 at 01:28