Skip to content

HelenaMaslowska/genetic-algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Traveling salesman problem solved by genetic algorithm in Python

Main program tries to solve the problem and show statistics and graphical representation shown on a plot. Why try? Traveling salesman problem is hard to solve without using brute force method. Here we use a faster solution. Algorithm is placed here.

How it works

PMX chooses two segments and replaces them. Then, it fixes all elements which must be unique and check width of this road. The more times this algorithm is repeated, the greater the chance of getting closer to the optimal solution is. Here is a mutation which has a 7% chance to appear.

Graph

Here is an implemented graph for found solution.

Mutations

There are 3 types of mutations:

  • Swap 2 numbers in input list
  • Swap fragment of list
  • Get random list started with 0

About

Komivoyager problem solved by genetic algorithm

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages