Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

SIMPLEX METHOD

• LP Graphical Method: solution is always associated with a corner point (extreme


point) of the solution space
• The Simplex Method’s key idea is to identify the extreme points algebraically
• Metode ini bersifat iterative, yang bergerak selangkah demi selangkah dimulai
dari suatu titik ekstrim pada daerah fisibel (ruang solusi) menuju ke titik ekstrim
yang optimum.

STANDARD LINEAR PROGRAMMING (LP)


1. All the constraints are equations with nonnegative right hand side
 it needs to convert inequalities into equalities

• ≤ constraint  slack variable


e.g. X1 + 2 X2 ≤ 3  X1 + 2 X2 + S1 = 3. S1 ≥ 0
S1 = slack variable
= the amount by which the available amount of the resource exceeds its
usage by the activities
= banyaknya resource yang tidak terpakai

• ≥ constraints  surplus variable


e.g 3 X1 + X2 ≥ 5  3 X1 + X2 – S2 = 5, S2 ≥ 0
S2 = surplus variable
= the excess of the left hand side over the minimum requirement

2. All the variables are nonnegative


3. The objective function: MAXIMIZATION or MINIMIZATION
1
THE STEPS OF THE SIMPLEX

Step 0 : Initial basic feasible solution


Standard LP forms: m equations, n unknowns (m < n)
Contoh: X1 + X2 + 4 X3 + 2 X4 + 3 X5 = 8
4 X1 + 2 X2 + 2 X3 + X4 + 6 X5 = 4
m=2 n =5
The maximum number of possible basic solutions:
Kombinasi n & m = n! / [m! * (n-m)!]

• By definition, a basic solution can include only m variables which are called
basic variables.
Untuk dapat mengidentifikasikan titik-titik ekstrim suatu ruang solusi secara
aljabar, sebanyak (n – m) variable harus di nol kan
• The remaining variables (n - m) are referred to as zero (nonbasic) variables.
• Jika suatu basic solution dapat memenuhi batas-batas (constraints) nonnegative,
maka solusi ini disebut sebagai: feasible basic solution
• Jika semua constraints adalah ≤, maka initial feasible solution dimulai dengan
meng-nolkan real variables nya

Contoh pada persoalan Flair Furniture


Objetive Max Z = 7 T + 5 C
Constraints 2 T + C ≤ 100
4 T + 3 C ≤ 240
T, C ≥ 0

2
• Inequalities  equalities
2 T + C ≤ 100  2 T + C + S1 = 100
4 T + 3 C ≤ 240  4 T + 3 C + S2 = 240
T & C adalah real variables
S1 & S2 adalah slack variables

Objetive Max Z = 7 T + 5 C
Z = 7 T + 5 C + 0 S1 + 0 S2
T, C, S1, S2 ≥ 0
Sebagai initial basic solution T & C = 0

Tabel Simplex
Iterasi 0 – Initial Basic Solution
Cj 7 5 0 0
BV T C S1 S2 RHS
0 S1 2 1 1 0 100
0 S2 4 3 0 1 240
Zj 0 0 0 0 0 Zj row
Cj - Zj 7 5 0 0 Cj-Zj row

• Cj = the objective function values (contribution rates) for each variable (located in
the first row and first column). The values in the first column indicates the unit
profit for each variable currently in the solution mix (variables S1 and S2 in the table
above).

• The Zj value for the RHS column provides the total contribution (gross profit in this

case) of the given solution (in the table above Zj = 0 = 0*100 + 0*240).

3
• The Zj values for the other columns (variables T, C, S1, and S2) represent the gross
profit given up by adding one unit of this variable into the current solution.

Zj = (profit per unit of S1)*(rate row 1) + (profit per unit of S2)*(rate row 2)

In table above, e.g. Zj for column T = (0)*(2) + (0)*(4) = 0

• The Cj – Zj number in each column represents the net profit that will result from
introducing 1 unit of each product or variable into the solution, i.e. the profit gained
minus the profit given up. (It is not calculated for the RHS column.)

To compute these numbers: subtract the Zj total for each column from the Cj value
at the very top of that variable’s column.

e.g. in table above (Cj – Zj) for column T = 7 – 0 = 7

Step 1: Select an ENTERING variable


Optimality condition: stop if there is no entering variable
• Problem Maksimasi  jika seluruh nonbasic variable pada (Cj – Zj) row
mempunyai koefisien non positif (negative atau nol)
• Problem Minimasi  jika seluruh nonbasic variable pada (Cj – Zj) row
mempunyai koefisien non negative (positif atau nol)

Objective Entering Variable


Maksimasi The most (+) coeff in the (Cj – Zj) row

Minimasi The most (-) coeff in the (Cj – Zj) row

In flair furniture problem, the objective is max, the entering variable is T.


4
Step2: Select a LEAVING variable  feasibility condition
• Hitung rasio antara RHS dan coeff dari constraints yang berada di pivot column
(i.e. column of entering variable)
• Pilih rasio yang terkecil dan nonnegative sebagai leaving variable.
• Interseksi antara pivot column dan pivot row dinamakan pivot element.

Cj 7 5 0 0
BV T C S1 S2 RHS Ratio
0 S1 2 1 1 0 100 50 Pivot row
0 S2 4 3 0 1 240 60
Zj 0 0 0 0 0
Cj - Zj 7 5 0 0

Pivot column Pivot element (2)

STEP 3: Gauss-Jordan Computation


1. New pivot row = current pivot row : pivot element
2. Row yg lain (Zj row tidak perlu dihitung)
New row = (current row) ─ [(its pivot column coeff) * (new pivot row)]
T C S1 S2 RHS
New pivot row (T) 1 1/2 1/2 0 50

S2 row 4 3 0 1 240
─ [4*new pivot row] -4 -2 -2 0 -200
New S2 row 0 1 -2 1 40
The new tableau corresponding to the new basic solution
(with new basic variables: T & S2)

5
Hasil Iterasi 1
Cj 7 5 0 0
BV T C S1 S2 RHS
7 T (NPV) 1 0.5 0.5 0 50
0 S2 0 1 -2 1 40
Zj 7 3.5 3.5 0 350
Cj - Zj 0 1.5 -3.5 0

Belum optimum karena variabel C memiliki (+) coeff in the (Cj – Zj) row = 1.5.

Iterasi 2
Cj 7 5 0 0
BV T C S1 S2 RHS Ratio
7 T (NPV) 1 0.5 0.5 0 50 100
0 S2 0 1 -2 1 40 40
Zj 7 3.5 3.5 0 350
Cj - Zj 0 1.5 -3.5 0

Pivot column Pivot element Pivot row

Hasil Iterasi 2
Cj 7 5 0 0
BV T C S1 S2 RHS
7 T 1 0 1.5 -0.5 30
5 C (NPV) 0 1 -2 1 40
Zj 7 5 0.5 1.5 410
Cj - Zj 0 0 -0.5 -1.5

All coeff in (Cj – Zj) row have value ≤ 0  OPTIMUM. T = 30 C = 40 Z = 410

6
MINIMIZATION PROBLEM
Objective Min Z = 2 X1 – 3 X2
Constraints X1 + X2 ≤ 4  X1 + X2 + S1 = 4
X1 – X2 < 6  X1 – X2 + S2 = 6
Z = 2 X1 – 3 X2  Z = 2 X1 – 3 X2 + 0 S1+ 0 S2

Iterasi 0
• Step 1 & 2
Cj 2 -3 0 0
BV X1 X2 S1 S2 RHS Ratio
0 S1 1 1 1 0 4 4 Pivot
0 S2 1 -1 0 1 6 -6 row
Zj 0 0 0 0 0 #DIV/0!
Cj - Zj 2 -3 0 0

Pivot column Pivot element

• Step 3
X1 X2 S1 S2 RHS
New pivot row (X2) 1 1 1 1 4

S2 row 1 -1 0 1 6
─ [(-1) * new pivot row] 1 1 1 0 4
New S2 row 2 0 1 1 10

7
Hasil Iterasi 1

Cj 2 -3 0 0
BV X1 X2 S1 S2 RHS
-3 X2 1 1 1 0 4
0 S2 2 0 1 1 10
Zj -3 -3 -3 0 -12
Cj - Zj 5 0 3 0

Tidak ada (-) coeff di (Cj – Zj) row  OPTIMUM


X1 = 0 X2 = 4 Z = -12

Exercises
1. Max profit = 9 X1 + 7 X2
Constraints 2 X1 + X2 ≤ 40
X1 + 3 X2 ≤ 30

2. Max Z = 5 X1 + 4 X2
Constraints 6 X1 + 4 X2 ≤ 24
X1 + 2 X2 ≤ 6
-X1 + X2 ≤ 1
X2 ≤ 2

3. Max Z = 60 X1 + 30 X2 + 20 X3
Constraints 8 X1 + 6 X2 + X3 ≤ 48
4 X1 + 2 X2 ≤ 20
2 X1 + 1.5 X2 + 1.5 X3 ≤ 8
X2 ≤ 5

8
LP PROBLEMS WITH ≥ AND/OR = CONSTRAINTS

Artificial variables R  assuming the role of slack at iteration 0

Method I – THE M-METHOD


M is a sufficiently large positive value

Objective: Maximize  (─) MRi


Mimimize  (+) MRi

M-METHOD Example 1: Min Z = 4 X1 + X2


Constraints Inequalities  equalities
3 X1 + X2 = 3 3 X1 + X2 = 3
4 X1 + 3 X2 ≥ 6 4 X1 + 3X2 – S1 = 6
X1 + 2 X2 ≤ 4 X1 + 2 X2 + S2 = 4
X1, X2 ≥ 0 X1, X2, S1, S2 ≥ 0

S1 = Surplus variable, S2 = Slack variable

Constraints 1 & 2 have no slack  add artificial variable R1 & R2

Constraints: 3 X1 + X2 + R1 = 3
4 X1 + 3 X2 – S1 + R2 = 6 X1, X2, S1, S2, R1, R2 ≥ 0
X1 + 2 X2 + S2 = 4
Objective: Min Z = 4 X1 + X2+ 0 S1 + 0 S2 + MR1 + MR2

Starting BV = R1, R2 & S2 (slack variable), Non-basic Variable = X1, X2, S1


9
Iterasi 0
Cj 4 1 0 0 M M
BV X1 X2 S1 S2 R1 R2 RHS Ratio
0 S2 1 2 0 1 0 0 4 4
M R1 3 1 0 0 1 0 3 1
M R2 4 3 -1 0 0 1 6 1,5
Zj 7M 4M -M 0 M M 9M
Cj - Zj 4 - 7M 1 - 4M M 0 0 0

Iterasi 1
Cj 4 1 0 0 M M
BV X1 X2 S1 S2 R1 R2 RHS Ratio
0 S2 0 1,66666667 0 1 -0,33333 0 3 1,8
4 X1 1 0,33333333 0 0 0,333333 0 1 3
M R2 0 1,66666667 -1 0 -1,33333 1 2 1,2
Zj 4 2M -M 0 -M M 3M
Cj - Zj 0 1-2M M 0 2M 0

Itrasi 2
Cj 4 1 0 0 M M
BV X1 X2 S1 S2 R1 R2 RHS Ratio
0 S2 0 0 1 1 1 -1 1 1
4 X1 1 0 0,2 0 0,6 -0,2 0,6 3
1 X2 0 1 -0,6 0 -0,8 0,6 1,2 -2
Zj 4 1 0,2 0 1,6 -0,2
Cj - Zj 0 0 -0,2 0 M-1.6 M+0.2

Iterasi 3
Cj 4 1 0 0 M M
BV X1 X2 S1 S2 R1 R2 RHS
0 S1 0 0 1 1 1 -1 1
4 X1 1 0 0 -0,2 0,4 0 0,4
1 X2 0 1 0 0,6 -0,2 0 1,8
Zj 4 1 0 -0,2 1,4 0 3,4
Cj - Zj 0 0 0 0,2 M-1.4 M OPTIMUM

Answer: X1 = 2/5 X2 = 9/5 Z = 17/5


10
M-METHOD Example 2:
Objective Max Z = 3 X1 + 5 X2  Z = 3 X1 + 5 X2 + 0 S1 + 0 S2 – MR1
Constraints X1 ≤ 4  X1 + S1 = 4
2 X2 ≤ 12  2 X2 + S2 = 12
3 X1 + 2 X2 = 18  3 X1 + 2 X2 + R1 = 18
X1, X2 ≥ 0  X1, X2, S1, S2, R1 ≥ 0

Iterasi 0
Cj 3 5 0 0 -M
BV X1 X2 S1 S2 R1 RHS Ratio
0 S1 1 0 1 0 0 4 4
0 S2 0 2 0 1 0 12 #DIV/0!
-M R1 3 2 0 0 1 18 6
Zj -3M -2M 0 0 -M -18M
Cj - Zj 3 + 3M 5 + 2M 0 0 0

Iterasi 1
Cj 3 5 0 0 -M
BV X1 X2 S1 S2 R1 RHS Ratio
3 X1 1 0 1 0 0 4 #DIV/0!
0 S2 0 2 0 1 0 12 6
-M R1 0 2 -3 0 1 6 3
Zj 3 -2M 3M + 3 0 -M 12 -6M
Cj - Zj 0 5 + 2M -3M - 3 0 0

Iterasi 2
Cj 3 5 0 0 -M
BV X1 X2 S1 S2 R1 RHS
3 X1 1 0 1 0 0 4 4
0 S2 0 0 3 1 -1 6 2
5 X2 0 1 -1,5 0 0,5 3 -2
Zj 3 5 -4,5 0 2,5 27
Cj - Zj 0 0 4,5 0 -M - 2.5

11
Iterasi 3
Cj 3 5 0 0 -M
BV X1 X2 S1 S2 R1 RHS
3 X1 1 0 0 -0,33333 0,333333 2
0 S1 0 0 1 0,333333 -0,33333 2
5 X2 0 1 0 0,5 0 6
Zj 3 5 0 1,5 1 36
Cj - Zj 0 0 0 -1,5 -M-1 OPTIMUM

Answer: X1 = 2 X2 = 6 Z = 36

12
Method II – THE TWO-PHASE METHOD

 Error karena M adalah bilangan positif yang sangat besar


 Misal pada contoh sebelumnya:
Z – (3 M + 3)*X1 – (2 M + 5)*X2 – 0 S1 – 0 S2 = –18 M
Bila M = 100.000, maka coeff X1 dan X2 menjadi:
` (300.000 + 3) dan (200.000 + 5)

Pada perhitungan computer bisa diabaikan

 Pada two-phase method, konstanta M dihilangkan

PHASE 1
1.1 Fungsi tujuan semula diganti dengan meminimumkan jumlah variable artifisial
min r = min (R1 + R2 + … + Ri)

1.2 Untuk menguji apakah persoalan kita memiliki solusi fisibel atau tidak
 Jika nilai minimum tujuan baru = 0  the problem has feasible solution
 Jika nilai minimum tujuan baru bernilai positif  the problem has NO
feasible solution  STOP

PHASE 2
2.1 Gunakan solusi basis optimum dari fase 1 sebagai solusi awal bagi persoalan semula
2.2 Ubah fungsi tujuan fase 1 kembali ke fungsi tujuan awal soal
2.3 Lanjutkan dengan cara seperti biasa

13
Contoh
Objective Max Z = 3 X1 + 5 X2
Constraints X1 ≤ 4  X1 + S1 = 4
2 X2 ≤ 12  2 X2 + S2 = 12
3 X1 + 2 X2 = 18  3 X1 + 2 X2 + R1 = 18 *
X1, X2 ≥ 0  X1, X2, S1, S2, R1 ≥ 0

Phase 1
Fungsi tujuan semula diganti dengan meminimumkan jumlah variable artifisial
Objective: Min Z = R1
Constraints: same constraints as above

Iterasi 0  perhatikan nilai koefisien Cj


Cj 0 0 0 0 1
BV X1 X2 S1 S2 R1 RHS Ratio
0 S1 1 0 1 0 0 4 4
0 S2 0 2 0 1 0 12 #DIV/0!
1 R1 3 2 0 0 1 18 6
Zj 3 2 0 0 1 18
Cj-Zj -3 -2 0 0 0

Iterasi 1
Cj 0 0 0 0 1
BV X1 X2 S1 S2 R1 RHS Ratio
0 X1 1 0 1 0 0 4 #DIV/0!
0 S2 0 2 0 1 0 12 6
1 R1 0 2 -3 0 1 6 3
Zj 0 2 -3 0 1 6
Cj-Zj 0 -2 3 0 0

14
Iterasi 2
Cj 0 0 0 0 1
BV X1 X2 S1 S2 R1 RHS
0 X1 1 0 1 0 0 4
0 S2 0 0 3 1 -1 6
0 X2 0 1 -1,5 0 0,5 3
Zj 0 0 0 0 0 0
Cj-Zj 0 0 0 0 1

 Nilai optimum tujuan fase 1 = 0  The problem has feasible solution


 Untuk fase 2, R tidak diikutsertakan lagi

Dari tabel optimum di fase 1 (pada Iterasi 2) digunakan sebagai


constraints untuk fase 2.

PHASE 2
Tujuan semula Z = 3 X1 + 5 X2
Constraints X1 + S1 = 4
3 S1 + S2 = 6
X2 – 3/2 S1 = 3

Iterasi 0  jangan lupa merubah koefisien Cj


Cj 3 5 0 0
BV X1 X2 S1 S2 RHS Rasio
3 X1 1 0 1 0 4 4
0 S2 0 0 3 1 6 2
5 X2 0 1 -1,5 0 3 -2
Zj 3 5 -4,5 0 27
Cj-Zj 0 0 4,5 0

15
Iterasi 1
Cj 3 5 0 0
BV X1 X2 S1 S2 RHS
3 X1 1 0 0 -0,33333 2
0 S1 0 0 1 0,333333 2
5 X2 0 1 0 0,5 6
Zj 3 5 0 1,5 36
Cj-Zj 0 0 0 -1,5 OPTIMUM

X1 = 2 X2 = 6 Z = 36

Latihan
1. Objective Min Z = 3 X1 + 5 X2
Constraints X1 ≤ 4; 2 X2 = 12; 3 X1+ 2 X2 ≥ 18; X1,X2 ≥ 0
Selesaikan dengan metode 2 fase

2. The Muddy River Chemical Corporation must produce exactly 1000 pounds of a
special mixture of phosphate & potassium for a customer. Phosphate costs $5 per
pound and potassium costs $6 per pound. No more than 300 pounds of phosphate
can be used, and at least 150 pounds of potassium must be used.
The problem is to determine the least-cost blend of the two ingredients.
Selesaikan dengan Metode M dan Metode 2 fase

16

You might also like