Available online at www.sciencedirect.com
ScienceDirect
Available online at www.sciencedirect.com Procedia Computer Science 00 (2018) 000–000
ScienceDirect
www.elsevier.com/locate/procedia
Procedia Computer Science 124 (2017) 46–52
4th Information Systems International Conference 2017, ISICO 2017, 6-8 November 2017, Bali, Indonesia
The Performance of Ant System in Solving Multi Traveling Salesmen Problem Eka N. Kencana*, Ida Harini, K. Mayuliana Department of Mathematics – Udayana University, Kampus Bukit Jimbaran, Badung 80361, Indonesia
Abstract Multi Traveling Salesmen Problem (mTSP) is an extended situation of Traveling Salesman Problem (TSP) that is classified to combinatorial optimization problems. For many years, TSP has been employed to test the proposed algorithms that belong to meta heuristic techniques. This work is directed to study the performance of ant system (AS) to solve mTSP. This technique was simulated to determine a total shortest route for 5 to 10 salesmen who have to visit 10, 15, 20, 25, and 30 cities. The performance of AS is measured by observing the minimum distance resulted and the average completion time. Ten trials are made for every combination of salesman-city. The result showed that the minimum distance and the processing time of the AS increase consistently whenever the number of cities to visit increase. In addition, a different number of sales who visited certain number of cities proved significantly affect the running time of AS, but did not prove significantly affect the minimum distance. © 2018 The Authors. Published by Elsevier B.V. Peer-review under responsibility of the scientific committee of the 4th Information Systems International Conference 2017. Keywords: Ant system; combinatorial optimization; mTSP; simulation.
1. Introduction Combinatorial optimization problems are loosely defined as the problems that are hard to solve but they easy to state. For practical domain, it is frequently found optimization problem cannot be solved to optimality within polynomially bounded computation time or a NP-hard problem. This situation often leads the problem solver to use the heuristic algorithm(s) to get ‘near-optimal solution’ in a relatively short time[1-2]. A group of algorithms that can be utilized to handle wide-range of NP-hard problems is said meta heuristic algorithm. Some famous
* Corresponding author. Tel.: +0-000-000-0000 ; fax: +0-000-000-0000 . E-mail address:
[email protected] 1877-0509 © 2018 The Authors. Published by Elsevier B.V.
Peer-review under responsibility of the scientific committee of the 4th Information Systems International Conference 2017.
1877-0509 © 2018 The Authors. Published by Elsevier B.V. Peer-review under responsibility of the scientific committee of the 4th Information Systems International Conference 2017 10.1016/j.procs.2017.12.128
2
Eka N. Kencana et al. / Procedia Computer Science 124 (2017) 46–52 Author name / Procedia Computer Science 00 (2018) 000–000
47
techniques fall within this group are tabu search [3-4], simulated annealing [5], genetic algorithm [6], and the Ant System [1]. Perhaps the most computational optimization under studied to evaluate proposed algorithms that are belonged to heuristic techniques is Traveling Salesman Problem (TSP) [2]. If the number of agents increases, TSP changes to another optimization problem, a Multi Traveling Salesmen Problem (mTSP). Briefly, mTSP is aimed to find total minimum distance of routes take by the agents [7]. As an extension of TSP, mTSP is more complex because it has to find a set of Hamiltonian circuit without sub-tour for (𝑚𝑚 > 1) salesmen to serve a set of (𝑛𝑛 > 𝑚𝑚) nodes so that each node is visited exactly by one salesman [8]. Because of its attractiveness to solve NP-hard problem, some researchers tried to modify this algorithm and evaluate its performance. Several modified mTSP and/or TSP techniques, for examples, are: • Time Windows: TSP is modified by adding constraints that some cities have to be visited in specific time period. For instance, Favaretto et al.[9] used TSP with Time Windows (TSPTW) on a logistic distribution problem; • Multiple Depots: multiple depots exist and each depot has a specific number of salesmen. The salesmen can return to a different depot at the end of their travel as long as the number of salesmen in each depot the same as before. An example of this technique is demonstrated by [10]. • Number of Salesmen: generally, the number of salesmen in mTSP is fixed. However, there is also found number of salesmen is a bounded variable. On this case, for each salesman is assigned, an associative fixed cost applied and must be considered in optimization process. It is common to represents mTSP by integer linear programming formulation. Let 𝐺𝐺 = (𝑉𝑉; 𝐸𝐸 ) where 𝑉𝑉 = {1, … , 𝑛𝑛} is the set of vertices (nodes) and 𝐸𝐸 = {(𝑖𝑖, 𝑗𝑗 ); (𝑖𝑖, 𝑗𝑗) ∈ 𝑉𝑉; 𝑖𝑖 ≠ 𝑗𝑗} is the set of edges. Let 𝐶𝐶 = (𝑐𝑐𝑖𝑖𝑖𝑖 ) is a distance matrix associated with 𝐸𝐸 and 𝑚𝑚 the number of salesmen are used. Based on integer linear programming formulation, mathematically mTSP can be expressed in following equations11: (1) subject to
(2)
(3)
(4) Equation (2) ensures that exactly 𝑚𝑚 sales depart from and return to depot (nodes 1). Sub tour elimination constraints that are added in (3) is used to prevent sub tours which are formed between intermediate nodes. Refers to Bektas, this constraints are called sub-tours elimination constraints (SECs) [11]. From several SECs that are proposed to use in mTSP, we applied SEC from Dantzig et al.[12] noting that number of cities are simulated in our study were relatively small although this SEC originally is proposed to use for TSP but also valid for mTSP [11]. These subtours elimination can be expressed in the following:
Eka N. Kencana et al. / Procedia Computer Science 124 (2017) 46–52 Author name / Procedia Computer Science 00 (2018) 000–000
48
3
(5) By imposing (5) as SEC in (3), connectivity between nodes as the solution set is achieved by preventing the subtours’ formation of cardinality S excluding the depot. 2. The Ant System 2.1. Basic concept The main idea of ant algorithm is based on the behavior of ant colonies. The real ants are capable to find foods with the shortest route from their nests by tracking pheromone information. Pheromone is a semiochemical secreted from the body of an ant that impacts the behavior of another ant receiving it. Along traveling, ants deposit pheromones in their tracks and, with some probabilities, will follow by other ants. Interesting introduction about the idea of Ant Colony System can be read in Dorigo et al.[1][13]. The behavior of artificial (intelligent) ants of the Ant System (AS) are similar to real ants, except for two aspects, i.e. (a) the artificial ants have information regarding their environment and use it to being adaptive, and (b) they can remembered the feasible solution 2. 2.2. AS algorithm Basically, AS algorithm is constructed by two main phases i.e. tour construction (TC), and update the pheromone trails (PT). In TC phase on AS algorithm, m ants are randomly put on one of n cities. At construction step, each ant k; k = 1,…, m has random proportional rule to choose which city will be visited on next move. This rule implies the probability of ant k that is currently positioned at city i goes to to city j, can be expressed as1:
(6)
In (6),
is a value that a priori determined which represents the visibility of city j from city i with the
distance between two cities is symbolized with
;
is a pheromone trail on edge ij;
parameters which represent the pheromones trails and the heuristic information; and
and
are two
is unvisited feasible cities
for ant k to tour while being at city i. In (6), to provide a good optimization, it is common to set as suggested by Dorigo et al. (1996)[14]. After all the artificial ants have constructed their initial tour, process to update pheromones trails is started. Refers to Dorigo & Stützle [1], the pheromones values for all edges are decreased by a constant factor that is called pheromones evaporation rate. This process is followed by adding the remainder by pheromone trails that are left because of ants pass the edge. Pheromone evaporation and total pheromones on respective edge after all ants cross edge ij can be expressed in (7) and (8) as follow: (7) where represents the pheromone evaporation rate and it is used to avoid excessive number of pheromone for edge ij. E is all edges’ tour for ants. (8)
4
Eka name N. Kencana et al.Computer / Procedia Computer Science 124 (2017) 46–52 Author / Procedia Science 00 (2018) 000–000
49
is the amount of pheromones left by ant k on the edges it had visited and can be expressed as follows:
where
(9)
In (9), represents the tour length of ant k that is counted as the sum of edges’ length belongs to summary of those steps that are represent the AS algorithm [14] can be listed as follow:
. The
% AS algorithm to so solve mTSP (modified from SD Stovba) %
% ------------------------------------------------------- % < Input m and n > < Input of matrix D, which its elements represents the distance between cities > < Inizialitation of the parameters: > for i = 1 to n % Each edge for j = 1 to n if i ≠ j % Visibility of cities j from i
else end
end
end for r = 1 to % represents maximum iteration for k = 1 to m % for each ant < Build a route for ant k according to (6) > < Calculate > next k If “is best solution found?”
end
< Update and > else for i = 1 to n % for each edge for j = 1 to n < Update pheromone trails according to (7) and (8) > end end
3. Experiment Setting and Computational Results 3.1. Setting The m number of ants are set to visit n number of cities, where m = 5,···,10 and n = 10,15,20,25,30. For each city, the D matrix that its elements represent the Euclidean distances between city i with j ( ) is randomly generated. All ants are initially positioned at the depot. For each one of number of sales-city combination, number of maximum
Eka N. Kencana et al. / Procedia Computer Science 124 (2017) 46–52 Author name / Procedia Computer Science 00 (2018) 000–000
50
5
iteration is set to 200. At the end of each iteration, computation time as well the minimum of total length are recorded. Ten replications were made for each one of the combination between number of sales with city. 3.2. Computational results The computational results for all combination number of sales-cities regarding minimum total length and its computation times are listed in Table 1: Table 1. Computational results of minimum total length and computation times Number of Salesmen Minimum Total Length
Number of Cities 10 15 20 25 30 §
Computation Time§
§
5
6
7
8
9
10
5
6
7
8
9
10
239.9 41.71 237.0 71.16 293.7 32.83 331.9 69.12 393.9 85.74
227.5 54.93 240.1 40.85 303.2 67.45 370.7 63.73 333.6 48.84
187.9 46.81 248.3 49.73 314.4 56.76 333.7 51.25 345.0 72.81
185.8 47.85 256.8 45.28 314.8 76.77 331.9 52.84 372.2 67.97
225.3 54.95 241.4 56.40 297.0 70.07 311.2 44.67 380.2 46.20
173.9 28.52 277.7 38.77 314.8 51.08 315.5 64.56 367.7 76.07
21.6 0.33 22.7 0.76 24.5 0.66 24.4 1.35 25.8 1.07
21.7 0.63 22.1 0.47 23.9 0.64 23.7 0.41 25.8 0.56
22.3 0.99 23.4 0.94 24.0 0.75 23.8 0.57 25.5 0.61
22.9 0.78 23.0 0.40 24.2 0.68 25.3 1.59 25.7 0.54
22.7 0.66 22.9 0.48 24.3 0.97 24.7 0.97 26.2 0.65
22.6 0.52 23.7 0.79 23.8 0.56 24.6 0.56 26.5 0.67
̇The first row of each number of cities represents the average value, and the second row is its standard deviation.
As expected, we found the average of 10 replications for minimum total distance as well the average of computation time tend to increase whenever number of cities to be visited increase (see Fig. 1 and Fig. 2). Despite these facts, AS likes the other heuristic algorithms, shows increasing the number of agents can not always decrease the minimum total distance of routes [14]. To justify, we conduct analysis of variance (ANOVA) test for minimum total length’s data to see the differences may exist between total routes for different number of sales. The result shows total length routes to visit 10 cities were statistically differ if the number of salesmen increase. Applying Duncan’s multiple comparison test, we found 5, 6, and 9 salesmen were in one group that indifference in determining total length routes; 6, 9, 7, and 8 salesmen were in second group; and 7, 8, and 10 salesmen were in the third group. For another number of cities that were simulated in this study, the ANOVA result did not show that the number of salesmen will affect the minimum total length, significantly. For the average computation times data, we have got the ANOVA results differ from average total length routes. Four out of 5 number of salesmen were simulated showed significant differences in average computation time to find the optimal route. For a number of cities to visit equal (n) to 20, there are no statistical differences among the average computation times needed to find the optimal solution whenever the number of salesmen differs. But for another number of cities, the average computation time is statistically different among them. For n = 10, Duncan’s test makes 3 groups of average computation times with the member of the first is {5, 6} salesmen, member of the second groups is {6, 7} salesmen and the last group consisting of {7, 10, 9, 8} salesmen. For n = 15 cities, 4 groups are formed with member of each group are {6}, {5, 6, 8}, {9, 8, 7}, and {7, 10} salesmen, respectively. For n = 25 cities, 2 groups were formed with its elements are {6, 7, 5, 10, 9} and {5, 10, 9, 8} salesmen. For n = 30 cities, as well as n = 25 cities, two groups were formed with its elements are {7, 8, 5, 6, 9} and {5, 6, 9, 10} salesmen, respectively.
Eka N. Kencana et al. / Procedia Computer Science 124 (2017) 46–52
51
Author name / Procedia Computer Science 00 (2018) 000–000
6
Fig. 1. Plot of number of cities and average total time of travel for different number of ants
Fig. 2. Plot of number of cities and average computation time for different number of ants
4. Conclusion In the last two decades, many researchers try to combine the principles in bioscience domains with computing mathematics especially for handling mathematical problems by adopting the animal’s behavior in computing principles. These facts lead to the rising of what so called technobiology [14]. Our research showed the application of ant system in solving multi-TSP gave results similar to other research. Despite the increasing of minimum total distance as well the completion time of the algorithm, we showed there are no warranties the increasing number of agents will reduce the distance. References [1] [2] [3]
M Dorigo, T Stützle. Ant Colony Optimization. Massachusetts Institute of Technology; 2004. B Bullnheimer, RF Hartl, C Straub. A new rank based version of the ant system - a computational study. Working Paper No. 1, University of Vienna (April 1991). F Glover. Tabu search—part I. ORSA Journal on Computing 1989; 1 (3):190–206.
52
[4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14]
Eka N. Kencana et al. / Procedia Computer Science 124 (2017) 46–52 Author name / Procedia Computer Science 00 (2018) 000–000
7
F Glover. Tabu search—part II. ORSA Journal on Computing 1990; 2 (1):4–32. S Kirkpatrick, CD Gelatt, Jr., MP Vecchi. Optimization by Simulated Annealing. Science 1983; 200:671-680. JH Holland. Adaptation in Natural and Artificial Systems. University of Michigan Press; 1975. M Sedighpour, M Yousefikhoshbakht, NM Darani. An effective genetic algorithm for solving the multiple traveling salesman problem. Journal of Optimization in Industrial Engineering 2011; 8:73–79. H Larkia, M Yousefikhoshbakht. Solving the multiple traveling salesman problem by novel metaheuristic algorithm. Journal of Optimization in Industrial Engineering 2014; 16:55–63. D Favaretto, E Moretti, P Pellegrini. An ant colony system approach for variant of the traveling salesman problem with time windows. Journal of Information and Optimization Sciences 2006; 27 (1):35–54. HM Shu, LD Bo. A novel method for solving the multiple traveling salesmen problem with multiple depots. Chinese Science Bulletin 2012; 57 (15): 886–1892. T Bektas. The multiple traveling salesman problem: an overviewof formulations and solution procedures. Omega 2006; 34: 209-219. GB Dantzig, DR Fulkerson, SM Johnson. Solution of a large-scale travelling salesman problem. Operation Research 1954; 2: 393-410. M Dorigo, LM Gambardella. Ant colony system: A cooperative learning approach to the traveling salesman problem. IEEE Transactions on Evolutionary Computation 1997; 1 (1):53–66. SD Shtovba. Ant algorithms: Theory and applications. Programming and Computer Software 2005; 31 (4):167–178.