{"id":23088115,"url":"https://github.com/m0rningdawning/tsp-genetic-algorithm","last_synced_at":"2025-04-03T16:50:57.240Z","repository":{"id":44093648,"uuid":"507524683","full_name":"m0rningdawning/tsp-genetic-algorithm","owner":"m0rningdawning","description":"Travelling Salesman Problem solved using Genetic Algorithm","archived":false,"fork":false,"pushed_at":"2023-12-06T20:41:39.000Z","size":31,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-09T05:39:11.903Z","etag":null,"topics":["c","genetic-algorithm","travelling-salesman-problem","tsp"],"latest_commit_sha":null,"homepage":"","language":"C","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/m0rningdawning.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}},"created_at":"2022-06-26T09:01:06.000Z","updated_at":"2024-11-17T22:40:46.000Z","dependencies_parsed_at":"2023-01-20T07:47:11.150Z","dependency_job_id":null,"html_url":"https://github.com/m0rningdawning/tsp-genetic-algorithm","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/m0rningdawning%2Ftsp-genetic-algorithm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m0rningdawning%2Ftsp-genetic-algorithm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m0rningdawning%2Ftsp-genetic-algorithm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m0rningdawning%2Ftsp-genetic-algorithm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m0rningdawning","download_url":"https://codeload.github.com/m0rningdawning/tsp-genetic-algorithm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247043324,"owners_count":20874085,"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":["c","genetic-algorithm","travelling-salesman-problem","tsp"],"created_at":"2024-12-16T20:16:01.006Z","updated_at":"2025-04-03T16:50:57.223Z","avatar_url":"https://github.com/m0rningdawning.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Travelling Salesman Problem\nTravelling Salesman Problem solved using Genetic Algorithm.\n\n![GitHub language count](https://img.shields.io/github/languages/count/m0rningdawning/tsp-genetic-algorithm)\n![GitHub top language](https://img.shields.io/github/languages/top/m0rningdawning/tsp-genetic-algorithm) \n![GitHub last commit](https://img.shields.io/github/last-commit/m0rningdawning/tsp-genetic-algorithm)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n\n## Main functions\nThe algorithm involves four main functions:\n### Mutation\nThe function randomly chooses two places inside a single chromosome and interchanges them. The function requires the usage of the auxillary function \"Tournament\" in order to choose the chromosome to be mutated.\n### Mutation inverse\nThe function randomly chooses an element in the range from the 2nd to the 6th inside the single chromosome and reverses the next five elements. Function requires the use of the auxillary function \"Tournament\" in order to choose the chromosome to be mutated.\n### Crossover\nThe function interchanges the last five elements of the two chromosomes one by one. It also avoids repetition by comparing each individual element that ought to be replaced with the first five elements inside the target chromosome.\n### Reproduction\nThe function copies the last 2 chromosomes untouched to the new generation in order to occasionally help avoid local minimum situations.\n\n## Auxillary functions:\nThe algorithm involves two auxillary functions:\n### Fitness\nThe function checks the overall distance of the given chromosome's route.\n### Tournament\nThe function checks the fitness of randomly chosen chromosomes and returns the position of the winning chromosome in the \"chromemx\" array.\n## Features\nThe program is fully functional for 10 cities as well as any amount up until 10 with slight code modifications. It also has the ability to randomly generate the symmetrical matrix of distances in a given range so that the user won't bother with inputting it themselves.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm0rningdawning%2Ftsp-genetic-algorithm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm0rningdawning%2Ftsp-genetic-algorithm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm0rningdawning%2Ftsp-genetic-algorithm/lists"}