Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


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

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


Documentation Status Maintenance made-with-python pip-version OpenCV-version Pandas-version numpy-version ipythonjupyter-version Matplotlib-version made-with-Markdown contributors Logo Flow-charts

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/
|   |   ├──
|   |   └──
|   ├── som/ 
|   |   ├──
|   |   ├──
|   |   └──
|   └──


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 with pip3 when using python3. In case you need to install pip follow this link to get pip 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

  1. Clone the repo in terminal using following command:

    git clone

    or download github repo as .zip and extract it in the desired location.

  2. In terminal navigate to the root folder abd locate the file and run the following command:


If every requirement is fulfilled a Pyplot window should open with the dotted line showing the solution for the Travelling salesman problem, example




  1. Introduction
  2. Architecture
  3. SOM Class Methods
  4. SOM_1D Class Methods
  6. Notebooks

1 Introduction

2 Architecture

3 SOM Class methods

4 SOM 1D Class methods


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.


@Sudharsan :

Thank you for visiting our Repo!


A neural network solution to typical travelling salesman problem. It uses 1D self organizing map-a unsupervised learning technique to find a travel route for a given number of cities.