Is there an algorithm or set of algorithms that would let you find the shortest walking distance from an arbitrary start node so that every node gets visited in a weight, undirected graph? It's not quite Traveling Salesman, because I don't care if a node is visited more than once. (It doesn't even matter if you make it back to the start -- the walker can end up in some far-off node as long as it was the last one needed to visit all nodes.) It's not quite minimum spanning tree, because it may be that going A-->B-->C-->A-->D is a (non-unique) shortest path to visit A, B, C, and D. My intuition says that this isn't quite an NP problem, because it doesn't have the restrictions that make NP problems so tricky. I could, of course, be completely wrong.
Open walks have different starting and ending nodes. Closed walks, in turn, have the same starting and ending nodes. So, circuits and cycles are closed walks, but not every closed walk is a circuit or cycle. Trails are open walks with no repeated edges in the sequence.
A path in a graph is a sequence of adjacent edges, such that consecutive edges meet at shared vertices. A path that begins and ends on the same vertex is called a cycle. Note that every cycle is also a path, but that most paths are not cycles.
Path: a trail that connects all vertices. Cycle: a trail that finishes on the vertex it begins on. No vertex is repeated. Circuit: a path that begins and ends on the same vertex.
A path in a graph is a succession of adjacent edges, with no repeated edges, that joins two vertices. Definition. A circuit is a path which joins a node to itself.
From Wikipedia's article on Travelling Salesman Problem:
Removing the condition of visiting each city "only once" does not remove the NP-hardness, since it is easily seen that in the planar case there is an optimal tour that visits each city only once (otherwise, by the triangle inequality, a shortcut that skips a repeated visit would not increase the tour length).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With