Research Article

Developing Programming Tools to Handle Traveling Salesman Problem by the Three Object-Oriented Languages

Algorithm 10

Our HGA’s pseudocodes.
1  Create population of random tours;
     //First storey is GA and increases tours  quality. It uses IGX as its crossover [5].
2  Use steady-state GA by heuristic crossover to improve population;
3  Sort population according to cost in ascendant order;
4  Tour    best-so-far    population0;
     //Second storey is HGA and uses GSX as its crossover, Double-Bridge as its mutation and LK
     as its LS.
5  for (i = 1; i <= gen-size; i++)
6  {
7  Tour    child;
8   int index;
9   if(rand_01() < crossover-rate)
10{
11index = linear selection from population;
12father    population[index];
13index = linear selection from population;
14mother    population[index];
15crossover(father, mother, child);
16Improve child by lk;
17}
18else
19{
20child    linear selection from population;
21mutate child by double-bridge;
22Improve child by lk;
23}
24Sort population according to cost in ascendant order;
25if (i % period == 0)
26update candidate set according to edges density in population;
(27)if(best-so-far cost > population0  cost)
(28)best-so-far cost    population0;
(29)}
(30)Report best-so-far;