The travelling salesman problem (also called the travelling salesperson problem or TSP) asks the following question: "Given a list of cities and the distances between each pair of cities, what is the shortest possible route that visits each city exactly once and returns to the origin city?" It is an NP-hard problem in combinatorial optimization, important in theoretical computer science and operations research.
This repository is an implementation for the paper Comparison of Algorithms for Solving Traveling Salesman Problem, we have implemented the three proposed algorithms in the paper for different numbers of capital cities around the world.
Please make sure that your system has the following platforms:
python3.9
-
First get the code by either run this command through SSH:
git clone git@github.com:karmelyoei/TSP.git
or through HTTPS:
git clone https://github.com/karmelyoei/TSP.git
-
Install environment:
virtualenv -p python3.9 .venv && source .venv/bin/activate # or, if you don't have 'virtualenv' util installed: # python -m venv .venv && source .venv/bin/activate
-
Install dependencies:
python -m pip install -r requirements.txt
These steps will assist you in running the code .
- Start the each algorithm file using the following command:
python3 -m mprof run ./SA_run.py
All the results will be saved inside the ./results/ folder so make sure you have created this folder in the root of this repo.
If you have encountered any problems while running the code, please open a new issue in this repo and label it bug, and we will assist you in resolving it.
@karmelyoei 😎
Our reposiorty is licensed under the terms of the MIT see the license here!
If you'd like to contact me send me an email karmel.salah@gmail.com