Parallel EigenAnt algorithm based on MPI by ACO approach

Parallelization is among the best approaches that can be used to enhance the performance in heuristic algorithms. The EigenAnt algorithm model is an Ant Colony Optimization (ACO) that leads to the selection of the shortest paths. In this research, we propose a Parallel EigenAnt Algorithm (PEAA) using Ant Colony Optimization approach. The algorithm is implemented by Message Passing Interface (MPI) in a parallel form. It is possible to send or receive messages to a group of processes in collective communications. Parallel EigenAnt algorithm improves the speed to find a better solution by ants. Experimental results showed that the proposed parallel EigenAnt algorithm yields a significant improvement by finding the shortest path from a source to a destination. The results also showed that the suggested algorithm improves the execution time and efficiency. The performance of the proposed method improved the speedup, efficiency and quality of solution compared to Sequential EigenAnt algorithm.


Introduction
Ant Colony Optimization (ACO) is a bio-inspired optimization algorithm [1].ACO has been used for the solving of numerous optimization problems.First, ACO algorithm called ant system that was proposed by Dorigo et al. and Ant Colony System (ACO) [2].
Production and hosting by ISPACS GmbH.http://www.ispacs.com/journals/cacsa/2017/cacsa-00080/International Scientific Publications and Consulting Services Since then, a number of ACO algorithms have been developed including Max-Min AS (MMAS) [3].Some strategies for parallelization have been reported recently.Jie et al. [4] proposed parallel ant colony optimization algorithm based on Message Passing Interface, which has the characteristics of coarsegranularity interacting multi ant colonies, partially asynchronous parallel implementation and also a new information exchange strategy.Relevant research of PACO has been focused on the use of MPI which is executed on c1usters [5,6].Many parallel algorithms have been proposed for the artificial Ant Colony algorithm.Parallel implementation of ACO [7] can obviously reduce the computational time for the large scale combinatorial optimization problem, and much of the previous researches in this field focuses on parallel implementation using MPI which is executed on clusters.Effective parallelization strategies for the Ant Colony Optimization metaheuristic on Graphics Processing Units (GPUs) presented in [8].Kucukkoc et al. [9] proposed a Mixed-model parallel two-sided assembly line system that can be utilized to produce large-sized items in an inter-mixed sequence.Parallel ant colony optimization based metaheuristic proposed in [10] for solving the maximum-weight clique problem.Parallelization of algorithms has proven to be very powerful method in the case of population based algorithms like genetic algorithms, ant colony optimization and artificial bee colony algorithm.Asadzadeh [11] suggested a parallel artificial bee colony algorithm for the job shop scheduling problem by a dynamic migration strategy.In the method, artificial bee colony algorithm consists of several colonies that is located on different hosts of the network and is executed in various colonies in parallel manner.Damghani et al. [12] proposed Parallel implementation of Bees Algorithm based on Message Passing Interface.This parallel approach increases the Speedup.EigenAnt algorithm [13] employs Jayadeva et al. al's EigenAnt algorithm to find the shortest path between a source and a destination, based on selective pheromone removal that occurs only on the path that is actually chosen for each trip.Ezzat et al. [14] proposed an Ant Colony Optimization Approaches for the Sequential Ordering Problem.In the suggested method, they present two approaches aimed at improving the performance of the ant colony optimization.EigenAnt is an ACO algorithm introduced by Jayadeva et al. [15].It has been applied only to the problem of finding shortest paths, an easy problem that was meant just to provide context for studying of the convergence properties in the algorithm.Xiong et al. [16] employed an Improved Parallel Ant Colony Optimization Based on Message Passing Interface to improve the parallel efficiency.The proposed Parallel implementation in ACO can obviously reduce the computational time.The reminder of this paper is organized as follow.In Section 2, we describe the artificial ant colony algorithm.In Section 3, we describe the EigenAnt algorithm.Our proposed parallel EigenAnt algorithm and execution time in parallel method would be explained in section 4 and 5. Our conclusion is given in Section 6.

Artificial Ant Colony Algorithm
Ant algorithm operates in the way that the ants regularly create the candidate responses and they may store pheromones values.The created candidate responses start from a blank response by each ant.Then, they add the ant one by one to the response until the completion of a complete solution.After completing of the solution, the parts of the response, as a part of the found response, will be used further by other ants in the iteration stage.After initializing the pheromone ways and other parameters, a main loop is repeated until the preparing of termination condition (which can be a certain number of solutions or limitations on CPU time).In the main loop, the ants initially create possible solutions.Finally, the created solutions may be improved by applying a local search and finally, pheromone traces are updated.The pseudo-code of the ACO algorithm is given below: http://www.ispacs.com/journals/cacsa/2017/cacsa-00080/International Scientific Publications and Consulting Services

Initialization Process
The first stage mainly involves the formation of the pheromone paths and initialization.

Construction Process
In the iteration stage, each ant produces solution for the problem according to the status transfer law.When all ants produce a solution, a nationwide law will be presented during updating of the pheromones in two phases: One is the evaporation phase, which is a part of pheromone, and the other one is strengthening and resonance that each ant leaves some pheromones on itself that corresponds to the value of the found solution.The process is repeated until the achieving of a stop condition.

EigenAnt Algorithm
EigenAnt uses a colony consisting of a single ant that is charged by finding the shortest path from a source to a destination.During every iteration t, it probabilistically chooses a path i to follow according to the following equation (3.1): Where is the amount of pheromone on the path i at iteration t.After an ant selects a path i, the pheromone trail on that path is updated according to the following equation: Where a is the evaporation rate, b is a weighting parameter, and di = 1/Ct, where Ct is the cost of the solution found in iteration t.Jayadeva et al. [15] suggest default parameter settings of a = 1 2 and b = 1, and report that the performance of the algorithm is not very sensitive to the choice of parameter values.They have also shown that the shortest path is the system's unique stable equilibrium state.Even if the pheromone trails are initialized to favor longer paths, or if path lengths change dynamically during execution, the system will still tend towards the shortest path.

Parallel EigenAnt Algorithm
The use of parallel algorithms increases the program speed and optimal use of multi-processor computers power.In this article, MPI (message passing interface) was used for parallelization of EigenAnt algorithm.MPI is intended as a standard implementation in the "message passing" model of parallel computing.A parallel computation consists of a number of processes, each working on some local data.Each process has purely local variables, and there is no mechanism for any process to directly access the memory of another.
Step 1: Initialization -Initialize the pheromone trail Step 2: -For each ant Repeat -Solutions construction using the pheromone trail -Update the pheromone trail -Until stopping criteria http://www.ispacs.com/journals/cacsa/2017/cacsa-00080/International Scientific Publications and Consulting Services Sharing of data between processes takes place by message passing, that is, explicit sending and receiving data between processes.One of the methods is Master-Slave in which a process acts as a Master and others as the slaves.Master process is responsible for sending and receiving messages to the slave, messages harmonization and doing managerial tasks.Slaves are usually responsible for running the main part of algorithm and perform the same operations.In MPI, any available process in a communicator is determined by a unique number called rank.The rank, which is associated to each process, is an integer more than or equal to zero (≥0), as the rank of master process is zero in the method.In this algorithm first, master process produces SN random solutions with D parameter, where D is the number of optimization parameters.Any solutions vector   (i = 1, 2, ..., SN) is D-dimensional.The SN is equal to the Pheromone paths.Then SN solutions are divided among P processes so that each processor takes SN P solution according to Equation (4.1): Distribution of probabilities for choosing of a random path is obtained below: The pseudo-code in the parallel EigenAnt algorithm is given below: The Update path choice probabilities are obtained using (4.5):MPI provides communication between the processes.The speedup factor is a measure to captures the relative benefit of solving a computational problem in parallel.The speedup factor of a parallel computation utilizing p processors is derived as the following ratio: Where s T is the execution time taken to perform the computation on one processor, and p T is the execution time needed to perform the same computation using p processors.The efficiency factor of a parallel computation is obtained below: p s efficiency p  (4.7)

execution time in parallel method
In this article, parallel EigenAnt Algorithm that is an improved ACO algorithm has been evaluated by the MPI interface.The implementation of the parallel algorithm approach reduces the running time.As the processors numbers increased, the processing time would be reduced.It shows the improvement of algorithm to the EigenAnt sequential algorithm.To obtain better results, we compared the parallel with two interfaces of MPI and OpenMT that MPI showed better results.We implemented the parallel EigenAnt Algorithm in C++ language by the use of MPI, then compared the obtained results with sequential EigenAnt Algorithm.All experiments were carried out on a computer with an Intel Core 2 Duo P7450 2.13 GHz CPU and 4 GB's of RAM.For parallel EigenAnt algorithms we set m = 1,  = 0.5 and  = 1.We set the pheromone trail on an edge (i; j) to be equal to zero if it is infeasible (i.e.: it is a precedence constraint), a small constant if the edge length is zero, and to its length otherwise.Speedup in MPI and OpenMP buydifferent threads numbers is shown in Table 1.According to Figure 2, the convergence speed of EigenAnt applied multi-core parallel computing is faster than serial EigenAnt, and the former is better than latter in the quality of solution at the same iteration.We compared Speedup and Efficiency for the solution quality of parallel EigenAnt Algorithm with MPI and OpenMP is shown in Figure 3 and Figure 4.

Conclusion
In this paper, we propose a parallel EigenAnt optimization algorithm by ACO approach.Our aim was to increase the execution time in the algorithm.To improve the speedup and efficiency in the algorithm, we use the parallelization in the MPI interface.According to the algorithm, an ant is easily able to find the shortest path from a source to a destination and this reduces the running time of the algorithm based on the amount of pheromone.A comparison of the performance between MPI and OpenMP is made by different threads in Table I.The result of implementation has shown that it was possible to design an efficient parallel EigenAnt Optimization algorithm in MPI.This method improves the speed and quality of solution compared to the sequential algorithm.Benchmark instances are used to investigate the performance of the proposed approach.

Table 1 :
Results of experiment with different thread numbers, 200 iterations.The results of the best time in the execution of algorithm for two interfaces are shown in Table 2. MPI interface shows the time improvement in the execution of parallel algorithm.

of Threads Time of Sequential Execution(ms) Time of MPI Execution(ms) Time of OpenMP Execution(ms)
International Scientific Publications and Consulting Services

Table 2 :
The best value of different with processor numbers

Table 2 .
Simulation results show that the speedup on the volume of data increases linearly as the number of processors is increased.