{"id":22211422,"url":"https://github.com/almayor/genetic-tsp","last_synced_at":"2025-03-25T05:44:02.797Z","repository":{"id":113056788,"uuid":"281780289","full_name":"almayor/genetic-tsp","owner":"almayor","description":"Genetic algorithm for the Travelling salesman problem","archived":false,"fork":false,"pushed_at":"2020-10-31T19:04:01.000Z","size":2758,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-30T05:26:43.980Z","etag":null,"topics":["genetic-algorithm","tsp","tsp-solver"],"latest_commit_sha":null,"homepage":"","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/almayor.png","metadata":{"files":{"readme":"README.md","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,"publiccode":null,"codemeta":null}},"created_at":"2020-07-22T20:49:09.000Z","updated_at":"2020-10-31T19:04:03.000Z","dependencies_parsed_at":"2023-06-07T12:00:13.931Z","dependency_job_id":null,"html_url":"https://github.com/almayor/genetic-tsp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/almayor%2Fgenetic-tsp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/almayor%2Fgenetic-tsp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/almayor%2Fgenetic-tsp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/almayor%2Fgenetic-tsp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/almayor","download_url":"https://codeload.github.com/almayor/genetic-tsp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245407755,"owners_count":20610232,"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":["genetic-algorithm","tsp","tsp-solver"],"created_at":"2024-12-02T20:31:39.356Z","updated_at":"2025-03-25T05:44:02.768Z","avatar_url":"https://github.com/almayor.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Genetic Travelling Salesman\n\n### Overview\n\n* A simple genetic algorithm for the [Travelling salesman problem](https://en.wikipedia.org/wiki/Travelling_salesman_problem). \n* \u003c 100 lines of code\n* Achieves reasonable performance for 25, 50, 100 cities\n* Optimal solution isn't guaranteed as the algorithm can get stuck in local minima / be slow to converge, but empirically was found to work well\n\n### 25 cities\n\n* Convergence is fast\n![](resources/25_distance_generation.png)\n\n* Snapshot of each generation (with freeze on finish)\n\n![](resources/25-cities-evolution.gif)\n\n### 50 cities\n\n* Convergence is fast\n![](resources/50_distance_generation.png)\n\n* Snapshot of every 10th generation (with freeze on finish)\n\n![](resources/50-cities-evolution.gif)\n\n### 100 cities\n\n* Convergence is reasonable\n![](resources/100_distance_generation.png)\n\n* Snapshot of every 10th generation (with freeze on finish)\n\n![](resources/100-cities-evolution.gif)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falmayor%2Fgenetic-tsp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falmayor%2Fgenetic-tsp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falmayor%2Fgenetic-tsp/lists"}