Research Article
Advanced Harmony Search with Ant Colony Optimization for Solving the Traveling Salesman Problem
Pseudocode 1
The pseudo-code for the proposed algorithm (AHS-ACO).
| Procedure: The proposed algorithm for the TSP | | Begin | | Objective function , | | Generate initial harmonics (real number arrays) | | Define harmony memory considering rate , pitch adjusting rate , mutation rate | | Initialize the pheromone tables | | Generate initial harmony randomly and apply pheromone update | | while (not_termination) | | for : number of nodes | | Generate random number variable (rand) | | if (rand < ) | | Generate random number variable (rand) | | if (rand < ), generate the nearest city to the previous harmonic | | else choose an existing harmonic the highest fitness probability | | end if | | else generate new harmonics via randomization | | end if | | end for | | Accept the new harmonics (solutions) if better | | Generate random number variable (rand) | | if (rand < ) operate inversion mutation end if | | Apply the pheromone update | | Create as many cities as the HMS based pheromone using Ant Colony Optimization | | Update harmony memory and apply pheromone update | | end while | | Find the current best solutions | | End |
|