Anda di halaman 1dari 45

Optimization and

Linear Programming

Rini Novrianti Sutardjo Tui
Rini Novrianti Sutardjo Tui

The Optimal Decision Problem

The Optimal Decision Problem Decision which incurs the least cost among the set of permissible decisions
Decision which incurs the least cost among the set of permissible decisions The set of all
Decision which incurs the least cost among
the set of permissible decisions
The set of all
The cost of
permissible
each
decisions is
The decisions can be
decision is
known
ranked according to
known
whether they incur
greater or lesser cost

Optimization Methods

Linear Discrete-time Optimal Control Programming Programming Dynamic Non-linear
Linear
Discrete-time
Optimal Control
Programming
Programming
Dynamic
Non-linear

Programming

Linear Programming (LP)

Standard form of LP problem with m constraints and n variables

Maximize/minimize :Z=c1x1+c2x2+…+cnxn

Constraints

:a11x1+a12x2+…+a1nxn=b1

a21x1+a22x2+…+a2nxn=b2

am1x1+am2x2+…+amnxn=bm

x1≥0;x2≥0;…;xn≥0

b1≥0;b2≥0;…;bm≥0

Linear Programming in Vector Form

a11 ... a1n  a12  a ... a2n  Amxn =  21 a22 ...
a11
...
a1n 
a12
 a
...
a2n
Amxn =
21
a22
...
 ...
...
Maximize/minimize :Z=cx
...
amn
Constraints
:Ax=b
am1
am2
x1
b1 
x≥0
 x
xn1  
2
 b
bm1  
2
b≥0
 ...
xn
c2
...
cn
bm
c1n c1

Prerequisites of LP Model

Function of objective is maximize or minimize All variables are non- negative
Function of objective is maximize or minimize All variables are non-
Function of objective is
maximize or minimize
All variables are non-

negative

is non-negative

All constraints are stated

as equations

Constant in right

side of constraints

Linear Programming Model

Minimize

:Z=40x1+36x2

Constraints :x1≤8

x2≤10

:5x1+3x2≥45

x1≥0;x2≥0

B C x2 = 10 x1 A (8, 5/3) 5 9 5 x1 = 8 x2
B
C
x2 = 10
x1
A (8, 5/3)
5
9
5
x1 = 8
x2
15
10

Simplex Method

Simplex
Simplex
Simplex For complex and broad problem of linear programming
Simplex For complex and broad problem of linear programming

For complex and broad problem of linear programming

Constant in right side of constraint equations has to be non- negative, if not
Constant in
right side of
constraint
equations has
to be non-
negative, if not

then it has to be transformed to positive value.

All constraints have to be equations, if not

then slack variable or surplus variable is needed.

General Model of Simplex Method

aximize

Function of Objective: Maximize

Z – C1X1-C2X2-

. . . . .

–CnXn-0S1-0S2-. .

.-0Sn = NK

Function of Constraints:

a11X11+a12X12+. . .

.+a1nXn+

S1+0S2+. .

Activities Variables

Slack Variables

a21X21+a22X22+. . .

……. ……

..

.+a2nXn+

..

0S1+1S2+. . …. …

..

..

=

……. …

.+0Sn = b1 .+0Sn = b2

General Model of Simplex Method

Function of Objective: Minimize

Z – C1X1-C2X2-

. . . . .

–CnXn-0S1-0S2-. .

.-0Sn = RhV

Function of Constraints:

a11X11+a12X12+. . .

.+a1nXn-

S1-0S2-. . .

a21X21+a22X22+. . .

Activities Variables

.+a2nXn-

Surplus Variables

0S1-1S2-. . .

……. ……

..

……. …

..

..

…. …

..

=

Minimize

am1Xm1+am2Xm2+. . .

… .+amnXn- S1-

- 0Sn = b1 - 0Sn = b2 … -1Sn = bm

0S2-. . .

Solving Simplex Model

Formulate LP problem into standard form of LP

Transform LP model into simplex model

Formulate simplex table

Take steps of solving

Solving Simplex Model Formulate LP problem into standard form of LP Transform LP model into simplex

Simplex Model

Row table of Cj - Zj Column table of basic variables Table of Matrix
Row table of Cj - Zj
Column table of
basic variables
Table of Matrix

Linear Programming

COLUMN TABLE OF MATRIX OF BASIC VARIABLES

Example – Step 1

Maximize:

Linear Programming Method

Function of Objective:

Maximize: Z=8X1 + 6X2 (in thousand IDR) Function of Constraints:

Material A : 4X1 + 2X2 ≤ 60 Material B : 2X1 + 4X2 ≤ 48

X1, X2 ≥ 0

Step 2

Simplex Model:

Function of Objective: Maximize Z– 8X1–6 X2–0S1- 0S2 = 0

Function of Constraints:

4X1+2X2+ S1+ 0S2 = 60 2X1+4X2+0S1+ 1S2 = 48

X1, X2, S1, S2 ≥ 0

Step 3 – 1

Simplex Table

Basic

Z

   

S1

S2

RhV

Variables

X1

X2

Step 3 – 2

Simplex Table Basic Z X1 X2 S1 S2 RhV Variables Z S1 S2
Simplex Table
Basic
Z
X1
X2
S1
S2
RhV
Variables
Z
S1
S2

Step 3 – 3

Simplex Table

Basic

Z

X1

X2

S1

S2

RhV

Variables

Z

1

-8

-6

0

0

0

S1

S2

Step 3 – 4

Simplex Table

Basic

Z

X1

X2

S1

S2

RhV

Variables

Z

1

-8

-6

0

0

0

S1

0

4

2

1

0

60

S2

Step 3 – 5

Simplex Table

Basic

Z

X1

X2

S1

S2

RhV

Variables

Z

1

-8

-6

0

0

0

S1

0

4

2

1

0

60

S2

0

2

4

0

1

48

Step 4 – 1

First iteration – Iteration-0

Basic

Z

X1

X2

S1

S2

RhV

Variables

Z

1

-8

-6

0

0

0

S1

0

4

2

1

0

60

S2

0

2

4

0

1

48

Step 4 – 2

Iteration-1: Determining key column

Basic

Z

X1

X2

S1

S2

RhV

Variables

Z

1

-8

-6

0

0

0

S1

0

  • 4 2

1

0

60

S2

0

  • 2 4

0

1

48

Keycolumn: column with biggest negative valueof coefficientsof function of constraints.

Step 4 – 3

Iteration-1: Determining key row

Basic

Z

Variables

Z

1

S1

0

S2

0

15 S1 X1 X2 RhV Index Keynumber 24 48 1 0 2 4 S2 60 0
15
S1
X1
X2
RhV
Index
Keynumber
24
48
1
0
2 4
S2
60
0
1
4 2
-
0
0
0
-6
-8

Index value:RV/keycolumn Keyrow: row with smallest index value(positive).

Step 4 – 4

Iteration-1: Changes of row value

Basic

Z

X1

X2

S1

S2

RhV

Variables

Z

X1

0

1

½

¼

0

15

S2

Newkey row: (previouskey row)/key number

Other row value:(previousrow value) –( (new keyrow) x keycolumn of the row itself).

Step 4 – 5

Iteration-1: Changes of row value

Basic

Z

X1

X2

S1

S2

RhV

Variables

Z

X1

0

1

½

¼

0

15

S2

0

0

3

1

18

Newkey row: (previouskey row)/key number

Other row value:(previousrow value) – (new keyrow) x keycolumn of the row itself

Step 4 – 6

Iteration-1: Changes of row value

Basic

Z

X1

X2

S1

S2

RhV

Variables

Z

1

0

-2

2

0

120

X1

0

1

½

¼

0

15

S2

0

0

3

1

18

Newkey row: (previouskey row)/key number

Other row value:(previousrow value) – (new keyrow) x keycolumn of the row itself

Step 4 – 7

Iteration-2: Determining key column

Basic

Z

X1

X2

S1

S2

RhV

Variables

Z

1

0

-2

2

0

120

X1

0

1

½

¼

0

15

S2

0

0

3

1

18

Step 4 – 8

Iteration-2: Determining key row

Basic

Z

X1

X2

S1

S2

RhV

Index

Variables

Z

1

0

-2

2

0

120

-

X1

0

1

½

¼

0

15

30

S2

0

0

3

1

18

6

Step 4 – 9

Iteration-2: Changes of row value Z X1 X2 S1 S2 RhV Index Basic Variables Z X1
Iteration-2: Changes of row value
Z
X1
X2
S1
S2
RhV
Index
Basic
Variables
Z
X1
X2
0
0
1
-1/6
1/3
6
-

Step 4 – 10

Iteration-2: Changes of row value

Basic

Z

X1

X2

S1

S2

RhV

Index

Variables

Z

1

0

0

5/3

2/3

132

-

X1

0

1

0

1/3

-1/6

12

-

X2

0

0

1

-1/6

1/3

6

-

Solution X1 = 12 Zmax = X2 = 6 IDR 132,000
Solution
X1 = 12
Zmax =
X2 = 6
IDR
132,000
Solution X1 = 12 Zmax = X2 = 6 IDR 132,000

Linear Programming

ROW TABLE OF MATRIX OF

CJ - ZJ

Example – Step 1

Maximize:

Linear Programming Method

Function of Objective:

Maximize: Z=3X + 5Y

Function of Constraints:

2X ≤ 8

3Y ≤ 15

6X + 5Y ≤ 30

X, Y ≥ 0

Step 2

Simplex Model:

Function of Objective: Maximize

Z=3X+5Y+0S1+0S2+0S3

Function of Constraints:

2X+0Y+ 1S1+ 0S2+0S3 = 8

0X+3Y+ 0S1+ 1S2+0S3 = 15

6X+5Y+ 0S1+ 0S2+1S3 = 30

X,Y, S1, S2 , S3 ≥ 0

Step 3 – Enter each coefficient into

simplex table

BasicVar.

Obj.

Cj

3

5

0

0

0

Qty.Ratio

 

X

Y

S1

S2

S3

S1

0

8

2

0

1

0

0

S2

0

15

0

3

0

1

0

S3

0

30

6

5

0

0

1

 

Zj

0

0

0

0

0

Cj-Zj

3

5

0

0

0

Step 4 – Determine key column

BasicVar.

Obj.

Cj

3

5

0

0

0

Qty.Ratio

 

X

Y

S1

S2

S3

S1

0

8

2

0

1

0

0

S2

0

15

0

3

0

1

0

S3

0

30

6

5

0

0

1

 

Zj

0

0

0

0

0

Cj-Zj

3

5

0

0

0

Keycolumn: column with biggest positive

valueof Cj – Zj (maximize),or column with biggest negativevalueof Cj – Zj(minimize).

Step 5 – Determine key row

BasicVar.

Obj.

Cj

3

5

0

0

0

Qty.Ratio

 

X

Y

S1

S2

S3

S1

0

8

2

0

1

0

0

8/0=~

S2

0

15

0

3

0

1

0

15/3=5

S3

0

30

6

5

0

0

1

30/5=6

 

Zj

0

0

0

0

0

Cj-Zj

3

5

0

0

0

Quantity_ratio

Q_value coefficient _of _variables_of _key_column_of _responding_row

Keyrow: row with the smallest valueof quantityratio.

Step 6 – Determine pivot point

BasicVar.

Obj.

Cj

3

5

0

0

0

Qty.Ratio

 

X

Y

S1

S2

S3

S1

0

8

2

0

1

0

0

8/0=~

S2

0

15

0

3

0

1

0

15/3=5

S3

0

30

6

5

0

0

1

30/5=6

 

Zj

0

0

0

0

0

Cj-Zj

3

5

0

0

0

Step 7 – Change value of key row

New value : previous key row value/pivot point 15/3 0/3 3/3 0/3 1/3 0/3 5 0
New value : previous key row value/pivot point
15/3
0/3
3/3
0/3
1/3
0/3
5
0
1
0
1/3
0
New value for row S2:

Step 8 – Change value of non-key

row

New value = previous value – (FR x previous value of key row)

FR (fixed ratio) is coefficient of variables of key column of corresponding row/pivot point

Row S1:

FR = 0/3 = 0,

  • 30 6

    • 5 0

      • 0 1

Since value of FR is 0, therefore for row S1, new value = previous value

(5/3) x 15

Row S2:

0

  • 3 1

    • 0 0

FR = 5/3,

  • 5 6

  • 0 -5/3

    • 0 1

Step 9 – Change table in step 3

BasicVar.

Obj.

Cj

3

5

0

0

0

Qty.Ratio

 

X

Y

S1

S2

S3

S1

0

8

2

0

1

0

0

Y

5

5

0

1

0

1/3

0

S3

0

5

6

0

0

-5/3

1

 

Zj

0

5

0

5/3

0

Cj-Zj

3

0

0

-5/3

0

Changein basicvariable:variablesof key column(Y) replace variableof keyrow (S2)

Step 10 – Optimality test

Simplex table is consideredoptimal if value of Cj- Zj≤ 0 for case of

maximize and value of Cj – Zj ≥ 0 for case of minimize.

Table in step 9 indicates that there is still positive value of Cj-Zj,

therefore optimal condition has not been reached yet.

Repeat step 3 – 9 until optimized solution is achieved.

Step 11 – Repeat step 3 – 9

 

Obj.

Cj

3

5

0

0

0

Qty.Ratio

 

Basic

X

Y

S1

S2

S3

Var.

S1

0

38/6

0

0

1

5/9

-2/6

Y

5

5

0

1

0

1/3

0

X

3

5/6

1

0

0

-5/18

1/6

 

Zj

3

5

0

15/18

3/6

Cj-Zj

0

0

0

-15/18

-3/6

Solution

Y=5 X = 5/6 Z = (3 x 5/6) + (5 x 5) = 27.5
Y=5
X = 5/6
Z = (3 x
5/6) + (5 x
5) = 27.5
M i n i n g M a n a g e m e n t
M i n i n g M a n a g e m e n t
M i n i n g M a n a g e m e n t
M i n i n g M a n a g e m e n t
M i n i n g M a n a g e m e n t
M i n i n g M a n a g e m e n t
M i n i n g M a n a g e m e n t
M i n i n g M a n a g e m e n t
M
i n
i n
g
M
a
n a g
e m
e
n t