An open API service indexing awesome lists of open source software.

https://github.com/ccfelius/travelingsalesman

Solve the TSP problem under simplified assumptions
https://github.com/ccfelius/travelingsalesman

simulated-annealing stochastic-simulation traveling-salesman

Last synced: about 2 months ago
JSON representation

Solve the TSP problem under simplified assumptions

Awesome Lists containing this project

README

        

## Traveling Salesman Problem

### License:

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

#### Required Packages:
- numpy

- scipy.stats

- math

- pandas

- copy

- matplotlib

#### Instructions:
Clone everything on your local machine. Make sure all required packages are installed and everything is in the right place. If that is the case, you can directly run best_of_3.py if you want to simulate.

#### Directories
- TSP-configurations and TSP

These directories contain information about TSP problems of different sizes, and contains data from the TSP problem we aim to solve (a280.tsp).
- data

This is the folder that contains all simulated data used in our report

- plots

In this folder all plots for the assignments are stated

#### Python files
- best_of_3.py

This file is used for the simulations, it makes use of hybrid sampling and is therefore called 'best of 3'. If you want to run simulations you should run this file. The initial settings of this file are not corresponding to the settings used to get the simulations from the report, but are set in order to find a local or global minimum as it has a lower temperature and not a random path at the beginning, but it contains a 'best guess'.

- cooling_methods.py

In this file different cooling methods are implemented. This is file is required for running best_of_3.py

- sampling_methods.py

In this file different sampling methods (swap, insert and invert) as well as the methods to calculate the total distances are implemented. This is file is required for running best_of_3.py

- statistics.py

This file reads simulated data from the data folder. It subsequently prints the mean, standard deviation and confidence interval of simulations. In order to derive statistics from different batches of simulations, one should change the filename(s) in the script.

- read.py

This file reads the data from the given optimal path and calculates its corresponding.
- plot_cooling.py

In this file the plot for cooling schemes and decreasing temperature is generated.

- SA.py and SA_knn.py

These files can be experimented with if one wants to sample from its K-nearest-neighbor. However, for the assignments, we did not ended up using these files and therefore they can be neglected.

- TSP.py and TSP_a280.py

Both these files are used to plot the graph that shows how the optimal paths are visualized