Professional Documents
Culture Documents
Pheromone Trails
A B
D
Pheromone C
D
Pheromone C
D
Pheromone C
D
Pheromone C
D
Pheromone C
D
Pheromone C
D
Pheromone C
A B
D
Pheromone C
D
Pheromone C
Models Authors
capacitated MST Kershenbaum (1974)
degree-constrained MST Narula and Ho (1980)
stochastic MST Ishii et al. (1981)
quadratic MST Xu (1984)
probabilistic MST Bertsimas (1990)
multi-criteria MST Zhou and Gen (1996)
leaf-constrained MST Fernandes et al. (1998)
Parameters
n: the total number of nodes in the network
V: the finite set of nodes (vertices) representing terminals
S : the subset of nodes
wij : the weight of connecting node i to node j, i.e., the weight of
link (i,j); the weight matrix (wij) is symmetric.
Decision Variables
xij : the 0,1 decision variable; 1, if link (i,j) is selected, and 0, otherwise.
n 1 n
min f ( x ) wij xij 1
w12=2 ,x12=1
2
i 1 j i 1 w18=3 ,x18=1
n 1 n 8 w23=4 ,x23=1
s. t.
i 1 j i 1
xij n 1 : connectivity
6
w67=5 ,x67=1
w78=1 ,x78=1
w79=4 ,x79=1
3
7 9
n 1 n
x
w49=8 ,x49=1
| S | 1, S V \{1},| S | 2 : no loop
w56=6 ,x56=1
ij
iS jS 5 4
j 1
Fig. 3.2 Simple MST Model
xij 0 or 1, i , j 1, 2, ..., n
2 2 2
1 2 1 2 1 2
6 6 3 6
3 3
5 5 5 8 4
8 4 8 4
1 1 1 3
3 3
7 7 6 7 4 2 3
6 4 2 3 6 4 2 3 7 9
7 9 7 9
2 2 2
2 2 6 2 8
6 8 6 8
1 1 1
5 4 5 4 5 4
{(1, 2), (1, 6), (1, 8), (2, 3), (2, 8), (3, 4),
{2, 7, 3, 4, 6, 2, 2, 1, 8, 6,
1 (3, 9), (4, 5), (4, 9), (5, 6), (5, 7), (6, 7), 0 (4, 5) {(4, 5)} 1
2, 5, 1, 4, 3}
(7, 8), (7, 9), (8, 9)}
{(1, 2), (1, 6), (1, 8), (2, 3), (2, 8), (3, 4),
{2, 7, 3, 4, 6, 2, 2, 8, 6, 2,
2 (3, 9), (4, 9), (5, 6), (5, 7), (6, 7), (7, 8), 1 (7, 8) {(4, 5), (7, 8)} 2
5, 1, 4, 3}
(7, 9), (8, 9)}
{(1, 2), (1, 6), (1, 8), (2, 3), (2, 8), (3, 4),
{2, 7, 3, 4, 6, 2, 2, 8, 6, 2,
3 (3, 9), (4, 9), (5, 6), (5, 7), (6, 7), (7, 9), 2 (1, 2) {(4, 5), (7, 8), (1, 2)} 4
5, 4, 3}
(8, 9)}
{(1, 6), (1, 8), (2, 3), (2, 8), (3, 4), (3, 9), {7, 3, 4, 6, 2, 2, 8, 6, 2, 5,
4 3 (3, 4) {(4, 5), (7, 8), (1, 2), (3, 4)} 6
(4, 9), (5, 6), (5, 7), (6, 7), (7, 9), (8, 9)} 4, 3}
{(1, 6), (1, 8), (2, 3), (2, 8), (3, 9), (4, 9), {7, 3, 4, 6, 2, 8, 6, 2, 5, 4, {(4, 5), (7, 8), (1, 2), (3, 4),
5 4 (3, 9) 8
(5, 6), (5, 7), (6, 7), (7, 9), (8, 9)} 3} (3, 9)}
{(1, 6), (1, 8), (2, 3), (2, 8), (4, 9), (5, 6), {(4, 5), (7, 8), (1, 2), (3, 4),
6 {7, 3, 4, 6, 8, 6, 2, 5, 4, 3} 5 (5, 7) 10
(5, 7), (6, 7), (7, 9), (8, 9)} (3, 9), (5, 7)}
{(1, 6), (1, 8), (2, 3), (2, 8), (4, 9), (5, 6), {(4, 5), (7, 8), (1, 2), (3, 4),
7 {7, 3, 4, 6, 8, 6, 5, 4, 3} 6 (1, 8) 13
(6, 7), (7, 9), (8, 9)} (3, 9), (5, 7), (1, 8)}
{(1, 6), (2, 3), (2, 8), (4, 9), (5, 6), (6, 7), {(4, 5), (7, 8), (1, 2), (3, 4),
8 {5, 4, 6, 8, 6, 7, 4, 3} 7 (1, 6) 18
(7, 9), (8, 9)} (3, 9), (5, 7), (1, 8), (1, 6)}
25 WASEDA UNIVERSITY , IPS Soft Computing Lab.
3. Minimum Spanning Tree Problem
Prims Algorithm
Prim, R. C.: Shortest connection networks and some generalizations, Bell Systems
Technology Journal, vol.36, pp. 1389-1401, 1957.
Thomas, H., E. Charles and L. Rivest: Introduction to Algorithms, The MIT Press, 1996.
Horowitz, E., A. Sahni and S. Rajasekaran: Computer Algorithms/C++, Computer
Science Press, 1997.
Drozdek, A.: Data Structures and Algorithms, Brooks/Cole, 2000
procedure 2: Prims Algorithm
input: graph G=(V, E), weight wij , (i, j) A
output: spanning tree T
begin
T;
choose a random starting node sV;
CC{s}; // C: set of connected nodes
AA{(s, v), v V}; // A: eligible edges
while CV do
choose an edge (u, v)argmin{wij | (i,j)A};
AA-{(u, v)};
If v C then // connect v to the partial tree
TT{(u, v)};
CC{v};
AA{(v, w)| (v, w)wC };
end
end
output spanning tree T;
26 end WASEDA UNIVERSITY , IPS Soft Computing Lab.
3. Minimum Spanning Tree Problem
Example of Prims Algorithm
2
2 1 2
1 2 3 6
2 3 6 2
1 2 1 2 5 8 4
3 6 5 8 4 3 6
1 3
1 3
5 8 4 5 8 4
7 2
1 3 6 7 4 2
3 1 3 6 7
4
9 3
7 9
7 2 2
6 7 4 2
3 2 6 7
4
9 3
7 9 2 8 6 2 8
6
2 2 1
2 8 5
1
4 6 2 8 5 4
6
1 1
5 4 5 4
Select a node
at random
2
2 1 2
1 2 3 6
2 3 6 2
1 2 1 2 5 8 4
3 6 5 8 4 3 6
1 3
5 8 4 1 3
5 8 4 7 2
1 3 7 2 6 7
4
9 3
6 7
4
9 3 1 3
7 2 2
6 7
4
9 3 2 6 7 4 2
3 2 8
2 8 7 9 6
6
2 1
6 2 8 1
2 5 4
5 4 6 2 8
1
5 4 5 1
4
Penjadwalan yang baik adalah penjadwalan yang tidak mengandung bentrok antar komponen
yang dijadwalkan, dalam hal ini berupa kelas, waktu, dan ruang.
Soft constraint
Ruang yang digunakan oleh suatu kelas dalam satu hari
diharapkan terdapat pada gedung yang sama [soft contstraint I].
Dari enam hari perkuliahan dalam satu minggu diharapkan
setiap kelas sebaiknya mendapatkan satu atau dua hari
perkuliahan yang kosong [soft contstraint II].
Dalam satu hari perkuliahan diharapkan jumlah jam perkuliahan
untuk satu kelas tidak terlalu banyak dan tidak terlalu sedikit,
sebaiknya antara empat sampai enam jam perkuliahan [soft
contstraint III].
Soft constraint
Soft contraint ini tidak mutlak harus terpenuhi, namun
diharapkan terpenuhi agar solusi yang diperoleh
merupakan solusi yang lebih baik
Batasan Masalah:
keterangan:
T(e,t) adalah kandungan pheromone
e pada saat t.
P adalah derajat penguapan
pheromone.
Mulai
Buat Graf
Telusuri
Graf
Update
Pheromone node
pada graf
YA
Output
Selesai
e1 e2 e3 e4 e5 e6 e7 e193
t1 O O O O O O O O
t2 O O O O O O O O
t2 O O O O O O O O
t4 O O O O O O O O
t5 O O O O O O O O
t6 O O O O O O O O
t7 O O O O O O O O
t8 O O O O O O O O
t9 O O O O O O O O
t10 O O O O O O O O
t11 O O O O O O O O
t12 O O O O O O O O
t13 O O O O O O O O
..
t90 O O O O O O O O
( e,t ) (1 ). ( e,t )
Sedangkan untuk node yang merupakan penelusuran
koloni dan semut terbaik, maka pheromone nya diupdate
lagi dengan menambah 1. Kemudian lakukan pengecekan
sebagai berikut, untuk semua node:
3 13.0
5
t1
t2
t3
t4
t5
t6
t7
t8
t9
t10
t11
t12
t13
t14
t15
Dari data di atas terlihat bahwa iterasi terbaik adalah iterasi dari koloni=4 dan semut=1 dengan
nilai pelanggaran soft constraint terkecil (176). Hasil pelanggran soft constraint terkecil tersebut
cenderung diperoleh bukan pada iterasi pertama. Dengan demikian dapat disimpulkan bahwa
update pheromone berpengaruh terhadap pencarian jadwal yang lebih baik.