Given a directed graph G=(V,E) and subset of vertices V', find the shortest path that visits all vertices in V' exactly once and never revisits any vertex in V.
-
Without the last condition, a reasonable approach would be to use Floyd-Warshall (or Dijkstra's, etc.) to precompute all pairwise shortest-path-distances for V', call these E', and use a TSP heuristic to approximate the shortest Hamiltonian path through the graph G' = (V', E'). With the last condition, this approach fails, e.g. when two shortest paths have overlapping vertices, allowing revisits.
-
Answer:
This appears to be equivalent to finding a minimum weight Hamiltonian path in the graph [math]G^{'} = \left(V^{'}, E \cap \left(V^{'} \times V^{'}\right)\right)[/math]. So you can just any algorithm for that.
Justin Rising at Quora Visit the source
Related Q & A:
- How to determine the shortest path?Best solution by Stack Overflow
- How to find connected components of a random graph?Best solution by Mathematics
- How do I save a large number of incoming e-mails to my computer in one go?Best solution by Yahoo! Answers
- How do I attach a music file to an e-mail?Best solution by ehow.com
- How can I find my career path?Best solution by eHow old
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.