Traveling Salesman Problem Simulator

Created By: Paarth Tara



What is it? The Traveling Salesman Problem simply asks for the solution to this dilemma: If a salesman had to start from one city and get to another city while visiting all the other cities between them only once, what is the shortest path the salesman could take?

Why is it important? The Traveling Salesman Problem has many applications in the fields of Biology, Electrical Engineering, Computer Science, Mathematics, and even Economics. Solving this problem can reveal algorithmic techniques that can be utilized in other places, as well.

What does this simulation show? In this simulation, each circle will represent a city. The green circle will represent the starting city, and the red circle will represent the ending city. The rest of the circles will be white and will serve as intermediary cities. The solution will be found as the shortest path which starts at the green circle and goes through each white circle only once, eventually ending at the red circle.

Instructions: To get started using this simulation, first decide how many cities you would like to work with (including the starting and ending cities). Enter this number in the input box in the "Create Points" button, and click on it. This will generate a random assortment of circles which will represent cities. If you ever decide to restart your simulation, click on the "Restart" button.

Once you've created your points, click on any one of the two buttons with the following text: "Iterative Solution" or "Recursion Solution". Each of these buttons will trigger the execution of the given algorithm, which will solve for the shortest distance to visit all of the generated points, starting with the green point and ending at the red point. The amount of time taken to execute the algorithm will be presented in the console, which you can enter in your datasheet. Use the "Take Snapshot" button to download an image of the current canvas to your "Downloads" folder.

Console

      Retain Previous Outputs

All timing data and other information can be viewed here.


Currently Empty

Note: When using the "Create Points" button, click on the text, specifically, for it to work.


Create      Points
Restart
Iteration Solution
Recursion Solution
Take Snapshot