In my transport geography class, we were asked to do a "best guess" on the route which does the following on this graph:
- Starts at A
- Visits each node
- Returns to A
- minimizes distance.
I wrote up program which calculated all of the five step paths that started from A, visited every node, and returned to A. I then calculated the cost of these paths.
How would other people solve this?
My teacher gave us a "hint" that we should read about Dijkstra's algorithm, but I couldn't see how to apply that to solve this particular problem. My solution would fall apart pretty quickly as the number of steps or nodes increased.