ant colony optimization with castes - univerzita karlovaai.ms.mff.cuni.cz/~sui/ants.pdf ·...

42
01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001 00100000 01110011 01101011 01110101 01110000 01101001 01101110 01100001 00100000 01101011 01100001 01110100 01100101 01100100 01110010 01111001 00100000 01110000 01101111 01100011 01101001 01110100 01100001 01100011 01110101 00101100 00100000 01000110 01000101 01001100 00100000 01000011 01010110 01010101 01010100 00101100 00100000 01010000 01110010 01100001 01101000 01100001 00000000 Ant Colony Optimization Ant Colony Optimization with Castes with Castes Oleg Kovářík Oleg Kovářík [email protected] [email protected] http://cig.felk.cvut.cz http://cig.felk.cvut.cz Computational Intelligence Group Computational Intelligence Group Department of Computer Science and Engineering Department of Computer Science and Engineering Faculty of Electrical Engineering Faculty of Electrical Engineering Czech Technical University in Prague Czech Technical University in Prague

Upload: others

Post on 02-Aug-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

01001110 0110010101110101 0111001001101111 0110111001101111 0111011001100001 0010000001110011 0110101101110101 0111000001101001 0110111001100001 0010000001101011 0110000101110100 0110010101100100 0111001001111001 0010000001110000 0110111101100011 0110100101110100 0110000101100011 0111010100101100 0010000001000110 0100010101001100 0010000001000011 0101011001010101 0101010000101100 0010000001010000 0111001001100001 0110100001100001 00000000

Ant Colony OptimizationAnt Colony Optimizationwith Casteswith Castes

Oleg Kovářík Oleg Kovářík [email protected]@fel.cvut.cz

http://cig.felk.cvut.czhttp://cig.felk.cvut.cz

Computational Intelligence GroupComputational Intelligence GroupDepartment of Computer Science and EngineeringDepartment of Computer Science and Engineering

Faculty of Electrical EngineeringFaculty of Electrical EngineeringCzech Technical University in PragueCzech Technical University in Prague

Page 2: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

Content

1) Ant Algorithms

2) ACO & Applications

3) ACO with Subsolutions

4) ACO with Castes

5) Continuous ACO

Page 3: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

1) ANT ALGORITHMS

Clustering (ACA, ATTA, ACLUSTER, DataBots, Cellular Ants,...)

Combinatorial Optimization (ACO, MMAS, AS, ...)

Continuous and mixed-variable optimization (ACO*, DACO, AACA, BACA, ...)

Classification Rules Extraction (Ant-Miner)

Feature Extraction

Robotics

Page 4: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

Clustering

Real and simulatedant clustering

Cellular antsColor and shape

negotiations

automatic number of classes, similarity Moere et al. (2006)

http://code.ulb.ac.be

Page 5: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

Combinatorial Optimization

TSP, VRP, Quadratic assignment, Job-shop sheduling, Sequential ordering, Graph coloring, Bin packing, Shortest common subsequence, ...

+ dynamic problems like Network Routing or Network Flows

Bruce G. Marcot

Page 6: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

2) ANT COLONY OPTIMIZATION

Page 7: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

ACO (Dorigo)ACO (Dorigo)

Ant Colony Optimization metaheuristic–parallel stochastic search–probability guided by pheromone–updated by feedback and evaporation

?

Page 8: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

TSPTSP

Travelling Salesman Problem–the shortest closed simple path through given cities–NP-complete

Page 9: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

ACO - path constructionACO - path construction

radnom starting city

Which next?Nearest? Used in best solutions?

Pheromone map

Page 10: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

Max-Min Ant System (MMAS)

Probability of choosing path from city i to city j

Update by best solution & evaporation

pheromone levelmemory

distance-1

heuristic

depends on inclusion in best tour

Page 11: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

Logistics, Circuit Boards

http://www.stevenagecircuits.co.uk

Circuit Boards Drilling (Laser)

Travelling Salesman, Vehicle Routing, ...

http://www.tsp.gatech.edu

Page 12: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

Phylogenetic trees

ACTCGTATCGTGTATGTGCTA ...CACGACAGGTCTTGCTACATT ...GGGCTCGCATACATTACTATA ...

DNASimilarity matrix

Phylogenetic tree

ACO on TSP

Page 13: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

3) ACO WITH SUBSOLUTIONS

Page 14: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

Parallelization on Cell

Cell Broadband Engine

Processor

1 x PPE

8 x SPE

Page 15: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

Step 1: Select Subsets of Cities

solve on separate unitsusing ACO

Page 16: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

Step 2: Solve & Return Pheromone

merge pheromonematrices

Page 17: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

Pheromone Map for 1000 Cities

with one solution:

Page 18: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

Results

Page 19: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

4) ACO WITH CASTES

Page 20: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

Problem with Optimal Parameters

Probability of choosing path from city i to city j

We can search for optimal parameters (problem dependent)

Adapt parametersOR

pheromone level distance-1

Page 21: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

ACO+C: Ant CastesACO+C: Ant Castes

Specialization of ants -> castes

different behaviour (workers, explorers, ...)

several kinds of pheromone (attractive vs. repulsive)

Page 22: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

Example: MMAS+C

Castes with different parameters αl, βl

Probability of choosing city for l-th caste

Different beaviour for each caste

Page 23: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

Data

8 TSP, 3 Assymetric TSP from TSPLIB Real cities, drilling problems:

eil101.tsp

lin105.tsp

pr107.tsp

Page 24: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

MMAS vs. MMAS+C

MMAS MMAS+C (10 castes)

Averages from 30 runs, lower = better:

Page 25: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

Adaptive castes

Dynamic number of ants in castesDepends on number of improvements

Improvement not significant (larger problems?)

caste 1

caste 2

num

ber o

f ant

s

0, 0

max

imaxiteration

Page 26: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

Dynamics

<- strong nearest distance heuristric pheromone based local search ->

iterations

tour

leng

th tour lengths for all ants castes (color = caste)

best solution found

Page 27: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

GA castes design

Genetic algorithm improving "queens"

Improvement not significant Algorithm is robust orResults too close to optimum -> larger problems?

worker explorer

Page 28: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

Demo: Configuration

# castes:#id weight greedyprob beta attractpheromone[] repulsepheromone[] laypheromone[] 0 1.0 0.1 4.0 2.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.05 0.0 0.0 0.0 1 1.0 0.1 10.0 0.0 2.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 2 1.0 0.1 4.0 2.0 2.0 2.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.05 0.05 0.5 0.0 0.0 3 1.0 0.1 1.0 2.0 2.0 2.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.05 0.05 0.5 0.0 0.0 4 1.0 0.0 0.0 2.0 2.0 2.0 2.0 0.0 0.0 0.0 0.0 0.0 0.0 0.05 0.05 0.05 0.0 0.0

# pheromones# id evaporation 0 0.05 1 0.01 2 0.025 3 NN 4 0.8

caste 2 is attracted to the pheromone 1 by exponent 2.0

and lays most substance to the pheromone 2

1

2

2

Page 29: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

Demo: Visualization

3 standard pheromones

static "greedy" pheromone

solutions for all pheromones

(thicker lines = best solution)

... demonstration

Page 30: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

Improvemets

Limited neighborhood

Restarts (pheromone reinitialization)

Hybridization (k-OPT, Lin-Kernighan)

but

random + restarts + LK = are the ants necessary?

experiments needed

Page 31: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

Comparison with other methods

● Reported to perform better than GA and SA on TSP, but results depend strongly on parameters, lot of experiments only on e.g. 3 small datasets ● Comparison with standard methods

– e.g. Concorde (http://www.tsp.gatech.edu/concorde/)– comparison not available– results of Concorde seems to be unreachable– biggest problem: 526280881 celestial objects– found path that is proved to be within 0.796% of the cost of

an optimal tour (using decomposition)

Page 32: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

5) CONTINUOUS ACO

Page 33: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

Direct Application of ACO

DACO (Min Kong, Peng Tian 2006)n variables x

i with normal distribution

N (μi , σi ), i {1, · · · , ∈ n}

Updates by global best solution x:

μ(t) = (1 − ρ) μ (t − 1) + ρxσ(t) = (1 − ρ) σ (t − 1) + ρ|x − μ(t − 1)|

x1

x2

Page 34: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

Extended ACO

ACO* (Socha 2004)

complex pheromone distribution

Gaussian kernel PDF

x1

Page 35: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

Ants & Neural Networks

Ant Colony Optimization for

combinatorial optimization (TSP)...

... can be extended for

continuous optimization...

...can optimize NN weights

(Blum, Socha 2005)

Page 36: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

GAME (Kordík)GAME (Kordík)

Niching Genetic Algorithm

Select:transfer function,parameters,optimization method

for each unit

Page 37: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

GAME

Niching Genetic Algorithm

Page 38: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

GAMEGAME

Page 39: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

Two spirals dataset

Classification2 classes

Page 40: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

Training and testing set

Page 41: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

Results on testing dataset

Page 42: Ant Colony Optimization with Castes - Univerzita Karlovaai.ms.mff.cuni.cz/~sui/ants.pdf · 2009-01-08 · 01001110 01100101 01110101 01110010 01101111 01101110 01101111 01110110 01100001

Seminář z umělé inteligence, Praha 2009

Oleg Kovářík, [email protected], http://cig.felk.cvut.cz

Thank youThank you