Skip to content

Sudharsan10/travelling-salesman-problem-neural-network

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Social-header

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 https://github.com/Sudharsan10/travelling-salesman-problem-neural-network.git
    

Status

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/
|   |   ├── __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 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 https://github.com/Sudharsan10/travelling-salesman-problem-neural-network.git
    

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

  2. 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

start-screen

Documentation

Contents:

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

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

Thank you for visiting our Repo!

About

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.

Topics

Resources

Stars

Watchers

Forks