Movement of ants depends upon the
amount of pheromone available on the edges of the graph. The probability pit of
transition of those virtual ant from node I to t using the formula given below
Pit=( ?i?+?iß)/?( ?Ni?+ ?Niß)
Where ?i indicate the
attractiveness of transition in the past and ?i denote the transition
attractiveness of the ants.
Ni- set the nodes connected to the
?, ß- are the parameters.
Step 1: Start.
Step 2: Init the pheromones for all
the connection between cities.
Step 3: Consider 20 (may be more
than that) ants.
Step 4. For each ant do
4.a) Start the ant from an random city.
4.b) Choose the next city using probability equation based on the pheromone
strength and distance to the next city.
Probability can be measure as probability for the path k to i
((T ^?)*( N^ ß))/(sum((T ^?)*( N^ ß))for
all the points not yet in the path.
Where T is 1/dij
N is the amount of pheromone and
alpha and beta are the two parameters.
4.c) Visit all the city once and construct a path.
4,d) Combine all the pheromones from all the path and update it as
1/dij=Initial pheromone from k to
i=(1-rho)*(pheromone from k to i)+(sum of pheromone from k to I from most
Where rho is the decay constant.
4.e) do the same step from (4.a) to (4.e) until there is no change to get the
best path and time.
Step 5. Implement the updation and
check for the best solution.
Step 6. End.
Iteration is set to 100 with population default
For each path initial pheromone as 1.0( It may
varies and outcome are observed)
Rate of evaporation( initial value 0.1) that is
rho.( It varies according to the length of path, availability of number of
Values of alpha and beta (may vary and thus
result effects) Initial value alpha=1.0 and beta=2.0 and Pheromone