Sei sulla pagina 1di 37

Ant Systems short Overview.

Ant Algorithms

Gabriel NEGARĂ
ngabi@infoiasi.ro
ngabi@infoiasi.ro

FCS, 2 dec. 2005, IAŞI


ANT Systems: biological motivation
...ANT Systems: biological motivation
...ANT Systems: biological motivation
...ANT Systems: biological motivation

Ants & Humans

- food

- medicine

- etc.

- COMPUTER SCIENCE
Web resources
n Dorigo home page:
http://iridia.ulb.ac.be/~mdorigo/HomePageDorigo/

n ACO home site:


http://www.aco-metaheuristic.org/

n AntColony.org
http://www.antcolony.org/
About ACO
n Ant Colony Optimization (ACO) studies artificial
systems that take inspiration from the behavior of real
ant colonies and which are used to solve discrete
optimization problems.

n In 1999, the Ant Colony Optimization


metaheuristic was defined by Dorigo, Di Caro and
Gambardella

n The first ACO system was introduced by Marco


Dorigo in his Ph.D. thesis (1992), and was called Ant
System (AS).
… about ACO
n First applications: TSP, QAP
n Since 1995 Dorigo, Gambardella and Stützle
have been working on various extended
versions of the AS paradigm .
n Dorigo and Gambardella have proposed Ant
Colony System (ACS), Stützle and Hoos have
proposed MAX-MIN Ant System (MMAS);
both approaches applied to the symmetric and
asymmetric travelling salesman problem
…about ACO
n March 2000 issue of Scientific American or
the recent paper titled "Inspiration for
Optimization from Social Insect Behavior"
appeared on July 6, 2000, in Nature

n The recent book "Ant Colony Optimization"


(Dorigo and Stützle, 2004) gives a full
overview of the many successful applications
of Ant Colony Optimization
CONFERENCES AND WORKSHOPS ON
ANT COLONY OPTIMIZATION
ANTS 2006: Fifth International Workshop on Ant Colony
Optimization and Swarm Intelligence, Brussels, Belgium, 4.-7.
September 2006

ACO/Swarm Intelligence Track at GECCO 2005


Washington D.C., USA, June 25-29, 2005

IEEE 2005: Swarm Intelligence Symposium, The Westin


Pasadena, Pasadena, California, USA, June 8-10, 2005

ANTS 2004: Fourth International Workshop on Ant Colony


Optimization and Swarm Intelligence, Brussels, Belgium, 5.-8.
September 2004
… ACO conferences, workshops
n ANTS 2002 - From Ant Colonies to Artificial Ants: Third International
Workshop on Ant Algorithms, Brussels, Belgium, 11.-14. September 2002

n Special ACO session at MIC-2001 Porto, Portugal, July 16-20, 2001

n ACO special track at GECCO-2001 San Francisco, USA, July 7-11, 2001

n ANTS'2000 - From Ant Colonies to Artificial Ants: Second International


Workshop on Ant Algorithms, Brussels, Belgium, September 8-9, 2000

n Ant Colony Methods Session at 1999 Congress on Evolutionary Computation,


Washington DC, USA, July 6-9, 1999

n ANTS'98 - From Ant Colonies to Artificial Ants: First International


Workshop on Ant Colony Optimization, Brussels, Belgium, October 15-16, 1998

n Ant Colony Optimization Session at INFORMS Tel Aviv 1998


Tel Aviv, Israel, June 28 - July 1, 1998
ACO publications
n ACO META-HEURISTIC AND OVERVIEW PAPERS

n APPLICATIONS TO THE SYMMETRIC AND ASYMMETRIC TSP

n APPLICATIONS TO THE SEQUENTIAL ORDERING PROBLEM

n APPLICATIONS TO THE QUADRATIC ASSIGNMENT PROBLEM

n APPLICATIONS TO THE VEHICLE ROUTING PROBLEM

n APPLICATIONS TO SCHEDULING PROBLEMS

n APPLICATIONS TO THE GRAPH COLOURING PROBLEM

n APPLICATIONS TO PARTITIONING PROBLEMS

n APPLICATIONS TO TELECOMMUNICATIONS NETWORKS

n PARALLEL IMPLEMENTATIONS
ASYMMETRIC TSP

!
8th DIMACS Implementation Challenge:
The Traveling Salesman Problem
SOP
n Definition
The Sequential Ordering Problem (SOP) with precedence
constraints consists of finding a minimum weight Hamiltonian
path on a directed graph with weights on the arcs and on the
nodes, subject to precedence constraints among nodes.
SOP can also be formulated as a general case of the
asymmetric traveling salesman problem (ATSP). In this
representation cij is an arc weight (where cij may be different
from cji) which can either represent the cost of arc (i, j) when
cij>=0, or an ordering constraint when cij=-1
(cij=-1 means that element j must precede, not necessarily
immediately, element i).
QUADRATIC ASSIGNMENT
PROBLEM
n The quadratic assignment problem (QAP) is one of
fundamental combinatorial optimization problems in the
branch of optimization or operations research in mathematics,
from the category of the facilities location problems.

n The problem models the following real-life problem:


There are a set of n facilities and a set of n locations. For each pair of
locations a distance is specified and for each pair of facilities a weight
or flow is specified (e.g., the amount of supplies transported between
the two facilities). The problem is to assign all facilities to different
locations with the goal of minimizing the sum of the distances
multiplied by the corresponding flows.
VEHICLE ROUTING PROBLEM
A ‘practical’ definition (scenario):

A fleet of vehicles supplies customers. Each vehicle


has a certain capacity and each customer has a certain
demand.

There exists a depot(s) and a distance (length, cost,


time) matrix between the customers.

The aim is to find optimal vehicle routes


(minimum distance or/and number of vehicles)
ACO – Ant Colony Optimisation
combinatorial optimization using colonies of agents (ANTS)

- ACO meta-heuristics
- collaborative systems, based on feedback

- ant algorithms
- parallel, adaptable, probabilistic algorithms
ACO Meta-heuristics
Components:

n local components
- ants generation
- ants activity
- pheromone vaporisation

n global components
- daemon actions
Travelling Salesman Problem (TSP)

Ant Cycle Algorithm

Step 1:
- pheromone traces have equal values for every edge
- place ants in graph’s nodes
Step 2:
locate start-up node (city) of every ant on first position in tabu list
Step 3:
repeat, for every ant, until tabu list is full
- move ant from current node to a neighbour node, chosen with probability
depending on trace’s value and on weight of edge between the two nodes -/
- put chosen node in ant’s tabu list
Travelling Salesman Problem (TSP)

Ant Cycle Algorithm

Step 4:
foreach ant
- compute tour length described by the ant
- modify the optimal value found (in case of a better value)
- add pheromone on tour’s edges, depending of his length
Step 5:
- increment number of iterations (NC)
Travelling Salesman Problem (TSP)

Ant Cycle Algorithm

Step 6:
- if (maximum iterations number is not reached) and
(there is no stagnation behaviour)
then
empty tabu lists
go to step 2
else
print best solution found
end algorithm

Complexity: O(NC n3) NC – number of iterations, n – order of graph


Vertex Ant Walk
n VAW – for trees
- DFS similar algorithm
- complexity: O(2n)

n Edges Ant Walk (EAW)


- movement of ants on edges
Vertex Ant Walk
set (σ, τ) pairs to (0,0)
set a starting node for each agent
repeat
n u nod; (σ(.), τ(.)) for u’s neighbourhood
- choose v: u’s neighbour with minumum lexigografic value for
(σ(.), τ(.));
- in case of ambiguity, choose randomly
n σ(u) : = σ(v) + 1;
n τ(u) : = t;
n t : = t +1;
n go to v
until (graph is explored)
Vertex Ant Walk
Vertex Ant Walk

Complexity: O(nd)
n: number of edges
d: graph diameter
Graph coloring problem (GCP)

… is the problem of finding, for a given


graph G, an optimal coloring.

The least possible number k of colors


for which a graph G has a k-coloring
is called the chromatic number of G.

An optimal coloring means a coloring with a


number of colors equal to the cromatic number.
EAC – Experience-based Ant-like Colouring

Description:
Entities:

- ant-system based - agents


- approximate - daemon
- probabilistic
- polinomial
EAC – (new) features
n a NEW type of adiacency matrix, A for graph G = (V, E)

… matrix A holds negative values corresponding to indices


representing pairs of non-adiacent nodes in graph

a) auv=1, if (u,v) is edge in E u, v Є V


b) auv=0, if (u,v) is not an edge in E
or
auv= ph, if (u,v) is not an edge in E, ph < 0, u ≠ v
(at a certain moment in the execution of algorithm…)
EAC - features
n cooperation between agents (pheromone traces)
…materialized by global matrix A
n individual work
…every agent shares his experience to the
global knowledge
n elitism
…as a scenario, only “good” agents modify the global
knowledge
n vaporisation
…implemented via elitism or “decreasing” the global
experience after a number of iterations
EAC – general scheme
begin
· read matrix A
· foreach (iteration)
· foreach (ant a in Ants)
· a color the graph using
an experience based specific algorithm
(using one of the specific coloring algorithms)
· if (a is elitist)
· a modifies the matrix A
· endif
· end foreach
· end foreach
· print the results
end
EAC - Coloring specific methods
1. Experience based greedy coloring

begin
· ant a picks the common, global matrix A
· foreach (vertex i in V ) (i)
· let S1, S2, ..., Sj be the current coloring sets (ii)
· determine feasible coloring sets for i: Si1, Si2, ..., Sik (iii)
· if (there are no feasible sets for i)
· add i to a new set, Sj+1, as first element of the set (iv)
· else
· foreach (set S in Si1, Si2, ..., Sik)
· compute score for S: sum(ait), foreach t in S
· end foreach
· randomly choose S’ from best scored sets (v)
· add i to S’
· endif
· end foreach
end
EAC - Coloring specific methods
2. Experience based dsatur coloring

begin
· ant a picks the common, global matrix A
· while (coloring is not completed) (i)
· choose a non-colored vertex i based on a dsatur criteria (ii)
· let S1, S2, ..., Sj be the current coloring sets
· determine feasible coloring sets for i: Si1, Si2, ..., Sik
· if (there are no feasible sets for i)
· add i to a new set, Sj+1, as first element of the set
· else
· foreach (set S in Si1, Si2, ..., Sik)
· compute score for S: sum(ait), foreach t in S
· endforeach
· randomly choose S’ from best scored sets
· add i to S’
· endif
· end while
end
cEAC – contracting EAC

n another complex, hybrid coloring method, based on EAC

n an experience, ant-system based coloring method

n a method based on successive contractions of the graph

n contractions are performed based on the previous experience

n contractions are performed until the graph becomes a clique

n the number of vertices in the clique represents the

coloring number of cEAC


cEAC – algorithm
begin
· initialize matrix A, for G
· while (G is not a clique)
· foreach (ant a in ants)
· a colors the current graph G,
based on global experience
(using one of the specific coloring algorithms)
· a modify the matrix A
(depending on the coloring number found)
· end foreach
· contract graph G, obtain graph G’
· G = G’
· end while
end
cEAC
a
trivial
example
pcEAC – Parallel cEAC
begin
· initialize matrix A, for G
· while (G is not a clique)
· foreach (ant a in ants)
· a colors the current graph G,
based on global experience

in a separate thread...

· a locks and modify the matrix A


· end foreach
· contract graph G, obtain graph G’
· G = G’
· end while
end

Potrebbero piacerti anche