Traveling-Salesman-Algorithm

Subscribe to My youtube Channel : Auctux

Traveling Salesman using 3 algorithms:

  • Brute force
    • Random
    • Lexicographical order
  • genetic algorithm
  • Ant Colony optimization
    • Elitist
    • Max-Min

Requirements

Pygame : pip install pygame


Controls

  • Esc To close the window
  • Space To Pause and Start Simulation
  • Enter or Return To toggle the UI Panel

# Brute force solution , just by using going through all the possible combination 
# with a random function until we find the shortest distance
manager.BruteForce() 
# using Lexicographical order to solve the problem by going in order into all the possible routes
manager.Lexicographic()
# using genetic algorithm to find the fittest one
manager.GeneticAlgorithm()
# using AntColonyOptimization(name:String) 
manager.AntColonyOptimization("ACS") # or "ELITIST" or "MAX-MIN"

Screenshot (240)

Unsolved Issues & Bugs

 The code is a little bit redundant , it's need some refactoring.
 And the ui also need some retouch

Screenshot (241)