A Hybrid Simulated Annealing Algorithm for Travelling ...

9
HAL Id: hal-01962049 https://hal.archives-ouvertes.fr/hal-01962049 Submitted on 20 Dec 2018 HAL is a multi-disciplinary open access archive for the deposit and dissemination of sci- entific research documents, whether they are pub- lished or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers. L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d’enseignement et de recherche français ou étrangers, des laboratoires publics ou privés. A Hybrid Simulated Annealing Algorithm for Travelling Salesman Problem with Three Neighbor Generation Structures Misagh Rahbari, Ali Jahed To cite this version: Misagh Rahbari, Ali Jahed. A Hybrid Simulated Annealing Algorithm for Travelling Salesman Prob- lem with Three Neighbor Generation Structures. 10th International Conference of Iranian Operations Research Society (ICIORS 2017), University of Mazandaran, May 2017, Babolsar, Iran. hal-01962049

Transcript of A Hybrid Simulated Annealing Algorithm for Travelling ...

Page 1: A Hybrid Simulated Annealing Algorithm for Travelling ...

HAL Id: hal-01962049https://hal.archives-ouvertes.fr/hal-01962049

Submitted on 20 Dec 2018

HAL is a multi-disciplinary open accessarchive for the deposit and dissemination of sci-entific research documents, whether they are pub-lished or not. The documents may come fromteaching and research institutions in France orabroad, or from public or private research centers.

L’archive ouverte pluridisciplinaire HAL, estdestinée au dépôt et à la diffusion de documentsscientifiques de niveau recherche, publiés ou non,émanant des établissements d’enseignement et derecherche français ou étrangers, des laboratoirespublics ou privés.

A Hybrid Simulated Annealing Algorithm for TravellingSalesman Problem with Three Neighbor Generation

StructuresMisagh Rahbari, Ali Jahed

To cite this version:Misagh Rahbari, Ali Jahed. A Hybrid Simulated Annealing Algorithm for Travelling Salesman Prob-lem with Three Neighbor Generation Structures. 10th International Conference of Iranian OperationsResearch Society (ICIORS 2017), University of Mazandaran, May 2017, Babolsar, Iran. �hal-01962049�

Page 2: A Hybrid Simulated Annealing Algorithm for Travelling ...

1

A Hybrid Simulated Annealing Algorithm for Travelling Salesman Problem

with Three Neighbor Generation Structures

Misagh Rahbari 1,*

, Ali Jahed 2

1 Department of Industrial Engineering, Faculty of Engineering, Kharazmi University, Tehran, Iran

Email: [email protected] 2 Department of Industrial Engineering, Islamic Azad University South Tehran Branch , Tehran, Iran

Email: [email protected]

Abstract Travelling salesman problem (TSP) has been considered as one of the most complicated problems. The

problem is NP-Hard and practical large-scale instances cannot be solved by exact algorithms within

acceptable computational times. The aim of this study is to presents a hybrid method using tabu search and

simulated annealing technique to solve TSP called hybrid simulation annealing (HSA). The proposed HSA

algorithm incorporates three neighborhood structures, called swap, insertion and reversion, to explore

different possibilities of neighbor solution. This proposed HSA not only prevents revisiting the solution but

also maintains the stochastic nature. Finally, the performance of the proposed HSA is examined against

tabu search and simulation annealing technique, and the preliminary results indicate that the HSA is

capable of solving real-world problems, efficiently.

Keywords: Travelling salesman problem, Simulated annealing, Tabu search, Meta-heuristics methods

1. Introduction Most problems in discrete optimization concern the problems in NP-hard classes which are difficult to find the

best solution in reasonable time. We can use two approaches for finding the solution. First exact algorithm to

find the best solution and the other approach is to use meta-heuristics algorithms. Some examples of first

approach is Multi-agent systems in production planning and control scheduling of mixed-model assembly

lines [1]. Agent based on flow shop scheduling [2],[3],[4]. The second method is based on meta-heuristic

optimization. These techniques generate different sets of solutions and filter out some low scored solutions in

order to maximize or minimize the objective function.

The geometrical structure of the objective function is not involved as a part of solution finding process.

Without considering the actual geometrical structure of the objective function, it is almost impossible to

achieve the best solution. However, the objective functions of some combinatorial optimization problems are

rather difficult to define due to their nature. For example, the travelling salesman problem (TSP) concerns the

sequence of cities and the total travelling distance. The best sequence of cities is the desired solution to be

achieved. Hence, a set of travelling sequences must be used as a set of generated points scattered throughout

the manifold of objective function for optimizing the function. But in general, the objective function of this

problem concentrates only the total distance and lacks the sequence of traversed cities. Furthermore, this

problem can be transformed to various NP- complete problems such as DNA sequencing, planning and

logistics.

Previously, the rever several proposed algorithms to solve the problems related to travelling salesman

problems such as vehicle routing [5], scheduling problems [6]. A number of meta- heuristic algorithms have

been implemented to find the optimal path by various researchers.

Some of the techniques are Ant colony Optimization (ACO) [7],[8],[9], Genetic Algorithm (GA)[10],[11].

Other newly emerging techniques have been also applied to TSPs such as Intelligent Water Drop (IWD)

Page 3: A Hybrid Simulated Annealing Algorithm for Travelling ...

2

algorithm [12] and River Formation Dynamics (RFD) [13]. Some improvements of ant colony optimization to

overcome the problems of pheromone update and being stuck at local optimal solution are also proposed. For

instance, PS–ACO [14] modified the pheromone updating rules of ACO by using the mechanism of

PSO.ACS–TSPTW based on the ACO technique to solve the travelling salesman problem with time windows

(TSPTW) [15]. GA–PSO–ACO [16] used the randomness, rapidity, and wholeness of the PSO and GA in the

first step to obtain sub – optimal solutions for adjusting the initial allocation of pheromone in ACO. The

problem of travelling salesman combines two interesting instantaneous aspects. The first aspect is the

sequence of objects which are traversed cities. The second aspect is the minimum total travelling distance.

2. Describe model

The TSP model is shown here:

Parameters

:ij travel costs from city i to cityc j o: f city n number

Decision variables

1

0 :ij

the path goes from city i to city j

otherwiX

se

:i variable for eau Po ch city to asitiv void sue btours

0 , 0

minn n

ij ij

i j i j

c X

Subject to:

0 1ijX , 0,1,.......,i j n

, 0

1n

ij

i j i

X

0,1,.......,j n

, 0

1n

ij

i j j

X

0,1,.......,i n

1i j iju u nX n 2 i j n

The objective shows that we want to minimize the cost. The first constraint shows that all of the variables are

binary. Second constraint shows that there is one city that goes to other city. The Third constraint shows that

there is on exit from each city. The last constraints enforce that there is only a single tour covering all cities,

and not two or more disjointed tours that only collectively cover all cities.

Page 4: A Hybrid Simulated Annealing Algorithm for Travelling ...

3

3. Definition of algorithms

3.1 SIMULATED ANNEALING ALGORITHM Simulated annealing (SA) is a generic probabilistic meta-heuristics for combinatorial optimization problem of

locating a good approximation to the global optimum of a given function in a relatively large search space.

During the search, SA not only accepts better solutions but also the worse solutions but with a decreasing

probability. At higher temperatures, the probability of accepting worse solutions is much higher. But, as the

temperature decreases, the probability of accepting worse solution decreases. The probability of acceptance is

assigned the value:

Probability of acceptance = ( / )exp Z T

A randomly generated number is used to test whether the move is accepted. Finally to decreases and update

temperature, we multiply the current temperature by a constant ALPHA:

Update temperature = T

The SA consists of two loops. The inner loop runs till maximum number of acceptance or study neighbors for

current temperature reached. The outer loop check for the stopping condition to be met. Each time the inner

loop is finished, the temperature is updated using an update temperature formula till primary temperature to

become equal freezing temperature.

3.2 TABU SEARCH ALGORITHM

Tabu search (TS) is an optimization technique for solving permutation problem. TS moves from a current

solution to the best solution in its neighborhood by use long-term memory (LTM). Long-term memory (LTM)

has one main purposes: to drive the search towards the regions of the solution space not yet explored and with

high potential of containing good solutions the formula to determine the best replacement for generation

neighbor:

Random (i, j) = rand/Long-term memory (LTM) (i, j)

(n1, n2) = the indices of maximum value in random

Short-term memory (STM) has one main purposes: to prevent the return to the most recently visited solutions

in order to avoid cycling. The exit strategy of STM as a first in first out (FIFO). Finally after the generation

neighbor we update STM and LTM till maximum of iteration is reached.

3.3 HYBRID SIMULATION ANNEALING ALGORITHM

The proposed hybrid simulation annealing (HAS) meta-heuristic is introduced for travelling salesman problem

based on the hybridization of two algorithms, namely SA and TS. In the algorithm by the combination of

simulated annealing (SA) and tabu search (TS), the number of solution revisits has been remarkably

decreased. By using the proposed HAS, a number of solution revisits can be decreased by providing a short-

term memory while keeping the stochastic nature of the SA algorithm also the proposed HAS, not only

accepts better solutions but also the worse solutions but with a decreasing probability.

Page 5: A Hybrid Simulated Annealing Algorithm for Travelling ...

4

The proposed HAS has a number of advantages, including stochastic feature avoiding cycling and Short-term

memory to escape from local optima. These characteristics limit the search from a previously visited solution

and improve the performance of the conventional SA remarkably.

3.4 THREE NEIGHBOUR GENERATION STRUCTURE

In using of meta-heuristics for TSP, the most widely used and the simplest representation solution is

permutation encoding. In permutation encoding the order of the numbers in the array represents the visiting

order of the cities.

In this section, we present three neighbor generation structure that using in proposed HAS.

3.4.1 SWAP

Selecting two random positions in permutation encoding representation solution and swapping elements of

these positions is the easiest and most widely used way of generating of neighbor solutions. In order to help to

understand, in the Figure 1 we introduce the swap method. For example, if the third and fifth element be

selected then their position will be replace by each other.

Figure 1.neighbor generation with swap operator

3.4.2 REVERSION

Selecting two random positions in permutation encoding representation solution and reversing the direction

between two randomly chosen elements. In order to help to understand, in the Figure 2 we introduce the

reversion method. For example, if the second and fifth element be selected then reversing the direction

between their position.

Page 6: A Hybrid Simulated Annealing Algorithm for Travelling ...

5

Figure 2.Neighbor Generation with Reversion Operator

3.4.3 INSERTION

Selecting two random positions in permutation encoding representation solution and with due attention to

number of chosen elements, reversing the direction between two randomly chosen elements. In order to help

to understand, in the Figure 3. we introduce the reversion method. For example, if the second and fifth

element be selected then reversing the direction between their position.

Figure 3.Neighbor Generation with Insertion Operator in 2 State

Page 7: A Hybrid Simulated Annealing Algorithm for Travelling ...

6

4.Computational results

In this section, we present details of the implementation of the proposed HSA and compares the results with

TS and SA. For the testing of these techniques, 3 example problems from the literature were used. All these

techniques were written in MATLAB programming language and every technique was run 50 times for every

problem. For the comparison of the techniques, GAP of the average results with due attention to the optimal

solution was used.

( ) ( )% 100

( )

average Z optimal ZGAP

optimal Z

Table 1 shows details of our results.

Name of techniques

Problem number

Name of instances

Number of city

Average Z

Optimal Z

GAP (%)

SA

1 Gr17[17] 17 2119.28 2085 1.64

2 Gr48[17] 48 5312.9 5046 5.28

3 Gr96[17] 96 62779.78 55209 13.71

TS

1 Gr17[17] 17 2110.3 2085 1.21

2 Gr48[17] 48 5332.86 5046 5.68

3 Gr96[17] 96 65622.28 55209 18.86

HSA

1 Gr17[17] 17 2096.8 2085 0.56

2 Gr48[17] 48 5281.2 5046 4.6

3 Gr96[17] 96 61510.32 55209 11.41

Table 1.The summary of comparison of HSA with TS and SA

Page 8: A Hybrid Simulated Annealing Algorithm for Travelling ...

7

5. Conclusion

In this study, first we have presented travelling salesman problem then presented two well known technique,

tabu search and simulated annealing. We have presented a hybrid simulation annealing (HAS) meta-heuristic

based on combination of two well-known techniques, tabu search and simulated annealing to solve travelling

salesman problem. Also, we introduce three neighbor generation structure that used in proposed HAS called

swap, insertion and reversion. To validate and verify the proposed HSA, the technique were tested on 3well

known benchmark problem sets from literature. The proposed HAS has been illustrated to be efficient in

finding optimal solutions in most cases.

Acknowledgments

The first author greatly appreciates to the Research Deputy of University of Mazandaran for their support.

References [1] Caridi, Maria, and Andrea Sianesi. "Multi-agent systems in production planning and control: An application to the

scheduling of mixed-model assembly lines." International Journal of production economics 68.1 (2000): 29-42.

[2] Don Taylor et al, An Assignment Algorithm for Dynamic Picking Systems, Journal IIE Transactions, 28 (1996) 607

616.

[3] Neubert, Gilles, and Matteo M. Savino. "Flow shop operator scheduling through constraint satisfaction and constraint

optimisation techniques." International Journal of Productivity and Quality Management 4.5-6 (2009): 549-568.

[4] Savino, Matteo M., Antonio Mazza, and Gilles Neubert. "Agent-based flow-shop modelling in dynamic

environment." Production Planning & Control 25.2 (2014): 110-122.

[5] Bektas, Information and Control, 174(3) (2006) 1449-1458.

[6] Whitelyetal, Genetic Algorithms and Machine Scheduling With Class Setups, International Journal ofcomputer and

engineering management,(1989)

[7] Lee, Seung Gwan, Tae Ung Jung, and Tae Choong Chung. "An effective dynamic weighted rule for ant colony

system optimization." Evolutionary Computation, 2001. Proceedings of the 2001 Congress On. Vol. 2. IEEE, 2001.

[8] Zhu, QingBao, and Shuyan Chen. "A new ant evolution algorithm to resolve TSP problem." Machine Learning and

Applications, 2007. ICMLA 2007. Sixth International Conference on. IEEE, 2007

[9] Tsai, Cheng-Fa, and Chun-Wei Tsai. "A new approach for solving large traveling salesman problem using

evolutionary ant rules." Neural Networks, 2002. IJCNN'02. Proceedings of the 2002 International Joint Conference on.

Vol. 2. IEEE, 2002.

[10] Liao, Yen-Far, Dun-Han Yau, and Chieh-Li Chen. "Evolutionary algorithm to traveling salesman problems."

Computers & Mathematics with Applications 64.5 (2012): 788-797.

[11] Pullan, Wayne. "Adapting the genetic algorithm to the travelling salesman problem." Evolutionary Computation,

2003. CEC'03. The 2003 Congress on. Vol. 2. IEEE, 2003.

[12] Shah-Hosseini, Hamed. "The intelligent water drops algorithm: a nature-inspired swarm-based optimization

algorithm." International Journal of Bio-Inspired Computation 1.1-2 (2009): 71-79.

[13] Rabanal, Pablo, Ismael Rodríguez, and Fernando Rubio. "Applying river formation dynamics to solve NP-complete

problems." Nature-inspired algorithms for optimisation. Springer Berlin Heidelberg, 2009. 333 -368.

[14]Shuang, Bing, Jiapin Chen, and Zhenbo Li. "Study on hybrid PS-ACO algorithm." Applied Intelligence 34.1 (2011):

64-73.

Page 9: A Hybrid Simulated Annealing Algorithm for Travelling ...

8

[15] Cheng, Chi-Bin, and Chun-Pin Mao. "A modified ant colony system for solving the travelling salesman problem

with time windows." Mathematical and Computer Modelling 46.9 (2007): 1225-1235.

[16] Deng, Wu, et al. "A novel two-stage hybrid swarm intelligence optimization algorithm and application." Soft

Computing 16.10 (2012): 1707-1722.