Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Traveling Salesman

This project is an implementation of the Traveling Salesman Problem using various algorithms, including the Nearest Neighbour and 2-opt algorithms. The goal of the project is to find the shortest possible route that a salesman can take to visit a given set of cities and return to the starting point.

traveling-salesman

Algorithms Used

  • Nearest Neighbour: This algorithm starts with an arbitrary city and repeatedly selects the nearest unvisited city until all cities are visited. It provides a quick but suboptimal solution.
  • 2-opt: This algorithm optimizes the initial solution obtained from the Nearest Neighbour algorithm. It iteratively swaps pairs of edges to improve the route until no further improvements can be made. It often produces better solutions but requires more computation.

Visualisation

The project utilizes the p5.js library for visualizing the traveling salesman problem. p5.js is a JavaScript library that simplifies the creation of interactive graphics and animations on the web. It provides a straightforward and intuitive way to display the cities, routes, and the optimization process.

Styling

This project incorporates the Bootstrap CSS framework for styling.

Installation

  1. Clone the repository:
    git clone https://github.com/your-username/traveling-salesman.git
    
  2. Open the project directory:
    cd traveling-salesman
    
  3. Launch the application in a web browser.

Feel free to contribute to the project by implementing additional algorithms, improving the visualizations, or enhancing the user interface.

Resources

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages