ant colony network planning - guc
TRANSCRIPT
NETWORK PLANNINGAnt Colony
1
How to Apply Ant Colony on Bin Packing Problem (BPP)
2
Packing number of items in bins of a fixed (maximum) capacity.
Pack items into as few bins as possible (minimize the number of bins).
Inefficient solution
34
6 7
What is BPP ?
46
37
So if we have items with values 3,4,6,7 and the maximum
capacity of bin is 10
Optimal solution
36
4 7
Ant Colony Algorithm
3
No
Initialize pheromonestrails
Construct Ant Solution
Apply Local Search(optional)
Update Pheromones
Termination Condition?Yes
Finish
Initialize pheromones trails
4
Pheromones are deposited by ants as long as
they move in a route.
The density of these pheromones is proportional
to the number of ants.
BPP
It encodes combination of sizes for these items.
Initialize pheromones
trails
Construct Ant Solution
Apply Local Search
(optional)
Update Pheromones
Termination Condition?
Yes
Finish
No
Construct Ant Solution
5
Choose number of ants for your solution.
Every ant will start with an empty bin
New Items are added to each ant partial
solution.
Allowed items are those who are still small
enough to fit in the bin.
Initialize pheromones
trails
Construct Ant Solution
Apply Local Search
(optional)
Update Pheromones
Termination Condition?
Yes
Finish
No
Apply Local Search (optional)
6
Initialize pheromones
trails
Construct Ant Solution
Apply Local Search
(optional)
Update Pheromones
Termination Condition?
Yes
Finish
No
In every antβs solution, the least full bins are opened
and their contents are made free.
Items in the remaining bins are replaced by larger
free items.
This gives fuller bins with larger items and free the
smaller items to reinsert.
We will proceed until no further improvement is
possible.
Example for local search
7
Update Pheromones
8
Initialize pheromones
trails
Construct Ant Solution
Apply Local Search
(optional)
Update Pheromones
Termination Condition?
Yes
Finish
No
Pheromone trail will evaporate with a small amount after
each iteration.
The left part makes the pheromone on all edges decay.
The speed of this decay is defined by π, the evaporation
parameter.
The right part increases the pheromone on all the edges
visited by ants. The amount of pheromone m ants deposit
on an edge. In this way, the increase of pheromone for an
edge depends on the number of ants that use this edge,
and on the quality of the solutions found by those ants.
m indicates how many times i and j go together in the
best solution
Ο π, π = ππ π, π + ππ(π πππ π‘)
Termination Condition
9
Initialize pheromones
trails
Construct Ant Solution
Apply Local Search
(optional)
Update Pheromones
Termination Condition?
Yes
Finish
No
Examples of termination Conditions:
Reaching specific number of iterations.
The optimization solution doesnβt change for
specific number of iterations.
Example
10
The items that we have: 3 1 2 4 6 3 3 5 2 4 5 2 3 7
Capacity of each bin = 10
Start with 2 ants
ππ,π π‘ βΆ π‘ππ‘ππ πβπππππππ πππππ ππ‘ ππ ππππππππ‘πππ
πππ‘π€πππ ππ‘πππ π πππ π at a given time t
ππ,ππ
π‘ βΆ πβπππππππ πππππ ππ‘ ππ¦ πππ‘ π ππ ππππππππ‘πππ
πππ‘π€πππ ππ‘πππ π πππ π at a given time tππ: ππππ’ππ‘ ππ πβπππππππ πππππ ππ‘ ππ¦ πππ‘ π = 3
Example (construct antsβ solutions)
11
Items: 3 1 2 4 6 3 3 5 2 4 5 2 3 7
Ant 1 Ant 2
4213
36
253
54
32
737
52
24
35
63
3124
We will assume that ant 1 will start filling the bins with items from left hand side and ant 2 from right hand side.
Example (update pheromones)
12
Number of bins used by ant 1 is 6
Number of bins used by ant 2 is 6
ππ = 3
So pheromone update value for ant 1 will be 0.2 andpheromone update value for ant 2 will be 0.2
Ant 1 Ant 2
4213
36
253
54
32
737
52
24
35
63
3124
0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2
Example (update pheromones)
13
4213
0.4
36
0.4
253
0.2
54
0.2
32
0.2
7
0.2
37
0.2
52
24
35
0.2 0.2 0.2
Ant 1 Ant 2
4213
36
253
54
32
737
52
24
35
63
3124
0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2
Example (Local Search)
14
Ant 1
4213
36
253
54
32
7
10 9 10 9 5 7
4213
36
253
54
10 9 10 9
3 2 7
4213
37
253
54
10 10 10 9
3 2 6
Example (Local Search)
15
4213
37
253
532
10 10 10 10
4 6
4213
37
253
532
10 10 10 10
46
10
Example (Local Search)
16
Ant 2
37
52
24
35
63
3124
10 7 6 8 9 10
37
35
63
3124
10 8 9 10
5 2 2 437
55
63
3124
10 10 9 10
3 2 2 4
Example (Local Search)
17
37
55
64
3124
10 10 10 10
3 3 2 2
37
55
64
3124
3322
10 10 10 10 10
THANK YOU
18