How ants find the way 1 Istanbul 2 Izmir 3 Antalya 4 Ankara 5 Kayseri 6 Samsun 7 Erzurum 8 Van 9 Diyarbakır 10 Gaziantep
Real ants leave a scented trail called pheromone as they walk and choose paths with a strong trail more often. An ant on a short path comes back sooner and refreshes its trail more often, so the short path's trail grows stronger. The algorithm imitates this: between every pair of cities there is a brass pheromone trail, all equal at the start, 0.0027.
Choosing the next city 1 Istanbul 2 Izmir 3 Antalya 4 Ankara 5 Kayseri 6 Samsun 7 Erzurum 8 Van 9 Diyarbakır 10 Gaziantep
The first ant is in Istanbul. It chooses the next city at random, but a city's probability grows with the pheromone on the trail to it and with how close it is. The thicker a red edge, the more likely that city. The most likely city is chosen with probability 0.305, the least likely with 0.020.
One ant's tour 1 Istanbul 2 Izmir 3 Antalya 4 Ankara 5 Kayseri 6 Samsun 7 Erzurum 8 Van 9 Diyarbakır 10 Gaziantep
At every step the ant chose one of the unvisited cities with the same rule, then returned to the start. Its tour is 4,143 km. Because the choices are random, the ant does not always go to the nearest city the way nearest neighbour does.
Pheromone is laid 1 Istanbul 2 Izmir 3 Antalya 4 Ankara 5 Kayseri 6 Samsun 7 Erzurum 8 Van 9 Diyarbakır 10 Gaziantep
One ant from each city, 10 ants finished their tours. First every trail evaporates: each one is multiplied by 1 − ρ. Then each ant lays 1 / L of pheromone on the edges it used, where L is its tour length. The shortest ant tour is 3,952 km, the longest 6,499 km. The edges of a short tour get more pheromone.
Round 2 1 Istanbul 2 Izmir 3 Antalya 4 Ankara 5 Kayseri 6 Samsun 7 Erzurum 8 Van 9 Diyarbakır 10 Gaziantep
Pheromone builds up on the edges of short tours while unused trails evaporate and thin out; the ants choose the strong trails more often. The best tour so far is red, 3,952 km. The average of this round's ants is 4,855 km.
Round 5 1 Istanbul 2 Izmir 3 Antalya 4 Ankara 5 Kayseri 6 Samsun 7 Erzurum 8 Van 9 Diyarbakır 10 Gaziantep
Pheromone builds up on the edges of short tours while unused trails evaporate and thin out; the ants choose the strong trails more often. The best tour so far is red, 3,543 km. The average of this round's ants is 4,398 km.
Round 10 1 Istanbul 2 Izmir 3 Antalya 4 Ankara 5 Kayseri 6 Samsun 7 Erzurum 8 Van 9 Diyarbakır 10 Gaziantep
Pheromone builds up on the edges of short tours while unused trails evaporate and thin out; the ants choose the strong trails more often. The best tour so far is red, 3,543 km. The average of this round's ants is 4,244 km.
Round 20 1 Istanbul 2 Izmir 3 Antalya 4 Ankara 5 Kayseri 6 Samsun 7 Erzurum 8 Van 9 Diyarbakır 10 Gaziantep
Pheromone builds up on the edges of short tours while unused trails evaporate and thin out; the ants choose the strong trails more often. The best tour so far is red, 3,318 km. The average of this round's ants is 4,126 km.
The shortest tour is found 1 Istanbul 2 Izmir 3 Antalya 4 Ankara 5 Kayseri 6 Samsun 7 Erzurum 8 Van 9 Diyarbakır 10 Gaziantep
After 20 rounds the best tour is 3,318 km, the same as the shortest tour found by trying every tour. The colony reached it in round 11. No ant tried every tour; the pheromone carried the knowledge of good edges from ant to ant.