Operation Research Ii: Materi Kuliah 1
Operation Research Ii: Materi Kuliah 1
Operation Research Ii: Materi Kuliah 1
3 SKS
MATERI KULIAH 1
susy susmartini
operations research II, 2006
DYNAMIC PROGRAMMING
KARAKTERISTIK DP:
PROBLEM DAPAT DIBAGI DALAM STAGE, DENGAN SUATU
POLICY DECISION,
SETIAP STAGE TERDIRI DARI SATU ATAU LEBIH STATE
(POSSIBLE CONDITIONS)
PENGARUH POLICY DECISION PADA SETIAP STAGE
MENGUBAH CURRENT STATE KE DALAM SUATU STATE YANG
BERHUBUNGAN DENGAN NEXT STAGE
SOLUTION PROBLEM DIDISAIN UNTUK MENDAPATKAN
OPTIMAL POLICY BAGI PROBLEM SECARA KESELURUHAN
OPTIMAL POLICY PADA SUATU STAGE BERSIFAT
INDEPENDENT DARI POLICY PADA STAGE SEBELUMNYA
SOLUTION PROCEDURE DIMULAI DENGAN MENENTUKAN
OPTIMAL POLICY PADA LAST STAGE
RECURSIVE RELATIONSHIP :
f n* sn Max / Min f n sn , xn
susy susmartini
operations research II, 2006
f n* sn Max / Min f n sn , xn
N
n
sn
: Jumlah stage
: label untuk stage ( n 1, 2, ......, N )
: current state untuk stage n
xn
xn*
f n sn , xn*
susy susmartini
operations research II, 2006
sn
State :
f n s n , xn
Stage
n+1
sn 1
contribution of xn
f n*1 sn 1
State :
sn
f n s n , xn
decision
xn
p1
p2
ps
from stage n
c1
f n*1 1
c2
cs
susy susmartini
operations research II, 2006
f n*1 2
s
f n*1 s
No. of
Medical
Teams
0
1
2
3
4
5
Thousands of Additional
Person-Years of Life
Country
1
0
45
70
90
105
120
0
20
45
75
110
150
0
50
70
80
100
130
susy susmartini
operations research II, 2006
Penyelesaian :
p (x )
Maximize
i 1
Subject to
i 1
x
i n
f n ( sn ) max
xn 0 ,1,....., s n
p (x )
i n 1
sn
f n ( s n , xn )
f n ( sn , xn ) pn ( xn ) f n1 ( sn xn )
f n ( sn )
max { pn ( xn ) f n1 ( sn xn )}
xn 0 ,1,....., s n
f 3 ( s3 ) max { p3 ( x3 )
x3 0 ,1,....., s3
susy susmartini
operations research II, 2006
for n 1,2
n=3
s3
f 3 ( s3 )
x3
0
1
2
3
4
5
0
50
70
80
100
130
0
1
2
3
4
5
susy susmartini
operations research II, 2006
n=2
f 2 ( s2 , x2 ) p2 ( x2 ) f 3 ( s2 x2 )
x2
s2
0
1
2
3
4
5
0
0
50
70
80
100
130
20
70
90
100
120
45
95
115
125
75
125
145
110
160
susy susmartini
operations research II, 2006
150
f 2 ( s2 )
x2
0
50
70
95
125
160
0
0
0 or 1
2
3
4
n = 1
f1 ( s1 , x1 ) p1 ( x1 ) f 2 ( s1 x1 )
x1
s1
5
160
170
165
160
155
120
f1 ( s1 )
x1
170
Optimal Solution :
x1 1
s2 5 1 4
s3 4 3 1
x2 3
x3 1
additional person years of life 170.000
susy susmartini
operations research II, 2006
SPRING
SUMMER
AUTUMN
WINTER
SPRING
REQUIREMENT
255
220
240
200
255
susy susmartini
operations research II, 2006
PENYELESAIAN :
STAGE
STAGE
STAGE
STAGE
1
2
3
4
:
:
:
:
Stage
n
SUMMER
AUTUMN
WINTER
SPRING
State :
sn
xn
200 xn sn 2,000 xn rn
Stage
n+1
xn
Value : f n sn , xn
f n*1 xn
rn xn 255
State sn xn 1
Ketika :
n 1, s1 x0 x4 255
susy susmartini
operations research II, 2006
Object function :
Minimize
200 x
4
i 1
rn
220
240
200
255
ri xi 255
subject to :
xi 1 2,000 xi ri
Feasible
Possible
xn
sn xn 1
220 x1 255
s1 255
for i 1, 2, 3, 4
Cost
x4 255
200 s4 255
susy susmartini
operations research II, 2006
200 255 x3
rn xn 255
200 x
2
,
000
x
f
n
n
n
n
n 1 xn
2
Solution procedure
Stage 4 :
n=4
s4
f 4* s4
200 s4 255
200 255 s4
Stage 3 :
n=3
f 3* s3 min
200 x3 255
min
200 x3 255
200 x s
200 x s
3
255
2,000 x3 200 f 4* x3
x4*
min f 3 s3 , x3 :
x3* 3
2
sehingga :
f 3* s3
s 250
s 250
200 3
s3 200 255 3
2
2
s 250
2,000 3
200
2
f 3* s3
s3
x3*
susy susmartini
operations research II, 2006
s3 250
2
Stage 2 :
n=2
f 2 s2 , x2 200 x2 s2 2,000 x2 r2 f 3* x2
2
200 x2 s2 2,000 x2 r2
2
f 2* s2
min
240 x2 255
f 2 s 2 , x2
2 s2 240
x2
3
Karena :
2
f 2 s2 , x2 600 0
2
x2
susy susmartini
operations research II, 2006
Ketika s2 240 :
f 2* s2
s2
220 s2 240
240 s2 255
x2*
240
200
2
2
2 250 s2 265 s2 30 3s2 575
9
susy susmartini
operations research II, 2006
2 s2 240
3
Stage 1 :
n=1
f1 s1 , x1 200 x1 s1 2,000 x1 r1 f 2* x1
2
Mengacu pada f 2* x1 :
2
250
200
2
1
200 x1 s1 2,000 x1 220
f1 s1 , x1
f1 s1 , x1 400 2 x1 s1 235
x1
s1 255
400
4 x1 3s1 225
f1 s1 , x1
x1
3
Karena :
2
f1 s1 , x1 0
2
x1
x1
maka untuk :
f1 s1 , x1 0
x1
Karena
x1
s1 255 x1 247.5
3s1 225
4
s1
f s1
255
185,000
247.5
*
1
*
1
*
1
247.5
susy susmartini
operations research II, 2006
*
2
245
x3*
x4*
247.5
255
susy susmartini
operations research II, 2006
PENYELESAIAN :
Sehingga :
Dimana :
f n* 0 0
susy susmartini
operations research II, 2006
Sehingga untuk sn 1,
2
1
2
f n 1, xn K xn 1
K xn
xn
xn
*
n 1
1 1 1 2
f n*1 1
Dimana :
f 4* 1 16
susy susmartini
operations research II, 2006
f * 0
n 1
xn
State :
Value
:
1 1
decision
1
f n 1, xn
xn
K xn 1
n3
xn
2
1
xn
f n*1 0 0
xn
K xn
f n*1 1
s3
0
1
0
16
1
12
2
9
1
f n*1 1
f 3 1, x3 K x3 1 2
x3
K xn
3
8
4
8
susy susmartini
operations research II, 2006
x3
16
5
f 3* s3
x3*
8.5
0
8
0
3 or 4
n=
2
x2
s2
0
1
0
8
x1
n=1
s1
1
KESIMPULA
N
f 2 1, x2
K x2 1 2
1
2
3
8
x2
f1 1, x1 K x1 1 2
x1
f 3* 1
f 2* s2
7.5
0
7
0
2 or 3
f1* s1
x1*
6 3/4
f 2* 1
7.5
6 3/4
6 7/8
7 7/16
x2*
x1* 2,
x2* 2 atau 3,
x3* 3 atau 4
dengan total expected cost $ 675
susy susmartini
operations research II, 2006
CONTOH
:
Penyelesaian :
Stage n : n th n 1, 2, 3
xn : number of chips to bet at stage n
State sn : number of chips in hand to begin stage n
f n sn , xn : probabilit y of finishing the three plays with at
least 5 chips, given that the statistician starts
stage n in state sn , and makes the immediate
decision xn
*
f n sn : max f n sn , xn
xn 0 ,1, ....., s n
f n s n , xn
f n*1 sn xn 2 3 f n*1 sn xn
susy susmartini
operations research II, 2006
s3 f 3* s3
n=
3
n=
2
0
1
2
3
4
>5
s2
x2
0
1
2
3
4
>5
f 2 s 2 , x2
0
0
0
0
2/3
2/3
1
1
0
4/9
4/9
8/9
0
0
0
2/3
2/3
1
x3*
2 (or more)
1 (or more)
0(or < s3 5)
f 3* s2 x2 2 3 f 3* s2 x2
4/9
2/3
2/3
2/3
2/3
susy susmartini
operations research II, 2006
2/3
f s2
*
2
0
0
4/9
2/3
8/9
1
x2*
1 or 2
0, 2 or 3
1
0(or<s2-5)
n=1
s1
3
f1 s1 , x1
f 2* s1 x1 2 3 f 2* s1 x1
2/3
20/27
2/3
2/3
f1* s1
x1*
20/27
Kesimpulan :
x1* 1
menang,
x
*
3 0
menang, x2 1
*
kalah,
x
3 2 atau 3
2
atau
3
x
*
2 1
menang, x3
*
kalah, x2* 1 atau 2
1
,
2
,
3
atau
4
x
2 2
susy susmartini
operations research II, 2006
MARKOV PROCESSES
DEFINISI :
MARKOV PROCESS MODELS adalah suatu proses stokastik untuk
memperkirakan keadaan di masa mendatang, dengan hanya
mempertimbangkan keadaan tepat sebelumnya. Sehingga untuk suatu
Markov Process, dengan present state yang diketahui, maka conditional
probability keadaan berikutnya bersifat independen dari keadaan
sekarang.
Suatu stochastic process X n , n 0,1, 2, ... dengan suatu finite or
countable state space, dikatakan mempunyai suatu Markov chain
structure jika
P X n 1 j X 0 i0 , X 1 i1 , ....., X n 1 in 1 , X n i
P X n 1 j X n i
P X n 1 j X n i
p
j 1
ij
1,
1 i, j N
i 1, 2, .......N
susy susmartini
operations research II, 2006
N x N Transition
Probability
Matrix P
State
P=
1
2
.
.
.
N
..
P11
p12
P1N
p21
p21
p2N
.
.
.
pN1
.
.
.
pN2
.
.
.
pNN
P pij
p N 1 p N 2 ..... p NN
susy susmartini
operations research II, 2006
Contoh 1:
Current
selection
Pizzaria A
Pizzaria B
Pizzaria C
Pizzaria B
Pizzaria C
0.5
0.4
0.3
0.3
0.2
0.3
0.2
0.4
0.4
susy susmartini
operations research II, 2006
Vi Vi
n
n 1
P Vi P
1
n2
P V P
1
n 1
Selection
Next Time, n= 1
Pizzaria A
p=0.5
p=0.3
p=0.2
p=0.4
Current
Selection,
Pzzaria B
( n=0 )
Selection Time
After Next, n= 2
p=0.4
p=0.2
Pizzaria B
p=0.2
p=0.4
Pizzaria A
Pizzaria B
Pizzaria C
Pizzaria A
Pizzaria B
Pizzaria C
p=0.4
p=0.3
Pizzaria C
p=0.3
p=0.4
Pizzaria A
Pizzaria B
Pizzaria C
susy susmartini
operations research II, 2006
p pikr pkj( n r ) ,
n
ij
k 0
susy susmartini
operations research II, 2006
V13 V11 P 2
P 4 P . P 3 P . P. P 2 P 2 . P 2
0.43 0.27 0.30
0.40 0.28 0.32
0.39 0.27 0.34
susy susmartini
operations research II, 2006
Contoh 2 :
Future States
Present
State
1/3
1/3
1/3
1/2
1/4
1/4
1/4
2/4
1/4
1/3
2/3
Dari State 1
Dari State 2
Dst
X
0
P 1
X
X
X
0
0
0
X
X
X
X
X X X X
X X X X
X X X X
X X X X
X
P 3
P 2
X X X X
X X X X
X
X
X
0
X
X
X
X
X
X
Pada power ke 3, transition matrix telah menjadi matrix yang hanya terdiri dari
positive probabilit y elements, sehingga ergodic chain tersebut merupakan Regular
Chain
susy susmartini
operations research II, 2006
Contoh 3 :
0
0 X
P 1 X 0
X 0
0 X
0 X
0 X P 2 0 X
0 0 X
0 X
X X 0
X 0
0
0 X
0 X
0 X
P 3 X 0
X 0
0 X
X X 0
0 0 X
0 X
0 X
P 4 0 X
0 X
X 0
lim pij n j
n
j 1
j i pij ,
i 1
susy susmartini
operations research II, 2006
j 0
1
untuk j 1, ...., M
Contoh 4 ( Pizzaria ) :
Current
selection
Pizzaria A
Pizzaria B
Pizzaria C
1 1 2 3
Pizzaria B
Pizzaria C
0.5
0.4
0.3
0.3
0.2
0.3
0.2
0.4
0.4
1 2 3 1 .0
0.5 1 0.4 2 0.3 3 0
0.3 1 0.8 2 0.3 3 0
I1 = 8
I5 = 5
I2 = 6
I6 = 8
I3 = 5
I7 = 6
I4 = 7
I8 = 2
susy susmartini
operations research II, 2006
g ij 2 pij 2 g ij 1 p jj
.
.
g ij n pij n g ij 1 p jjn1 g ij 2 p jjn 2 ............ g ij n 1 p jj
Contoh 6 (Pizzaria) :
susy susmartini
operations research II, 2006
n
g
ij 1
n 1
n
g
ii 1
n 1
kemudian state i disebut recurrent state, suatu saat state i pasti akan
kembali ke state i.
susy susmartini
operations research II, 2006
n
ii
n 1
ng
n 1
ij
jika
g
n 1
uij
n
ij
jika
g
n 1
n
ij
ng
n 1
n
ij
sehingga :
uij 1 pik u kj
k j
susy susmartini
operations research II, 2006
Contoh 7:
(kasus Pizzaria)
Current
selection
Pizzaria A
Pizzaria B
Pizzaria C
Pizzaria B
Pizzaria C
0.5
0.4
0.3
0.3
0.2
0.3
0.2
0.4
0.4
uij 1 pik u kj
k j
u 23 1 p21u13 p22u 23
u 23 3.21 weeks
3.14 weeks
j
0.3183
susy susmartini
operations research II, 2006
1
0
0 .3
0.1
0 .5
0 .2
0.2
0 .2
0
0
0.1
0 .4
susy susmartini
operations research II, 2006
1
0
P
0.3
0.2
0
1
0.1
0.2
0
0
0.5
0.2
0
0
0.1
0.4
I O
A N
0
P
0.3
0.2
r by r,
r by s,
s by r,
s by s,
0
1
0.1
0.2
0
0
0.5
0.2
0
0.1
0.4
a fundamental matrix :
1
F I N
F : the expected number of times a process is in each
nonabsorbing state before it is absorbed
N : the probabilit ies of going from any nonabsorbing
state to any other nonabsorbing state in exactly one state
I N
1
0
0.5
1 0.2
0.1 0.5
0.4 0.2
2.14
1
F I N
0.71
0.1
0.6
0.36
1.79
Beginning State
S3
S4
susy susmartini
operations research II, 2006
2.14
0.71
0.36 0.3
1.79 0.2
0.71
0.57
0.29
0.43
0.1
0.2
Jika terdapat 100 students, yang terdiri dari 40 students S 3 dan 60 students S 4 ,
maka jumlah students yang akan mencapai S1 dan S 4 adalah :
0.71
0.57
60
37.4
0.29
0.43
Artinya, jumlah students yang akan dapat mencapai state 1 sebanyak 62.6 atau 63
orang, sementara jumlah students yang akan mencapai state 2 sebanyak 37.4
atau 37 orang
susy susmartini
operations research II, 2006
State
1
2
3
Excelent
Acceptable, but of marginal quality
Unacceptable, blurry and unreadable
From
State
To State
1
1
2
3
0
0
0
7/8
3/4
0
1/8
1/4
1
State
Expected Cost
1
2
3
$0
$ 1000 (cost of illegible reports)
$ 5000 (cost of illegible reports, plus cost of repairing printer)
susy susmartini
operations research II, 2006
To state
1
1
2
3
0
0
1
7/8
3/4
0
1/8
1/4
0
1 1 2 3
1 1 3
2 7 8 1 3 4 2
3 18 1 1 4 2
1 2 11 0.1818
2 7 11 0.6364
3 2 11 0.1818
1 2 3 1.000
susy susmartini
operations research II, 2006
Artinya :
Untuk waktu yang cukup lama, printer akan berada pada :
State 1
State 2
State 3
Sehingga :
Untuk waktu yang cukup lama, diperkirakan rata-rata biaya untuk
maintenance policy :
$0 1
$1000 2
$5000 3
susy susmartini
operations research II, 2006
Contoh 10 :
Suatu credit card company membagi Status of Accounts Receivable
menjadi 4 kategori, yaitu :
Accounts Receivable
Category (states)
Status of Accounts
Receivable
1
2
3
4
Paid in full
Bad debt
0-30 days late
31-120 days late
Berikut ini adalah transition matrix (periode mingguan) yang berhasil dibuat oleh
company berdasarkan pengamatan :
To AR Category (state)
P=
From
AR
Category
(state)
0.4
0.2
0.2
0.2
0.3
0.3
0.3
0.1
susy susmartini
operations research II, 2006
Penyelesaian :
1
0
0.4
0.3
F I N
0 0
1 0
0.2 0.2
0.3 0.3
0 I O
0.2 A N
0.1
1
0 0.2
0.3
0
1
1.365 0.303
0.455 1.212
0.2
0.1
0.8 0.2
0
.
3
0
.
9
Probabilit y of absorption FA I N . A
1.365 0.303
0.455 1.212
susy susmartini
operations research II, 2006
0.4 0.2
0.637 0.363
0.3 0.3
0.546 0.454
Jika pada kondisi awal komposisi state 3 dan state 4 masing - masing
adalah $1,000,000 dan $500,000, maka vector T :
T $1,000,000
$500,000
T $1,000,000
0.637 0.363
$500,000
0.546 0.454
$590,000
Sehingga :
'
$910,000
Artinya, company dapat berharap bahwa dari state 3 dan state 4 tersebut dapat
berubah menjadi state 1 sebesar $910,000 dan state 4 sebesar $590,000
susy susmartini
operations research II, 2006