Welcome
This applet implements some simple, but effective heuristics for
the Traveling Salesman Problem with Euclidian distances - i.e.
in a 2D plane.
Directions
In the applet below, add points to the graph by clicking anywhere
besides where the buttons are. You must enter three or more points.
When you are done entering points, click on a button to solve the
TSP problem.
- MST uses the minimum spanning tree algorithm to build
a tour. The algorithmic analysis says this generates a 2-approximation
- i.e. at worst, the solution is only twice that of the optimal
solution. We found that it's usually much better.
- All MST is a heuristic that tries the MST algorithm from
all possible starting verticies and returns the best one.
- Greedy is the simplist possible heuristic - always go the
the closest neighbor until you have visited all of the nodes.
- Brute Force performs a brute-force enumeration of all
possible tours. It always finds the optimal solution, but it runs
very slowly. Therefore, you can only use it for small graphs (i.e.
less than ten nodes).
When the solver is done, the optimal tour will be drawn. You can see
the length of this tour in the "status area" at the bottom of
the Netscape window.
For more info on the Traveling Saleman Problem, check out the following: