{"id":13565961,"url":"https://github.com/diego-vicente/som-tsp","last_synced_at":"2025-04-13T13:24:27.318Z","repository":{"id":37254719,"uuid":"109746267","full_name":"diego-vicente/som-tsp","owner":"diego-vicente","description":"Solving the Traveling Salesman Problem using Self-Organizing Maps","archived":false,"fork":false,"pushed_at":"2023-12-24T16:40:59.000Z","size":5479,"stargazers_count":3888,"open_issues_count":0,"forks_count":606,"subscribers_count":116,"default_branch":"master","last_synced_at":"2025-04-06T10:08:02.316Z","etag":null,"topics":["self-organizing-map","som","traveling-salesman","tsp","tsp-approximation","tsp-problem"],"latest_commit_sha":null,"homepage":"https://diego.codes/post/som-tsp/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/diego-vicente.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-11-06T20:30:12.000Z","updated_at":"2025-04-01T08:00:28.000Z","dependencies_parsed_at":"2024-02-07T14:55:54.540Z","dependency_job_id":null,"html_url":"https://github.com/diego-vicente/som-tsp","commit_stats":{"total_commits":58,"total_committers":5,"mean_commits":11.6,"dds":"0.22413793103448276","last_synced_commit":"0d8f9c5285f906774d67d81f8ae9c1b4b75098ef"},"previous_names":["diegovicen/som-tsp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diego-vicente%2Fsom-tsp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diego-vicente%2Fsom-tsp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diego-vicente%2Fsom-tsp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diego-vicente%2Fsom-tsp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/diego-vicente","download_url":"https://codeload.github.com/diego-vicente/som-tsp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248718890,"owners_count":21150653,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["self-organizing-map","som","traveling-salesman","tsp","tsp-approximation","tsp-problem"],"created_at":"2024-08-01T13:01:58.966Z","updated_at":"2025-04-13T13:24:27.276Z","avatar_url":"https://github.com/diego-vicente.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"#+TITLE:  Solving the Traveling Salesman Problem using Self-Organizing Maps\n#+AUTHOR: Diego Vicente Martín\n#+EMAIL:  mail@diego.codes\n\nThis repository contains an implementation of a Self Organizing Map that can be\nused to find sub-optimal solutions for the Traveling Salesman Problem. The\ninstances of the problems that the program supports are =.tsp= files, which is\na widespread format in this problem. All the source code can be found in the\n=src= directory, while a report and brief presentation slides (in Spanish) can\nbe found in the =report= folder. However, for a complete read on the topic, you\ncan read [[https://diego.codes/post/som-tsp/][my blog post explaining this implementation and its evaluation]].\n\n[[file:diagrams/uruguay.gif]]\n\nTo run the code, only Python 3 and the dependencies (=matplotlib=, =numpy= and =pandas=,\nwhich are included in the Anaconda distribution by default) are needed. In case\nyou are not using Anaconda, you can install all the dependencies with:\n\n#+BEGIN_SRC sh\npip install -r requirements.txt\n#+END_SRC\n\nTo run the code, simply execute:\n\n#+BEGIN_SRC sh\ncd som-tsp\npython src/main.py assets/\u003cinstance\u003e.tsp\n#+END_SRC\n\nThe images generated will be stored in the =diagrams= folder. Using a tool like\n=convert=, you can easily generate an animation like the one in this file by\nrunning:\n\n#+BEGIN_SRC sh\nconvert -delay 10 -loop 0 *.png animation.gif\n#+END_SRC\n\nThis code is licensed under MIT License, so feel free to modify and/or use it\nin your projects. If you have any doubts, feel free to contact me or contribute\nto this repository by creating an issue.\n\n-----\n\nThis code was presented for the Bio-Inspired Artificial Intelligence course in\nthe Computer Science \u0026 Technology master's degree @ UC3M. A previous version of\nthis code can be found in [[https://github.com/DiegoVicen/ntnu-som][this repository]]. Special thanks to [[https://github.com/leo-labs][Leonard Kleinans]],\nwho worked with me in that previous version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiego-vicente%2Fsom-tsp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiego-vicente%2Fsom-tsp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiego-vicente%2Fsom-tsp/lists"}