Click to place a point. Press e to erase and delete points. Press r to input a random number of points. Press x to stop/start rendering for optimization. Press space to alternate between seeing the best path and the pheromone trails. Green Flag to run.
[ This is reposted from my alt, as I am removing this from my alt as I want to repurpose the other account ] Notes: To edit parameters, See Inside and look for the "Set Parameters" function in the "Algo" sprite. The parameters set are not necessarily the best. I just set them when testing, and they have stayed that way. Credits: https://strikingloo.github.io/ant-colony-optimization-tsp For providing the calculation for desirability, as well as more technical parts of the algorithm. https://www.youtube.com/watch?v=X-iSQQgOd1A For finding out about the algorithm. Explanation: Ant Colony Optimization (ACO) is inspired by the foraging behavior of ants. In a real colony, ants lay down pheromone (odor) trails whenever they find food to lead other ants to it. For more info, go to the Ant Colony Optimization Wikipedia page. Since couldn't find anything online about how exactly to update the pheromones, I decided to make it so that more pheromones are deposited on edges that are visited frequently. The Traveling Salesman Problem (TSP) asks: "Given a set of cities, what is the shortest path to traverse through every city (not more than once), and go back to the source city?". While the exact solution of this problem can be found by going through every possibility to find the best path, but the amount of possible paths grows very quickly with the number of cities ([n-1]! / 2). Because of this many algorithms have been developed to continue to find new, optimal solutions, not the exact solution (e.g. ACO, Genetic Algorithms, etc.).