Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Using a SOM (self-organizing map / kohonen map) to solve the traveling salesman problem, implemented in Ruby.
branch: master


Implementation of a Self-Organizing Map (SOM) for aproximating a solution to the Traveling Salesman Problem. Written as part of a series of exercises in the course IT3708 Subsymbolic Methods in AI at NTNU.

The problem dataset is specified in TSPLIB format as text files under /input, and new datasets must be added to settings.rb before use. Output is generated as a series of graphs depicting the state of the SOM in each iteration.

Run as

ruby ann.rb <task>

where <task> is one of those specified in settings.rb.

The implementation is discussed in our assignment report.

Example: Traveling Salesman in Luxembourg

Example output from the luxembourg problem:

ruby ann.rb luxembourg

SOM output as animated GIF


Something went wrong with that request. Please try again.