• No results found

Ant Colony Optimization (ACO)

N/A
N/A
Protected

Academic year: 2021

Share "Ant Colony Optimization (ACO)"

Copied!
36
0
0

Loading.... (view fulltext now)

Full text

(1)

Ant Colony Optimization (ACO)

• Exploits foraging behavior of ants

– Path optimization

• Problems mapping onto “foraging” are ACO-like

– TSP, ATSP – QAP

(2)

Travelling Salesman Problem (TSP)

• Why?

– Hard, shortest path problem

– NP hard, in fact (no polynomial time algorithm) – Well studied (can compare results to those

known)

• GA [Freisleben and Merz]

• Iterated Lin-Kernighan etc.

– Easy to explain

(3)

TSP

Connect n points,

visiting points only once such that total path

length is minimized. Path is closed; i.e. start point and end point are same.

It isn’t easy … Symmetric: dij = dji

Asymmetric: dij ≠ dji

(4)

TSP

It’s easy to create non- optimal tours …

(5)

Ant System (AS) for TSP

• Ants build tours by moving on graph

– Add cities one at a time until tour is complete

• Transition from node i to j depends on:

– Whether node visited (ants have a tabu list) – Inverse of distance,

– Pheromone deposits, – Transition rule:

ij

ij = 1/ d

η

τ

ij

[ ] [ ]

[ ] [ ]

=

ik

J l

il il

ij k ij

ij t

p α β

β α

η τ

η ) τ

(

(6)

Transition Equation

is the tabu list

Constants: α, β

α = 0, no cooperation, greedy search β = 0 no preference for shortest edge Note: pijk(t), even though pheromone concentrations same, tabu list may be different

[ ] [ ]

[ ] [ ]

=

ik

J l

il il

ij k ij

ij t

p α β

β α

η τ

η ) τ

k (

J

i

(7)

Pheromone Laying

• When tour complete, pheromone updated:

• Tk(t) tour by kth ant for iteration t

• Q a system parameter, value is relatively unimportant

=

0 ( , ) ( )

) ( )

, ( )

( ) /

( if i j T t

t T

j i if t

L

t Q k

k k

k

τij

(8)

Pheromone Decay

• System performs poorly without pheromone decay:

– Saturates, local optimum found

• Pheromone decay:

) ( )

( ).

1 ( )

( t

ij

t

ij

t

ij

ρ τ τ

τ ←  − + ∆

=

=

m

k

k ij

ij

t t

1

) ( )

( τ

τ

τij(0) small

(9)

Ant Density and Initial Positioning

• Number of ants, m, is constant for run:

– Too many, reinforcement too rapid

– Too few, pheromone decay prevents trail formation

• m = n found to be reasonable

• Initial positioning:

– One per node – Random

(10)

Elitest Ants

• Stolen from Genetic Algorithms (GAs)

– Elitist ant is one which reinforces edges belonging to best tour, T+ with length L+

– Each iteration, e elitist ants are added to other ants so that edges in T+ get extra e.Q/L+

• Improves algorithm … slightly

(11)

Complexity and Results

• Time complexity: O(t.n2.m) = O(t.n3), n=m

– T = # iterations, n = # cities, m = # ants

• Initial results:

– Disappointing, did not match Lin-Kernighan – Better for small TSP (Oliver 30 city)

– Rapid convergence, but only fair for 70 cities

(12)

Alg 2-1 (top)

Edge initialization

Ant initialization

Next Edge Choice

Tour Length Calculation Best tour update

Swarm Intelligence: Bonabeau et al

(13)

Alg 2-1 (bottom)

Ant pheromone updates

kth Ant updates Elitest Ant

updates

Save new edge Pheromone values

Swarm Intelligence: Bonabeau et al

(14)

Performance Results

25.1 459.8

422 SA

1.5 420.6

420 TS

1.3 420.4

420 AS-TSP

Std Dev.

Average Best Tour

Oliver30

best

(15)

Figure 2.12

Rapid Convergence for best tour:

1. Tends to avoid getting trapped in local optima 2. Maintains diversity in solutions as branching factor > 2

Swarm Intelligence: Bonabeau et al

(16)

Improvements

• Another transition rule:

[ ] [ ]

{ }

>

=

0

. 0

) ( max

arg

q q

if J

q q

if

j u Jik iu t iu

η β

τ

[ ] [ ]

[ ] [ ]

=

ik

J

l il il

iJ k iJ

iJ t

t t

p β

β

η τ

η τ

) ( ) ) (

(

q uniformly distributed [0,1], q0 is tunable

where J

J ik ,

(17)

Observations

• If q > q0, same transition as before

• If q ≤ q0, make “greedy” choice

– Uses heuristic knowledge about problem:

distances and pheromone trail

• q0, ~1 choose locally optimal solutions

• q0, ~0 all locally optimal solutions

evaluated Apply Simulated Annealing

to q0

(18)

Figure 2-13

Swarm Intelligence: Bonabeau et al

Maintains diversity –

Standard deviation remains “high”

(19)

Figure 2-14

Swarm Intelligence: Bonabeau et al

Considerable Diversity Remains during run Little initial pheromone,

choose all edges with same probability

(20)

Improved Pheromone Updating

• All ants deposit pheromone on tour completion

• ACS, best ant since beginning of trial updates network

– Encourages ants to search within vicinity of best tour found

– Exploration is more directed, more focussed

• Pheromone updates applied ONLY to edges on best path, (i,j) edges belonging to T+

(21)

Pheromone Updates

• Two forms:

– During creation of tour

– Upon tour completion by all ants

(22)

Pheromone Trail Updates

( 1 ) . ( ) . ( )

)

( t

ij

t

ij

t

ij

ρ τ ρ τ

τ ←  − + ∆

= +

∆ τ ij ( t ) 1 / L

(23)

For Each Ant Transition:

Local Pheromone Updates

( 1 ) . ( ) .

0

)

( ρ τ ρ τ

τ

ij

t ←  −

ij

t +

τ0 = initial value on pheromone trail

Set up to be 1/(n.Lnn), Lnn = length of tour found by nearest neighbor (NN) heuristic

When ant visits an edge, the pheromone concentration

decreases, making them less attractive forcing exploration of not yet visited edges.

Effect of local updating is to “shuffle tours.” Edge desirability changes dynamically as ants visit them.

Run NN demo

(24)

Candidate Lists

• Maintain list of preferred cities to be visited from a given city (size cl), ordered by distance

• Unvisited cities examined first, next city chosen according to:

[ ] [ ]

{ }

>

=

0

. 0

) ( max

arg

q q

if J

q q

if

j u Jik iu t iu

η β

τ

[ ] [ ]

[ ] [ ]

=

ik

J

l il il

iJ k iJ

iJ t

t t

p β

β

η τ

η τ

) ( ) ) (

(

where J

J ik ,

(25)

ACS-TSP

Swarm Intelligence: Bonabeau et al

Edge initialization

Ant initialization

Compute tour length

Tour Length Calculation Next Edge

Choice

Local Update

(26)

Alg 2-2a

Swarm Intelligence: Bonabeau et al

Best tour update

Ant pheromone Updates for

best tour Save new edge Pheromone values

(27)

Results (25 runs)

6.70 6.49

6.33 6.18

50 City (V)

5.87 5.86

5.81 5.74

50 City (IV)

5.83 5.70

5.65 5.58

50 City (III)

6.25 6.03

6.01 6.05

50 City (II)

6.06 5.89

5.88 5.88

50 City (I)

SOM EN

SA ACS-

TSP

best

(28)

Results

N/A N/A

(N/A) N/A

N/A (N/A) 103000

21761 (N/A) 4820

21282 (21285.44) KroA100

(100 cities)

173250 580

(N/A) 325000

542 (549.18) 80000

545 (N/A) 3480

535 (542.37) Eil75

(75 cities)

68512 443

(N/A) 100000

426 (427.86) 25000

428 (N/A) 1830

425 (427.96) Eil50

(50 cities)

SA

#iter SA

best EP

#iter EP

best GA

#iter GA

best ACS-

TSP

#iter ACS-TSP

best

best

(29)

Adding Local Heuristics

• To scale, add local optimization:

– Works in combination with ACS

– For TSP, use 2-opt, 3-opt and Lin-Kernighan

Run 2-opt demo Eliminate 2 edges and

reconnect two resulting paths to generate a different tour

(30)

ACS-3-opt

• Same as ACS, except:

– Each ant tour is minimized upon tour creation

For k = 1 to m do

Tk(t) ← 3-opt(Tk(t)) {apply local opt to each tour}

End For

(31)

ACS-3-opt Results (sTSP)

8807.3 8806

8837.9 8818

rat783 (783 cities)

27693.7 27686

27718.2 27693

att532 (532 cities)

42029 42029

42029 42029

lin318 (318 cities)

15780 15780

15781.7 15780

d198

(198 cities)

STSP (GA) Average STSP (GA)

Best ACS-3-opt

Average ACS-3-opt

Best

best

(32)

ACS-3-opt Results (aTSP)

2766.1 2755

2755 2755

ftv170 (170 cities)

36235.3 36230

36230 36230

kro124p (124 cities)

38683.8 38673

38679.8 38673

ft70

(70 cities)

14440 14422

14422 14422

ry48p (48 cities)

2810 2810

2810 2810

p43

(43 cities)

ATSP Average ATSP

Best ACS-3-opt

Average ACS-3-opt

Best

best

(33)

Other Potential Improvements

• All r best ants to update trail, instead of single ant

– Reduce probability of being trapped in local opt.

• Allow β – pheromone sensitivity -- to vary

• Remove pheromone from edges belonging to worst tours; i.e. those below average

– Increase convergence speed

• Use improved local search

Several potential projects

(34)

Observations

• Pheromone concentrations vary on edges

– Some strongly marked, some weakly – Strong on tour (likely)

– Weak point to alternative solutions

• Diversity of solutions useful in a dynamic environment

– We don’t start from scratch Swarm may be Superior in a

Dynamic environment

(35)

Other methods

• Min-Max AS [Stützle and Hoos]

– Iteration’s best ant updates pheromone trail

– Pheromone concentrations limited to [τminmax] – Trails initialized to τmax

• Bounding concentrations prevents stagnation

• Also,

– Strong trails reinforced less than weak

• Results better than AS, comparable with ACS

(

( )

)

)

(t max ij t

ij

τ τ

τ

∝ −

(36)

Elitest Mechanisms Bullnheimer et al

• Sort m ants according to tour length, Li(t)

• Ants update edges based upon their rank

• Used σ elitest ants:

– best σ – 1 deposit trail

– Weighted according to max {0, σ – µ}

( )

( ). / ( ), if ant uses (i, j), 0 otherwise

) (

, ) ( )

(

) ( /

) (

) ( )

( .

) ( . 1

) (

1

1

µ µ

σ τ

τ τ

τ

τ τ

σ τ

ρ τ

µ µ

σ µ

µ

t L Q t

t t

t L Q t

where

t t

t t

ij

ij r

ij ij

ij ij

ij ij

=

=

=

+

+

 

= + +

+

References

Related documents

State Transition Table #2 Idle Time = 0 RESET Paused Running Time = increment value.

As a result, Gcn4 levels increase, thereby leading to the transcriptional activation of amino acid biosynthetic genes via Gcn4 response elements (GCRE) (TGACTC) in their promoters

Subject matter jurisdiction of tribal, state or federal courts depends largely on (1) whether the defendant is an Indian or non-Indian person or entity 52 and (2) whether the

Table 6: Mean Scores of the Pattern of depreciation of Physical life of a Block of 3-bedroom flat in Lagos Metropolis using S Shape time series versus Estimated percentage,

And this summer, in July, at the Rim of the Pacific exercises, which is the biggest naval exercise in the world, off the coast of Hawaii, we’re going to have a carrier strike

When the data for the stroke clinic group (group b) were unblinded and compared to the sonographer's report, it was noted that there were seven ultrasound reports in the stroke

Our findings indicate that mothers’ income, fathers’ education and the time demands created by preschool children increase fathers’ share of gender-neutral leave as well as their