Anda di halaman 1dari 441

TEKNIK PERMODELAN DAN OPTIMASI PROSES

TIN 31A 3(2-3)


(Semester 6, 2021)

Prof. Dr.Ir. Yandra Arkeman, MEng *


Prof. Dr.Ir. Erliza Noor
Dr. Ir. Ika Amalia Kartika
Dr. Farah Fatma, STP
Deasy Kartika, ST, MT (R)**
Nisa Zahra, STP, MSi (R)

1
Deskripsi Perkuliahan
• Mata kuliah ini akan membahas:
– Falsafah dan ruang lingkup Teknik Optimasi
– Optimasi Non-Linier
– Optimasi Tanpa Kendala
– Optimasi Dengan Kendala
– Optimasi Kriteria Jamak
• Sudah diajarkan di Dept TIN sejak 1985
• Wajib mayor TIN sejak 2008

2
Strategi Perkuliahan
• Jumlah Kredit 3 :
– 2 Jam Kuliah, 3 Jam Praktimum
– 1 Jam = 50 menit
• Kuliah:
– Online: Synchronous dan Asynchronous (LMS)
– Yandra, Erliza Noor, Ika Amalia Kartika, Farah Fatma
• Responsi:
– Online: Synchronous dan Asynchronous (LMS)
– Deasy Kartika, Nisa Zahra

3
• Rancangan Penilaian:
- UTS : 35%
- UAS : 35%
- Responsi (Latihan dan Tugas) : 30%

4
Topik Perkuliahan
Pokok Topik Referensi
Bahasan
1 Kontrak Perkuliahan -
Pengantar Teknik Permodelan dan Optimasi Proses Chapter 1-4
2 Optimasi Tanpa Kendala  Peubah Tunggal Chapter 5

3 Optimasi Tanpa Kendala  Peubah Jamak Chapter 6

4 Optimasi Non-Linier Dengan Kendala  Peubah Jamak Chapter 8

5 Optimasi Kriteria Jamak Buku Penunjang

6 Metoda untuk Optimasi Global  Algoritma Genetika Buku Penunjang


Optimasi Multiobjective
7 Response Surface Methodology (RSM) Buku Penunjang

8 Aplikasi Teknik Optimasi Chapter 11-16

5
Referensi Utama
• Judul:
– Optimization of Chemical Processes
• Pengarang:
– Thomas F Edgar, David M Himmelblau dan Leon S Lasdon
• Penerbit:
– Mc Graw Hill (Tahun Terbaru)

6
Buku Penunjang
• Text Book 1:
– Title : Practical Optimization Methods with Mathematical Applications
– Author : M. Asghar Bhatti
– Publisher : Springer-Verlag, New York
• Text Book 2:
– Title : Numerical Methods and Analysis
– Authors : James L. Buchanan, Peter R. Turner
– Publisher : Mc. Graw Hill, New York

7
PENGANTAR TEKNIK PERMODELAN
DAN OPTIMASI PROSES

8
Teknik Optimasi

• Tahap pertama akan dibahas tentang Teknik Optimasi


• Pada saat membahas Teknik Optimasi akan tercakup
tentang Teknik Permodelan

9
• OPTIMASI  Mencari nilai maksimum
dan/atau minimum dari
suatu fungsi

• Bentuk-bentuk fungsi:
- Linier
- Tak Linier
- Diskrit
- Kontinyu

10
• Optimasi : - Tanpa Kendala
- Dengan Kendala
- Single Objective
- Multi Objective

• Teknik Optimasi : - Kalkulus (Analitik)


- Numerik
- Heuristik

• Heuristik : Metoda pencarian titik optimum atau yang


mendekati optimum dengan aturan (rules) tertentu 
untuk fungsi yang kompleks

• Aturan dalam metoda heuristik lebih rumit daripada


metoda numerik biasa

11
• Yang akan dipelajari pada mata ajaran ini:
- Optimasi untuk fungsi non-linier (tanpa dan
dengan kendala)
- Dengan berbagai teknik analitik dan numerik
(point to point search)
- Teknik baru:
• Multiple-point search
• Genetic Algorithms
• Selain itu akan dipelajari juga Optimasi Kriteria
Jamak (Multi-objective optimization)
• Juga akan diperlihatkan software untuk optimasi
(Solver, MatLab dan Genetic Algorithms)

12
• Tadi sudah dikatakan bahwa fokus kita
adalah model non-linier
– Fungsi Objective non-Linier
– Salah satu kendala non-linier
• Formulasi Umum :
Maks/Min: f(x)
Dengan kendala g(x) < > 0
h (x) = 0
x ε [ a,b ]

13
• Contoh bentuk fungsi  kontinyu dan tanpa kendala, sbb:

Gambar 1: > Uni-modal


> Satu titik optimum
Gambar 2: > Multi-modal
> Beberapa titik optimum
> Optimum lokal, Optimum global

14
• Cara yg lazim dipakai untuk mencari solusi
optimum fungsi kontinyu spt Gb.1 & Gb.2
adalah dengan menggunakan kalkulus:
> cari titik stationer
- batas atas & batas bawah selang
- titik maks/min  f I (x) = 0
> periksa apakah titik stationer tsb.
merupakan maks/min lokal.

15
> Salah satu caranya adalah dengan
melibatkan turunan keduanya
(Syarat Perlu dan Syarat Cukup)
- Jika f II (x) > 0  Minimum Lokal
- Jika f II (x) < 0  Maksimum Lokal

16
• Bagaimana jika variabelnya lebih dari
satu? (x1,x2) misalnya?
• Maks/Min f (x1,x2)
x1 ε [a,b]
x2 ε [c,d]
• Bentuk dapat digambarkan dalam ruang
tiga dimensi.
(Gambar  lihat slide berikutnya)

17
Fungsi dengan Dua Peubah

1) Max f ( x1 , x2 )  21.5  x1 Sin (4 x1 )  x2 Sin (20 x2 ) Gen & Cheng (1997)
 3,0  x1  12,1
4,1  x2  5,8

18
• Untuk menentukan syarat perlu dan syarat
cukup pada fungsi multi-variabel
diperlukan konsep:
– Turunan parsial
– Vektor gradien
– Matriks Hess
• Kondisi cukup untuk minimum lokal:
– Vektor gradien pada titik optimum = 0
– Matriks Hess > 0
• Konsep ini akan dipelajari secara detail
nanti (pada modul-modul mendatang)

19
• Kalau cara kalkulus tidak bisa atau sulit
digunakan  pakai cara numerik
• Contoh Metoda Numerik:
– Sequential Search Technique (SST)
– Teknik pencarian beruntun
• Contoh metoda SST:
– Penelusuran Fibonacci
– Penelusuran Nilai Tengah (Golden Mean Search)
• Metoda Lain:
– Metoda Newton-Raphson, Pengali Lagrange, Metoda
Penalty, dll

20
Contoh Fungsi Non-Linier  Tanpa Kendala
Z = 1,696.8p - 24.6p2 - 22,000

Figure 10.2
The nonlinear
profit function

21
- The slope of a curve at any point is equal to the derivative of the curve’s function.
- The slope of a curve at its highest point equals zero.

Figure 10.3
Maximum profit
for the
profit function

22
Z = 1,696.8p - 24.6p2 - 22,000
dZ/dp = 1,696.8 - 49.2p
p = $34.49
v = 1,500 - 24.6p
v = 651.6 pairs of denim jeans
Z = $7,259.45

Figure 10.4
Maximum profit, optimal price, and optimal volume

23
Constrained Optimization In Nonlinear Problems
Definition

- If a nonlinear problem contains one or more constraints it becomes


a constrained optimization model or a nonlinear programming model.
- A nonlinear programming model has the same general form as the
linear programming model except that the objective function and/or the
constraint(s) are nonlinear.
- Solution procedures are much more complex and no guaranteed
procedure exists.

24
Constrained Optimization In Nonlinear Problems
Graphical Interpretation
- Effect of adding constraints to nonlinear problem:
Figure 10.5
Nonlinear profit
curve for the profit
analysis model

Figure 10.6
A constrained optimization model

Figure 10.7
Constrained optimization
model with a solution
point not on the
constraint boundary

25
CONTOH KENDALA LINIER  Wilayah Kajian Linier

minimize f(x)
subject to
x1 + 2x2  40
40x1 + 50 x2  1,600
4x1 + 3x2  120
x1, x2,  0

Figure1. Linear Constraints

26
• Mengapa mempelajari teknik optimasi?:
- Banyak persoalan di bidang bisnis dan
agroindustri melibatkan model-model optimasi
- Baik di bidang manajemen maupun prosesing:
* Manajemen:
Pengambilan Keputusan, Penjadwalan,Manajemen
Produksi, Strategi,Pemasaran, Tata-letak,
Keuangan,dll.
* Prosesing:
=>Teknik Kimia, Unit Operasi, Unit Proses.
=> Pengendalian Lingkungan, dll

27
Transformation Process in Agroindustry

INPUT Transformation OUTPUT


process

Material Feedback Goods


Machines or
Labor Services
Management
Capital

28
Keputusan Operasi Strategy Kompetitif Keunggulan

• Kualitas • Fleksibilitas:
Desain
• Produk
Volume • Perbedaan
• Proses • Harga Murah (lebih bagus)
• Lokasi • Delivery
• Layout Kecepatan
• Harga/Biaya
Ketergantungan
• SDM (lebih murah)
• Kualitas :
• Jaringan supplier Kinerja

• Inventory • Pelayanan • Respon


Purna Jual (lebih cepat)
• Penjadwalan
• Jaringan
• Pemeliharaan Produk yang
luas

29
Contoh Aplikasi Bidang
Manajemen

• Optimasi Persediaan (Inventory Management)

30
What is Inventory?
• Stock of items kept to meet future demand for
– internal customers
– external customers
• Purpose of inventory management
– how many units to order
– when to order

31
Inventory Costs

• Carrying cost
– cost of holding an item in inventory
• Ordering cost
– cost of replenishing inventory

32
Economic Order Quantity (EOQ)
Models
• EOQ
– optimal order quantity that will minimize total
inventory costs
• Basic EOQ model

33
EOQ Cost Model
Co - cost of placing order D - annual demand
Cc - annual per-unit carrying cost Q - order quantity

CoD
Annual ordering cost =
Q
Cc Q
Annual carrying cost =
2
CoD Cc Q
Total cost = +
Q 2

34
EOQ Cost Model
Annual
cost ($) Total Cost
Slope = 0
CcQ
Minimum Carrying Cost =
total cost 2

CoD
Ordering Cost =
Q

Optimal order Order Quantity, Q


Qopt

35
EOQ Cost Model

Deriving Qopt Proving equality of


costs at optimal point
CoD Cc Q
TC = +
Q 2 CoD Cc Q
=
TC CoD Cc Q 2
= 2 +
Q Q 2
2CoD
C0D Cc Q2 =
Cc
0= +
Q2 2
2CoD
2CoD Qopt =
Qopt = Cc
Cc

36
EOQ Example
Cc = $0.75 per yard Co = $150 D = 10,000 yards

2CoD CoD CcQ


Qopt = TCmin = +
Cc Q 2
2(150)(10,000) (150)(10,000) (0.75)(2,000)
Qopt = (0.75) TCmin = 2,000 + 2

Qopt = 2,000 yards TCmin = $750 + $750 = $1,500

Orders per year = D/Qopt


= 10,000/2,000
= 5 orders/year
37
Contoh Aplikasi Bidang Prosesing

• Penentuan Ketebalan Lapisan Isolasi


untuk Boiler
• Halaman 9-10 (Example1.1) dan 89-91
(Example3.3)  Ref. Utama

38
The effect of insulation thickness on total cost

Cost
($/year) Total Cost
Slope = 0

Minimum Cost of insulation


total annual
cost

Cost of lost energy

Optimal thickness Insulation thickness


xopt

39
- Contoh-contoh Lain di bid. Manajemen/
Prosesing??
> Lihat Skripsi, Thesis, Disertasi
> Amati dunia nyata (Bisnis, Agroindustri, etc.)

- Aplikasi dunia nyata?


> Banyak
> Sumber: Interface, Engineering, Magazine, etc.

40
• Dari kedua contoh sebelumnya terlihat
bahwa masalah optimasi non-linier sering
harus dihadapi oleh manajer agroindustri
• Kalau fungsinya mudah  bisa digunakan
teknik derivatif atau gradien yang relatif
mudah
• Kalau fungsinya kompleks atau sulit?
– Perlu teknik-teknik lain yang akan dipelajari
dalam mata ajaran ini

41
Contoh fungsi sulit dan kompleks

42
Fungsi “Noisy”  Peubah Tunggal

. Max
F (x)

i1 i2 i3 … in x

i = initial population

43
Fungsi Kompleks  Peubah Jamak

1) f ( x1 , x2 )  21.5  x1 Sin (4x1 )  x2 Sin (20x2 )

 3.0  x1  12.1
4.1  x2  5.8

Ref. : Gen & Cheng (1997)

 ( x 1) 2 y2
 x 2 ( y 1) 2  x 3 4  x 2  y2 e
2) f (x, y)  3 (1 - x) 2 e  10   x  y  e 
2  3
- 3  x, y  3 Ref. : Chong dan Zak (1996)

25
1
3) f ( xi )  0.002   2
j 1
j   ( xi  aij ) 6
i 1

Refs. : Goldberg (1989)

4) Dan lain-lain  Ref. !

44
Fungsi Kompleks  Dua Peubah

1) Max f ( x1 , x2 )  21.5  x1 Sin (4 x1 )  x2 Sin (20 x2 )


 3,0  x1  12,1
4,1  x2  5,8

Gen & Cheng (1997)

x1* = 11.631407
x2* = 5.724824
f (x1*,x2*) = 38.818208

45
Hasil Eksperimen…
(PopSize=20; MaxGen=1000; Pc=0.88; Pm=0.20)

41 Gen & Cheng (1997)


Fitness maksimum x1* = 11.631407
39
x2* = 5.724824
37 f (x1*,x2*) = 38.818208
35
33
Fitness

31
29 x1* = 11.66395
Fitness rata-rata x2* = 5.724876
27
f (x1*,x2*) = 38.89309
25 Fitness * = 38,849309
23 at gen. 500th
21
0 50 100 150 200 250 300 350 400 450 500 550
Generasi

46
Fungsi Kompleks  Dua Peubah
2 y2
 x 2  ( y 1) 2 x 4  x 2  y2 e  ( x 1)
2) f (x, y)  3 (1 - x) 2 e  10   x  y  e
3

2  3
- 3  x, y  3

Chong & Zak (1996)


x* = - 0.004944 F(x,y)
y* = 1.645203
f (x*,y*) = 8.042244

y x

47
Hasil Eksperimen… Chong & Zak (1996)
(PopSize=20; MaxGen=1000; Pc=0.88; Pm=0.10) x* = - 0.004944
y* = 1.645203
f (x*,y*) = 8.042244
10 Fitness maksimum

9
Fitness rata-rata Using MATLAB :
8
x* = - 0.0303
7 y* = 1.5455
f (x*,y*) = 8.0926
Fitness

4
x* = - 0.362142
3 Fitness * = 9,276291 y* = 1.263218 (!)
2 At gen. 81th f (x*, y*) = 9.276291

1
0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150
Generasi

48
• Sekali lagi perlu ditegaskan bahwa teknik yang selama ini
sudah dipelajari:
- Linier Programming
- Hanya untuk Fungsi Linier saja
• Dalam mata ajaran ini akan dipelajari teknik-teknik yang lebih
lanjut,
– Namun tidak melupakan bahwa m.a TPOP ini untuk mahasiswa S1
– Metoda yang akan diajarkan sudah dipilih agar sesuai dengan
kemampuan mahasiswa S1
– Metoda-metoda lain diajarkan di tingkat pasca sarjana (S2/S3)
• Skill penunjang yang diperlukan untuk mempelajari Teknik
Optimasi:
- Computer Programming  Penerapan Komputer
- Matematika dan Kalkulus

49
• Metoda “conventional-search” untuk fungsi non-
linier masih ada kekurangannya:
– Perlu informasi tentang bentuk fungsi, arah
pencarian, gradien, jarak interval, dsb.
• Metoda baru  tidak perlu informasi seperti ini
– Bersifat heuristik atau meta-heuristik
– Contoh  Genetic Algorithms
– Bisa untuk berbagai keperluan  dengan kendala,
multi-tujuan, dll
– Akan dibahas sekilas di bagian akhir kuliah
– Pendalaman dapat dilakukan di tingkat 4 ataupun di
S2/S3

---yandra arkeman---

50
Teknik Permodelan dan Optimasi
Proses
Responsi
Deasy Kartika Rahayu Kuncoro

Genap 2022/2023
KONSEP DASAR OPTIMASI
• OPTIMASI → Upaya Mencari nilai maksimum
dan/atau minimum dari
suatu fungsi

• Bentuk-bentuk fungsi:
- Linier √
- Tak Linier
- Diskrit
- Kontinyu
Contoh-contoh Fungsi

Fungsi linier
Contoh-contoh Fungsi
TUJUAN Maksimimisasi : Z = 3X1 + 5X2
Dengan kendala : 2X1 ≤ 8
3X2 ≤ 15
6X1 + 5X2 ≤ 30
X2 X1 , X 2 ≥ 0

2X1 = 8
D C 3X2 = 15

B = (4, 6/5)
C = (5/6, 5)

B Contoh Optimasi Fungsi linier

0 A
Z X1
Z
6X1 + 5X2 = 30
Contoh-contoh Fungsi

200

180

160

140

120

100

80

60

40

20

0
-4 -3 -2 -1 0 1 2 3 4
Contoh-contoh Fungsi
Contoh Kasus Optimasi Non-Linier Programming:
Contoh-contoh Fungsi
Max f ( x1 , x2 ) = 21.5 + x1 Sin (4 x1 ) + x2 Sin (20 x2 )
− 3,0  x1  12,1
4,1  x2  5,8

Titik optimum dapat dicari


dengan metode genetic algorithm
Contoh-contoh Fungsi
Contoh-contoh Fungsi
KONSEP DASAR OPTIMASI
• Optimasi : - Tanpa Kendala
- Dengan Kendala
- Single Objective
- Multi Objective
• Teknik Optimasi : - Kalkulus (Analitik)
- Numerik
- Heuristik
• Heuristik : Metoda pencarian titik optimum atau yang
mendekati optimum dengan aturan (rules) tertentu →
untuk fungsi yang kompleks
• Aturan dalam metoda heuristik lebih rumit daripada
metoda numerik biasa
Aplikasi Optimasi NLP
Optimasi dapat diterapkan dalam berbagai proyek, seperti:
• Penentuan tata letak lokasi pabrik terbaik
• Penentuan rute distribusi bahan baku dan produk jadi
• Tata letak dan penentuan ukuran saluran pipa
• Peralatan dan desain bangunan
• Perawatan dan penjadwalan penggantian peralatan
• Operasional peralatan, seperti reaktor, kolom, absorber, dll.
• Evaluasi data bangunan untuk membangun model sebuah
proses
• Minimisasi biaya penyimpanan
• Alokasi bahan atau layanan diantara berbagai proses
• Perencanaan dan penjadwalan pembangunan
Non-Linear Programming
Beberapa Metode Optimasi terhadap sebuah fungsi nonlinier diantaranya:

Fungsi Nonlinier, dgn Metode Newton,


satu variabel, tak Metode FDAD, Proses
berkendala Metode Secant optimasi
dapat
Fungsi Nonlinier memanfaat-
tanpa kendala kan bbrp
program
Fungsi Nonlinier,
Metode Gradient, komputer:
dgn banyak variabel,
Metode Newton
tak berkendala
Fungsi -Ms. Excel
Nonlinier -Matlab
-dll
Substitusi Langsung,
Fungsi Nonlinier dgn
Metode Pengali Lagrange,
kendala persamaan
Metode Penalty
Fungsi Nonlinier
dengan kendala
Fungsi Nonlinier dgn
Kondisi Kuhn Tucker,
kendala
Metode Penaly, dll
pertidaksamaan
Non-Linier Programming
Gambar 1: > Uni-modal
> Satu titik optimum
Gambar 2: > Multi-modal
> Beberapa titik optimum
> Optimum lokal, Optimum global

Fungsi multimodal
Non-Linier Programming

Cara yang lazim dipakai untuk mencari solusi


optimum fungsi kontinyu (spt Gb. D & E)
adalah dgn menggunakan kalkulus.
→ Cari titik stasiuner
- batas atas & batas bawah selang
- titik maks/min → f’(x) = 0
→ Periksa apakah titik stasiuner tsb
merupakan maks/min lokal
Non-Linier Programming
> Salah satu caranya adalah dengan
melibatkan turunan keduanya
(Syarat Perlu dan Syarat Cukup)
- Jika f II (x) > 0 → Minimum Lokal
- Jika f II (x) < 0 → Maksimum Lokal
Fungsi Concave & Convex
-Penentuan kecembungan/kecekungan fungsi membantu dlm
penentuan apakah optimum lokal juga merupakan optimum
global

Fungsi Cekung terhadap sumbu x Fungsi Cembung terhadap sumbu x


(Concave Function) (Convex Function)
Jika nilai f(x) pd setiap garis lurus yang Jika nilai f(x) pd setiap garis lurus yang
menghubungkan nilai f(xa) dan f(xb) utk menghubungkan nilai f(xa) dan f(xb) utk
setiap pasang xa dan xb terletak pada setiap pasang xa dan xb terletak di atas
atau di bawah nilai fungsi atau pada nilai fungsi
Fungsi Concave & Convex

Plot turunan pertama dari fungsi cekung & cembung dgn 1 variabel

Turunan kedua dari f(x) untuk fungsi kuadratik


Fungsi Concave & Convex
Jika tanda dari turunan kedua f(x) pada range a ≤ x ≤ b
adalah selalu negatif atau nol, maka fungsi f(x) adalah
fungsi cekung (concave)/fungsi dengan titik maksimum

Jika tanda dari turunan kedua f(x) pada range a ≤ x ≤ b


adalah selalu positif atau nol (nonnegatif), maka fungsi
f(x) adalah fungsi cembung (convex)/fungsi dengan titik
minimum.

Strictly concave berarti tanda f’’(x) selalu negatif


Strictly convex berarti tanda f’’(x) selalu positif
Fungsi Concave & Convex
Dalam pencarian titik optimum, digunakan
turunan pertama fungsi yang disebut dengan
vektor gradien.

Jika nilai vektor gradien = 0 pada titik x* tertentu, maka titik x*


tersebut merupakan titik stasioner (titik ekstrem, bisa berupa
titik maksimum, titik minimum atau titik sadel)
Matrix Hess
Jika fungsi f diturunkan dua kali, maka di titik x terdapat
matriks turunan kedua yang disebut Matriks Hess [H]:

Matriks Hess dapat dianalisa untuk menentukan jenis


titik stasioner x* (apakah titik min, maks, atau saddle
point)
Contoh Soal
Minimumkan f(x)= x2-8 f(x)
20
x f(x)
-5 17
15
-4 8
-3 1
10
-2 -4
-1 -7
0 -8 5 f(x)

1 -7
2 -4 0
-6 -4 -2 0 2 4 6
3 1
4 8 -5

5 17
-10
Contoh Soal

f(x)= x2-8 → f’(x) = 2x


x f'(x)
-5 -10 f'(x)
-4 -8 15

-3 -6 10

-2 -4 5
-1 -2 0 f'(x)
0 0 -6 -4 -2 0 2 4 6
-5
1 2
-10
2 4
-15
3 6
4 8
5 10
Contoh Soal

f(x)= x2-8 → f’(x) = 2x → f”(x) =


x f"(x)
-5 2
f"(x)
-4 2
2,5
-3 2
2
-2 2
1,5
-1 2
f"(x)
1
0 2
1 2 0,5

2 2 0
-6 -4 -2 0 2 4 6
3 2
4 2
5 2
Fungsi Concave & Convex
Konsep kecembungan dan kecekungan juga dpt diterapkan pada
fungsi multivariabel. Untuk setiap fungsi objektif, Hessian
Matriks Hess H(x) harus dievaluasi untuk menentukan sifat f(x).
TEKNIK OPTIMASI
Kuliah ke 2  15 Februari 2021
Chapter 4: Basic Concept of Optimization
• Continuity of Functions
• Unimodal vs. Multimodal Functions
• Convex and Concave Functions
• Other Related Topics
• (Soal Latihan untuk Responsi)
4.1 Continuity of Functions

• A function of single variable x is continuous at point


x0 if:
• f(x0) exists
• lim x  x0 of f(x) exists
• lim x  x0 of f(x) = f(x0)
Functions with discontinuities
Example 4.1
• Cek apakah fungsi-fungsi berikut kontinyu atau
tidak! Untuk setiap fungsi tentukan pada daerah
mana f(x) dan f’(x) kontinyu!
• f(x) = 1/x
• f(x) = ln x
Jawab:
• Diskontinyuitas bisa menjadi masalah yang besar
atau tidak, tergantung kasusnya  lihat kembali
Gambar 1
• Kalau fungsi tdk bisa diturunkan  gunakan non-
gradient based methods (contohnya metoda
numerik)
Contoh fungsi obyektif yang diskontinyu

• Biasa ditemukan dalam disain proses atau disain


sistem
• Contoh  Scheduling
SCHEDULING
Cost

In combinatorial
optimization decision
variable is discrete and
has string value

abcd dacb bcda


Schedule
• Masalah diskontinyuitas bisa pula terjadi kalau
kita menggunakan peubah integer
• Contohnya  Optimasi diameter pipa (Ex: 4.2)
• Masalah bisa didekati dengan fungsi kontinyu,
kemudian dibulatkan
• Kalau tidak memungkinkan  Pakai Integer
Programming (Chap 9  m.a PO)
4.2 Unimodal vs. Multimodal Functions

• Jika unimodal  lebih mudah dipecahkan


• Jika multimodal  perlu metoda yang lebih
akurat
• Lihat Gambar 1 dan 2 di slide berikut !
• Lihat juga Gambar 4.3a dan b di hal 127 dan 128
• Untuk fungsi 2 peubah, bentuk unimodal multimodal bisa
dilihat dari gambar 3 dimensinya, kemudian diplotkan
konturnya ke dalam bentuk 2 dimensi
• Contoh di slide berikut
f(x,y)=x2+y2

5
7-8
6-7
5-6
f(x,y)
4 4-5
3-4
2-3
3 1-2
0-1

s5
1
s4

s3
0 Value Y
1 s2
2
3
Value X 4 s1
5

Gambar 3 Dimensi
f(x,y)=x2+y2

s5

s4

s3Value Y 6-8
4-6
2-4
0-2

s2

f(x,y) s1
1 2 3 4 5
Value X

Gambar Kontur 2 Dimensi


Fungsi Multimodal  Dua Peubah
2 y2
 x 2  ( y 1) 2 x 4  x 2  y2 e  ( x 1)
f (x, y)  3 (1 - x) e
2
 10   x  y  e
3

 2  3
- 3  x, y  3

F(x,y)

y x
FIGURE 8.3.3
Contours of the functions (8.3.6) and (8.3.7). (a) (2x - y)' + (y + 1)'; (b) 1(X)( y - x2)2 + (I - x)
FIGURE 8.3.3 (Continued)
4.3. CONVEX AND CONCAVE FUNCTIONS
• Penentuan kecembungan dan kecekungan fungsi akan
membantu untuk memastikan apakah optimum lokal juga
merupakan optimum global
• Bentuk fungsi konveks dan konkaf dapat dilihat di slide
berikut:
Persamaan fungsi konkaf dan konveks

• f[θxa+(1-θ)xb] ≥ θf(xa)+(1- θ)f(xb)


• Strictly concave (cekung)  (tanda menjadi >)
• Fungsi Konveks:
• Tanda menjadi ≤
• Strictly convex tanda menjadi <
• Cara lain untuk menguji atau menentukan konkaf atau
konveks adalah dengan menggunakan turunan kedua
fungsi
• Untuk fungsi konkaf satu peubah di semua area
asal x :
• F’’(x) ≤ 0
• Untuk fungsi konveks:
• F’’(x) ≥ 0
Untuk Fungsi dengan Peubah Dua atau Lebih
• Test untuk strict convexity:
• Gunakan matrix Hessian (matrik turunan kedua)
• Semua elemen diagonal dari matriks harus positif
• Determinan semua principal minor harus positif  slide tambahan
• Determinan H(x) juga harus positif
• Test lain: (slide tambahan)
• Eigenvalues of H(x) are positive (>0)
Click to The
edit Gradient
Master title style
• Review of the gradient ():
For a function “f ”, of variables x1, x2, …, xn:

 f f f 
f    
 x1 x2 xn 
Click to edit
The Master
Hessiantitle style
• The Hessian (2) of f(x1, x2, …, xn) is:
 f 2 f 2
f 
2

  
 x12
2
x1x2 x1xn 
 f f 2
f 2

 2 f   x x x2
2
x2 xn 
 2 1 
 2    
 f f f 
2 2

 x x  2 
 n 1 xn x2 xn 
• Page 128-129
• Example 4.4
• Example 4.5
• Example 4.6
• Example 4.7
Test dengan Eigenvalue
• Bagaimana menentukan nilai eigenvalue untuk matrix
3x3?
• Lihat referensi !
4.4 Convex Region
• Sering ditemukan dalam optimasi dengan kendala non-
linier
• Lihat slide berikut ini
Possible Optimal Solutions to NLPs
(not occurring at corner points)
objective function objective function
level curve level curve

optimal solution optimal solution

Feasible Feasible
Region Region

linear objective, nonlinear objective,


nonlinear constraints linear constraints

objective function
level curve objective function
level curves
optimal solution
optimal solution

Feasible
Region
Feasible
Region
nonlinear objective, nonlinear objective,
nonlinear constraints linear constraints
--- 15 Feb 2021 ---
Optmasi Multi-variabel dgn kendala
persamaan
Teknik Pemodelan dan Optimasi Proses

Responsi 2
Deasy Kartika Rahayu Kuncoro

Genap 2022/2023
KONSEP DASAR OPTIMASI
• Optimasi : - Tanpa Kendala
- Dengan Kendala
- Single Objective
- Multi Objective
• Teknik Optimasi : - Kalkulus (Analitik)
- Numerik
- Heuristik
• Heuristik : Metoda pencarian titik optimum atau yang
mendekati optimum dengan aturan (rules) tertentu →
untuk fungsi yang kompleks
• Aturan dalam metoda heuristik lebih rumit daripada
metoda numerik biasa
Non-Linear Programming
Beberapa Metode Optimasi terhadap sebuah fungsi nonlinier diantaranya:

Fungsi Nonlinier, dgn Metode Newton,


satu variabel, tak Metode FDAD, Proses
berkendala Metode Secant optimasi
dapat
Fungsi Nonlinier memanfaat-
tanpa kendala kan bbrp
program
Fungsi Nonlinier,
Metode Gradient, komputer:
dgn banyak variabel,
Metode Newton
tak berkendala
Fungsi -Ms. Excel
Nonlinier -Matlab
-dll
Substitusi Langsung,
Fungsi Nonlinier dgn
Metode Pengali Lagrange,
kendala persamaan
Metode Penalty
Fungsi Nonlinier
dengan kendala
Fungsi Nonlinier dgn
Kondisi Kuhn Tucker,
kendala
Metode Penaly, dll
pertidaksamaan
Non-Linier Programming
Gambar 1: > Uni-modal
> Satu titik optimum
Gambar 2: > Multi-modal
> Beberapa titik optimum
> Optimum lokal, Optimum global

Fungsi multimodal
Non-Linier Programming

Cara yang lazim dipakai untuk mencari solusi


optimum fungsi kontinyu (spt Gb. D & E)
adalah dgn menggunakan kalkulus.
→ Cari titik stasiuner
- batas atas & batas bawah selang
- titik maks/min → f’(x) = 0
→ Periksa apakah titik stasiuner tsb
merupakan maks/min lokal
Non-Linier Programming
> Salah satu caranya adalah dengan
melibatkan turunan keduanya
(Syarat Perlu dan Syarat Cukup)
- Jika f II (x) > 0 → Minimum Lokal
- Jika f II (x) < 0 → Maksimum Lokal
Fungsi Concave & Convex
-Penentuan kecembungan/kecekungan fungsi membantu dlm
penentuan apakah optimum lokal juga merupakan optimum
global

Fungsi Cekung terhadap sumbu x Fungsi Cembung terhadap sumbu x


(Concave Function) (Convex Function)
Jika nilai f(x) pd setiap garis lurus yang Jika nilai f(x) pd setiap garis lurus yang
menghubungkan nilai f(xa) dan f(xb) utk menghubungkan nilai f(xa) dan f(xb) utk
setiap pasang xa dan xb terletak pada setiap pasang xa dan xb terletak di atas
atau di bawah nilai fungsi atau pada nilai fungsi
Fungsi Concave & Convex

Plot turunan pertama dari fungsi cekung & cembung dgn 1 variabel

Turunan kedua dari f(x) untuk fungsi kuadratik


Fungsi Concave & Convex
Jika tanda dari turunan kedua f(x) pada range a ≤ x ≤ b
adalah selalu negatif atau nol, maka fungsi f(x) adalah
funsi cekung (concave)/fungsi dengan titik maksimum

Jika tanda dari turunan kedua f(x) pada range a ≤ x ≤ b


adalah selalu positif atau nol (nonnegatif), maka fungsi
f(x) adalah fungsi cembung (convex)/fungsi dengan titik
minimum.

Strictly concave berarti tanda f’’(x) selalu negatif


Strictly convex berarti tanda f’’(x) selalu positif
Pencarian titik Optimum secara analitik
(menggunakan turunan fungsi /kalkulus)
1. Cari titik stasiuner (Turunan pertama fungsi )
- batas atas & batas bawah selang
- titik maks/min → f’(x) = 0

2. Periksa apakah titik stasiuner tsb merupakan


maks/min lokal (Turunan kedua fungsi)
Salah satu caranya adalah dengan
melibatkan turunan keduanya
(Syarat Perlu dan Syarat Cukup)
- Jika f II (x) > 0 → Minimum Lokal
- Jika f II (x) < 0 → Maksimum Lokal
Pencarian titik Optimum secara analitik
(menggunakan turunan fungsi /kalkulus)
Fungsi dengan 1 variabel
Pencarian titik Optimum secara analitik
(menggunakan turunan fungsi /kalkulus)
Fungsi dengan banyak (n) variabel
Pencarian titik Optimum secara analitik
(menggunakan turunan fungsi /kalkulus)
Fungsi dengan banyak (n) variabel
Pencarian titik Optimum secara analitik
(menggunakan turunan fungsi /kalkulus)
Fungsi dengan banyak (n) variabel

Turunan 1 Fungsi/
Vektor gradien

Turunan ke-2 Fungsi/


Matriks Hess
Pencarian titik Optimum secara analitik
(menggunakan turunan fungsi /kalkulus)
CONTOH SOAL 1
Pencarian titik Optimum secara analitik
(menggunakan turunan fungsi /kalkulus)
CONTOH SOAL 1
Pencarian titik Optimum secara analitik
(menggunakan turunan fungsi /kalkulus)
CONTOH SOAL 1

JAWABAN:

Turunan 1 Fungsi/ Vektor gradien =


Pencarian titik Optimum secara analitik
(menggunakan turunan fungsi /kalkulus)
CONTOH SOAL 1

JAWABAN:

Turunan 1 Fungsi/ Vektor gradien =


Pencarian titik Optimum secara analitik
(menggunakan turunan fungsi /kalkulus)
CONTOH SOAL 1

JAWABAN:

Turunan 1 Fungsi/ Vektor gradien =


Pencarian titik Optimum secara analitik
(menggunakan turunan fungsi /kalkulus)
CONTOH SOAL 1

JAWABAN:

Turunan 1 Fungsi/ Vektor gradien =


Pencarian titik Optimum secara analitik
(menggunakan turunan fungsi /kalkulus)
CONTOH SOAL 1

JAWABAN:

Turunan 1 Fungsi/ Vektor gradien =


Pencarian titik Optimum secara analitik
(menggunakan turunan fungsi /kalkulus)
CONTOH SOAL 1

JAWABAN:

Turunan 1 Fungsi/ Vektor gradien =


Pencarian titik Optimum secara analitik
(menggunakan turunan fungsi /kalkulus)
CONTOH SOAL 1

JAWABAN:

Turunan 1 Fungsi/ Vektor gradien =


Pencarian titik Optimum secara analitik
(menggunakan turunan fungsi /kalkulus)
CONTOH SOAL 1

JAWABAN:

Turunan 1 Fungsi/ Vektor gradien =


Pencarian titik Optimum secara analitik
(menggunakan turunan fungsi /kalkulus)
CONTOH SOAL 1

JAWABAN:

Turunan 1 Fungsi/ Vektor gradien =


Pencarian titik Optimum secara analitik
(menggunakan turunan fungsi /kalkulus)
CONTOH SOAL 1

JAWABAN:

Turunan 1 Fungsi/ Vektor gradien =


Pencarian titik Optimum secara analitik
(menggunakan turunan fungsi /kalkulus)
CONTOH SOAL 1

JAWABAN:

Turunan 1 Fungsi/ Vektor gradien =


Pencarian titik Optimum secara analitik
(menggunakan turunan fungsi /kalkulus)
CONTOH SOAL 2

JAWABAN:
Pencarian titik Optimum secara analitik
(menggunakan turunan fungsi /kalkulus)
CONTOH SOAL 2

JAWABAN:
Pencarian titik Optimum secara analitik
(menggunakan turunan fungsi /kalkulus)
CONTOH SOAL 2

JAWABAN:
Pencarian titik Optimum secara analitik
(menggunakan turunan fungsi /kalkulus)
CONTOH SOAL 2

JAWABAN:
Pencarian titik Optimum secara analitik
(menggunakan turunan fungsi /kalkulus)
CONTOH SOAL 2

JAWABAN:
Pencarian titik Optimum secara analitik
(menggunakan turunan fungsi /kalkulus)
CONTOH SOAL 2

JAWABAN:
Pencarian titik Optimum secara analitik
Maksimum atau Minimum?
Pencarian titik Optimum secara analitik
Maksimum atau minimum ?
Tabel hubungan antara sifat fungsi 𝑓(𝑥) dengan H(𝑥):
Pencarian titik Optimum secara analitik
Maksimum atau minimum ?
Tabel hubungan antara sifat fungsi 𝑓(𝑥) dengan H(𝑥):

Bila terdapat hasil test matriks Hess suatu fungsi tidak tergolong aturan di atas, maka besar
kemungkinan pada titik 𝑥 ∗ tertentu pada fungsi tersebut adalah titik pelana/titik balik/saddle point.

Jika sebuah fungsi memiliki titik stasioner dengan matriks Hess-nya memiliki nilai eigen dengan
tanda berbeda-beda, maka fungsi tersebut tidaklah cembung (convex) dan tidak juga cekung
(concave).
Pencarian titik Optimum secara analitik
Maksimum atau minimum ?
Tabel hubungan antara sifat fungsi 𝑓(𝑥) dengan H(𝑥):

Misalkan sebuah fungsi dengan dua variabel memiliki elemen diagonal matriks Hess positif, namun setelah
dianalisa determinan principal minor-nya menghasilkan :

Det M1 positif

Der M2 negatif

Maka fungsi tersebut memiliki titik stasioner berupa titik pelana/titik balik/saddle point (perhatikan contoh-
contoh soal yang diuraikan selanjutnya).
Pencarian titik Optimum secara analitik
Maksimum atau minimum ?
Tabel hubungan antara sifat fungsi 𝑓(𝑥) dengan H(𝑥):

Misalkan sebuah fungsi dengan dua variabel memiliki elemen diagonal matriks Hess positif, namun setelah
dianalisa determinan principal minor-nya menghasilkan :

Det M1 positif

Der M2 negatif

Maka fungsi tersebut memiliki titik stasioner berupa titik pelana/titik balik/saddle point (perhatikan contoh-
contoh soal yang diuraikan selanjutnya).
Pencarian titik Optimum secara analitik
Maksimum atau minimum ?
Pencarian titik Optimum secara analitik
Contoh Soal 3
Pencarian titik Optimum secara analitik
Contoh Soal 3
Pencarian titik Optimum secara analitik
Contoh Soal 3
Pencarian titik Optimum secara analitik
Contoh Soal 3
Pencarian titik Optimum secara analitik
Contoh Soal 3
Pencarian titik Optimum secara analitik
Contoh Soal 3
Pencarian titik Optimum secara analitik
Contoh Soal 3
Pencarian titik Optimum secara analitik
Contoh Soal 3
Pencarian titik Optimum secara analitik
Contoh Soal 3
Pencarian titik Optimum secara analitik
Contoh Soal 3
Pencarian titik Optimum secara analitik
Contoh Soal 3
Pencarian titik Optimum secara analitik
Contoh Soal 3
Pencarian titik Optimum secara analitik
Contoh Soal 3
Pencarian titik Optimum secara analitik
Contoh Soal 3
Pencarian titik Optimum secara analitik
Contoh Soal 4
Pencarian titik Optimum secara analitik
Contoh Soal 4
Pencarian titik Optimum secara analitik
Contoh Soal 4
Pencarian titik Optimum secara analitik
Contoh Soal 4

Determinan
Principal
Minor
Pencarian titik Optimum secara analitik
Contoh Soal 4
Test
Eigenvalue
Pencarian titik Optimum secara analitik
Contoh Soal 4
Pencarian titik Optimum secara analitik
Latihan Soal

5
OPTIMIZATION OF UNCONSTRAINED
FUNCTIONS: ONE-DIMENSIONAL SEARCH
Teknik Optimasi
1. Indirect Method
Mencari titik optimum menggunakan syarat perlu dan
analisa turunan
(sdh dijelaskan minggu lalu)

2. Direct Method
(Optimasi Numerik)
metode pencarian titik ekstremum fungsi dengan
menguji coba serangkaian titik pada fungsi
 dapat dilakukan dengan bantuan komputer
Teknik Optimasi

direct method, stop when:

f(xk+1) - f(xk)  ε
direct method, stop when:

f(xk+1) - f(xk)  ε
Penentuan titik awal X0, prosedur
penggolongan (bracketing)
Semakin dekat titik awal (X0) terpilih dari titik
optimum, maka semakin cepat proses
pencarian optimasinya (Edgar & Himmelblau
2001).

Mis: Minimize f(x) = (x- 100)2


X 0 1 3 7 15 31 63 127 255
f(x) 104 9801 9409 8649 7225 4761 1369 729 2325
OPTIMIZATION OF UNCONSTRAINED
FUNCTIONS: ONE-DIMENSIONAL SEARCH

1. Newton’s Method
2. Finite Difference Approximation of
Newton’s Method (FDAD) / Quasi
Newton Method
3. Secant Method

Metode numerik kadang tidak dpt menemukan titik


optimum yg pas, tapi mendekati
1. NEWTON’S METHOD
• Metoda Iteratif (berulang!)

Dengan sendirinya rumus memberikan arah pencarian


Tentukan x awal !

Sampai kapan iterasi selesai?


- nilai

yang diinginkan .
- Sdh tidak ada beda antara nilai
fungsi iterasi satu dengan nilai
k+n fungsi pada iterasi berikutnya
f(xk+1) - f(xk)  ε
Minimumkan fungsi
gunakan metode newton dengan titik awal
pencarian x0 = 3 . Lakukan setidaknya 3 kali
iterasi untuk memastikan optimum tercapai.
2. FDAD/QUASI NEWTON METHOD
Digunakan dalam kasus turunan fungsi tidak diketahui
atau bila f(x) sulit diturunkan

Tentukan nilai h (h = ukuran


langkah pencarian)

Didekati dgn 2 titik dari samping


kanan dan kiri
3. SECANT METHOD

~
x* = xq – f’ (xq)
[f’(xq) – f’(xp)] / (xq-xp)
CONTOH SOAL
Minimisasi fungsi f(x) = x2 – x
Menggunakan metode
1.Indirect (analisa turunan)
2.Newton (x0=3)
3.Quasi Newton (misal h=10-3,
h=10-6)
4. Secant
(misal xp = -3 dan xq = 3)
CONTOH SOAL
Minimisasi fungsi f(x) = x4 – x + 1
Menggunakan metode
1.Newton (x0=3)
2.Quasi Newton (misal h=0.1)
3.Secant
(misal xp = -3 dan xq = 3)
Problem no.5.10 buku optimization of chemical
processes:
The total annual cost of operating a pump and
motor ( C) in a particular piece of equipment
is a function of x, the size (horsepower) of the
motor, namely
C = $500 + $0.9x + $0.03 (150,000)
x
Find the motor size that minimizes the total
annual cost.
Unconstrained Multi-variable
Optimization
Find X* = [x1, x2, … xn]T
That minimizes f(x1, x2, … xn)  f(x)
Suppose the function f (x) is a function that has a second
partial derivative at x*, if x* is the local minimum point, then
first-order condition
and
definit / semidefinit positive (second order condition),
where point x* so that ∇f (x*) = 0 is called a critical
point or an extreme point or stationary point of
function f.

The critical point of the function f (x) which is not the maximum
point and not the minimum point is called the saddle point /
saddle point of the function f (x).
The necessary conditions and the sufficient
condition to guarantee that x* is an extremum

1. F(x) is twice differentiable at x*


2. , that is, a stationary point exists at x*
3. H(x*) is positive definite for a minimum to exits at x*,
and negative definite for a maximum to exist at x*.
Determine if any extrema exist.
solution

2
Critical value of is

Thus (0,0) is not the maximum or minimum point of function f (x)

Thus (1,1) is the local minimum point of function f (x)


Determine if any extrema exist.
solution

-
-
4
-2

= (-2, 4, 1)
-2
Hessian matrix H (x) =

 f (x) = maximum
Determine if any extrema exist.
solution
x* = (0,0,0)T

(0,0,0) is minimum point for f (x)


Prove that f (x1, x2, x3) is convex function!
 f (x1, x2, x3) is convex function
How to optimize multi-variable
function
 Direct Methods
-- not require the use of derivatives in determining the
search direction.
Direct methods: simplex method, random search, grid
search, univariate search, conjugate search direction,
powell’s method
 Indirect Methods
Do make use of derivatives in determining the search
direction for optimization.
Indirect method: gradient method,
 Untuk kasus maksimasi, arah pencarian
merupakan gradien (disebut juga “steepest
ascent”); sedangkan untuk
 Untuk kasus minimasi, arah pencarian adalah
negatif dari gradien (“steepest descent”).
 l

l l f(xk+1)l – l f(xk)l l   atau l l (xk+1) – (xk) l l  


atau ll f(xk)l l  
s0 berupa:

s0
0

s0

s0)
s0
s1

x1 + s1

f(x1 + s1)

x2 = x1 + s1
Dengan menggunakan steepest descent, tentukan
minimum dari fungsi
F(x) = f(x1,x2)= x1-x2+2x12+2x1x2+x22

Titik awal xo = [0, 0] dan


kriteria pemberhentian selisih nilai f(xk+1) dan f(xk) < 0,01
xk+1 = xk +  xk
Tahapan Newton method
 Choose a starting point X0
 Calculate  f(xk) dan 2 f(xk)
 Calculate

 Do it all over again until converged

l l f(xk+1)l – l f(xk)l l  
Tahapan Newton method
 Tentukan x0
 Cari vektor gradient  f(xk)
 Cek  f(xk)
Jika  f(xk)=0 maka sudah optimum
Jika  f(xk)= 0 maka cari H(xk) dengan iterasi cara 1
(invers) atau cara 2 (bukan invers)

; xk+1 = xk +  xk
• Cek kembali  f(xk)
• Cek iterasi
l l f(xk+1)l – l f(xk)l l   atau l l (xk+1) – (xk) l l  
atau ll f(xk)l l  
OPTIMIZATION OF FUNCTION
WITH CONSTRAINTS
Direct elimination method
Optimize f (x, y) = x2 + y2
Subject to y + 3x = 3
Solution:
f (x,y) = x2 + y2
= x2 + (3 – 3x)2
= x2 + 9 -18x + 9x2
= 10x2 – 18x + 9 (new objective function)

f(x,y) = 20x – 18 = 0
20x = 18
x = 9/10 = 0.9

y = 3 – 3x
y = 3 – 3 (0.9)
y = 0.3
f’’(x,y) = 20 > 0

Optimum at (0.9,0.3) with f(x,y) = 0.9


LAGRANGE MULTIPLIER METHOD
Minimize f (x)
Subject to g (x)

 is a parameter which relates the partial derivative of


f(x) and g(x)
 is commonly referred to as a Langrange multiplier.
If an augmented objective function, called the
Langrangian, is defined as

L (x,) = f(x) +  g(x)


Optimum condition:

In addition to the necessary conditions for a


constrained optimum the following equation
must hold:

g(x)
Solve the problem
Minimize f (x, y) = x2 + y2
Subject to y + 3x = 3
By the Lagrange multiplier method.
Solution.
The Lagrange function is
L(x,y,) = x2 + y2 +  (y+ 3x – 3)

The necessary conditions for a stationary point are:


f(x,y) = 0,9
Exercise
Minimize

Subject to

Answer:

The necessary condition for a stationary point are

Eq.1

Eq.2

Eq.3
Eq.2

Eq.1

From Eq.3
With f (x) = 0.9
Exercises

1. Optimize Z (x,y) = 6-4x-3y


Subject to x2+y2 = 1

2. Optimize
Subject to
Optimize Z (x,y) = 6-4x-3y
Subject to x2+y2 = 1
Optimize f(x1,x2) = 4x12 + 5x22
Subject to 2x1 + 3x2 = 6
Subject to
The necessary condition for a stationary point are
Function with inequality constraint
Minimize
Subject to
x12 + x22 -1 ≤ 0
x1 2 + x 2 2 – 1 + u 2 = 0
Solution
Solve the problem
Minimize f(x) = x1x2
Subject to
The lagrange function is:

L (x1, x2, , )
The necessary conditions for a stationary point are:

-
Metode Karush Kuhn-tucker untuk
Inequality Constraint
• If we have objective function f(x,y) and constraint
g(x,y) < 0 then we have equation
L (x,y,) = f(x,y) - .g(x,y)

• To find the maximize/minimize from the equation we


have consider 5 condition:
=0 U
minimum

-80/25
Solve the problem using Kuhn Tucker method
Minimize f(x) = x1x2
Subject to
Metode kuhn tucker
Minimumkan f(x,y) = x2 – xy + 2y2
Dengan kendala x + y  8
Minimumkan f(x) = x12 + x22 – 4x1 – 4x2 + 8
Dengan kendala : x1 + 2x2 – 4  0
Dengan menggunakan metode Lagrange,
tentukan nilai optimum dari
f(x,y,z) = x2 +2y – z2
Dengan kendala
g (x) : 2x – y = 0
h (x) : y + z = 0
Optimasi ukuran kotak tanpa tutup

Kotak tanpa tutup yang isinya 32 m3 akan dibuat


secara tepat. Ingin diketahui ukuran kotak
(panjang = x, lebar = y, tinggi=z) yang luasnya
(termasuk dasar) minimum
Genetic Algorithms

Genetic Algorithms © Yandra Arkeman 2022 1


What are Genetic Algorithms?

 Genetic Algorithms (GA)


 Search algorithm (computerized)
 Based on natural selection, genetics principles and
survival of the fittest (theory of evolution)
 Population-based search, not point to point search

Genetic Algorithms © Yandra Arkeman 2022 2


ClickPoint
to edit
to Master
Point Search
title style

Tangent of f
(x) at xk

x
f (x) x* xk+1 xk

Newton’s Method approximates f (x) as a straight line


at xk and obtains a new point (xk+1), which is used to
approximate the function at the next iteration. This is
carried on until the new point is sufficiently close to x*.
Point to Point Search
xU xL
xL xL
xU xU

Dichotomous

1 2 3 5 8
Fibonacci: xU Golden-Section Search
1 1 2 3 5 8… xL xL xU divides intervals by
Ik+5 Ik+4 Ik+3 Ik+2 Ik+1 Ik K = 1.6180
Multiple Points or Population Based Seacrh

 The use of a GA to solve a function can be illustrated below :

f(x) Solutions’ coding

I1,1 = 100110110001110

I1.2 = 100110001110101

I1.n = 110110110001110

x
i1,1 I1,2 I1,n

Genetic Algorithms © Yandra Arkeman 2022 5


 Using a particular encoding technique, a GA
manipulates the chromosomes (binary digit 1 and
0) which represents the points in search space
 Genetic Algorithms solve the optimization
problems by manipulating the chromosomes
blindly using crossover and mutation operators
 The only information needed by GA is the fitness
function or the evaluation function of each
chromosome

Genetic Algorithms © Yandra Arkeman 2022 6


 The maximum point for the above function is
difficult to find by calculus (point to point
based search) as many sub-optimum values
exist
 GA can find the maximum point by using
blind and parallel search methods (multi-
point search)
 Blind means no derivatives or other
information needed except the fitness value

Genetic Algorithms © Yandra Arkeman 2022 7


 The differences of genetic algorithms (GA)
with analytical methods:
1. GA work with a coding of solution set, not the
solutions themselves
2. GA search from a population of solutions, not a
single solution
3. GA use payoff information (fitness function), not
derivatives or other auxiliary knowledge
4. Genetic algorithms use probabilistic transition
rule, not deterministic rule

Genetic Algorithms © Yandra Arkeman 2022 8


Timeline of main Cuckoo search
Firefly alg. The Monkey Search
Intelligent Water Drops Algorithm

contributions. Honey-Bee mating Optimization


Glowworm swarm optimization

Metaheuristic Bee colony Optimization

Genetic Algorithms © Yandra Arkeman 2022 9


Steps of Genetic Algorithms:
1) Generate initial population randomly
2) Evaluate each chromosome in this population using its fitness
function
3) Select a set of chromosomes to be “parents” and then
reproduce new chromosomes using crossover and mutation
operators
4) Evaluate these new chromosomes using their fitness functions
5) If stopping criteria reached, then stop else go to step 3.

Genetic Algorithms © Yandra Arkeman 2022 10


010000 011111 110111
100000 100010 111101
110011 110100
CROSSOVER 111111
001010 CROSSOVER 101000 111110
101111 101111 101111
110100 110100 … 110111
001101 110101 111101
101000 MUTATION 110000 MUTATION
111011
110010 110100 110111
110001 100000 repeating process
101111

Population 0 Population 1 Population 50


(Initial) (Final)

a chromosome

Genetic Algorithms © Yandra Arkeman 2022 11


Procedures of GAs
Start

Describe Problem

Generate Solutions

Yes
Step 1 Is it good enough? Stop

NO
Step 2
Select best parents to reproduce

Step 3
Step 4 Create a set of offspring
Step 5

Genetic Algorithms © Yandra Arkeman 2022 12


GA in Action !

A simple example :

 Max : f(x) = x2 ; 0 < x <=31

 We can make 5-digit chromosomes


to encode the search space 0 – 31

 Those chromosomes are : f(x)


00000  0 Max
00001  1
....... …
10101  21
....... …
11111  31

Then, we use HAND CALCULATION 0 31 x

Genetic Algorithms © Yandra Arkeman 2022 13


Explanation :
1 0 1 0 1

(1 x 24) + (0 x 23) + (1 x 22) + (0 x 21) + (1 x 20) = 21

 At first, generate initial population randomly. This population


consists of 4 chromosomes.

 Suppose that the initial chromosomes generated are :


01101  13
11000  24
01000  8
10011  19

Genetic Algorithms © Yandra Arkeman 2022 14


 Fitness function, f(x) = x2, so fitness value for each chromosome
are :

Fitness value
Chrom. No. Chrom. Structure x value
f(x) = x2
1. 01101 13 169
2. 11000 24 576
3. 01000 8 64
4. 10011 19 361
Total 1170
Average 293
Max 576

Genetic Algorithms © Yandra Arkeman 2022 15


 The next steps are crossover and mutation to create a new population.

 Before reproduction, chromosomes are selected based on their fitness


values

 Naturally, chromosomes which have high fitness value will be selected as


parents.

 A most commonly used selection technique is Roulette Wheel Selection.

 For the above case, suppose that the parents selected are :

 Chrom. 1 X Chrom. 2

 Chrom. 2 X Chrom. 4

Genetic Algorithms © Yandra Arkeman 2022 16


 The crossover process of Chrom. 1 and Chrom. 2 :
crossover point
(random)

P1 : 0 1 1 0 1 13

P2 : 1 1 0 0 0 24

fitness value
C1 : 0 1 1 0 0 12

C2 : 1 1 0 0 1 25

This process produces a child that is fitter than its parents

Genetic Algorithms © Yandra Arkeman 2022 17


 Crossover of Chrom. 2 and Chrom. 4 :

P1 : 1 1 0 0 0 24

candidate for
P2 : 1 0 0 1 1 19
optimum solution

C1 : 1 1 0 1 1 27

C2 : 1 0 0 0 0
16

 This process also shows that crossover creates a new chromosome


(child) that is fitter than its parents (higher fitness value).

The fittest chromosome is the candidate for optimal solution

Genetic Algorithms © Yandra Arkeman 2022 18


 A new population (Population 1) produced is :

Fitness value of
Chrom. No Chrom. Structure x value
f (x) = x2
1. 01100 12 144
2. 11001 25 625
3. 11011 27 729
4. 10001 16 256
Total 1754
Average 439
Max 729

Genetic Algorithms © Yandra Arkeman 2022 19


 This example shows that total, average and maximum
fitness values of the new population are higher than
initial population.

 This means that the searching process leads to an


optimum solution  CONVERGENT

 As mentioned before, the chromosome which has


maximum value is the candidate for the optimum
solution for the problem given

Genetic Algorithms © Yandra Arkeman 2022 20


Now, we continue our hand calculation…
Suppose that next crossover and mutation are:

P1 : 1 1 0 1 1 27

P2 : 0 1 1 0 0 12

C1 : 1 1 1 0 0 28

C2 : 0 1 0 1 1
11

mutation

*
C2’ 1 1 0 1 1 27

Genetic Algorithms © Yandra Arkeman 2022 21


 A new population (Population 2) produced is :

Fitness value of
Chrom. No Chrom. Structure x value
f (x) = x2
1. 11100 28 784
2. 11011 27 729
3. 11011 25 625
4. 10001 16 256
Total 2394
Average 598.5
Max 784

Genetic Algorithms © Yandra Arkeman 2022 22


If the above reproduction process continues, then it
will produce the optimum solution as follows :
x* = 31  f(x) = x2 = 961

Fitness value of
Chrom. No Chrom. Structure x value
f (x) = x2
1. 11111 31 961
2. 11111 31 961
3. 11111 31 961
4. 11111 31 961
Total 3844
Average 961
Max 961

Genetic Algorithms © Yandra Arkeman 2022 23


The GA search process is illustrated below:

optimum solution
Fitness

961 Max Fitness

784

729

576

0 1 2 … Gmax Generation

Genetic Algorithms © Yandra Arkeman 2022 24


 After hand calculation  computer simulation
 Program is developed in Delphi 7 (new version
of Pascal)
 Program can be translated into C++, etc.
 The output of the program for f(x)=x2, in the
interval 0 – 63 is presented in the following
slides.
 The plot of the output is presented in the next
figure

Genetic Algorithms © Yandra Arkeman 2022 25


Plot of GA search for f(x) = x2

4500

4000

3500

3000
Fitness Value

2500
MaxFitness
MinFitness
AvgFitness
2000

1500

1000

500

0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
Generation

Genetic Algorithms © Yandra Arkeman 2022 26


 Note that in the above two examples population sizes are only
4 and 10 ; and chromosome lengths are only 5 and 6.
 In real application of GA, population size could be 20 to 50
and chromosome length could be 50 or more.
 To find an optimum solution for a difficult function, number of
generation could be up to 500.

Genetic Algorithms © Yandra Arkeman 2022 27


Genetic Algorithms © Yandra Arkeman 2022 28
CONTOH
Maksimumkan f (x) = 4x12 + 5x22

x1 dan x2  [0, 31]


Gunakan kromosom dengan 5 digit untuk masing2 x1
dan x2
Ukuran populasi = 4
Generasi = 1
Gunakan Algoritma Genetika!
CONTOH
Maksimumkan f (x) = 4x12 + 5x22

x1 dan x2  [0, 31]


Gunakan kromosom dengan 5 digit untuk masing2 x1
dan x2
Ukuran populasi = 10
Generasi = 3
Gunakan Algoritma Genetika!
Genetic Algorithms can be applied to :
1. Function Optimization
2. Combinatorial Optimization
Function Optimization  Continuous, Real-value variable
Combinatorial Optimization  Discrete, String variable

Genetic Algorithms © Yandra Arkeman 2022 31


GA for Function Optimization

f(x)

Decision variable x
is continuous and has
real value

0.1 0.9 x

Genetic Algorithms © Yandra Arkeman 2022 32


Combinatorial Optimization

Cost
In combinatorial
optimization decision
variable is discrete and
has string value

abcd dacb bcda


Schedule

Genetic Algorithms © Yandra Arkeman 2022 33


Example 2. GA for Complex Function Optimization

1) Max f ( x1 , x2 )  21.5  x1 Sin (4 x1 )  x2 Sin (20 x2 )


 3,0  x1  12,1
4,1  x2  5,8

Gen & Cheng (1997)

x1* = 11.631407
x2* = 5.724824
f (x1*,x2*) = 38.818208

Genetic Algorithms © Yandra Arkeman 2022 34


CHROMOSE STRUCTURE
bj  a j
x j  a j  decimal ( substring j )  (12,1  (3,0))  10 4  151000
mj
2 1 217  151000  218  m1  18

(5,8  4,1)  10 4  17000


214  17000  215  m2  15

m  m1  m2  18  15  33
33 bit

vj 000001010100101001 101111011111110

18 bit 15 bit

12,1  (3,0)
Kromosom Nilai desimal x1   3.0  5417    2,687969
2 1
18
x1 000001010100101001 5417
101111011111110 5,8  4,1
x2 24318 x2  4,1  24318   5,361653
2 1
15

Genetic Algorithms © Yandra Arkeman 2022 35


Experimental Result ….
(PopSize=20; MaxGen=1000; Pc=0.88; Pm=0.20)

41 Gen & Cheng (1997)


Fitness maksimum x1* = 11.631407
39
x2* = 5.724824
37 f (x1*,x2*) = 38.818208
35
33
Fitness

31
29 x1* = 11.66395
Fitness rata-rata x2* = 5.724876
27
f (x1*,x2*) = 38.849309
25 Fitness * = 38,849309
23 at gen. 500th
21
0 50 100 150 200 250 300 350 400 450 500 550
Generasi

Genetic Algorithms © Yandra Arkeman 2022 36


Example 3. GA for Complex Function Optimization
2 y2
 x 2  ( y 1) 2 x 4  x 2  y2 e  ( x 1)
2) f (x, y)  3 (1 - x) 2 e  10   x  y  e
3

2  3
- 3  x, y  3

Chong & Zak (1996)


x* = - 0.004944 F(x,y)
y* = 1.645203
f (x*,y*) = 8.042244

y x

Genetic Algorithms © Yandra Arkeman 2022 37


Experimental Result… Chong & Zak (1996)
(PopSize=20; MaxGen=1000; Pc=0.88; Pm=0.10) x* = - 0.004944
y* = 1.645203
f (x*,y*) = 8.042244
10 Fitness maksimum

9
Fitness rata-rata Using MATLAB :
8
x* = - 0.0303
7 y* = 1.5455
f (x*,y*) = 8.0926
Fitness

4
x* = - 0.362142
3 Fitness * = 9,276291 y* = - 1.263218
2 At gen. 81th f (x*, y*) = 9.276291

1
0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150
Generasi

Genetic Algorithms © Yandra Arkeman 2022 38


Genetic Algorithms for Combinatorial Optimization

 GAs can also be used to solve “Combinatorial


Optimization Problems”, including :
1. Production scheduling (will be explained in details)
2. Plant-layout design
3. Transportation problems
4. Project management

Genetic Algorithms © Yandra Arkeman 2022 39


Flow-shop Scheduling Problems
 The flow shop problem can be presented as a set of N jobs {J1,J2,… JN} to schedule on M
machines.
 The machines are critical resources: one machine cannot be assigned to two jobs
simultaneously.
 Each jobs is composed of M consecutive tasks Ji = {ti1, ti2, …, tiM}, where tij represents the
jth task of the job Ji requiring the machine mj.
 It should be noted that jobs have the same processing sequence on the machines. To each
task tij is associated a processing time pij.

Genetic Algorithms © Yandra Arkeman 2022 40


 If number of jobs to be scheduled is n, the number of all
possible schedule is n!
 Example:
 No of job = 4  No of schedule = 4 ! = 24
 No of job = 6  No of schedule = 6 ! = 720
 So, the number of schedule increase dramatically if the
number of jobs increase
 No of job = 15
 No of schedule = 15! = 1,307,674,368,000
 This is called “Combinatorial Explosion”

Genetic Algorithms © Yandra Arkeman 2022 41


 If we have 15 jobs and all possible schedule must be
evaluated and if it needs 1 second to calculate one schedule,
the time required is 41,466 years to finish the calculation,
even using a computer !
 Using genetic algorithms, we only need to evaluate less then
1% of search space to find the optimum solution  often less
than 1 hour to finish calculation  very efficient

Genetic Algorithms © Yandra Arkeman 2022 42


Chromosome Structure

 Chromosome is represented in string form (not in


binary digit)
A B C D E F G H I
(not 1 0 1 0 1 0 1 1 0 1)
 Crossover  Partially Matched Crossover (PMX)
(repairing strategy)
 Mutation  inverse mutation

Genetic Algorithms © Yandra Arkeman 2022 43


Example crossover and mutation

Example of PMX :  Explanation :


 The chromosomes located between C1
C1 C2
and C2 are interchanged as follows :

C B G A F D I H E G B

A D
E H B D C I A F G
F C

D I
F G B D C I A H E

E H G A F D I C B
 The mutation technique used is
“inverse methods”, as describe below :
* *
C B G A F D I H E

C I G A F D B H E

Genetic Algorithms © Yandra Arkeman 2022 44


Example 1 : 4 jobs – 2
machines
Job processing time at M1 and M2

Mesin \ Job A B C D

M1 10 14 4 20

M2 6 8 16 12

This example just to show how GA works


Number of search space is 4! = 24  small
 CADB, DCAB

Genetic Algorithms © Yandra Arkeman 2022 45


Make-span value for all possible schedules

Genetic Algorithms © Yandra Arkeman 2022 46


Experiment Results

Plot of fitness value of GA’s search


(PopSize=10; MaxGen=500; Pc=0.90; Pm=0.01)

0,020

0,019

0,018

0,017
Fitness

0,016

0,015

0,014 Fitness * = 0,018519

0,013
0 10 20 30 40 50 60 70 80 90 100
Generasi

MaxFit MinFit AvgFit

Genetic Algorithms © Yandra Arkeman 2022 47


Plot of the best (smallest) makespan value in populations
(PopSize=10; MaxGen=500; Pc=0.90; Pm=0.01)

56,5

56

55,5

55
Makespan

54,5

54

53,5

53 Makespan * = 54

52,5
0 10 20 30 40 50 60 70 80 90 100
Generasi

Genetic Algorithms © Yandra Arkeman 2022 48


Example 2 : 8 jobs – 3
machines

Job processing time at M1, M2 and M3

Mesin \ Job A B C D E F G H

M1 48 26 44 2 30 40 14 66

M2 70 56 6 74 62 96 52 78

M3 18 104 22 36 100 10 82 34

Number of search space is 8! = 40,320

Genetic Algorithms © Yandra Arkeman 2022 49


Experiment Results

Plot of fitness values of GA’s search


(PopSize=10; MaxGen=500; Pc=0.90; Pm=0.01)

0,0022

0,0020

0,0018
Fitness

0,0016

0,0014

Fitness * = 0,001976
0,0012

0,0010
0 10 20 30 40 50 60 70 80 90 100 110
Generasi

MaxFit MinFit AvgFit

Genetic Algorithms © Yandra Arkeman 2022 50


Plot of the best (smallest) makespan values in populations
(PopSize=10; MaxGen=500; Pc=0.90; Pm=0.01)

550

540

530
Makespan

520

510

500

Makespan * = 506
490

480
0 10 20 30 40 50 60 70 80 90 100 110
Generasi

Genetic Algorithms © Yandra Arkeman 2022 51


 As can be seen in the previous slides the smallest makespan value in Example-2 is
found at the 20-th generation. The number of chromosomes evaluated (Ns) by GA
until this generation is:
Ns = (20 generation) x (22 chromosomes / generation) = 440 chromosome

 The number of chromosomes in the whole search space (Nt) is :


Nt = (number of job permutation ) = 8! = 40320 chromosomes

 Percentage of search of the GA in the serach space (PSearch) is :


PSearch = (Ns / Nt) x 100% = (440 / 40320) x 100% = 1,09 %

It can be seen that the GA search for optimum solution is very efficient

Genetic Algorithms © Yandra Arkeman 2022 52


Concluding Remarks :
 There are still a lot of unsolved problems in system engineering
 An alternative to solve those problems is by using Genetic Algorithms
 In using GAs, one can just use the available chromosome structures
and reproduction techniques
 then can be implemented in the computer.

 The real challenge for engineering scientists now (including graduate


and postgraduate students) is to create new reproduction techniques
and chromosome structures
 that can be applied to their problems

 We can make GA programs using Delphi7 or C++


 GA soft wares are being developed in many research centers now.
 This software is called “GA-Shell”, which still have many
limitations in its capability

Genetic Algorithms © Yandra Arkeman 2022 53


Any
question..?

Genetic Algorithms © Yandra Arkeman 2022 54


ALGORITMA GENETIK
KELAS RESPONSI

Mata Kuliah Teknik Pemodelan dan Optimasi Proses


Departemen Teknologi Industri Pertanian
Fateta - IPB
Genetic Algorithms
 Dimulai dengan satu set solusi random inisial =
population
 Setiap individu dalam populasi disebut kromosom,
yang merepresentasikan sebuah solusi pada
problem
 Sebuah kromosom merupakan simbol string,
biasanya berupa bit biner

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB


Genetic Algorithms
 Kromosom berevolusi melalui beberapa iterasi,
yang disebut generasi
 Pada masing-masing generasi, kromosom
dievaluasi, menggunakan pengukuran fitness
 Untuk menciptakan generasi berikutnya, kromosom
baru, disebut sebagai offspring, dibentuk melalui
proses crossover atau mutasi

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB


Genetic Algorithms
 Generasi baru dibentuk melalui:
- Selecting menurut nilai fitness (fitness values)
- Rejecting yang lain untuk menjaga ukuran populasi
tetap konstan
 Setelah beberapa generasi, algoritma mendekati
kromosom terbaik, yang diharapkan
merepresentasikan solusi optimum dari problem
(permasalahan)

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB


Genetic Algorithms, apa yang baru?
 GA bekerja dengan kode solusi, bukan solusi itu
sendiri
 GA mencari untuk grup solusi, bukan solusi tunggal
 GA menggunakan informasi langsung dari problem
atau constraint
 GA menggunakan pendekatan stokastik

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB


Mengapa menggunakan Genetic Algorithms?
 GA tidak membutuhkan latar belakang matematis
dari permasalahan
 GA efektif untuk pencarian global
 GA fleksibel dengan metode lain
- GA dengan fuzzy
- GA dengan ANN
- dll

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB


Terminologi Genetic Algorithms
 Populasi = sekelompok kromosom
 Kromosom = solusi
 Gene (bit) = bagian dari solusi

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB


Konversi!
 Konversi Bilangan Desimal → Biner
1 0 1 0 1 Gunakan bantuan
software konversi
setelah memahami
konversi secara
manual ya

(1 x 24) + (0 x 23) + (1 x 22) + (0 x 21) + (1 x 20) = 21

 Konversi Bilangan Biner → Desimal

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB


Struktur Genetic Algorithms

Populasi Seleksi
Evaluasi
awal

Crossover

Representasi
Mutasi
NO

Evaluasi Stop?
Start
YES

End

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB


Populasi Awal
 Populasi awal dibentuk secara random, sehingga
akan terdapat sejumlah kromosom acak sebagai
solusi awal
 Kromosom dapat berupa bilangan biner atau
bilangan nyata

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB


1. EVALUASI
 Tujuan: mengevaluasi nilai fitness masing-masing
kromosom
 Prosedur: masing-masing kromosom merupakan

pengkodean dari solusi, sehingga masing-


masingnya harus dikodekan menjadi solusi.
Untuk masing-masing solusi maka terdapat fungsi
fitness (fungsi objektif) untuk melihat apakah solusi
tersebut optimal atau tidak

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB


2. SELEKSI
 Masing-masing kromosom dipilih menurut nilai
fitness. Kromosom dengan nilai fitness yang lebih
tinggi akan bertahan
 Metode: roulette wheel, top selection dll

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB


2. SELEKSI : a. Roulette Wheel
 Terinspirasi dari Roulette Wheel di Kasino

E (5%)

Sehingga Koromosom dengan


D (20%) A (25%)
area yang lebih besar memiliki
kesempatan yang lebih besar untuk
B (15%) terpilih pada generasi berikutnya
C (35%)

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB


2. SELEKSI : a. Roulette Wheel
 Kalkulasikan nilai fitness utk masing masing
kromosom (yk)
 Jumlahkan semua nilai fitness (F)
 Kalkulasikan probabilitas masing-masing kromosom
(pk)
 Kalkulasikan Probabilitas kumulatif dari masing-
masing kromosom (qk)
 Ciptakan bilangan acak [0,1], kromosom pertama
di mana qk > nilai random yang dipilih

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB


2. SELEKSI : a. Roulette Wheel
 Contoh:
Kromosom Fitness Probabilitas Kumulasi Prob
1 10 0.1 0.1
2 23 0.23 0.33
3 16 0.16 0.49
4 20 0.2 0.69
5 31 0.31 1
Total 100

 Jika nilai random terpilih = 0.13 maka kromosom 2


yang terpilih. Jika nilai random terpilih = 0.5 maka
kromosom 4 yang terpilih
Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB
2. SELEKSI : b. Top
 Generasi berikutnya merupakan sejumlah kromosom
terbaik dari tahapan sebelumnya
 Dapat terjebak pada super kromosom

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB


3. Crossover
 Dua kromosom dapat menghasilkan dua offspring
dengan crossover. Ide berawal dari
mengkombinasikan gen antara dua kromosom untuk
membentuk individu baru
 Crossover rate (pc) = rasio offspring baru terhadap
populasi
 Crossover population = satu titik potong, banyak
Nilai “pc”
titik potong, dll biasanya
diketahui
pada soal ya

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB


3. Crossover
 Contoh 1
100110100
111000101
Crossover bisa
dilakukan pada
satu titik potong
pada sebuah
100110101 kromosom
111000100

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB


3. Crossover
 Contoh 2
100110001
111000101
Atau..
Crossover bisa
dilakukan pada
dua titik potong
111000001 pada sebuah
kromosom
100110101

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB


4. Mutasi
 Mutation Rate (pm) = rasio gen dibanding gen
dalam populasi yang mengalami mutasi
 Contoh
111000101
“pm” biasanya
sudah diketahui
pada soal

110000101

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB


4. Prosedur Mutasi
 Ciptakan nilai random untuk setiap gen (bit)
 Gen dengan nilai random kurang dari pm
dimutasikan

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB


Kriteria pemberhentian
 Stop pada generasi tertentu (membatasi jumlah
generasi/iterasi)
 Stop jika nilai fitness konstan untuk beberapa
generasi
 Stop jika tidak lagi ditemukan nilai fitness yang
lebih baik setelah beberapa generasi

Kapan kita
berhenti ber-
iterasi?
Ini jawabannya!

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB


CONTOH APLIKASI GA

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB


Contoh Soal GA
. f ( x , x ) = 21.5 + x Sin (4 x ) + x Sin (20 x )
Max 1 2 1 1 2 2
− 3,0  x1  12,1
4,1  x2  5,8

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB


Contoh Soal GA
. f ( x , x ) = 21.5 + x Sin (4 x ) + x Sin (20 x )
Max 1 2 1 1 2 2 Fungsi tujuan.
− 3,0  x1  12,1 Bila memasukan
nilai x1 dan x2,
4,1  x2  5,8 bisa diperoleh
nilai f(x1,x2)
yang biasa
Batasan nilai
disebut sebagai
Variabel x1
nilai fitness
dan x2
function dari x1,
x2 tersebut

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB


Contoh Soal GA

Max f ( x1 , x2 ) = 21.5 + x1 Sin (4 x1 ) + x2 Sin (20 x2 )


− 3,0  x1  12,1
4,1  x2  5,8
Contoh Soal GA - Representasi
.
→Mengkodekan berbagai variabel keputusan dalam bentuk string biner
→Panjang String biner sangat tergantung dari presisi yang diperlukan

Misal:
Domain dari variabel xj adalah [aj,bj] dan presisi yang diperlukan adalah
4 angka dibelakang koma. Kebutuhan akan presisi berimplikasi terhadap
jangkauan domain masing-masing variabel yang harus dibagi sedikitnya
sebesar (bj-aj) x 104 jangkauan.

Bit-bit yang diperlukan (didenotasikan dengan mj) untuk sebuah variabel


dapat dihitung sebagai berikut:

2mj-1 < (bj-aj) x 104 ≤ 2mj

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB


Contoh Soal GA - Representasi
.
→Mengkodekan berbagai variabel keputusan dalam bentuk string biner
Langkah →Panjang String biner sangat tergantung dari presisi yang diperlukan
pertama
Misal:
Domain dari variabel xj adalah [aj,bj] dan presisi yang diperlukan adalah
4 angka dibelakang koma. Kebutuhan akan presisi berimplikasi terhadap
jangkauan domain masing-masing variabel yang harus dibagi sedikitnya
sebesar (bj-aj) x 104 jangkauan.

Bit-bit yang diperlukan (didenotasikan dengan mj) untuk sebuah variabel


dapat dihitung sebagai berikut:

2mj-1 < (bj-aj) x 104 ≤ 2mj Digunakan


untuk mencari
banyak bit
dalam
kromosom
Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB
Contoh Soal GA - Representasi
.
→ Pemetaan dari string biner menjadi sebuah angka riil untuk var xj dapat
dihitung sebagai :
bj − a j
x j = a j + decimal( substring j )  m
2 j −1
Dimana decimal (substring) merepresentasikan nilai desimal dari substring j
untuk variabel j
(12,1 − (−3,0))  10 4 = 151000
Asumsikan bahwa presisi diatur hingga
empat angka dibelakang koma, maka 217  151000  218 → m1 = 18
bit-bit yang diperlukan untuk
variabel x1 dan x2 dikalkulasikan sebagai: (5,8 − 4,1)  10 4 = 17000
214  17000  215 → m2 = 15

m = m1 + m2 = 18 + 15 = 33

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB


Contoh Soal GA - Representasi
.
→ Pemetaan dari string biner menjadi sebuah angka riil untuk var xj dapat
Gunakan ini dihitung sebagai :
untuk mencari
nilai variabel bj − a j RUMUS 1
xj dari
x j = a j + decimal( substring j )  m
bilangan 2 j −1
desimal hasil
konversi Dimana decimal (substring) merepresentasikan nilai desimal dari substring j
bilangan biner untuk variabel j
(12,1 − (−3,0))  10 4 = 151000
Asumsikan bahwa presisi diatur hingga
empat angka dibelakang koma, maka 217  151000  218 → m1 = 18
bit-bit yang diperlukan untuk
variabel x1 dan x2 dikalkulasikan sebagai: (5,8 − 4,1)  10 4 = 17000
214  17000  215 → m2 = 15

Panjang
kromosom m = m1 + m2 = 18 + 15 = 33
adalah
m1+m2 bit
Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB
Contoh Soal GA- Representasi
. Panjang sebuah kromosom diketahui 33 bit, yang direpresentasikan:
33 bit

vj 000001010100101001 101111011111110

18 bit 15 bit

Nilai-nilai terkait untuk variabel x1 dan x2 diberikan sebagai berikut:

Kromosom Nilai desimal


x1 000001010100101001 5417
x2 101111011111110 24318

12,1 − (−3,0)
x1 = − 3.0 + 5417  = − 2,687969
218 − 1
5,8 − 4,1
x2 = 4,1 + 24318  = 5,361653
215 − 1
Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB
Contoh Soal GA- Representasi
. Panjang sebuah kromosom diketahui 33 bit, yang direpresentasikan:
33 bit

vj 000001010100101001 101111011111110

18 bit 15 bit

Nilai-nilai terkait untuk variabel x1 dan x2 diberikan sebagai berikut:

Kromosom Nilai desimal


x1 000001010100101001 5417
x2 101111011111110 24318

12,1 − (−3,0)
x1 = − 3.0 + 5417  = − 2,687969
218 − 1
5,8 − 4,1
x2 = 4,1 + 24318  = 5,361653
215 − 1
Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB
Contoh Soal GA

Max f ( x1 , x2 ) = 21.5 + x1 Sin (4 x1 ) + x2 Sin (20 x2 )


− 3,0  x1  12,1
4,1  x2  5,8
.
Contoh Soal GA- Populasi Awal
Populasi awal
. v1 = 111001011100110110101101001100111
v2 = 110110101101001000001100001001010
v3 = 010010100111001111011011100000010 Populasi Awal.
v4 = 000000110111001011100000001111001
v5 = 000111010000001010001101000010000 Terdiri dari 20
v6 = 000011110101010110000100011101111 kromosom
v7 = 100010011101010110000101010011110
v8 = 101001000000111001101101100001110
v9 = 100010100000110100001011111010110
v10 = 000101110111110011100001000110010
v11 = 010001100111101000001101011000010 Setiap bit pada
v12 = 101101011111010010001010010110110 kromosom
v13 = 011000001001101000011100000011110
v14 = 001110011100010101010111101100100
ditentukan secara
v15 = 100001001000101101110110101100001 random dengan
v16 = 111011101000100111110000001110000 bantuan program
v17 = 111011101000110110100111101101001
v18 = 100100110000111110111101001100010
v19 = 011110111001001100111000110011011
v20 = 000100101100010101010000010000111

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB


Contoh Soal GA

Max f ( x1 , x2 ) = 21.5 + x1 Sin (4 x1 ) + x2 Sin (20 x2 )


− 3,0  x1  12,1
4,1  x2  5,8
.
Contoh Soal GA- Evaluasi
. v1 = 111001011100110110101101001100111
v2 = 110110101101001000001100001001010
v3 = 010010100111001111011011100000010 Setiap kromosom
v4 = 000000110111001011100000001111001 dievaluasi nilai
v5 = 000111010000001010001101000010000
v6 = 000011110101010110000100011101111
fitness-nya
v7 = 100010011101010110000101010011110
v8 = 101001000000111001101101100001110
v9 = 100010100000110100001011111010110
v10 = 000101110111110011100001000110010
v11 = 010001100111101000001101011000010 - Konversi bilangan biner
v12 = 101101011111010010001010010110110 menjadi bentuk desimal
v13 = 011000001001101000011100000011110 - Hitung nilai riil variabel x1,
v14 = 001110011100010101010111101100100 x2 dari bentuk desimal
v15 = 100001001000101101110110101100001 dengan RUMUS1
v16 = 111011101000100111110000001110000 - Lalu masukan nilai x1, x2 tsb
v17 = 111011101000110110100111101101001 ke dlm fungsi tujuannya
v18 = 100100110000111110111101001100010
v19 = 011110111001001100111000110011011
v20 = 000100101100010101010000010000111

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB


.
Contoh Soal GA- Evaluasi
Menghitung nilai Nilai fitness
Populasi awal masing2 kromosom
. f( x1,x2 )
v1 = 111001011100110110101101001100111 F 1 = 26.984587
v2 = 110110101101001000001100001001010 F 2 = 16.393747
v3 = 010010100111001111011011100000010 F 3 = 24.872435
v4 = 000000110111001011100000001111001 F 4 = 18.826420
v5 = 000111010000001010001101000010000 F 5 = 22.567400
v6 = 000011110101010110000100011101111 F 6 = 27.076267
v7 = 100010011101010110000101010011110 F 7 = 29.358807

👉
v8 = 101001000000111001101101100001110 F 8 = 29.139782
v9 = 100010100000110100001011111010110 F 9 = 30.011271
v10 = 000101110111110011100001000110010 F10 = 18.146471
v11 = 010001100111101000001101011000010 F11 = 21.697422
v12 = 101101011111010010001010010110110 F12 = 19.216400
v13 = 011000001001101000011100000011110 F13 = 25.274593
v14 = 001110011100010101010111101100100 F14 = 25.816740
v15 = 100001001000101101110110101100001 F15 = 17.991199
v16 = 111011101000100111110000001110000 F16 = 24.240589
v17 = 111011101000110110100111101101001 F17 = 28.927788
v18 = 100100110000111110111101001100010 F18 = 31.892937
v19 = 011110111001001100111000110011011 F19 = 21.659521
v20 = 000100101100010101010000010000111 F20 = 23.983770 Total Fitness = 484.0782

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB


Contoh Soal GA

Max f ( x1 , x2 ) = 21.5 + x1 Sin (4 x1 ) + x2 Sin (20 x2 )


− 3,0  x1  12,1
4,1  x2  5,8
.
Contoh Soal GA- Seleksi
Probabilitas
Nilai fitness masing2 kromosom
Populasi awal masing2 kromosom
. F/Total fitness Nilai Kumulatif
v1 = 111001011100110110101101001100111 F 1 = 26.984587 p 1 = 0.055744 q 1 = 0.055744
v2 = 110110101101001000001100001001010 F 2 = 16.393747 p 2 = 0.033866 q 2 = 0.089610
v3 = 010010100111001111011011100000010 F 3 = 24.872435 p 3 = 0.051381 q 3 = 0.140991
v4 = 000000110111001011100000001111001 F 4 = 18.826420 p 4 = 0.038891 q 4 = 0.179882
v5 = 000111010000001010001101000010000 F 5 = 22.567400 p 5 = 0.046619 q 5 = 0.226502
v6 = 000011110101010110000100011101111 F 6 = 27.076267 p 6 = 0.055934 q 6 = 0.282435
v7 = 100010011101010110000101010011110 F 7 = 29.358807 p 7 = 0.060649 q 7 = 0.343084

👉
v8 = 101001000000111001101101100001110 F 8 = 29.139782 p 8 = 0.060196 q 8 = 0.403281
v9 = 100010100000110100001011111010110
v10 = 000101110111110011100001000110010
v11 = 010001100111101000001101011000010
F 9 = 30.011271
F10 = 18.146471
F11 = 21.697422
p 9 = 0.061997
p10 = 0.037487
p11 = 0.044822
👉
q 9 = 0.465278
q10 = 0.502764
q11 = 0.547586
v12 = 101101011111010010001010010110110 F12 = 19.216400 p12 = 0.039697 q12 = 0.587283
v13 = 011000001001101000011100000011110 F13 = 25.274593 p13 = 0.052212 q13 = 0.639495
v14 = 001110011100010101010111101100100 F14 = 25.816740 p14 = 0.053332 q14 = 0.692827
v15 = 100001001000101101110110101100001 F15 = 17.991199 p15 = 0.037166 q15 = 0.729993
v16 = 111011101000100111110000001110000 F16 = 24.240589 p16 = 0.050076 q16 = 0.780068
v17 = 111011101000110110100111101101001 F17 = 28.927788 p17 = 0.059759 q17 = 0.839827
v18 = 100100110000111110111101001100010 F18 = 31.892937 p18 = 0.065884 q18 = 0.905711
v19 = 011110111001001100111000110011011 F19 = 21.659521 Total Fitness p19 = 0.044744 q19 = 0.950455
v20 = 000100101100010101010000010000111 F20 = 23.983770 484.0782 p20 = 0.049545 q20 = 1.000000

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB


.
Contoh Soal GA- Seleksi
Probabilitas
Nilai fitness masing2 kromosom
Populasi awal masing2 kromosom
. F/Total fitness Nilai Kumulatif
v1 = 111001011100110110101101001100111 F 1 = 26.984587 p 1 = 0.055744 q 1 = 0.055744
v2 = 110110101101001000001100001001010 F 2 = 16.393747 p 2 = 0.033866 q 2 = 0.089610
v3 = 010010100111001111011011100000010 F 3 = 24.872435 p 3 = 0.051381 q 3 = 0.140991
v4 = 000000110111001011100000001111001 F 4 = 18.826420 p 4 = 0.038891 q 4 = 0.179882
v5 = 000111010000001010001101000010000 F 5 = 22.567400 p 5 = 0.046619 q 5 = 0.226502
v6 = 000011110101010110000100011101111 F 6 = 27.076267 p 6 = 0.055934 q 6 = 0.282435
v7 = 100010011101010110000101010011110 F 7 = 29.358807 p 7 = 0.060649 q 7 = 0.343084

👉
v8 = 101001000000111001101101100001110 F 8 = 29.139782 p 8 = 0.060196 q 8 = 0.403281
v9 = 100010100000110100001011111010110
v10 = 000101110111110011100001000110010
v11 = 010001100111101000001101011000010
F 9 = 30.011271
F10 = 18.146471
F11 = 21.697422
p 9 = 0.061997
p10 = 0.037487
p11 = 0.044822
👉
q 9 = 0.465278
q10 = 0.502764
q11 = 0.547586
v12 = 101101011111010010001010010110110 F12 = 19.216400 p12 = 0.039697 q12 = 0.587283
v13 = 011000001001101000011100000011110 F13 = 25.274593 p13 = 0.052212 q13 = 0.639495
v14 = 001110011100010101010111101100100 F14 = 25.816740 p14 = 0.053332 q14 = 0.692827
v15 = 100001001000101101110110101100001 F15 = 17.991199 p15 = 0.037166 q15 = 0.729993
v16 = 111011101000100111110000001110000 F16 = 24.240589 p16 = 0.050076 q16 = 0.780068
v17 = 111011101000110110100111101101001 F17 = 28.927788 p17 = 0.059759 q17 = 0.839827
v18 = 100100110000111110111101001100010 F18 = 31.892937 p18 = 0.065884 q18 = 0.905711
v19 = 011110111001001100111000110011011 F19 = 21.659521 Total Fitness p19 = 0.044744 q19 = 0.950455
v20 = 000100101100010101010000010000111 F20 = 23.983770 484.0782 p20 = 0.049545 q20 = 1.000000

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB


.
Contoh Soal GA- Seleksi
Misal, diperoleh nilai random
untuk masing-masing kromosom
. sebagai berikut

Nilai random 1 z = 0.757671


Nilai random 2 z = 0.534015
Nilai random 3 z = 0.556857
Nilai random 4 z = 0.150214
Nilai random 5 z = 0.801996
Nilai random 6 z = 0.280589

👉
Nilai random 7 z = 0.580488
Nilai random 8 z = 0.585261
Nilai random 9 z = 0.707035
Nilai random 10 z = 0.654927
Nilai random 11 z = 0.607109
Nilai random 12 z = 0.710492
Nilai random 13 z = 0.218055
Nilai random 14 z = 0.539730
Nilai random 15 z = 0.479116
Nilai random 16 z = 0.535222
Nilai random 17 z = 0.201610
Nilai random 18 z = 0.395832
Nilai random 19 z = 0.330506
Nilai random 20 z = 0.941961
Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB
.
Contoh Soal GA- Seleksi
Misal, diperoleh nilai random
. untuk masing-masing kromosom
sebagai berikut

Nilai random 1 z = 0.757671 ( = V16 )


Nilai random 2 z = 0.534015 ( = V11 )
Nilai random 3 z = 0.556857 ( = V12 )
Nilai random 4 z = 0.150214 (=V4 )
Nilai random 5 z = 0.801996 ( = V17 )

👉
Nilai random 6 z = 0.280589 (=V6 )
Nilai random 7 z = 0.580488 ( = V12 )
Nilai random 8 z = 0.585261 ( = V12 )
Nilai random 9 z = 0.707035 ( = V15 )
Nilai random 10 z = 0.654927 ( = V14 )
Nilai random 11 z = 0.607109 ( = V13 )
Nilai random 12 z = 0.710492 ( = V15 )
Nilai random 13 z = 0.218055 (=V5 )
Sehingga kromosom yang Nilai random 14 z = 0.539730 ( = V11 )
pada populasi awal memiliki Nilai random 15 z = 0.479116 ( = V10 )
nilai fitness tinggi memiliki Nilai random 16 z = 0.535222 ( = V11 )
kesempatan yang lebih besar Nilai random 17 z = 0.201610 (=V5 )
untuk terpilih pada proses Nilai random 18 z = 0.395832 (=V8 )
Seleksi Nilai random 19 z = 0.330506 (=V7 )
Responsi Mata
NilaiKuliah
randomTeknik
20 z =Optimasi-Dept
0.941961 TIN, IPB ( = V19 )
.
Contoh Soal GA- Seleksi
Nilai random KROMOSOM baru HASIL SELEKSI
Populasi awal . untuk masing-masing kromosom

v1 = 111001011100110110101101001100111 Nilai random 1 z = 0.757671 ( = V16 ) V 1' = 111011101000100111110000001110000


v2 = 110110101101001000001100001001010 Nilai random 2 z = 0.534015 ( = V11 ) V 2' = 010001100111101000001101011000010
v3 = 010010100111001111011011100000010 Nilai random 3 z = 0.556857 ( = V12 ) V 3' = 101101011111010010001010010110110
v4 = 000000110111001011100000001111001 Nilai random 4 z = 0.150214 (=V4 ) V 4' = 000000110111001011100000001111001
v5 = 000111010000001010001101000010000 Nilai random 5 z = 0.801996 ( = V17 ) V 5' = 111011101000110110100111101101001
v6 = 000011110101010110000100011101111 Nilai random 6 z = 0.280589 (=V6 ) V 6' = 000011110101010110000100011101111
v7 = 100010011101010110000101010011110 Nilai random 7 z = 0.580488 ( = V12 ) V 7' = 101101011111010010001010010110110
v8 = 101001000000111001101101100001110 Nilai random 8 z = 0.585261 ( = V12 ) V 8' = 101101011111010010001010010110110
v9 = 100010100000110100001011111010110 Nilai random 9 z = 0.707035 ( = V15 ) V 9' = 100001001000101101110110101100001
v10 = 000101110111110011100001000110010 Nilai random 10 z = 0.654927 ( = V14 ) V10' = 001110011100010101010111101100100
v11 = 010001100111101000001101011000010 Nilai random 11 z = 0.607109 ( = V13 ) V11' = 011000001001101000011100000011110
v12 = 101101011111010010001010010110110 Nilai random 12 z = 0.710492 ( = V15 ) V12' = 100001001000101101110110101100001
v13 = 011000001001101000011100000011110 Nilai random 13 z = 0.218055 (=V5 ) V13' = 000111010000001010001101000010000
v14 = 001110011100010101010111101100100 Nilai random 14 z = 0.539730 ( = V11 ) V14' = 010001100111101000001101011000010
v15 = 100001001000101101110110101100001 Nilai random 15 z = 0.479116 ( = V10 ) V15' = 000101110111110011100001000110010
v16 = 111011101000100111110000001110000 Nilai random 16 z = 0.535222 ( = V11 ) V16' = 010001100111101000001101011000010
v17 = 111011101000110110100111101101001 Nilai random 17 z = 0.201610 (=V5 ) V17' = 000111010000001010001101000010000
v18 = 100100110000111110111101001100010 Nilai random 18 z = 0.395832 (=V8 ) V18' = 101001000000111001101101100001110
v19 = 011110111001001100111000110011011 Nilai random 19 z = 0.330506 (=V7 ) V19' = 100010011101010110000101010011110
v20 = 000100101100010101010000010000111 Nilai random 20 z = 0.941961 ( = V19 ) V20' = 011110111001001100111000110011011
Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB
.
Contoh Soal GA- Seleksi
KROMOSOM baru HASIL SELEKSI
.
V 1' = 111011101000100111110000001110000
V 2' = 010001100111101000001101011000010
V 3' = 101101011111010010001010010110110
V 4' = 000000110111001011100000001111001
V 5' = 111011101000110110100111101101001
V 6' = 000011110101010110000100011101111
V 7' = 101101011111010010001010010110110
V 8' = 101101011111010010001010010110110
V 9' = 100001001000101101110110101100001
V10' = 001110011100010101010111101100100
V11' = 011000001001101000011100000011110
V12' = 100001001000101101110110101100001
V13' = 000111010000001010001101000010000
V14' = 010001100111101000001101011000010
V15' = 000101110111110011100001000110010
V16' = 010001100111101000001101011000010
V17' = 000111010000001010001101000010000
V18' = 101001000000111001101101100001110
V19' = 100010011101010110000101010011110
V20' = 011110111001001100111000110011011
Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB
Contoh Soal GA

Max f ( x1 , x2 ) = 21.5 + x1 Sin (4 x1 ) + x2 Sin (20 x2 )


− 3,0  x1  12,1
4,1  x2  5,8
.
Contoh Soal GA- Crossover

Crossover yang digunakan adalah pendekatan one-cut-point dan menukarkan bagian


kanan dari kedua parent untuk menghasilkan offspring.
Probabilitas crossover dapat kita atur sebagai pc = 0,25, ini bermaksud kita berharap
bahwa pada rata-rata 25%, kromosom-kromosom akan melalui crossover.

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB


.
Contoh Soal GA- Crossover

Crossover yang digunakan adalah pendekatan one-cut-point dan menukarkan bagian


kanan dari kedua parent untuk menghasilkan offspring.
Probabilitas crossover dapat kita atur sebagai pc = 0,25, ini bermaksud kita berharap
bahwa pada rata-rata 25%, kromosom-kromosom akan melalui crossover.

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB


.
Contoh Soal GA- Crossover
Misal, diperoleh bilangan random
untuk masing-masing kromosom:

v1' 0.858802623
v2' 0.412171133
v3' 0.672787355
v4' 0.020331487 << 0.25
v5' 0.548686904
v6' 0.179205992 << 0.25
v7' 0.297660174
v8' 0.20032016 << 0.25
v9' 0.035695266 << 0.25
v10' 0.49366949
v11' 0.239312227<< 0.25
v12' 0.924817959
v13' 0.986913538
v14' 0.419912587
v15' 0.751785988
v16' 0.51875157
v17' 0.647958564
v18' 0.142527841<< 0.25
v19' 0.776107015
v20' 0.769712165
Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB
.
Contoh Soal GA- Crossover
Misal, diperoleh bilangan random
untuk masing-masing kromosom:

v1' 0.858802623
v2' 0.412171133
v3' 0.672787355
v4' 0.020331487 << 0.25
v5' 0.548686904
v6' 0.179205992 << 0.25
v7' 0.297660174 Terdapat 6
v8' 0.20032016 << 0.25 kromosom
v9' 0.035695266 << 0.25 dengan nilai
v10' 0.49366949 random
v11' 0.239312227<< 0.25 dibawah pm =
v12' 0.924817959 0.25, sehingga 6
v13' 0.986913538 kromosom
v14' 0.419912587 tersebut dipilih
v15' 0.751785988 utk mengalami
v16' 0.51875157 crossover
v17' 0.647958564
v18' 0.142527841<< 0.25
v19' 0.776107015
v20' 0.769712165
Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB
.
Contoh Soal GA- Crossover
Misal, diperoleh bilangan random pc ( probability crossover ) = 0.25 dengan 20 buah bilangan
untuk masing-masing kromosom: random z < 0.25 terpilih kromosome dibawah ini.

v1' 0.858802623 V 1' = 111011101000100111110000001110000


v2' 0.412171133 V 2' = 010001100111101000001101011000010
v3' 0.672787355 V 3' = 101101011111010010001010010110110
v4' 0.020331487 << 0.25 V 4' = 000000110111001011100000001111001
v5' 0.548686904 V 5' = 111011101000110110100111101101001
v6' 0.179205992 << 0.25 V 6' = 000011110101010110000100011101111
v7' 0.297660174 V 7' = 101101011111010010001010010110110 Terdapat 6
v8' 0.20032016 << 0.25 V 8' = 101101011111010010001010010110110 kromosom
v9' 0.035695266 << 0.25 V 9' = 100001001000101101110110101100001 dengan nilai
v10' 0.49366949 V10' = 001110011100010101010111101100100 random
v11' 0.239312227<< 0.25 V11' = 011000001001101000011100000011110 dibawah pm =
v12' 0.924817959 V12' = 100001001000101101110110101100001 0.25, sehingga 6
v13' 0.986913538 V13' = 000111010000001010001101000010000 kromosom
v14' 0.419912587 V14' = 010001100111101000001101011000010 tersebut dipilih
v15' 0.751785988 V15' = 000101110111110011100001000110010 utk mengalami
v16' 0.51875157 V16' = 010001100111101000001101011000010 crossover
v17' 0.647958564 V17' = 000111010000001010001101000010000
v18' 0.142527841<< 0.25 V18' = 101001000000111001101101100001110
v19' 0.776107015 V19' = 100010011101010110000101010011110
v20' 0.769712165 V20' = 011110111001001100111000110011011
Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB
.
Contoh Soal GA- Crossover
Populasi setelah mengalami perubahan pada 6
buah kromosom
Diambil 3 pasang kromosome dan dengan 3
bilangan random diantara 1-32 dilakukan V 1' = 111011101000100111110000001110000
crossover. V 2' = 010001100111101000001101011000010
V 3' = 101101011111010010001010010110110
V 4''= 000011110101010110000100011101111
z= 1 V 5' = 111011101000110110100111101101001
z = 14 V 6''= 000000110111001011100000001111001
z = 23 V 7' = 101101011111010010001010010110110

V 4'' = 000011110101010110000100011101111
V 6'' = 000000110111001011100000001111001
V 8'' = 101101011111011101110110101100001
V 9'' = 100001001000100010001010010110110
V11'' = 011000001001101000011101100001110
👉 V 8''= 101101011111011101110110101100001
V 9''= 100001001000100010001010010110110
V10' = 001110011100010101010111101100100
V11''= 011000001001101000011101100001110
V12' = 100001001000101101110110101100001
V13' = 000111010000001010001101000010000
V14' = 010001100111101000001101011000010
V18'' = 101001000000111001101100000011110 V15' = 000101110111110011100001000110010
V16' = 010001100111101000001101011000010
V17' = 000111010000001010001101000010000
V18''= 101001000000111001101100000011110
V19' = 100010011101010110000101010011110
Responsi Mata Kuliah V20'
Teknik = 011110111001001100111000110011011
Optimasi-Dept TIN, IPB
.
Contoh Soal GA- Crossover
Populasi setelah mengalami perubahan pada 6
buah kromosom
V 1' = 111011101000100111110000001110000
V 2' = 010001100111101000001101011000010
V 3' = 101101011111010010001010010110110
V 4''= 000011110101010110000100011101111
V 5' = 111011101000110110100111101101001
V 6''= 000000110111001011100000001111001
V 7' = 101101011111010010001010010110110
V 8''= 101101011111011101110110101100001
V 9''= 100001001000100010001010010110110
V10' = 001110011100010101010111101100100
V11''= 011000001001101000011101100001110
V12' = 100001001000101101110110101100001
V13' = 000111010000001010001101000010000
V14' = 010001100111101000001101011000010
V15' = 000101110111110011100001000110010
V16' = 010001100111101000001101011000010
V17' = 000111010000001010001101000010000
V18''= 101001000000111001101100000011110
V19' = 100010011101010110000101010011110
Responsi Mata Kuliah V20'
Teknik = 011110111001001100111000110011011
Optimasi-Dept TIN, IPB
Contoh Soal GA

Max f ( x1 , x2 ) = 21.5 + x1 Sin (4 x1 ) + x2 Sin (20 x2 )


− 3,0  x1  12,1
4,1  x2  5,8
.
Contoh Soal GA- Mutasi
Mutasi berarti merubah satu atau lebih gen gen dengan suatu probabilitas
yang setara dengan mutasi rate.

Probabilitas mutasi diatur sebagai pm = 0,01, bermaksud pada rata-rata


1% dari total bit dalam populasi akan melalui proses mutasi.

Jika terdapat 20 kromosom (masing-masing kromosom 33 bit) dalam


sebuah populasi, maka ada m x pop_size = 33 x 20 = 660 bit di dalam
keseluruhan populasi. Maka diharapkan ada sekitar 6,6 mutasi per
generasi, dimana setiap bit mempunyai kesempatan yang sama untuk
dimutasikan.

Untuk itu diperlukan sebarisan sebarang nilai acak rk, k = 1,2,3,…,660


dengan kisaran nilai [0,1]

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB


.
Contoh Soal GA- Mutasi
Mutasi berarti merubah satu atau lebih gen gen dengan suatu probabilitas
yang setara dengan mutasi rate.

Probabilitas mutasi diatur sebagai pm = 0,01, bermaksud pada rata-rata


1% dari total bit dalam populasi akan melalui proses mutasi.

Jika terdapat 20 kromosom (masing-masing


kromosom 33 bit) dalam sebuah populasi,
maka ada m x pop_size = 33 x 20 = 660 bit di dalam keseluruhan
populasi. Maka diharapkan ada sekitar 6,6 mutasi per generasi, dimana
setiap bit mempunyai kesempatan yang sama untuk dimutasikan.

Untuk itu diperlukan sebarisan sebarang nilai acak rk, k = 1,2,3,…,660


dengan kisaran nilai [0,1]

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB


.
Contoh Soal GA- Mutasi
Populasi setelah mengalami crossover
V 1' = 111011101000100111110000001110000
V 2' = 010001100111101000001101011000010
V 3' = 101101011111010010001010010110110
V 4''= 000011110101010110000100011101111
V 5' = 111011101000110110100111101101001
V 6''= 000000110111001011100000001111001
V 7' = 101101011111010010001010010110110
V 8''= 101101011111011101110110101100001
V 9''= 100001001000100010001010010110110 Akan
V10' = 001110011100010101010111101100100 mengalami
V11''= 011000001001101000011101100001110
V12' = 100001001000101101110110101100001
mutasi dengan
V13' = 000111010000001010001101000010000 pm = 0.01
V14' = 010001100111101000001101011000010
V15' = 000101110111110011100001000110010
V16' = 010001100111101000001101011000010
V17' = 000111010000001010001101000010000
V18''= 101001000000111001101100000011110
V19' = 100010011101010110000101010011110
V20' = 011110111001001100111000110011011
Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB
.
Contoh Soal GA- Mutasi
Populasi setelah mengalami crossover
V 1' = 111011101000100111110000001110000
V 2' = 010001100111101000001101011000010
V 3' = 101101011111010010001010010110110
V 4''= 000011110101010110000100011101111
V 5' = 111011101000110110100111101101001
V 6''= 000000110111001011100000001111001
V 7' = 101101011111010010001010010110110
V 8''= 101101011111011101110110101100001
V 9''= 100001001000100010001010010110110
V10' = 001110011100010101010111101100100
V11''= 011000001001101000011101100001110
V12' = 100001001000101101110110101100001
V13' = 000111010000001010001101000010000
V14' = 010001100111101000001101011000010
V15' = 000101110111110011100001000110010
V16' = 010001100111101000001101011000010
V17' = 000111010000001010001101000010000
V18''= 101001000000111001101100000011110
V19' = 100010011101010110000101010011110
V20' = 011110111001001100111000110011011
Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB
.
Contoh Soal GA- Mutasi
Populasi setelah mengalami crossover
V 1' = 111011101000100111110000001110000
V 2' = 010001100111101000001101011000010
V 3' = 101101011111010010001010010110110
V 4''= 000011110101010110000100011101111
V 5' = 111011101000110110100111101101001
V 6''= 000000110111001011100000001111001
V 7' = 101101011111010010001010010110110
V 8''= 101101011111011101110110101100001
V 9''= 100001001000100010001010010110110
V10' = 001110011100010101010111101100100
V11''= 011000001001101000011101100001110
V12' = 100001001000101101110110101100001 Bit dengan
V13' = 000111010000001010001101000010000 nilai random di
V14' = 010001100111101000001101011000010
bawah 0.01 akan
V15' = 000101110111110011100001000110010
V16' = 010001100111101000001101011000010 mengalami
V17' = 000111010000001010001101000010000 mutasi
V18''= 101001000000111001101100000011110
V19' = 100010011101010110000101010011110
V20' = 011110111001001100111000110011011
Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB
.
Contoh Soal GA- Mutasi
Populasi setelah mengalami crossover
V 1' = 111011101000100111110000001110000
V 2' = 010001100111101000001101011000010
V 3' = 101101011111010010001010010110110
V 4''= 000011110101010110000100011101111
V 5' = 111011101000110110100111101101001 Misal terpilih bit
V 6''= 000000110111001011100000001111001 dengan nilai random
V 7' = 101101011111010010001010010110110
V 8''= 101101011111011101110110101100001 di bawah 0.01
V 9''= 100001001000100010001010010110110
V10' = 001110011100010101010111101100100
V11''= 011000001001101000011101100001110 Nilai Random

👉
V12' = 100001001000101101110110101100001
z = 0.0027149 kromosom ke = 2 posisi bit ke = 12
V13' = 000111010000001010001101000010000
V14' = 010001100111101000001101011000010 z = 0.0078123 kromosom ke = 6 posisi bit ke = 24
V15' = 000101110111110011100001000110010 z = 0.0039235 kromosom ke = 13 posisi bit ke = 20
V16' = 010001100111101000001101011000010 z = 0.0033136 kromosom ke = 14 posisi bit ke = 27
V17' = 000111010000001010001101000010000
V18''= 101001000000111001101100000011110
V19' = 100010011101010110000101010011110
V20' = 011110111001001100111000110011011
Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB
.
Contoh Soal GA- Mutasi
Sehingga...
Populasi setelah mengalami crossover
V 1' = 111011101000100111110000001110000 V 1 = 111011101000100111110000001110000
V 2' = 010001100111101000001101011000010 V 2 = 010001100110101000001101011000010
V 3' = 101101011111010010001010010110110 V 3 = 101101011111010010001010010110110
V 4''= 000011110101010110000100011101111 V 4 = 000011110101010110000100011101111
V 5' = 111011101000110110100111101101001 V 5 = 111011101000110110100111101101001
V 6''= 000000110111001011100000001111001 V 6 = 000000110111001011100000001111001
V 7' = 101101011111010010001010010110110 V 7 = 101101011111010010001010010110110
V 8''= 101101011111011101110110101100001 V 8 = 101101011111011101110110101100001
V 9''= 100001001000100010001010010110110 V 9 = 100001001000100010001010010110110
V10' = 001110011100010101010111101100100 V10 = 001110011100010101010111101100100
V11''= 011000001001101000011101100001110 V11 = 011000001001101000011101100001110
V12 = 100001001000101101110110101100001

👉
V12' = 100001001000101101110110101100001
V13' = 000111010000001010001101000010000 V13 = 000111010000001010001101000010000
V14' = 010001100111101000001101011000010 V14 = 010001100111101000001101010000010
V15' = 000101110111110011100001000110010 V15 = 000101110111110011100001000110010
V16' = 010001100111101000001101011000010 V16 = 010001100111101000001101011000010
V17' = 000111010000001010001101000010000 V17 = 000111010000001010001101000010000
V18''= 101001000000111001101100000011110 V18 = 101001000000111001101100000011110
V19' = 100010011101010110000101010011110 V19 = 100010011101010110000101010011110
V20' = 011110111001001100111000110011011 V20 = 011110111001001100111000110011011
Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB
.
Contoh Soal GA- Mutasi

V 1 = 111011101000100111110000001110000
V 2 = 010001100110101000001101011000010
Populasi V 3 = 101101011111010010001010010110110
V 4 = 000011110101010110000100011101111
Baru Hasil V 5 = 111011101000110110100111101101001
V 6 = 000000110111001011100000001111001
Mutasi V 7 = 101101011111010010001010010110110
V 8 = 101101011111011101110110101100001
V 9 = 100001001000100010001010010110110
V10 = 001110011100010101010111101100100
V11 = 011000001001101000011101100001110
V12 = 100001001000101101110110101100001
V13 = 000111010000001010001101000010000
V14 = 010001100111101000001101010000010
V15 = 000101110111110011100001000110010
V16 = 010001100111101000001101011000010
V17 = 000111010000001010001101000010000
V18 = 101001000000111001101100000011110
V19 = 100010011101010110000101010011110
V20 = 011110111001001100111000110011011
Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB
.
Contoh Soal GA- Mutasi

V 1 = 111011101000100111110000001110000
V 2 = 010001100110101000001101011000010
V 3 = 101101011111010010001010010110110
V 4 = 000011110101010110000100011101111
V 5 = 111011101000110110100111101101001
V 6 = 000000110111001011100000001111001
V 7 = 101101011111010010001010010110110
V 8 = 101101011111011101110110101100001
V 9 = 100001001000100010001010010110110
V10 = 001110011100010101010111101100100
V11 = 011000001001101000011101100001110
V12 = 100001001000101101110110101100001
V13 = 000111010000001010001101000010000
V14 = 010001100111101000001101010000010
V15 = 000101110111110011100001000110010
V16 = 010001100111101000001101011000010
V17 = 000111010000001010001101000010000
V18 = 101001000000111001101100000011110
V19 = 100010011101010110000101010011110
V20 = 011110111001001100111000110011011
Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB
Contoh Soal GA

Max f ( x1 , x2 ) = 21.5 + x1 Sin (4 x1 ) + x2 Sin (20 x2 )


− 3,0  x1  12,1
4,1  x2  5,8
.
Contoh Soal GA- Evaluasi
Fitness Function
Nilai Desimal Nilai Riil masing2
POPULASI HASIL MUTASI (Hasil konversi Variabel x1, x2 kromosom baru
Biner ke desimal)
V 1 = 111011101000100111110000001110000 V 1 = .... x1, x2 = .... f(x1, x2) = ....
V 2 = 010001100110101000001101011000010 V 2 = .... x1, x2 = .... f(x1, x2) = ....
V 3 = 101101011111010010001010010110110 V 3 = .... x1, x2 = .... f(x1, x2) = ....
V 4 = 000011110101010110000100011101111 V 4 = .... x1, x2 = .... f(x1, x2) = ....
V 5 = 111011101000110110100111101101001 V 5 = .... x1, x2 = .... f(x1, x2) = ....
V 6 = 000000110111001011100000001111001 V 6 = .... x1, x2 = .... f(x1, x2) = ....
V 7 = 101101011111010010001010010110110 V 7 = .... x1, x2 = .... f(x1, x2) = ....
V 8 = 101101011111011101110110101100001 V 8 = .... x1, x2 = .... f(x1, x2) = ....
V 9 = 100001001000100010001010010110110
V10 = 001110011100010101010111101100100
V11 = 011000001001101000011101100001110
V12 = 100001001000101101110110101100001
👉 V 9 = ....
V10 = ....
V11 = ....
V12 = ....
👉 x1, x2 = ....
x1, x2 = ....
x1, x2 = ....
x1, x2 = ....
👉
f(x1, x2) = ....
f(x1, x2) = ....
f(x1, x2) = ....
f(x1, x2) = ....
V13 = 000111010000001010001101000010000 V13 = .... x1, x2 = .... f(x1, x2) = ....
V14 = 010001100111101000001101010000010 V14 = .... x1, x2 = .... f(x1, x2) = ....
V15 = 000101110111110011100001000110010 V15 = .... x1, x2 = .... f(x1, x2) = ....
V16 = 010001100111101000001101011000010 V16 = .... x1, x2 = .... f(x1, x2) = ....
V17 = 000111010000001010001101000010000 V17 = .... x1, x2 = .... f(x1, x2) = ....
V18 = 101001000000111001101100000011110 V18 = .... x1, x2 = .... f(x1, x2) = ....
V19 = 100010011101010110000101010011110 V19 = .... x1, x2 = .... f(x1, x2) = ....
V20 = 011110111001001100111000110011011 V20 = .... x1, x2 = .... f(x1, x2) = ....
Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB
Contoh Soal GA

Max f ( x1 , x2 ) = 21.5 + x1 Sin (4 x1 ) + x2 Sin (20 x2 )


− 3,0  x1  12,1
4,1  x2  5,8
.
Contoh Soal GA- Iterasi 2
Fitness Function
Nilai Desimal Nilai Riil masing2
POPULASI HASIL MUTASI (Hasil konversi Variabel x1, x2 kromosom baru
Biner ke desimal)
V 1 = 111011101000100111110000001110000 V 1 = .... x1, x2 = .... f(x1, x2) = ....
V 2 = 010001100110101000001101011000010 V 2 = .... x1, x2 = .... f(x1, x2) = ....
V 3 = 101101011111010010001010010110110 V 3 = .... x1, x2 = .... f(x1, x2) = ....
V 4 = 000011110101010110000100011101111 V 4 = .... x1, x2 = .... f(x1, x2) = ....
V 5 = 111011101000110110100111101101001 V 5 = .... x1, x2 = .... f(x1, x2) = ....
V 6 = 000000110111001011100000001111001 V 6 = .... x1, x2 = .... f(x1, x2) = ....
V 7 = 101101011111010010001010010110110 V 7 = .... x1, x2 = .... f(x1, x2) = ....
V 8 = 101101011111011101110110101100001 V 8 = .... x1, x2 = .... f(x1, x2) = ....
V 9 = 100001001000100010001010010110110
V10 = 001110011100010101010111101100100
V11 = 011000001001101000011101100001110
V12 = 100001001000101101110110101100001
👉 V 9 = ....
V10 = ....
V11 = ....
V12 = ....
👉 x1, x2 = ....
x1, x2 = ....
x1, x2 = ....
x1, x2 = ....
👉
f(x1, x2) = ....
f(x1, x2) = ....
f(x1, x2) = ....
f(x1, x2) = ....
V13 = 000111010000001010001101000010000 V13 = .... x1, x2 = .... f(x1, x2) = ....
V14 = 010001100111101000001101010000010 V14 = .... x1, x2 = .... f(x1, x2) = ....
V15 = 000101110111110011100001000110010 V15 = .... x1, x2 = .... f(x1, x2) = ....
V16 = 010001100111101000001101011000010 V16 = .... x1, x2 = .... f(x1, x2) = ....
V17 = 000111010000001010001101000010000 V17 = .... x1, x2 = .... f(x1, x2) = ....
V18 = 101001000000111001101100000011110 V18 = .... x1, x2 = .... f(x1, x2) = ....
V19 = 100010011101010110000101010011110 V19 = .... x1, x2 = .... f(x1, x2) = ....
V20 = 011110111001001100111000110011011 V20 = .... x1, x2 = .... f(x1, x2) = ....
Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB
.
Contoh Soal GA- Iterasi 2
Fitness Function
Nilai Desimal Nilai Riil masing2
POPULASI HASIL MUTASI (Hasil konversi Variabel x1, x2 kromosom baru
Biner ke desimal)
V 1 = 111011101000100111110000001110000 V 1 = .... x1, x2 = .... f(x1, x2) = ....
V 2 = 010001100110101000001101011000010 V 2 = .... x1, x2 = .... f(x1, x2) = ....
V 3 = 101101011111010010001010010110110 V 3 = .... x1, x2 = .... f(x1, x2) = ....
V 4 = 000011110101010110000100011101111 V 4 = .... x1, x2 = .... f(x1, x2) = ....
V 5 = 111011101000110110100111101101001 V 5 = .... x1, x2 = .... f(x1, x2) = ....
V 6 = 000000110111001011100000001111001 V 6 = .... x1, x2 = .... f(x1, x2) = ....
V 7 = 101101011111010010001010010110110 V 7 = .... x1, x2 = .... f(x1, x2) = ....
V 8 = 101101011111011101110110101100001 V 8 = .... x1, x2 = .... f(x1, x2) = ....
V 9 = 100001001000100010001010010110110
V10 = 001110011100010101010111101100100
V11 = 011000001001101000011101100001110
V12 = 100001001000101101110110101100001
👉 V 9 = ....
V10 = ....
V11 = ....
V12 = ....
👉 x1, x2 = ....
x1, x2 = ....
x1, x2 = ....
x1, x2 = ....
👉
f(x1, x2) = ....
f(x1, x2) = ....
f(x1, x2) = ....
f(x1, x2) = ....
V13 = 000111010000001010001101000010000 V13 = .... x1, x2 = .... f(x1, x2) = ....
V14 = 010001100111101000001101010000010 V14 = .... x1, x2 = .... f(x1, x2) = ....
V15 = 000101110111110011100001000110010 V15 = .... x1, x2 = .... f(x1, x2) = ....
V16 = 010001100111101000001101011000010 V16 = .... x1, x2 = .... f(x1, x2) = ....
V17 = 000111010000001010001101000010000 V17 = .... x1, x2 = .... f(x1, x2) = ....
V18 = 101001000000111001101100000011110 V18 = .... x1, x2 = .... f(x1, x2) = ....
V19 = 100010011101010110000101010011110 V19 = .... x1, x2 = .... f(x1, x2) = ....
V20 = 011110111001001100111000110011011 V20 = .... x1, x2 = .... f(x1, x2) = ....
Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB
Iterasi dilanjutkan hingga tercapai
optimum, atau...
.

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB


LATIHAN
Dengan menggunakan Algoritma Genetika, lakukan upaya maksimasi dari fungsi
𝑓 𝑥, 𝑦 = 4 + 3 (1 − 𝑥)2 𝑦 𝑥
Dengan batasan 0 ≤ 𝑥 ≤ 5, dan
0≤𝑦≤5
Diketahui 1 populasi terdiri dari 10 kromosom, Pc = 0,4 ; Pm = 0,05 ; Lakukan sebanyak 2 kali iterasi
dengan tingkat ketelitian 103
Kesimpulan apa yang dapat Anda ambil?
Thank You!

Responsi Mata Kuliah Teknik Optimasi-Dept TIN, IPB

Anda mungkin juga menyukai