0

Given a graph with a start vertex S and end vertex E, how to find k shortest paths from S to E conditioned that all vertices must be visited exactly once?

The graph can have cycles. Can someone please elaborate how to use Dijkstra or Viterbi algorithm to solve this? Start = S, End = End, A,B and C should be visit exactly once

  • Possible duplicate of [Understanding Dijkstra Algorithm](https://stackoverflow.com/questions/40247747/understanding-dijkstra-algorithm) – Shashwat Mar 19 '18 at 07:03
  • I don't know for Viterbi, but for Dijkstra there is more than enough on Wiki to implement that algorithm. See https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm – Frederik.L Mar 19 '18 at 07:04
  • Maybe a clarification is needed: k shortest paths does not mean k paths of the minimum length. They can be equal to or greater than the shortest. But I need k paths. in increasing order of their length. – Gossip Girl Mar 19 '18 at 07:21

0 Answers0