in reply to Travelling problem
The shortest_path method is not designed for solving the travelling salesman problem. It just finds the shortest way to get from A to D following the edges you've defined. A-B-D (weight 700) is shorter than A-C-D (1300), A-B-C-D (1300), or A-C-B-D (1700). The direct route A-D (weight 700) has an equal to A-B-D; in the case of multiple routes with equal weight, I don't know whether which one is returned is random or deterministic.
Graph may have what you need.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Travelling problem
by Dirk80 (Pilgrim) on Dec 21, 2013 at 21:14 UTC | |
by Dirk80 (Pilgrim) on Dec 22, 2013 at 20:55 UTC |