Skip to content

kmousaa/TSP-visualiser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TSP Visualisation Tool

The travelling salesman problem (TSP) is widely renowned and used all around us in the real world. It involves finding the best path in a graph where distance is minimised. Think of the nodes in the graph as houses, the edges as roads, and you are a delivery driver trying to drop off packages in each home and return to the starting point. This project brings the TSP to life by allowing you to solve it visually using four algorithms: Brute Force, Nearest Neighbor, Greedy, and Christofides.

Features

  1. Create your own graph by adding and removing nodes - or click "random graph" for a template one
  2. Add weights to the graph by clicking the edge and input your desired weight
  3. You can generate random weights too
  4. Once happy, select the algorithm and visualise it using the media buttons at the bottom of the screen
  5. If you want to test your understanding of an algorithm, toggle "interactive mode" and select the next step of the algorithm
image

Deployment

Before you begin, ensure you have installed Node.js - you can download it from the Node.js official website.

  1. Clone the repository: git clone https://github.com/kmousaa/TSP-visualiser.git
  2. Navigate to the Project Directory: cd TSP-visualiser
  3. Enter the Application Directory: cd my-app
  4. Install Dependancies: npm install
  5. Start Server: npm start

Once both the server and client are running, open your browser and navigate to http://localhost:3000

Future Work

  • 2-opt Algorithm
  • Simulated Annealing
  • Ant Colony Optimization