Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/diego-vicente/som-tsp
Solving the Traveling Salesman Problem using Self-Organizing Maps
https://github.com/diego-vicente/som-tsp
self-organizing-map som traveling-salesman tsp tsp-approximation tsp-problem
Last synced: 7 days ago
JSON representation
Solving the Traveling Salesman Problem using Self-Organizing Maps
- Host: GitHub
- URL: https://github.com/diego-vicente/som-tsp
- Owner: diego-vicente
- License: mit
- Created: 2017-11-06T20:30:12.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-12-24T16:40:59.000Z (12 months ago)
- Last Synced: 2024-11-20T21:56:43.194Z (22 days ago)
- Topics: self-organizing-map, som, traveling-salesman, tsp, tsp-approximation, tsp-problem
- Language: Python
- Homepage: https://diego.codes/post/som-tsp/
- Size: 5.23 MB
- Stars: 3,867
- Watchers: 117
- Forks: 605
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
- License: LICENSE
Awesome Lists containing this project
- awesome-ccamel - diego-vicente/som-tsp - Solving the Traveling Salesman Problem using Self-Organizing Maps (Python)
README
#+TITLE: Solving the Traveling Salesman Problem using Self-Organizing Maps
#+AUTHOR: Diego Vicente Martín
#+EMAIL: [email protected]This repository contains an implementation of a Self Organizing Map that can be
used to find sub-optimal solutions for the Traveling Salesman Problem. The
instances of the problems that the program supports are =.tsp= files, which is
a widespread format in this problem. All the source code can be found in the
=src= directory, while a report and brief presentation slides (in Spanish) can
be found in the =report= folder. However, for a complete read on the topic, you
can read [[https://diego.codes/post/som-tsp/][my blog post explaining this implementation and its evaluation]].[[file:diagrams/uruguay.gif]]
To run the code, only Python 3 and the dependencies (=matplotlib=, =numpy= and =pandas=,
which are included in the Anaconda distribution by default) are needed. In case
you are not using Anaconda, you can install all the dependencies with:#+BEGIN_SRC sh
pip install -r requirements.txt
#+END_SRCTo run the code, simply execute:
#+BEGIN_SRC sh
cd som-tsp
python src/main.py assets/.tsp
#+END_SRCThe images generated will be stored in the =diagrams= folder. Using a tool like
=convert=, you can easily generate an animation like the one in this file by
running:#+BEGIN_SRC sh
convert -delay 10 -loop 0 *.png animation.gif
#+END_SRCThis code is licensed under MIT License, so feel free to modify and/or use it
in your projects. If you have any doubts, feel free to contact me or contribute
to this repository by creating an issue.-----
This code was presented for the Bio-Inspired Artificial Intelligence course in
the Computer Science & Technology master's degree @ UC3M. A previous version of
this code can be found in [[https://github.com/DiegoVicen/ntnu-som][this repository]]. Special thanks to [[https://github.com/leo-labs][Leonard Kleinans]],
who worked with me in that previous version.