Application of the random key based electromagnetism-like heuristic for solving travelling salesman problems

Abstract


Introduction
The traveling salesman problem (TSP) is an extensively studied classical combinatorial optimization problem that aims to find the optimal tour of n cities by minimizing the total traveling distance, beginning and terminating at the same location and visiting the other locations only one time. Although small instances can be solved for optimality by mixed integer programming, as the size of instances increase the TSP is remarkably challenging. Therefore, academicians published over a thousand articles, developing algorithms and methodologies to solve this problem more effectively [29].
Combinatorial optimization problems involve finding the best possible solution from a finite set of solutions fulfilling certain constraints. Since many combinatorial optimization problems are NP-hard, complete methods-that guaranties optimalityoften leads to high computation times for real-world applications [7]. Therefore, approximate methods are utilized to yield acceptable solutions in a significantly reduced computation time by sacrificing the guarantee of finding optimal solution.
The use of meta-heuristics is a rapidly growing field of research, especially for combinatorial optimization problems. Due to the theoretical and practical complexity of the problem, researchers propose hybrid approaches by integrated meta-heuristics, ie. genetic-tabu search based algorithm [20]; ant colony-tabu search algorithm [18]. The inspiration behind hybridization of different algorithms is to utilize the best performing characteristics of various optimization techniques, that is, integrating these methods are accepted as a good idea [7].
In this study, we represent an adaption of electromagnetismlike (EML) algorithm approach to solve symmetric TSPs. Birbil and Fang [5] introduced EML heuristic for solving global optimization problems. EML heuristic utilizes an attracting-repelling mechanism to converge a solution for optimality. By constructing additional transformation procedures or hybridization with other search and meta-heuristic algorithms, many researchers successfully employed the algorithm for solving discrete and constrained optimization problems. Recently, EML algorithm has been used for computing eigenvalues and eigenvectors [34], redundancy allocation problem [36], prediction of diabetes mellitus [37], vehicle routing [38], [40], cell formation and layout problem [16], maximum betweenness problem [13], nurse scheduling [21], project scheduling [12], single machine scheduling [8]- [10], [30] and set covering problem [23].
The outline of this paper is as follows. In Section 2, a recent literature review on TSPs is presented briefly. In Section 3, the integrated methodology is introduced, underlying methods and their principles are explained in detail. Random key technique and the hybridization with EML algorithm are extensively discussed. In Section 4, computational results are presented. In Section 5, we present the results and our conclusions. Additionally, future research areas are discussed.

Traveling salesman problem
Among combinatorial optimization problems, the most prominent problem is generally referred as TSP. It generally intends to discover the optimal route among a given set of locations with beginning and ending at the same predefined location by focusing on the minimum travelling distance.
In this study, we consider a generic un-capacitated vehicle routing problem: Where is assigned to 1 if truck goes to node from node , 0 otherwise.
is the distance between node and node . Equation (1) is the objective function that minimizes the total routing distance. Equation (2) and Equation (3) ensure only one route between two nodes. Equation (4) is the sub-tour elimination constraint where is the subset of the cities and the representation of binary decision variables is given in Equation (5).
In recent years, hybridization of different approximate methods is getting more popular in order to effectively solve TSPs. By smart integration of heuristics, authors attempt to promote the advantages and eliminate the shortcomings of algorithms.

Proposed algorithm
The electromagnetism-like (EML) heuristic is presented to solve continuous unconstrained optimization problems. In this study, we integrate random key procedure to EML heuristic in order to solve constrained combinatorial optimization problems. The original EML heuristic can solve effectively test functions such as Rastrigin, Davis, Lavy and Kearfott functions in an appropriate computation time. Thus, we adapt the algorithm by embedding the random key procedure into it to solve sequencing and allocation problems.  Here, it should be noted that in original EML heuristic, the value of variable k have been the k th (k ∈ n) random coordinate value of the particle i (i ∈ m).
In this modified algorithm, the random numbers, which have been assigned into the cells of the position vector, are the coordinate values and the random key method is applied to the coordinates of particles [37].

Electromagnetism-Like heuristic
The EML heuristic is inspired from electromagnetism theory and Coulomb law. The algorithm proposes that there is an attracting/repelling effect between particles in the solution space. In elementary physics, it is known that electrically charged particles affect each other with respect to their relative charge magnitude and sign. Hence, two positively or two negatively charged particles repel each other, whereas particles, which have opposite signed charges, attract each other.
In EML algorithm, every particle's charge sign is assumed to be positive and the magnitude of the charge is expressed by its present objective function value. The algorithm implies that if a particle performs better by means of the objective function, it has a greater charge value, and vice versa. The charge of a particle expresses the level of attracting and/or repelling forces in the population. Therefore, highly charged particles attract remaining less charged particles of the population in order to converge to the optimal solution.
A classic population-based search approach proceeds on a set of feasible solutions. Similarly, EML heuristic proposed by Birbil and Fang [5], utilizes an attraction-repulsion mechanism to move these feasible points (solutions) toward optimality.
Since EML heuristic works on a set of sample points, the number of particles (points) in the population should be determined. A main assumption is that the particles are uniformly distributed between a corresponding upper bound and a lower bound. The performance of each particle is Here, ( ) is a minimization type objective function, m is the size of population and is the dimension of the problem. The charge of a particle , , can mathematically be calculated as in Equation (6): Where ( ) is the best level of objective for the current population.
The attracting mechanism encourages the points to move closer to better solutions, and conversely, the repelling mechanism encourages the points by moving away from worse ones [6]. All the particles in the population move along the resultant force that is exerted on them. After calculating the charges of the particles, in order to find to the movement direction of each particle the resultant force vector of each particle is calculated.
The resultant force vector F i of particle i is computed as in Equation (7).
In equation (7), the magnitude of the force which is exerted on particle emanated from particle is oppositely proportional to Euclidian distance between these particles. Additionally, the magnitude of force is proportionate to the charges of particles. Hence, higher force occurs between higher charged particles and contrarily lower force occurs between low charged particles. Unlike electrical charges, EML algorithm assigns no signs to the charge of an individual particle.
In order to define the direction of a particular force, algorithm compares the objective function values of particles. The total force vector exerted on each particle is computed by addition of each forces exerted on particle . Since the direction of total exerted force depends on the location of particles, the particles, that turn out to be sufficiently close, may lead to a direction rather than the statistically projected gradient of .
In EML algorithm, particles can move on the feasible region to find the optimal solution. This feasible region consists of the area between upper bound ( ) and lower bound ( ) of the k variables. RNG vector represents the feasible movements toward the upper bound, or the lower bound, for the corresponding dimension. As the resultant force vector is calculated, each particle moves toward its new position by a random step length . Here, is generated regarding to standard uniform distribution with parameters [0,1].
There exist four procedures in EML algorithm. The initialization phase is the first phase, which is employed for sampling feasible solutions. After calculating the objective values, local neighborhood search procedure start. The local procedure is employed for searching for a better refinement. The third procedure, CalcF, is utilized for calculating the total force exerted on each point, and the last procedure, Move, move a population of points toward optimality by maintaining feasibility. The pseudo-code of EML is given as follows: Here, ∈ [0,1] is the local search parameter, MAXITER corresponds to the maximum iteration number and LSITER corresponds to the maximum local search number and is the number of sample points (particles) in the search space.

Random key technique
Random key (RK) approach is firstly introduced by Bean [4] in order to attempt to overcome the difficulty of maintaining feasibility by using real-coded genetic algorithm to address a wide variety of combinatorial optimization problems.
Subsequently, numerous researchers employed this robust concept with different heuristics to find the optimal solution of combinatorial problems, as: Particle swarm algorithm [35] and genetic algorithms [32].
In order to calculate the minimum value of an objective function ( ), an n dimensional position vector should be evaluated. An illustrative example is given as in Table 1 and Table 2:    For this example, the elements of the vector are sorted in the ascending order and the random key generator has generated 0.71, 0.23 and 0.83 for the first three elements. Since 0.71 is the 8 th largest number of the series, it will be assigned to the 8 th element of the vector. Before the transformation, the index of 1 associated to 0.71 will be assigned to the 8 th cell of the new vector, simultaneously. The second and third generated random numbers are 0.23 and 0.83. They are respectively the 4 th and 9 th larger numbers of series. The index of 0.23 is 2 and the index of 0.83 is 3. So, they will be assigned ın the 4 th and 9 th cells of the new cells simultaneously. Thus, the new sequence {6,7,10,2,4,5,9,1,3,8} will be generated.
The steps of random key technique can be summarized as: (i) for each cell of the vector, a random number is generated, (ii) n random numbers are sorted in the ascending order and (iii) the corresponding indices of the random numbers are also sorted with respect to their random number position.
While utilizing the random key technique, a well-performing sorting algorithm is appropriate in terms of time complexity and computational processing speed. After sorting the all the values, the objective value of the new generation can be calculated.

Application
In this section, we investigate the efficiency of proposed algorithm in solving un-capacitated travelling salesman problem.

Data
The efficiency of the proposed method is discussed on the results of 15-known TSP instances, which can be found in (http://comopt.ifi.uni-heidelberg.de/software/TSPLIB95) TSPLIB in the literature. The problem instances and pertinent data is given in Table 3. These test problems are chosen because there was data available in the literature to compare our results with those obtained by other heuristics in the literature.

Results
We summarized the results in Table 4 to illustrate the individual performance of proposed method.
By performing 35 trials for each problem instance, EML heuristics yield efficient results in small and medium size problems. As the number of vertices increases, the time needed for solution increases and convergence to optimality decreases. Figure 2 shows the average time needed for finding solution of the problem.

Comparative results
For further investigation of the performance of proposed algorithm in solving TSPs, we compared the results of each problem obtained from 4 heuristic algorithms in the literature. These 15 problem instances in TSP library have been solved by the algorithms of Somhom et al. [33], Aras et al. [2], Cochrane and Beasley [11], Masutti and Castro [22] and proposed EML heuristics. Obtained results are given in Table 5.  Furthermore, we investigated the effects of parameter setting on computation times. Algorithm utilizes three parameters: these are number of particles , maximum number of iterations for local search LSITER and maximum number of iterations for local search MAXITER. Figures 3a-3c illustrate the effects of these parameters on computation times. Parameter setting in this study is done by several random trials. We have done our computations with 2.20 GHz and 2.0 GB RAM computer. The procedure is coded in Microsoft® Visual Basic® for Applications.

Conclusions and discussions
For improving valuable standards for the advancement of hybrid meta-heuristics. it will be important to enhance current approaches on algorithm development [7].
In this paper. we developed a hybrid procedure to solve uncapacitated TSPs. The proposed method has two phases. In the first phase, we proposed a procedure to initialize random solutions by excluding the problem constraints. Next, we utilized EML heuristics to improve the quality of obtained solution. We tested it on a set of TSP instances. The accuracy of results shows the algorithm performs well in terms of optimality. However, an extra effort is required to improve the computational time. We believe that modifying the code syntax or replacing the programming language with another programming language will yield efficient results in a reasonable computation time, especially for the problems that has higher dimensions.   Additionally, the parameter setting in the two-phase EML algorithm has significant effect on the results and computation time, directly. If the parameter of (which denotes the number of particles) increases sufficiently, local search procedure ensures to converge or to find the optimal objective solution. However, simultaneously, this situation increases computation time too much and it decreases the practicality of the algorithm. Hence, parameter setting is crucial for the algorithm's performance.
Instead of local search procedure in the proposed method, simulated annealing algorithm can be utilized to increase the convergence to optimal objective solution. This hybrid approach will be explored in order to decrease the total computation time.
For future research, the proposed algorithm can be utilized to solve other combinatorial optimization problems. Additionally, multiple objective extensions of the algorithm and extensions handling uncertainty in the problem statement are other interesting topics in order to develop new heuristic algorithms especially for vehicle routing problems.