Traveling Salesman Applet
Above is the link to an applet whose purpose is to demonstrate the Greedy
Algorithm and Nearest Neighbor Algorithm, as taught in the MAT 118
course at Stony Brook.
The applet will draw a Hamiltonian circuit starting at vertex "A" and
display the total weight of that circuit, based on a given set of weights
that can be changed by the user. The user can also change the number of
vertices.
The applet has two tabs:
- Graph tab
- Run the Greedy Algorithm by clicking the, "Greedy," button.
- Run the Nearest Neighbor Algorithm by clicking the, "NearestN,"
button.
- Reset the graph to a complete graph by clicking the, "Reset," button.
- Weights tab
- Enter weights (a number greater than zero) for the edges in the
text boxes. The default value is, "1.0".
- Change the number of vertices (and, therefore, edges) by clicking
the "Vertices" button. A window prompt will appear in which you
can enter the new number of vertices you want to use. The number
must be an integer between 2 and 26, inclusively. The default
value is, "4".
Site maintained by: Josh Rembaum