Vous êtes sur la page 1sur 41

TOPIC 3

OPTIMIZATION
Linear Programming

1
LEARNING OUTCOMES
At the end of the topic, students are able:
• Understand why and where optimization occurs
in engineering problem solving. (CO1-PO2)
• Understand the major elements of the general
optimization problem: objective function,
decision variables, and constraints. (CO1-PO2)
• To adopt and apply Simplex Method to solve
linear programming problems. (CO2-PO2, CO2-
PO4)
Standard Form
Basic linear programming problem consists of two major
parts:
– The objective function
– A set of constraints

For maximization problem, the objective function is generally


expressed as

Maximise Z c1 x1 c2 x2 ...... cn xn

cj = payoff of each unit of the jth activity that is undertaken


xj = magnitude of the jth activity
Z = total payoff due to the total number of activities
• The constraints can be represented generally as

ai1 x1 ai 2 x2  ain xn bi
Where aij=amount of the ith resource that is consumed
for each unit of the jth activity and bi=amount of the
ith resource that is available

• The general second type of constraint specifies that


all activities must have a positive value, xi>0 .

• Together, the objective function and the constraints


specify the linear programming (LP) problem.
Fig. 15.1

Can obtain a single optimal solution


Set of Linear equations using the objective function (~
illustrated GRAPHICALLY unique solution)
Possible outcomes that can be generally obtained
in a linear programming problem:

1. Unique solution. The maximum objective


function intersects a single point.
2. Alternate solutions. Problem has an infinite
number of optima corresponding to a line
segment.
3. No feasible solution.
4. Unbounded problems. Problem is under-
constrained and therefore open-ended.
There are three other possible outcomes of a linear
programming problem:

Alternate solutions No feasible solution Unbounded problems

Fig 15.2
SIMPLEX METHOD
• Assumed that the optimal solution is an
extreme point.

• Constraint equations are reformulated


as equalities by introducing slack
variables.

8
• A slack variable measures how much of a
constrained resource is available, e.g.,
7x1+ 11 x2 ≤ 77
If a slack variable S1 is defined as amount of
raw gas that is not used for a particular
production level (x1, x2) and add it to the left side
of the constraint, it makes the relationship exact.
i.e. 7x1+ 11 x2 + S1 = 77

• If slack variable= positive, it means that we have


some slack, i.e. some surplus that is not being
used.
• If slack variable = negative, it tells that we have
exceeded the constraint.
• If slack variable = zero, we have exactly met the
constraint. We have used up all the allowable
resource. 9
Example

10
Solution:
Formulate the LP with the objective function
Z subject to the constraints.
Z 150x1 175x2

7 x1 11x2 77
10 x1 8 x2 80
x1 9
x2 6

x1 , x 2 , S1 , S 2 , S 3 , S 4 0 11
Introduce Slack
variables

Z 150 x1 175 x2

7 x1 11x2 S1 77
10 x1 8 x2 S2 80
x1 S3 9
x2 S4 6

x1 , x 2 , S1 , S 2 , S 3 , S 4 0
12
STEPS :
1. Draw a ‘tableau’ with all the non-basic variables,
the Solution and Intercept columns.
Number of rows and columns depend on total no.
of slack variables.

TABLEAU 1

Basic Z x1 x2 S1 S2 S3 S4 Solu- Inter-


tion cept

For column headings:


Z insert Z, all non-basic variables
#1 (x1 to xn) and slack variables
S1 (S1 to Sn),
where n = no. of total constraints
S2
S3 For row headings:
insert Z and S1 to Sn.
S4 13
2. Fill up the boxes with all the coefficients.
For the objective function (say, Z), make the profit = 0

Z 150 x1 175 x2 0
#2
Basic Solu- Inter-
Z x1 x2 S1 S2 S3 S4
tion cept

Z 1 -150 -175 0 0 0 0 -
S1 0 7 11 1 0 0 0 77
S2 0 10 8 0 1 0 0 80
S3 0 1 0 0 0 1 0 9
S4 0 0 1 0 0 0 1 6
14
#4:
77 / 7 = 11
#3
Basic Z x1 x2 S1 S2 S3 S4 Soln Inter-
cept

Z 1 -150 -175 0 0 0 0 - -

S1 0 7 11 1 0 0 0 77 11

S2 0 10 8 0 1 0 0 80 8

S3 0 1 0 0 0 1 0 9 9

S4 0 0 1 0 0 0 1 6
5. Choose the smallest positive number from the intercept
column (i.e. = 8). Find the corresponding value in the x1
column (= 10).
The related slack variable is S2 (termed as LEAVING
VARIABLE). This will be replaced with x1 in the next
#5
tableau.

Basic Z x1 x2 S1 S2 S3 S4 Soln Inter-


cept
Z 1 -150 -175 0 0 0 0 - -

S1 0 7 11 1 0 0 0 77 11

S2 0 10 8 0 1 0 0 80 8

S3 0 1 0 0 0 1 0 9 9

S4 0 0 1 0 0 0 1 6 16
6. Need to transform 10 to 1, i.e. divide all elements in that
row by 10, termed as normalise.
7. All other elements in that x1 column must be transformed
into zeros.

Basic Soln Inter-


Z x1 x2 S1 S2 S3 S4
cept
R1 Z 1 -150 -175 0 0 0 0 - -

R2 S1 0 7 11 1 0 0 0 77 11

R3 S2 0 10 8 0 1 0 0 80 8

R4 S3 0 1 0 0 0 1 0 9 9

R5 S4 0 0 1 0 0 0 1 6

17
8. Draw a new TABLEAU 2, x1 replaces S2 in the row
heading.
To perform no. 6, normalise the intersect value, where R3 = R3* / 10
* coefficients in previous Tableau

Basic Soln Inter-


Z x1 x2 S1 S2 S3 S4
cept
R1 Z 0
#6

R2 S1 0

R3 x1 0 1 0.8 0 0.1 0 0 8

R4 S3 0

R5 S4 0

18
E.g. To transform Z function at the entering variable (i.e. -150
to make as zero, all elements in R1 must be transform
using general equation of : R1 = R1* -(-150/1x R3)
where R3 = current coefficient and
R1* = previous coefficient
Similarly, find for all other coeffs. in the Z row.
#7
Basic Soln Inter-
Z x1 x2 S1 S2 S3 S4
cept

Z 1 0 -55 0 15 0 0 1200 -
R1

R2 S1
R3 x1 0 1 0.8 0 0.1 0 0 8

R4 S3
R5 S4 19
For other rows :
R2 = R2* -(7/1 x R3), R4 = R4*- (1/1 x R3)
R5 remains the same since element is already zero.

Basic Soln Inter-


Z x1 x2 S1 S2 S3 S4
cept
R1 Z 1 0 -55 0 15 0 0 1200 -

R2 S1 0 0 5.4 1 -0.7 0 0 21

R3 x1 0 1 0.8 0 0.1 0 0 8

R4 S3 0 0 -0.8 0 -0.1 1 0 1

R5 S4 0 0 1 0 0 0 1 6

20
9. Check for other negative values in the Z function row.
x2 is now the entering variable. Repeat the process;
calculate the intercepts and find the smallest positive
number. Thus S1 is the ‘leaving variable’ and change to x2
for next Tableau.

Basic Z x1 x2 S1 S2 S3 S4 Soln Inter-


cept
Z 1 0 -55 0 15 0 0 1200 -

S1 0 0 5.4 1 0 0 0 21 3.889

x1 0 1 0.8 0 1 0 0 8 10

S3 0 0 -0.8 0 0 1 0 1 -1.25

S4 0 0 1 0 0 0 1 6 6
21
10. Draw a new TABLEAU 3.
R2 = R2* / 5.4, R1 = R1* -(-55/1x R2),
R3 = R3* - (0.8xR2)
R4 = R4* - (- 0.8x R2), R5 = R5* - R2
# 11 Basic Soln Inter
Z x1 x2 S1 S2 S3 S4
-cept
0 0 10.1855 7.8704 0 0 1413.889 -
R1 Z 1
0 0 1 0.1852 -0.1296 0 0 3.8889
R2 x2
0 1 0 -0.1481 0.2037 0 0 4.8889
R3 x1
0 0 0 0.1481 -0.2037 1 0 4.111
R4 S3
0 0 0 -0.1852 0.1296 0 1 2.1111
R5 S4
22
11. If there are no other negative unknown
values (in this case x1 and x2) in the Z
row, stop the work.

Therefore solution is when


x1 = 4.8889 and x2 = 3.8889,
and maximum profit = 1413.89

23
Exercise 15.3
Maximise f(x,y) = 1.75 x + 1.25 y

Subject to :
1.2 x + 2.25 y < 14
x + 1.1y < 8
2.5x + y < 9
x > 0, y > 0

24
SOLUTION :

Objective function : Z 1.750x 1.25 y 0

1.2 x 2.25 y S1 14
x 1.1y S2 8
2.5 x y S3 9

x, y, S1 , S 2 , S3 0

25
TABLEAU 1:
Basic
Z x y S1 S2 S3 Solu Inter-
-tion cept
Z 1 -1.75 -1.25 0 0 0 -
R1
S1 0 1.2 2.25 1 0 0 14 11.667
R2

R3 S2 0 1.0 1.1 0 1 0 8 8

R4 S3 0 2.5 1 0 0 1 9 3.6

1. Determine entering variable = largest –ve no. in objective


function, then calculate intercept values.
2. Determine the smallest +ve no. of the intercept column,
find corresponding leaving variable. 26
TABLEAU 2:
Basic
Z x y S1 S2 S3 Solu Inter-
-tion cept
Z 1 0 -0.55 0 0 0.7 6.30

S1 0 0 1.77 1 0 -0.48 9.68 5.469

S2 0 0 0.7 0 1 -0.4 4.4 6.286

x 0 1 0.4 0 0 0.4 3.6 9.00

3. Make pivot element (= 2.5) to be 1 and all others in


column as zeros.
i.e. R4 = R4*/2.5, R1 = R1* + 1.75 R4,
R2 = R2* - 1.2 R4, R3 = R3* - R4 27
Note :
There is still a negative value in the Z row.
Repeat process; find intercept values.

Find smallest positive no. in the intercept


column. Check corresponding leaving
variable.

28
TABLEAU 3:

Basic
Z x y S1 S2 S3 Solu Inter-
-tion cept
1 0 0 0.3107 0 0.5508 9.3079
Z
0 0 1 0.5649 0 0.2712 5.4689
y
0 0 0 - 1 -0.2102 0.5717
S2 0.3955

0 1 0 -0.226 0 0.5085 1.4124


x

R2 = R2*/1.77, R1 = R1* + 0.55 R2,


R3 = R3* - 0.7 R2, R4 = R4* - 0.4 R2
29
Solution:
The profit is maximised at 9.3079 when
x = 1.4124 and
y = 5.4689

EXERCISE:
Do Problems 15.1 (a, c, e), 15.12, 16.16

30
Problem 15.1
a) Set up linear programming:
Say, xa = amount of product A produced,
xb = amount of product B produced.
The objective function is to maximize profit,
P 45xa 20xb
subject to the following constraints:
20xa 5xb 9500 {raw materials}
0.04xa 0.12xb 40 {productio n time}
x a x b 550 {storage}
x a , xb 0 {positivity}
b) To solve graphically, the constraints can
be reformulated as the following straight
lines
xb 1900 – 4 xa {raw materials}
xb 333.3333- 0.33333xa {production time}
xb 550 - xa {storage}

• The objective function can be reformulated


as
xb (1 / 20) P 2.25xa
P=
xb

mater
st
time

22,5
or
300

ag

ial
00
e
optimum
200

P=
P=

15,0
7,50

100

00
0

xa
0
0 200 400 600

Using graphical method


c) Using Simplex Method
TABLEAU 1
Basis P xa xb S1 S2 S3 Solution Intercept
P 1 -45 -20 0 0 0 0
S1 0 20 5 1 0 0 9500 475
S2 0 0.04 0.12 0 1 0 40 1000
S3 0 1 1 0 0 1 550 550
TABLEAU 2
Basis P xa xb S1 S2 S3 Solution Intercept
P 1 0 -8.75 2.25 0 0 21375
xa 0 1 0.25 0.05 0 0 475 1900
S2 0 0 0.11 -0.002 1 0 21 190.9091
S3 0 0 0.75 -0.05 0 1 75 100
TABLEAU 3
Basis P xa xb S1 S2 S3 Solution Intercept
P 1 0 0 1.666667 0 11.66667 22250
xa 0 1 0 0.066667 0 -0.33333 450
S2 0 0 0 0.005333 1 -0.14667 10
xb 0 0 1 -0.06667 0 1.333333 100
Solution:
• Profit is maximised at $22,250/-
when xa = 450 kg
xb = 100 kg
Solving a Minimization Problem
A minimization problem is in standard form if the objective
function is to be minimized,

E.g. Minimise w = 1.75 x + 1.25 y


1.2 2.25 14
Subject to the constraints where:
1.2 x + 2.25 y > 14 1 1.1 8
x + 1.1y > 8 2.5 1 9
2.5x + y > 9
1.75 1.25 0
And x > 0, y > 0

To solve this problem, use the following steps.

1. Form the augmented matrix for the given system


of inequalities, and add a bottom row consisting
of the coefficients of the objective function.
2. Form the transpose of this matrix (change Row to
Column)
1.2 1 2.5 1.75
2.25 1.1 1 1.25

14 8 9 0

3. Form the dual maximization problem corresponding to


this transposed matrix.
Implies that the objective function with new variables.
That is, find the maximum of the objective function given by
Z = 14 a + 8b + 9 c (coefficients in the bottom row)
subject to the constraints where:
1.2 a + b + 2.5c < 1.75
2.25a + 1.1 b + c < 1.25
4. Apply the simplex method to the dual
maximization problem. The maximum value of z
will be the minimum value of w.

• Moreover, the values of unknowns x1, x2… and


xn (in this case: x and y) will occur in the row of
the final simplex tableau, in the columns
corresponding to the slack variables.
Thus for the Simplex LP:

The constraints will now be:


1.2 a + b + 2.5c + S1 = 1.75
2.25a + 1.1 b + c + S2 = 1.25
a > 0, b > 0, c > 0
Apply Simplex Method:
No column for Z function
Tableau 1

Basic a b c S1 S2 Solution Intercept

Z -14 -8 -9 0 0
1.458
S1 1.2 1 2.5 1 0 1.75

S2 2.25 1.1 1 0 1 1.25 0.556

Tableau 2

Basic a b c S1 S2 Solution Intercept

Z 0 -1.156 -2.778 0 6.22222 7.778

S1 0 0.413 1.967 1 -0.5333 1.083 0.551

a 1 0.489 0.444 0 0.444 0.556 1.250


39
/contd.
Tableau 3
Basic a b c S1 S2
Solution Intercept
Z 0.000 -0.572 0.000 1.412 5.469 9.308
c 0 0.210 1.000 0.508 -0.271 0.551 2.621
a 1.000 0.395 0.000 -0.226 0.565 0.311 0.786
Tableau 4
Basic a b c S1 S2 Solution Intercept
Z 1.446 0 0 1.086 6.286 9.757
c -0.531 0 1 0.629 -0.571 0.386
b 2.529 1 0 -0.571 1.429 0.786

= X =Y

Minimum = 9.757 when x = 1.086 Note : The slack variables in objective


y= 6.286 row are the answers

40
Note: Convenient to use EXCEL Solver

• Just change the appropriate sign


conventions accordingly

Inequalities follow
original functions

Coefficients remain similar


as in original functions 41

Vous aimerez peut-être aussi