Presentation is loading. Please wait.

Presentation is loading. Please wait.

When Ants Attack! Ant Algorithms for Subset Selection Problems Derek BridgeFinbarr TarrantChristine Solnon University College CorkUniversity of Lyon.

Similar presentations


Presentation on theme: "When Ants Attack! Ant Algorithms for Subset Selection Problems Derek BridgeFinbarr TarrantChristine Solnon University College CorkUniversity of Lyon."— Presentation transcript:

1 When Ants Attack! Ant Algorithms for Subset Selection Problems Derek BridgeFinbarr TarrantChristine Solnon University College CorkUniversity of Lyon

2 Overview Ant Algorithms for Best Hamiltonian Path-Finding Problems Subset Selection Problems Definitions and examples Ant-SS, an Ant Algorithm for Subset Selection Problems Solution construction step Pheromone updating step Parameters Experimental Results Conclusions

3 Ant Algorithms Find solutions or near-solutions to intractable discrete optimization problems Inspired by the behaviour of real ants Ants communicate indirectly by laying trails of pheromone “stigmergy” Enables the ants to find shortest paths between nest and food

4 Ant Algorithms Problem is modelled as a search for a minimum cost path in a graph Artificial ants complete a series of walks of the graph Each path corresponds to a potential solution They deposit pheromone on their path in proportion to its quality Unlike real ants, typically the pheromone is deposited on completion of the path only the best paths receive pheromone (“elitism”)

5 Ant Algorithms The ants choose between destinations probabilistically based on a combination of the cumulated pheromone τ, and an heuristic factor η A B C Τ η

6 Ant Algorithms The pheromone intensifies search around the most promising paths But to avoid stagnation, we need techniques to diversify search, e.g: raise the importance of the heuristic factor evaporate some pheromone impose lower and upper bounds on the pheromone (MAX-MIN Ant Systems)

7 Travelling salesperson problem Find the minimum length route that: starts in, e.g., Cork; visits each town exactly once; returns to Cork.

8 And now the bad news... Num of towns, n Num of routes, (n – 1)! ÷ 2 Time to find shortest route 28 21 A 19-digit number 52 mins 3 billion (10-digit number) 360 microsecs360 14 7 Nearly 40,000 years A 28-digit number 2 trillion centuries

9 Demo

10 Best Hamiltonian Path-Finding Problems Ant algorithms have been used for Travelling salesperson problems Quadratic assignment problems Vehicle routing problems Permutation constraint satisfaction problems Characteristics ants must visit every vertex in the graph heuristic factor is often inverse of edge cost

11 Subset Selection Problems Intuition: Given a set S, find a subset S’  S that satisfies certain properties and/or optimizes some objective function Example: the multidimensional 0-1 knapsack problem Choose which objects to put into the knapsack but total weight < 15kg (and perhaps other properties) and maximise monetary value

12 Subset Selection Problems An SS problem may be defined by a triple (S, S feasible, f) where S is a set of objects; S feasible   (S) is a set that contains all feasible subsets of S; f : S feasible   is an objective function that associates a real-valued cost f(S’) with every feasible subset of objects S’  S feasible. The goal of an SS problem (S, S feasible, f) is to find S*  S such that S*  S feasible and f(S*) is maximal.

13 Multidimensional knapsack as a SS Problem S is the set of objects; S feasible contains every subset that satisfies all the resource constraints, i.e. S feasible = {S’  S |  i  1..m,  j  S’, r ij < b i } where m is the number of resources, r ij is the consumption of resource i by object j, and b i is the available quantity of resource i; f returns the total profit, i.e.,  S’  Sfeasible, f(S’) =  j  S’ p j where p j is the profit associated with object j.

14 Other SS Problems Maximum Clique Maximum Boolean Satisfiability Maximum Constraint Satisfaction Minimum Vertex Cover Graph Matching Edge-Weighted k-Cardinality Tree

15 Ant-SS Initialise pheromone repeat for each ant k, construct a solution S k as follows: Randomly choose a first object o i  S S k  {o i } Candidates  {o j  S \ o i | S k  {o j }  S feasible } while Candidates    Choose an object o i  Candidates with probability p(o i, S k ) based on τ(o i, S k ) and η(o i, S k )  S k  S k  {o i }  Remove o i from Candidates  Remove from Candidates every object o j such that S k  {o j }  S feasible end while end for Optionally, apply local search Update the pheromone until maximum number of cycles reached or acceptable solution found S feasibe must be defined in such a way that feasible subsets can be constructed incrementally

16 Pheromone update In SS Problems, the order in which objects are selected is not significant hence rewarding consecutively visited vertices (by placing pheromone on visited edges) is not meaningful Vertex pheromone strategy reward solution S k by associating pheromone with each object o i  S k Clique pheromone strategy reward solution S k by associating pheromone with each pair of different objects (o i, o j )  S k  S k

17 Vertex Pheromone Strategy Pheromone is laid on objects represents the learned desirability of selecting that object 1 2 3 4 5 1 2 3 4 5 The ant’s walkWhere pheromone is laid

18 How does this affect candidate selection? Initialise pheromone repeat for each ant k, construct a solution S k as follows: Randomly choose a first object o i  S S k  {o i } Candidates  {o j  S | S k  {o j }  S feasible } while Candidates    Choose an object o i  Candidates with probability p(o i, S k ) based on τ(o i, S k ) and η(o i, S k )  S k  S k  {o i }  Remove o i from Candidates  Remove from Candidates every object o j such that S k  {o j }  S feasible end while end for Optionally, apply local search Update the pheromone until maximum number of cycles reached or acceptable solution found

19 Vertex Pheromone Strategy: how it affects candidate selection 1 2 3 4 5 1 2 3 4 5 Suppose the ant has selected objects 1, 2 and 4. The probability of selecting object 5 is based on the pheromone on object 5; the heuristic value of object 5 Τ5Τ5 η5η5

20 Clique Pheromone Strategy Pheromone is laid on pairs of objects represents the learned desirability of selecting one object given that another has been selected 1 2 3 4 5 1 2 3 4 5 The ant’s walkWhere pheromone is laid

21 Clique Pheromone Strategy: how it affects candidate selection 1 2 3 4 5 1 2 3 4 5 Suppose the ant has selected objects 1, 2 and 4. The probability of selecting object 5 is based on the pheromone between objects 1 & 5, 2 & 5, and 4 & 5; the heuristic value of object 5 Τ 5 = Τ(1,5) + Τ(2, 5) + Τ(4, 5) η5η5

22 Comparison Vertex Pheromone Strategy evaporation: O( |S| ) reward of subset S k : O( |S k | ) Clique Pheromone Strategy evaporation: O( |S| 2 ) reward of subset S k : O( |S k | 2 )

23 Experiments τ min = 0.01; τ max = problem-dependent Evaporation rate, ρ = 0.01 Number of ants = 30 Pheromone factor weight = 1 Heuristic factor = problem-dependent Heuristic factor weight = problem-dependent Pheromone update strategy: tried both Local search: tried without/with

24 Maximum Clique Problem τ max = 6 Heuristic factor, η = 1 (in effect, none) Heuristic factor weight = 0 Results averaged over 50 runs

25 Solution Quality Results Without local searchWith local search Graphω(G)VertexCliqueVertexClique C125.9 3434.0 C250.9 4443.944.0 C500.9  57 55.255.655.355.9 C1000.9  68 65.366.065.766.2 C2000.9  78 73.474.174.574.3 All variants find optimal solutions to ‘easy’ instances On harder instances, Clique outperforms Vertex Incorporating local search improves solution quality

26 Solution Time Results Without local searchWith local search VertexCliqueVertexClique Cycles Time (secs) Cycles Time (secs) Cycles Time (secs) Cycles Time (secs) C125.9600.11260.2140.0230.0 C250.93590.84731.71720.52391.0 C500.97223.89238.94774.66718.6 C1000.9121913.2235955.083223.4124249.8 C2000.9177041.33268214.41427112.42067238.7 Vertex needs fewer cycles than Clique Hence, and because it is cheaper, Vertex converges in less time than Clique Local search reduces Cycles but not always Time

27 Convergence (C500.9)

28 Comparisons with other algorithms In other experiments on maximum clique problems (Solnon), Ant-SS outperforms a genetic algorithm is comparable to an adaptive greedy search is slightly outperformed by a tabu search

29 Constraint Satisfaction Problems τ max = 4 Heuristic factor η is select variable based on smallest-domain heuristic factor of variable’s value is inversely proportional to the number of additional constraints that would be violated Heuristic factor weight = 10 Results averaged over 100 runs

30 Solution Quality Results Without local searchWith local search ptpt κVertexCliqueVertexClique 0.20 0.74100% 0.23 0.8745%93%91%100% 0.26 1.0089%97%99%100% 0.29 1.14100% All variants find solutions to ‘easy’ instances On harder instances, Clique outperforms Vertex Incorporating local search improves solution quality All instances are solvable. We show % of runs that succeeded in finding a solution

31 Solution Time Results Without local searchWith local search VertexCliqueVertexClique Cycles Time (secs) Cycles Time (secs) Cycles Time (secs) Cycles Time (secs) 0.20901.2634.820.02 0.23108419.584978.247230.823031.6 0.26101918.173766.136526.926038.7 0.294497.851645.2271.8385.4 Clique needs fewer cycles than Vertex!!! But, because it is cheaper, Vertex converges in less time than Clique Local search reduces Cycles but not always Time

32 Comparisons with other algorithms In other experiments on constraint satisfaction problems (Solnon), Ant-SS outperforms a genetic algorithm because Clique nearly always finds a solution even on harder instances, but the genetic algorithm does not is slower than a complete search on smaller instances but much faster on larger instances

33 Conclusions We defined Subset Selection Problems We have defined the Ant-SS algorithm with two pheromone strategies, Vertex and Clique We have evaluated on a number of problem instances good performance relative to other algorithms Clique typically finds better quality solutions but Vertex generally requires less CPU time


Download ppt "When Ants Attack! Ant Algorithms for Subset Selection Problems Derek BridgeFinbarr TarrantChristine Solnon University College CorkUniversity of Lyon."

Similar presentations


Ads by Google