ANT COLONY OPTIMIZATION PARAMETER SELECTION FOR SHORTEST PATH PROBLEM

The shortest path problem has been studied to be solved through diverse deterministic and also stochastic approaches such as Ant Colony Optimization. One of the most challenging issues with the implication of Ant Colony Optimization to solve the shortest path problem is parameter selection and tuning which is found crucial to improve the computational performance of problem-solving. To tune parameters, it is vital to observe the response of each parameter to different values and study their effect on the final results. In this research, two experiments are designed and conducted to study the behavior of parameters in terms of generated results and computational performance. In the first experiment, evaporation, updating, and transition rule parameters are studied by iterative execution of shortest path generation between nodes considering different parameter values. In the second experiment, the number of initial ants is studied. Inspecting the results, it is observed that to avoid premature stagnation decreasing α value is recommended. On the other hand, ρ is observed to be considered for tuning of speed and number of diffusions of the algorithm. Moreover, it is realized that a high Q value would result in more correct results. Inspecting the initial number of ants, a threshold is realized where increasing the number of ants over this threshold would drastically result in more optimized paths.


INTRODUCTION
The shortest path problem is briefly defined as finding a path between two vertices (or nodes) in a graph such that the sum of the weights of its constituent edges is minimized. The shortest path problem has always been debated as one of the interesting topics in geo-informatics diverse multidisciplinary applications. Many different solutions for this problem have been introduced such as Dijkstra's algorithm (Dijkstra, 1959), Bellman-Ford algorithm (Bellman, 1958), A* search algorithm (Zeng, Church, 2009), Floyd-Warshall algorithm (Floyd, 1962), Johnson's algorithm (Johnson, 1977) to provide the most optimized solutions with minimum computational costs. Along with these deterministic solutions, meta-heuristic algorithms such as Genetic algorithms (Mitchell, 1998) and especially Ant Colony Optimization (ACO) algorithms (Dorigo, 1992) are also utilized to propose a hand in providing innovative solutions for shortest path problem through stochastically defined approaches. These bio-inspired solutions have always been found interesting as they conform to the instruction of the shortest path problem and confront the limitations of its deterministic solutions. Ant Colony Optimization is an explicit practice of turning inspirations from nature into soft computational problem-solving algorithms. The original idea comes from observing the exploitation of food resources among ants, in which ants' individually limited cognitive abilities are collectively able to find the shortest path between the food source and the nest (Engelbrecht, 2007). The natural mechanism for such behavior lies beneath the indirect communication protocol or stigmergy among ants, through laying detectable substance known as a pheromone. As ants tend to take a path with higher pheromone intensity and considering the accumulative and evaporative * Corresponding author property of pheromone, the shortest path between food source and nest is gradually constructed. Artificial ants mimic this phenomenal behavior to find the best solutions for optimization problems by generating the shortest path within a network, drawn to fit the optimization problem requirements within a mathematically defined structure by rules and parameters. Paths with larger pheromone concentrations have a higher probability of being selected by ants. Through the iterative deployment of ants, the optimized path, and as a matter of fact, the optimized solution is selected.
ACO has been useful for providing solutions in many recent fields of interest. Traveling salesman problem (Manfrin et al., 2006), Vehicle routing problem (Barán, Schaerer, 2003), sequential ordering (Gambardella, Dorigo, 2000), set covering (De A Silva, Ramalho, 2001), shortest common super-sequence (Michel, Middendorf, 1999), text mining (Hnadl, Mayer, 2002) and assignment problems (Annaluru et al., 2004) are some of the major topics where ACO solutions are applicable (Engelbrecht, 2007). Moreover, in recent years, ACO has been practiced for Geo-informatics applications. Indoor room optimal spatial allocation is practiced using Multiple ACO (Yang et al., 2017). In other research, a study is conducted on location-allocation modeling of trauma centers. This study analyzed the spatial distribution characteristics of trauma demands and the candidate locations of trauma centers based on spatial analysis and presented a hierarchical location-allocation model for low-and high-level trauma centers in Shenzhen. The response, coverage, treatment, and cost capacities of the trauma center locations were considered, and an ant colony optimization was used to calculate the optimal solution. The objectives of this study were to optimize trauma center locations, improve the allocation of medical trauma resources, and reduce the rate of deaths and disabilities due to trauma (Zhu et al., 2016).
One of the most prominent challenges of ACO is parameter selection and optimization. The ACO results are sensitive to parameter values where irrelevant value assignments would generate inaccurate results and could impose over computation and time consumption. In most cases, parameter values are kept constant through each run of the algorithm (Stützle et al., 2011). In the other policy, the values are meant to change during the process adoptively. To choose any of the mentioned policies, a detailed insight of each parameter's characteristics should be realized. In other words, it is vital to know how a change in one parameter could affect the obtained results. Therefore, in this research to receive comprehensive knowledge about parameters, and how they affect the solution, a study on parameters and configuration on ACO for solving the shortest path problem is conducted. The main reasons for investigating ACO parameters for the shortest path problem could be summarized as followings: To investigate how each parameter individually affects the obtained results.

II.
To define boundaries for each parameter values.

III.
To consciously direct the algorithm in the ambiguous accuracy/cost trade-off situation.
In this paper, reviewing the literature on ACO and its parameters tuning, the designed experiments for parameter behavior study is presented. The experiments are then conducted and the results are tightly inspected and evaluated.

REVIEW ON ACO AND PARAMETER TUNING
The main structure of ACO is composed of a set of agents also known as ants, situated on a graph, consisted of nodes and arcs. In reality, as ants take any random path, a kind of chemical substance, known as Pheromone which is detectable by other ants is laid on the trail. As pheromone accumulates when a path is used by multiple ants and as it evaporates by the time, and as ants tend to choose the path with higher amount of pheromone, the shortest path is selected (Engelbrecht, 2007). According to the extended bridge experiment, it is observed that the selected path is biased towards the shortest path, since ants that follow the shortest path return to the nest earlier than ants on the longer path. The pheromone on the shorter path is therefore reinforced sooner than that on the longer path and eventually a shortest path is selected (Goss et al., 1989).
Artificial ants are entitled to find shortest path in the network of graphs between two specific start and destination nodes through a mathematical imitation of ants' behavior. At first some k ants are initially deployed on the start node and all arcs throughout the environment are assigned with an initial pheromone value. Then ants are randomly or heuristically (considering black list of previously passed arcs) deployed in the network. Each ant chooses next arc considering the pheromone value and other considerable external costs such as length or traffic delay, probabilistically. This process is conducted through transition rules. Reaching the destination node, the pheromone value of the arcs along the path is updated concerning the length of the generated path or any other cost function. To prevent premature convergence, pheromone values on arcs are entitled to evaporate before being reinforced based on the constructed path. Performing the same procedure iteratively all k ants are converged to an identical path which is considered as the optimized shortest path between start and destination points (Engelbrecht, 2007). Figure 1 summarizes entities and procedures of ACO.

ACO components and parameters
Variations and modifications of ACO are numerous. Simple Ant Colony Optimization (SACO) (Dorigo, Di Caro, 1999), Ant Algorithm (Dorigo, 1992), Ant Colony Systems (ACS) (Dorigo, Gambardella, 1997), Elitist Ant System(EAS) (Dorigo, 1992), Ranked based Ant System (RAS) (Bullnheimer et al., 1997), Max-Min Ant System (MMAS) (Stützle, Hoos, 2000) are some of the prominent variants of ACO. But regardless of this diversity, most ACO variants share some basic components which are summarized as followings: 2.1.1 Deployment: Deployment is defined as how ants are propagated and distributed in the network. At the lowest level, a random deployment is applicable as practiced in simple ACO where on the other hand some heuristic approaches define a set of blacklists about nodes and arcs which are previously chosen by the ants, to be avoided during deployment procedure as practiced in Ant System. The implication of loop removal is the other matter of debate.

Transition rule:
It defines the mechanism through which an ant situated on any node, chooses the next arc to tread. Most transition rules consider a probabilistic approach as others ensure some deterministic aspects within the process of choosing the next arc. The relative pheromone amount on feasible arcs is the prominent decision-making item as in some variants like Ant System, the length of each arc is also taken into consideration. Each transition rule has exclusive parameter configuration and different tuning procedure. Equation (1), defines the transition rules utilized in SACO. is the probability of choosing arc ij by ant k and is the set of all feasible nodes to node i and is the pheromone value at arc ij and α is the power.
In equation (2) the transition rules defined in AS are explained, where is the heuristic information which could be simply assigned by the inverse of Euclidian distance. α and β are tuning parameters. There is another version of AS which considers only α value to balance the exploration-exploitation trade-off defined in equation (3).
Where r ∼ U(0,1) and r0 ∈ [0,1] are user-specified parameters; ∈ is a node randomly selected according to the transition rule in equation (5) where β is the tuning parameter.

Pheromone Updating:
The mechanism defines how pheromone values on each link are updated after each iteration. In many cases of ant colony optimization e.g. SACO, after each iteration, all successfully arrived ants to the destination node are considered to update pheromones. In some cases, only the best ant of any iteration is chosen to update pheromone values. Also, some variants choose the overall best of all the iterations for pheromone updating. The amount of pheromone update to each link (i,j) is mostly computed proportionately to the inverse of the constructed path length of the constructed path by and k. ( ) is the length of the path constructed by ant k at time step t. in SACO the pheromone update to each link is computed as equation (7).
On the other hand, computing the amount of pheromone value increase has its variants. In AS, three variants of Ant-Cycle, Ant-Density, and Ant-Quantity is proposed. Ant-cycle considers a Q value proportional to the fitness value of the constructed path. Ant-Density adds a Q value for each link in the constructed path and Ant-Quantity considers the length of each link to compute updating values. As observed, the Q parameter is critically important to be optimally chosen, to optimize the process of shortest path selection (Engelbrecht et al., 2007). Ant-Cycle, Ant-Density, and Ant-Quantity are defined in equations (9), (10), and (11) respectively.

Pheromone Evaporation:
The procedure determines the amount of pheromone to be reduced after every iteration of ant deployment in the process of artificial evaporation. This is mainly performed to decrease the desirability of an arc as it is not selected by ants as a successful constructed path after any iteration. The cardinal function of evaporation is to prevent premature stagnation according to equation (12).
The constant, ρ ∈ [0,1], specifies the rate at which pheromones evaporate, causing ants to "forget" previous decisions. In other words, ρ controls the influence of search history. For large values of ρ, pheromone evaporates rapidly, while small values of ρ result in slower evaporation rates. The more pheromones evaporate, the more random the search becomes, facilitating better exploration. For ρ = 1, the search is completely random (Engelbrecht, 2007).

Convergence:
This element defines when the iterative procedure should stop and consecutively when the final results are obtained. When all deployed ants in the latest iteration construct the same path, it could be concluded that the best path is generated although many other convergence criteria, such as the maximum number of iteration or desirability differences could be practiced.

ACO Parameter Tuning
ACO parameter tuning approaches are roughly divided into offline versus online procedures. Offline tuning supposed to find the appropriate setting of an algorithm before it is deployed mostly done under trial and error fashion and often leads to the uneven tuning of different algorithms (Stützle et al., 2011). Online parameter tuning modifies parameters setting while solving problem instances. Adaptive and self-adaptive parameters setting has been introduced (Eiben et al., 1999). To tune ACO parameters it is vital to know the properties of an optimized solution. Therefore, the following measures should be taken into consideration to evaluate each configuration of solutions. Judgment on different parameter tuning and configuration is ruled by the assessment of the following measures:

Quality of results:
The quality of results basically inspects how successful meta-heuristic optimization is, specifically, in terms of finding the most optimized solution. For the purpose, the fitness function values of each result are compared to one another and to the fitness function of the ground truth (shortest possible path), determined through deterministic approaches. This could be simply expressed by a ratio computed by dividing the length of the constructed path by the length of the ground truth as defined in equation (13). In this study, this ratio is simply labeled as Detour Ratio.
ISPRS Annals of the Photogrammetry, Remote Sensing and Spatial Information Sciences, Volume V-4-2020, 2020 XXIV ISPRS Congress (2020 edition) Figure 1. Ant colony optimization entities and procedures.

Time consumption:
This measure usually expresses the complexity of the algorithm, but in the case of ACO, it also refers to the efficiency of the algorithm in producing results with the minimum iterative deployment of ants. Time consumption is a function of the machine configuration and algorithm efficiency which might jeopardize unbiased evaluation of results in case of ACO investigation and therefore it should be treated cautiously.

The number of diffusions:
This measure is defined as the total number of times ants are appointed to choose the next link based on transition rules. Regardless of the complexity variations in different variations of ACO, this value could be considered as a measure of efficiency.

THE PROPOSED EXPERIMENTS
To observe the behavior of ACO parameters for solving the shortest path problem, some experiments are specifically designed and conducted. The following briefly define the experimented ACO, network dataset, and experiment configuration.

Experimented ACO Variant
In this research, a modified simple Ant Colony Optimization algorithm tuned for finding the shortest path problem is used. This variant of ACO is different from classic SACO in terms of pheromone updating based on the Euclidian distance of the path. Moreover, pheromone update is applied considering iteration best and overall best solutions which are defined in ACS and not considered in classic SACO. The pheromone updating is performed based on the Ant-Density solution. Evaporation procedure is conducted considering a constant ρ value.
Convergence also occurs when all ants deployed in each iteration unanimously construct an identical path.

Network Dataset
For this experiment street network of Gohardasht district in suburbs of the city of Karaj in central Iran, is chosen. Before any experiment, the dataset is preprocessed and changed to be efficiently applicable by the ACO algorithm. More specifically, unnecessary nodes are removed to facilitate the process of deployment (Zarrinpanjeh et al., 2013).

Experiment #1:
In the first experiment, the determination of the best configuration of parameters considering Evaporation factor "ρ", updating parameter "Q" and transition rule parameter "α" is tested. For each parameter, a set of predefined values is considered which are depicted in table 2. The pheromone updating mechanism is also performed considering both the overall best and iteration best solutions. Therefore, a total number of 480 compositions of parameters are defined where the shortest path selection is executed 10 times for each configuration repeatedly. In other words, the shortest path selection is repeated for a specific start-end node for 4800 times. Moreover, some 40 predefined sets of start-end nodes are selected to repeat the experiment.

Experiment #2:
The second experiment is designed to evaluate the effect of the number of initial ants on the process of finding the shortest path. The ACO in the experiment is tuned considering the best configuration resulted in experiment #1. Shortest path selection is executed concerning 10 different amounts of initial ants. The experiment is repeated 10 times for each configuration. Therefore, considering iteration best and overall best strategy shortest path selection is executed for a specific start-end node, 200 times.

IMPLEMENTATION AND RESULTS
Two main clusters of computer applications are designed for the implication of experiments and evaluation of results. The first one is almost a toolbox for ACO, configured to solve the shortest path problem. This toolbox enjoys the capability of performing preprocessing and also blending configuration of different variants of ACO to generate new modifications. Moreover, it is designed to alternatively tune configuration and parameters and generate result files for every run of the algorithm keeping the records of the constructed path in each iteration, final results, time consumption, and algorithm configuration and parameters. The second cluster receives results file, manages rendered information, and produces evaluations and conclusions.

Experiment #1 Results and Discussions
It should be considered that the algorithm is conducted on 40 different start-end nodes. But due to the difference in the problem configuration, the results for different start destination nodes could not be compared to each other there for the results for a long trip is chosen to be evaluated and discussed. Figure 2 shows the mean of all 20 identically the same experiments including both iteration best and overall best variation for some other start end destinations. As it is observable in figure 2, regardless of changes in the start and destination nodes, the results are vividly similar to each other as the length of the constructed path is normalized to the length of the best solution (Detour Ratio). The vertical axis is the number of movements ants make to construct the optimized path (Diffusions).
In figure 3 the results of experiment #1 for the two distant nodes (eastern and western modes) are illustrated. In figure 3(a) each dot represents a run of the algorithm for the path considering the number of Diffusion and Detour Ratio. Eventually, the results of all 4800 configurations practiced in the experiment are shown in figure 3(a). Figure 3(b) shows the mean of all 20 identically the same experiments including both iteration best and overall best variation. Table 4 also states the 20 best configurations sorted concerning Detour Ratio.
Inspecting figure 3(a), four main distinguishable regions are realized. Region A encompasses solutions stuck in premature stagnation. These solutions enjoy low computation cost and suffer from high Detour Ratio. Region B limits the results over computation in terms of high Diffusion and unsatisfying Detour Ratio due to parameter miss assignment. Region C is where most optimized solutions are supposed to occur. Region D is the place where the shortest paths are obtained at the cost of high diffusions.  Table 4. The best 20 result with respect to Detour Ratio.
The individual behavior of each parameter is illustrated in figure  4 where mean, minimum and maximum values of the results for constructed path length (distance) and the number of movements of ants (Diffusion) for each parameter are depicted.
The increase of α eventually increases constructed path length. Considering all three diagrams for mean, max, and min values it is observed that the increase has linearly taken place enjoying a low increase rate. On the other hand, the mean of diffusions decreased in response to the increase of α value. Nevertheless, the maximum diffusion amount shows up to decrease up to one third, increasing α value from 1 to 5. If it is needed to generate an optimized path very fast the increase in alpha is recommended.
Inspecting ρ value, it is observed that the increase of ρ has no major effect on the mean length of the constructed path. Moreover, the maximum number of diffusions decreases to half increasing ρ values from 0.1 to 0.4.it is concluded the increase of ρ has no major effect on the minimum number of diffusions and mean length of the constructed path.
With an increase in Q value the maximum number of diffusions decreases.it is observed that the increase in Q value decreases the possibility of obtaining the shortest path. The individual behavior of each parameter is illustrated in figure  5 from another aspect. According to figure 4(a), It is observed that most premature convergences appear at α=5. Decreasing α could eventually decrease the possibility of premature convergence. In other words, decreasing the value of α could be applied as the first solution to avoid premature stagnation.
Inspecting figure 5(b) it is realized that ρ could not be considered as a decisive parameter as dots with different sizes and intensity appear equally distributed in the diagram. In this case, ρ could be used for micrometric tuning of speed and number of diffusions of the algorithm.
Experiments with lower Q values are likely to end up inside the optimized box in figure 3(a). Therefore, it is recommended to avoid high Q values. It is also observed that an increase in Q does not necessarily decrease the number of diffusions.

Experiment #2: Results and Discussions
Experiment #2 is conducted according to the best solution achieved in experiment #1(based on table 4) and exclusively focused on the initial number of ants. According to figure 6(a), at the record highlighted inside the box, a sudden decrease in the distance is observed. This means that there exists a threshold in the initial ants' number where assigning values beyond this threshold not only would not improve the quality of results but also imposes over computation. On the other hand, inspection Figure 5(b) it is observed that diffusion levels enjoy a linear growth with respect to increasing the Initial number of ants.
It is also realized that increasing the initial number of ants would eventually increase the number of diffusions. If the target is to decrease the number of diffusions by any purpose, decreasing the initial number of ants could be a solution. Initial Number of ants is inspected from another perspective through figure 7. According to figure 7(a), lower values of initial ants construct random results with low diffusion values due to premature stagnation.
Some same results occurred with a different initial number of ants and different diffusions values. This could be interpreted that initial values of 500, 1000, and 2000 are not optimized initial ant number as the results are not improved compared to each other as over computation is imposed. According to figure 7(a), it is also observed that the best results for this specific case with respect to the quality of results and the number of diffusions occur somewhere between 75 to 100 number of ants. This is totally confirmed by the sudden decreased highlighted inside the box in figure 6(a).

CONCLUSIONS
This research is mainly focused on investigating the effect of parameter selection on finding the shortest path via ACO algorithms. Four parameters are tightly inspected through two specifically designed experiments. Two main clusters of applications are designed for the implication of experiments and evaluation of results. Inspecting facts and figures the following items could be summarized ACO is found useful to solve the shortest path problem as it is intrinsically imitating the ant's foraging behavior to find the shortest path and conform to the shortest path problem. At another level according to its swarm agent basics, ACO is implacable in a distributed and decentralized system.
Concerning ACO parameters increasing α would lead to an increase in the length of the constructed path, but it is also useful to speed up the process of convergence. Therefore, to speed up the convergence of ACO, increasing α should be considered as the first solution.
Inspecting ρ values, it is observed that the parameter is not considered as a decisive item compared to α, where modifications in ρ do not impose major changes in the results in terms of quality of results and number of diffusion and therefore it could be used as a tool for micrometric tuning of algorithm especially to speed up the algorithm.
The Q parameter is observed to be a critical factor as the increase of Q value would decrease the possibility of obtaining optimum results. The experiment shows that Q should be set below a specific boundary to achieve acceptable results. Therefore, it should not be considered as a tuning parameter to speed up convergence and lower values of Q are also recommended.
Inspecting the initial number of ants, a threshold is detected while increasing the number of initial ant to values higher than the threshold would drastically improve the obtained results.
Although each particular problem has its threshold, the results show that a boundary of the threshold for each configuration of problems could be considered. It is recommended to investigate to estimate the optimum number of initial ants for various configurations of problem, considering network structure and configurations.