A solution to travelling salesman problem using 1D self-organizing maps.
Explore the docs »
Report bug
·
Request feature
In this project we will try to solve a traveling salesman problem using unsupervised learning technique - self organizing maps (SOM).
Table of contents
- Quick start
- Pre-Requisites
- Run instructions
- Status
- What’s included
- Documentation
- Bugs and Feature requests
- Creators
- Thanks
Quick start
There are two ways to run this app:
- Download the latest Docker container. and run from the app in that container ( Note: No Docker container is available at the moment)
- Clone the repo:
git clone https://github.com/Sudharsan10/travelling-salesman-problem-neural-network.git
Status
What’s included
Within the download you’ll find the following directories and files, logically grouping the modules in its own packages. You’ll see something like this:
(root folder)/
├── docs/
├── img/
├── models/
| └── weights/
├── notebooks/ ...
├── src/
| ├── handler/
| | ├── __init__.py
| | └── utility.py
| ├── som/
| | ├── __init__.py
| | ├── som.py
| | └── som_1d.py
| └── main.py
├── Readme.md
└── setup.py
Pre-requisites
This app depends on numpy
, matplotlib
, OpenCV
and pandas
libraries. We can setup this up using pip installer or conda virtual environment tool.
- setting up using pip installer
pip install numpy
pip install pandas
pip install matplotlib pip install jupyterlab
Note: If you have both python2 and python3 installed replace
pip
withpip3
when using python3. In case you need to installpip
follow this link to getpip
setup before running the above commands. -
setting up using conda environment for
python3
conda install -c anaconda numpy matplotlib pandas Opencv
Note: To install and setup anaconda environment follow this link first and visit this section again after successfully setting up the conda environment.
Run instructions
To run the app, first finish the pre-requisites mentioned, then
- Clone the repo in terminal using following command:
git clone https://github.com/Sudharsan10/travelling-salesman-problem-neural-network.git
or download github repo as
.zip
and extract it in the desired location. - In terminal navigate to the root folder abd locate the
setup.py
file and run the following command:python setup.py
If every requirement is fulfilled a Pyplot window should open with the dotted line showing the solution for the Travelling salesman problem, example
Documentation
Contents:
1 Introduction
2 Architecture
3 SOM Class methods
4 SOM 1D Class methods
5 Utility.py
6 Notebooks
You find the tsp_som.ipynb
in the following dir show below,
(root folder)/
...
├── notebooks/
| └── tsp_som.ipynb
...
With this file you can tweak the main section code or if needed with actual algorithm as per your desire to modify or experiment with custom code and see the outputs.
Bugs and feature requests
Have a bug or a feature request? Search for existing and closed issues, if your problem or idea is not addressed yet, please open a new issue.
Creators
@Sudharsan : www.iamsudharsan.com