I know that if there are negative cost cycles in a graph, the relative shortest path problem belongs to the np-complete class. I need to prove this by performing a polynomial reduction using the Hamiltonian cycle problem. Could anyone explain it? It would be very helpful.
Asked
Active
Viewed 435 times
0
-
1Can't do that, since shortest path problem with negative cycles is not NP-hard. If there's a negative cycle, then there is no shortest path. Maybe you mean shortest *simple* path. Then the reduction is easy -- just set all the weights to -1 – Matt Timmermans Jan 08 '21 at 03:47
-
Yes, i mean the simple shortest path. Can you show me an example of reduction? I am a little confused. – Mark Jan 09 '21 at 07:26
-
I would only write an answer to the question that is actually asked. If you want to edit the question so that it asks the question you really intend to ask, then I might answer it. – Matt Timmermans Jan 10 '21 at 17:05