Professional Documents
Culture Documents
4 - Pertemuan 4 - Searching - 3 - Meta Heuristic Search
4 - Pertemuan 4 - Searching - 3 - Meta Heuristic Search
1 17/04/2021
Review-Metode Pencarian
Searching
Un-
Informed
informed
Greedy
BFS DFS A*
BFS
IDS BDA*
2 17/04/2021
Large Solution Space - 13,509 cities in
the US
3 17/04/2021
Large Problem Space
4 17/04/2021
Large Problem Space
http://www.tsp.gatech.edu/data/ml/
mona-lisa100K.gif
5 17/04/2021
Mona Lisa TSP
The current best known results for the Mona Lisa TSP:
Tour: 5,757,191 Bound: 5,757,072 Gap: 119 (0.0021%)
The tour was found on March 17, 2009, by Yuichi Nagata. The bound gives a
value B such that no tour has length less than B; this bound was found on
November 25, 2011, with the Concorde code.
The Gap number is the gap in our knowledge, that is, the difference between
the length of the tour and the value of the bound.
It has been over two years since Yuichi Nagata produced the best-known
tour. To help perk up interest in searching for an even better solution, we are
offering a $1,000 prize to the first person to find a tour shorter than
5,757,191.
6 17/04/2021
Our current best weapon A* [1]
A* = Sejarah + Masa Depan
– Sejarah (aktual) adalah baik.
– Masa Depan (prediksi) itu diperlukan.
– Sejarah bisa menjadi Pelajaran Berharga.
– “Jangan sekali-kali melupakan sejarah” [Soekarno].
– Sejarah yang ditulis Pemenang = ???
– Sikap kritis sangat diperlukan.
7 17/04/2021
Our current best weapon A* [2]
Perbandingan IDS dengan A* yang menggunakan h1 dan h2. Data yang digunakan
adalah rata-rata 100 kasus 8-puzzle dengan kedalaman solusi yang bervariasi [RUS95].
8 17/04/2021
So what’s with large problem space
TSP dengan 100 lokasi
Seorang kurir punya waktu kerja: 8 jam
Rute yang
11 jam 7 jam 7 jam 20 menit
dihasilkan
11 jam 9 jam 7,5 jam
Total Waktu
(lembur 3 jam) (lembur 1 jam) (tidak lembur)
9 17/04/2021
Optimasi [1]
Deterministic
State Space Search Dynamic Programming Branch and Bound
Probabilistic
Monte Carlo Algorithms
Simulated Evolutionary
Annealing (SA) Computation (EC)
Harmony Search
Tabu Search (TS)
(HS)
Evolutionary
Memetic Algorithm
Programming
Evolution Differential
Strategies (ES) Evolution (DE)
Genetic
Standard GP
Programming (GP)
Linear GP
Grammatical
Guided GP
10 17/04/2021
Optimasi [2]
10
Luas = (12/16).100
= 75
11 17/04/2021
Optimasi [3]
Luas = (12/20).100
= 60
Model matematis ??
10
Luas = (16/20).100
= 80
10
13 17/04/2021
Evolutionary Computation
EC: abstraction from the theory of biological
evolution that is used to create optimization
procedures or methodologies, usually
implemented on computers, that are used to solve
problems“ [JUL07].
14 17/04/2021
Teori Evolusi
•Ilmuwan Berbeda pendapat
• Pro: Alam tercipta secara acak
• Kontra: Alam diciptakan oleh intelligent designer (Tuhan)
• Spesies ber-evolusi menjadi spesies lain yang lebih baik???
Evolusi
15 17/04/2021
Mutasi: bisa lebih baik?
17 17/04/2021
Optimization Algorithms
Deterministic
State Space Search Dynamic Programming Branch and Bound
Probabilistic
Monte Carlo Algorithms
Simulated Evolutionary
Annealing (SA) Computation (EC)
Harmony Search
Tabu Search (TS)
(HS)
Evolutionary
Memetic Algorithm
Programming
Evolution Differential
Strategies (ES) Evolution (DE)
Genetic
Standard GP
Programming (GP)
Linear GP
Grammatical
Guided GP
18 17/04/2021
Skema umum EAs
Seleksi orangtua
Orangtua
Inisialisasi
Rekombinasi
Populasi
Mutasi
Terminasi
Anak
Seleksi survivor
19 17/04/2021
Beberapa algoritma EAs
1. Genetic Algorithms (GA): binary strings
2. Evolution Strategies (ES): real-valued vectors
3. Evolutionary Programming (EP): finite state
machines
4. Genetic Programming (GP): LISP trees
5. Differential Evolution (DE) ES
6. Grammatical Evolution (GE) GP
20 17/04/2021
Representasi Individu dan Fungsi Fitness
21 4/17/2021
genome
kromosom
...
...
...
gen genotype
Representasi Biner
Phenotype: x1 = 7 dan x2 = 5
x1 x2
0 1 1 1 0 1 0 1
Representasi Biner
(ra − rb )
x = rb + N
( g1.2 −1 + g 2 .2 − 2 + ... + g N .2 − N )
2
i =1
−i
Rentang Nilai: [-
1, 2]
Representasi Integer
(ra − rb )
x = rb + N
( g1.10 −1 + g 2 .10 − 2 + ... + g N .10 − N )
9.
i =1
10 −i
x1 x2
0 1 3 9 9 9
Representasi Real
x = rb + (ra − rb ) ( g1 + g 2 + ... + g N )
x1 x2
0,2390 1,0000
Representasi Permutasi
Individu: urutan kunjungan semua lokasi
10
3
9
4
8
1
7
5
2
4
5
3
2
6
1
0
0 1 2 3 4 5 6 7 8 9 10
Kromosom: 1 5 2 6 3 4
1 2 3 4 5 6
Maksimasi: f = h
1
Minimasi: f =
(h + a)
Fungsi Fitness
Maksimasi: f = h
1
Minimasi: f =
(h + a)
Seleksi Orangtua
30 4/17/2021
Seleksi Orangtua
1. Roulette wheel
2. Baker’s SUS (Stochastic Universal Sampling)
3. Tournament Selection
Roulette Wheel
Kromosom Fitness
K1 2
K4
K2 1
K1
K3 1
K3
K4 4
K2
Jumlah 8
Putaran ke-1
K2 K3
K4
K4
K3
K3
K2 K1
K4
K2
K1
K1
2 3
Kromosom Fitness
K1 2
K4 K1
K2 1
K3 1
K2
K4 4 K3
Jumlah 8
1 4
Kelemahan Baker’s SUS
2 3
Kromosom Fitness
K1 1,98
K4 K1
K2 2,01
K3 1,99
K3 K2
K4 2,02
Jumlah 8
1 4
Kelemahan Baker’s SUS
2 3
Kromosom Fitness
K1 K2 K3
K1 1
K2 1
K3 1 K4
K4 17
Jumlah 20
1 4
Tournament Selection
K1 0 1 1 1 0 1 1 1 0 1 0 1
.
.
K7 1 0 1 1 0 0 1 1 0 1 0 1
. K1 0 1 1 1 0 1 1 1 0 1 0 1
. K2 1 0 1 1 0 0 1 1 0 1 0 1
K30 1 1 1 1 0 1 1 1 1 1 1 1
K3 1 1 1 1 0 1 1 1 1 1 1 1
.
. K4 1 1 0 0 0 0 0 0 0 1 0 1
K61 1 1 0 0 0 0 0 0 0 1 0 1 K5 0 1 1 0 0 0 1 0 0 1 0 0
.
.
. Terpilih sebagai
K100 0 1 1 0 0 0 1 0 0 1 0 0
orangtua berdasarkan
prosedur tertentu
37 4/17/2021
Rekombinasi
Titik potong
Orangtua 1 1 0 1 1 0 1 0 1 1 0 1 0 1 1 1 0 Anak 1
Orangtua 2 0 1 1 0 1 1 1 0 0 1 1 1 0 1 0 1 Anak 2
Rekombinasi banyak titik
Titik 1 Titik 2
Orangtua 1 1 0 1 1 0 1 0 1 1 0 1 0 1 1 0 1 Anak 1
Orangtua 2 0 1 1 0 1 1 1 0 0 1 1 1 0 1 1 0 Anak 2
(a)
Titik 1 Titik 2 Titik 3
Orangtua 1 1 0 1 1 0 1 0 1 1 1 1 0 0 1 0 0 Anak 1
Orangtua 2 0 1 1 0 1 1 1 0 0 0 1 1 1 1 1 1 Anak 2
(b)
Rekombinasi Seragam
Orangtua 1 1 0 1 1 0 1 0 1 1 1 1 1 1 1 1 0 Anak 1
Pola 0 1 0 0 1 0 1 1
Orangtua 2 0 1 1 0 1 1 1 0 0 0 1 0 0 1 0 1 Anak 2
Rekombinasi untuk Rep. Integer
• Discrete Crossover
• Single Arithmetic Crossover
• Simple Arithmetic Crossover
• Whole Arithmetic Crossover
Discrete Crossover
Alfa = 0,7
0,5 0,1 0,2 0,3 0,8 0,2 0,7 0,5 0,1 0,2 0,3 0,52 0,2 0,7
0,2 0,7 0,3 0,5 0,4 0,1 0,9 0,2 0,7 0,3 0,5 0,68 0,1 0,9
Alfa = 0,5
0,5 0,1 0,2 0,3 0,8 0,2 0,7 0,5 0,1 0,2 0,3 0,8 0,15 0,8
0,2 0,7 0,3 0,5 0,4 0,1 0,9 0,2 0,7 0,3 0,5 0,4 0,15 0,8
Alfa = 0,5
0,5 0,1 0,2 0,3 0,8 0,2 0,7 0,35 0,4 0,25 0,4 0,6 0,15 0,8
0,2 0,7 0,3 0,5 0,4 0,1 0,9 0,35 0,4 0,25 0,4 0,6 0,15 0,8
Anak 1 : x + (1 − ) y
Anak 2 : y + (1 − ) .x
Rekombinasi untuk Rep. Permutasi
• Order Crossover
• Partially Mapped Crossover
• Cycle Crossover
• Edge Recombination
Order Crossover
TP1 TP2
Orangtua 1 1 5 2 7 6 4 8 3 2 7 6 Anak 1
Orangtua 2 3 2 1 8 4 6 7 5 1 8 4 Anak 2
TP1 TP2
Orangtua 1 1 5 2 7 6 4 8 3 2 7 6 Anak 1
Orangtua 2 3 2 1 8 4 6 7 5 1 8 4 Anak 2
52 4/17/2021
Mutasi
a <= Pm
a <= Pm
Mutasi untuk Representasi Integer
a <= Pm
Mutasi untuk Representasi Integer
Probabilitas
Mutasi Creep (Perlahan)
• Mutasi Uniform
• Mutasi Non-uniform dengan distribusi tetap
Mutasi untuk Rep. Permutasi
67 4/17/2021
Seleksi Survivor
• Generational Model
• Steady State Model
K1 1 1 0 0 0 0 0 1
Pas 1
K3 0 0 1 1 0 0 0 0
K1 1 1 0 0 0 0 0 1
Seleksi
orangtua K2 1 1 0 0 0 0 0 1
K2 1 0 0 1 0 0 1 1 Pas 2
KN 0 0 1 1 0 0 0 0
K3 1 0 0 1 0 0 1 1
. .
. .
. .
KN 1 0 0 0 1 0 0 1
K1 1 1 0 0 0 0 0 1
Pas
K2 1 0 0 1 0 0 1 1 N/2
Rekombinasi
Penggantian dan Mutasi
N kromosom
K1 0 0 0 0 1 1 0 1
K2 0 1 0 1 0 0 0 1
K3 0 1 0 0 1 0 1 0
.
.
.
KN 1 1 0 0 1 1 1 1
N kromosom baru
Seleksi Survivor: Generational
K1 1 1 0 0 0 0 0 1
Pas 1
K3 0 0 1 1 0 0 0 0
K1 1 1 0 0 0 0 0 1
Seleksi
orangtua K2 1 1 0 0 0 0 0 1
K2 1 0 0 1 0 0 1 1 Pas 2
KN 0 0 1 1 0 0 0 0
K3 1 0 0 1 0 0 1 1
. .
. .
. .
KN 1 0 0 0 1 0 0 1
K1 1 1 0 0 0 0 0 1
Pas
K2 1 0 0 1 0 0 1 1 N/2
Rekombinasi
Penggantian dan Mutasi
N kromosom
K1 0 0 0 0 1 1 0 1
K2 0 1 0 1 0 0 0 1
K3 0 1 0 0 1 0 1 0
.
.
.
KN 1 1 0 0 1 1 1 1
N kromosom baru
Seleksi Survivor: Generational
K1 1 1 0 0 0 0 0 1
K1 1 1 0 0 0 0 0 1 Pas 1
Seleksi
orangtua K3 0 0 1 1 0 0 0 0
K2 1 0 0 1 0 0 1 1
.
K3 1 0 0 1 0 0 1 1 .
.
.
. K1 1 1 0 0 0 0 0 1
. Pas
K2 1 0 0 1 0 0 1 1 M/2
KN 1 0 0 0 1 0 0 1
Rekombinasi
dan Mutasi
Penggantian
M kromosom
berdasarkan
metode seleksi
survivor
K1 0 0 0 0 1 1 0 1
.
.
.
KM 1 1 0 0 1 1 1 1
Rekombinasi
dan Mutasi
Penggantian
M kromosom
berdasarkan
metode seleksi
survivor
K1 0 0 0 0 1 1 0 1
.
.
.
KM 1 1 0 0 1 1 1 1
73 4/17/2021
Minimasi Fungsi
Nilai minimum h = ?
h( x1 , x 2 ) = x + x
2
1
2
2
x1 , x 2 [−5,12; 5,12]
Individu Biner
x1 x2
1 1 0 1 0 1 0 1 0 0 0 1 0 0 1 1 0 1 0 1
1
f = 2
( x1 + x 2 ) + 0,01
2
x1 , x 2 [−5,12; 5,12]
Generasi 1
Generasi 10 x = rb +
(ra − rb )
N
( g1.2 −1 + g 2 .2 − 2 + ... + g N .2 − N )
2
i =1
−i
x1 , x 2 [−5,12; 5,12]
Generasi 10
Generasi 100