Ant Colony Optimization: an overview Vittorio Maniezzo University of Bologna, Italy Metaheuristics Metaheuristics include: • Simulated Annealing • Tabu Search • GRASP • Genetic Algorithms • Variable Neighborhood Search • … • ACO Vittorio Maniezzo - University of Bologna 2/52 Ant System Ant System (AS) was the first ACO algorithm presented [CDM91]. The idea it was to modify a constructive heuristic so that the ordering of the components could be recalculated at each iteration taking into account • the a priori expectation, ηi, of the usefulness of a particular component ci as in standard constructive approaches, • but also an a posteriori measure, τi, of the goodness of solutions constructed using that particular component. Vittorio Maniezzo - University of Bologna 3/52 Ant System • general purpose heuristic inspired by nature; • parallel distributed search effort; • combines a problem-specific constructive heuristic (visibility) and a general-purpose adaptive problem representation Vittorio Maniezzo - University of Bologna 4/52 ACO Ant Colony Optimization is the name given by M.Dorigo [D98] to a class of algorithms whose first member was AS. The main underlying idea is that of parallelizing search over several constructive computational threads, all based on a dynamic memory structure with information on the effectiveness of previously obtained results and in which the behavior of each single agent is inspired by the behavior of real ants. Web page: http://iridia.ulb.ac.be/~mdorigo/ACO/ACO.html Vittorio Maniezzo - University of Bologna 5/52 The biological metaphor E H E E D D Obstacle H C B A A t=0 E d=1 D d=0.5 H C 15 ants B A Vittorio Maniezzo - University of Bologna C B E 30 ants D 15 ants A t=1 E 30 ants D 10 ants τ=15 H C d=0.5 d=1 Obstacle H C τ=15 15 ants B 15 ants 10 ants τ=30 B 30 ants A 20 ants τ=30 20 ants 30 ants A 6/52 Ant agents An ant is defined to be a simple computational agent, which iteratively constructs a solution for the problem to solve. Partial problem solutions are seen as states; each ant moves from a state ι to another one ψ, corresponding to a more complete partial solution. At each step σ, each ant k computes a set of feasible expansions to its current state, and moves to one of these in probability, according to a probability distribution specified as follows. Vittorio Maniezzo - University of Bologna 7/52 Probability of a move The formula for defining the probability distribution at each move makes use of a set tabuk which indicates a set of infeasible moves for ant k. Probabilities are computed as follows: α ⋅ τιψ + (1 − α ) ⋅ ηιψ if (ιψ ) ∉ tabu k ∑ (α ⋅ τιν + (1 − α ) ⋅ ηιν ) k p ιψ = (ιν )∉tabu k 0 otherwise Parameter α defines the relative importance of trail with respect to attractiveness. Vittorio Maniezzo - University of Bologna 8/52 Trail update Trails are updated at each iteration, increasing the level of those related to moves that were part of "good" solutions, while decreasing all others. After each iteration t of the algorithm, trails are updated using the following formula. τ ιψ (t ) = ρτιψ (t − 1) + ∆τ ιψ where ρ is a user-defined coefficient and ∆τιψ represents the sum of the contributions of all ants that used move (ιψ) to construct their solution. Vittorio Maniezzo - University of Bologna 9/52 Attractiveness and trail For ant k, the probability pιψ of moving from state ι to state ψ depends on the combination of two values: • the attractiveness η of the move, as computed by some heuristic indicating the a priori desirability of that move; • the trail level τ of the move, indicating how proficient it has been in the past to make that particular move, the a posteriori the desirability of that move. Vittorio Maniezzo - University of Bologna 10/52 CCA0 example 10 7 9 8 3 2 4 6 10 7 1 9 5 8 3 2 4 6 1 5 Vittorio Maniezzo - University of Bologna 11/52 ACO pseudo code 1 (Initialization) Initialize τιψ, ∀ι,ψ 2 (Construction) For each ant k do repeat compute ηιψ ∀ι,ψ choose in probability the state to move into append the chosen move to the k-th ant’s set tabuk until ant k has completed its solution [apply a local optimization procedure] enddo 3. (Trail update) For each ant move (ι,ψ) do compute ∆τιψ and update the trail values 4. (Terminating condition) If not(end_condition) go to step 2. Vittorio Maniezzo - University of Bologna 12/52 Ant System 1. Initialize a set A of partial solutions ai=∅, i=1, … , m. 2. For i=1 to m choose a component cj to append to solution ai with probability given as a function of ai, ηj, τj. 3. If the solutions in A are not complete, go to step 2. 4. Evaluate z(ai), i=1, … , m and update τj, j=1, … , n accordingly. 5. If not (end condition) go to step 1. Vittorio Maniezzo - University of Bologna 13/52 ANTS conferences The ACO has been specified in different ways by different authors. This variety was represented in the ANTS series of international workshops (ANTS'98, ANTS‘2000 and ANTS'2002), conferences entirely devoted to algorithms inspired by the observation of ants behavior. Many applications: from plan merging to routing problems, from driver scheduling to search space sharing, from set covering to nurse scheduling, from graph coloring to dynamic multiple criteria balancing problems, etc. Vittorio Maniezzo - University of Bologna 14/52 ACO approaches ABC ACS Bonabeau et al. [B98], van der Put, Rothkrantz [vdPR98] network routing Dorigo, Ganbardella [DG97] TSP, VRP AntNet Di Caro, Dorigo [DCD97], [DCD98] ANTS Maniezzo [M98] , Maniezzo, Carbonaro [MC99] AS Colorni, Dorigo, Maniezzo [CDM91], [D92], [CDMT94], [DMC96] ASrank Bullnheimer, Hartl, Strauss [BHS97] network routing HAS Gambardella, Taillard, Dorigo [GTD99] QAP, VRP, SOP MMAS Stuetzle, Hoos [SH98,SD99] TSP, QAP QAP, FAP TSP, QAP, JSP TSP, VRP AS-SCS Michel, Middendorf [MM98] Costa, Hertz [CH97] SCS - Merkle, Middendorf, Schmeck [MM00,MMS00] Scheduling Problems - Gambardella, Dorigo [GD00] SOP - Kawamura et al. [KYSO00] TSP Vittorio Maniezzo - University of Bologna GCP 15/52 Max-min ant system Stuetzle and Hoos [SH97] introduced Max-Min Ant System (MMAS), a modification of AS. They use two parameters, a maximum and minimum trail levels, in order to restrict possible trail values to the interval [τmin, τmax]. Moreover, MMAS controls the trail levels (initialized to their maximum value τmax, only allowing the best ant at each iteration to update trails. Trails that receive very rare reinforcements will lower their strength and will be selected more and more rarely by the ants, until they reach the τmin value. Vittorio Maniezzo - University of Bologna 16/52 AS-rank Bullnheimer, Hartl and Strauss [BHS97] proposed yet another modification of AS, called AS-rank, introducing a rank-based version of the probability distribution to limit the danger of over-emphasized trails caused by many ants using sub-optimal solutions. At each iteration the ants are sorted by solution quality and the contribution of an ant to the trail level update is weighted according to the rank of the ant, considering only the Ω best ants. Vittorio Maniezzo - University of Bologna 17/52 Ant Colony System Gambardella and Dorigo [GD95, 97] proposed ACS, where trails are updated with (constant) values which predict the quality of solution using the relative edges. Trail values are added offline only to the arcs belonging to the best tour so far, while ants perform online step-by-step trail updates to favor the emergence of other solutions. Each ant uses a pseudo-random proportional rule to choose the next node to move to based on a q0 ∈ [0,1] parameter that modulates the exploration inclinacy. ACS also uses a data structure associated to vertices called candidate list, as in GRASP. Vittorio Maniezzo - University of Bologna 18/52 ANTS 1 (Initialization) Compute a (linear) lower bound LB to the problem to solve Initialize τιψ, ∀ι,ψ with the primal variable values 2 (Construction) For each ant k do repeat compute ηιψ ∀ι,ψ, as a lower bound to the cost of completing a solution containing ι,ψ choose in probability the state to move into append the chosen move to the k-th ant’s set tabuk until ant k has completed its solution apply a local optimization procedure enddo 3. (Trail update) For each ant move (ι,ψ) do compute ∆τιψ and update the trail values 4. (Terminating condition) If not(end_test) go to step 2. Vittorio Maniezzo - University of Bologna 19/52 Convergence W.Gutjahr [W00] proposed a convergence proof for AS. For a restricted version of AS and using suitable parameter values (many ants or little evaporation), the propobability of AS achieving an optimal solution can be made arbitrarily close to 1. Vittorio Maniezzo - University of Bologna 20/52 Current applications … Applications are listed by class of problems and in chronological order (from Dorigo, Gambardella, 2003). Problem name Traveling salesman Authors Dorigo, Maniezzo, Colorni Gambardella, Dorigo Dorigo, Gambardella Stuetzle, Hoos Bullnheimer, Hartl, Strauss Cordòn, et al. Quadratic assignment Maniezzo, Colorni, Dorigo Gambardella, Taillard, Dorigo Stuetzle, Hoos Maniezzo Maniezzo, Colorni Scheduling problems Colorni, Dorigo, Maniezzo Stuetzle Bauer et al. den Besten, Stuetzle, Dorigo Merkle, Middendorf, Schmeck Vittorio Maniezzo - University of Bologna Algorithm name Year AS 1991 Ant-Q 1995 ACS, ACS-3-opt 1996 MMAS 1997 ASrank 1997 BWAS 2000 AS-QAP 1994 HAS-QAP 1997 MMAS-QAP 1997 ANTS 1998 AS-QAP 1999 AS-JSP 1994 AS-FSP 1997 ACS-SMTTP 1999 ACS-SMTWTP 1999 ACO-RCPS 2000 21/52 Current applications (cont.) Problem name Vehicle routing Authors Algorithm name Bullnheimer, Hartl, Strauss AS-VRP Gambardella, Taillard, Agazzi HAS-VRP Connection-oriented Schoonderwoerd et al. ABC network routing White, Pagurek, Oppacher ASGA Di Caro, Dorigo AntNet-FS Bonabeau et al. ABC-smart ants Connection-less Di Caro, Dorigo AntNet, AntNet-FA network routing Subramanian, Druschel, Chen Regular ants Heusse et al. CAF van der Put, Rothkrantz ABC-backward Sequential ordering Gambardella, Dorigo HAS-SOP Graph coloring Costa, Hertz ANTCOL Shortest common supersequence Michel, Middendorf AS-SCS Frequency assignment Maniezzo, Carbonaro ANTS-FAP Generalized assignment Ramalhinho Lourenco, Serra MMAS-GAP Multiple knapsack Leguizamòn, Michalewicz AS-MKP Optical networks routing Navarro Varela, Sinclair ACO-VWP Redundancy allocation Liang, Smith ACO-RAP Constraint satisf. Solnon Ant-P-solver Vittorio Maniezzo - University of Bologna Year 1997 1999 1996 1998 1998 1998 1997 1997 1998 1998 1997 1997 1998 1998 1998 1999 1999 1999 2000 22/52 Reality bites Real-world ACO applications An ACO-based company! Vittorio Maniezzo - University of Bologna 24/52 Car pooling Vittorio Maniezzo - University of Bologna 25/52 Stochastic VRP Vittorio Maniezzo - University of Bologna 26/52 Urban solid waste collection Vittorio Maniezzo - University of Bologna 27/52 Civil protection Vittorio Maniezzo - University of Bologna 28/52 Traffic flow optimization Vittorio Maniezzo - University of Bologna 29/52