1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and...

57
1 Chapter 7 Chapter 7 Linear Programming

Transcript of 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and...

Page 1: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

1

Ch

apte

r 7

Chapter 7

Linear Programming

Page 2: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

2

•Linear Programming (LP) ProblemsBoth objective function and constraints are linear.Solutions are highly structured and can be rapidly obtained.

Linear Programming (LP)

•Has gained widespread industrial acceptance since the 1950sfor on-line optimization, blending etc.

•Linear constraints can arise due to:1. Production limitation e.g. equipment limitations, storage

limits, market constraints.2. Raw material limitation3. Safety restrictions, e.g. allowable operating ranges for

temperature and pressures.4. Physical property specifications e.g. product quality

constraints when a blend property can be calculated as an average of pure component properties:

n

1iiiPyP

Ch

apte

r 7

Page 3: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

3

5. Material and Energy Balances- Tend to yield equality constraints. - Constraints can change frequently, e.g. daily or hourly.

•Effect of Inequality Constraints- Consider the linear and quadratic objective functions on

the next page.- Note that for the LP problem, the optimum must lie on one

or more constraints.

•Generic Statement of the LP Problem:

subject to:

•Solution of LP Problems- Simplex Method (Dantzig, 1947)- Examine only constraint boundaries- Very efficient, even for large problems

n

1iiixcfmax

1

0 1,2,...,

1, 2,...,

i

n

ij j ij

x i n

a x b i n

Ch

apte

r 7

Page 4: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

4Figure The effect of an inequality constraint

on the maximum of quadratic function,f(x) = a0 +a1 x + a2 x2. The arrowsindicate the allowable values of x.

Ch

apte

r 7

Page 5: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

5

Ch

apte

r 7

Page 6: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

6

x1 x3

x4

x2

x5

x6

Refinery input and output schematic.

Ch

apte

r 7

Page 7: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

7

Ch

apte

r 7

Page 8: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

8

Ch

apte

r 7

Solution

Let x1 = crude #1 (bbl/day)x2 = crude #2 (bbl/day)

Maximize profit (minimize cost):

y = income – raw mat’l cost – proc.cost

Calculate amounts of each productProduced (yield matrix):

gasoline x3 = 0.80 x1 + 0.44 x2

kerosene x4 = 0.05 x1 + 0.10 x2

fuel oil x5 = 0.10 x1 + 0.36 x2

residual x6 = 0.05 x1 + 0.10 x2

Income

gasoline (36)(0.80 x1 + 0.44 x2)kerosene (24)(0.05 x1 + 0.10 x2)fuel oil (21)(0.10 x1 + 0.36 x2)residual (10)(0.05 x1 + 0.10 x2)

Page 9: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

9

So,

Income = 32.6 x1 + 26.8 x2

Raw mat’l cost = 24 x1 + 15 x2

Processing cost = 0.5 x1 + x2

Then, the objective function is

Profit = f = 8.1 x1 + 10.8 x2

Constraints

Maximum allowable production:

0.80 x1 + 0.44 x2 < 24,000 (gasoline)

0.05 x1 + 0.10 x2 < 2,000 (kerosene)

0.10 x1 + 0.36 x2 < 6,000 (fuel oil)

and, of course, x1 > 0, x2 > 0

Ch

apte

r 7

Page 10: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

10

Ch

apte

r 7

Graphical Solution

1. Plot constraint lines on x1 – x2 plane.

2. Determine feasible region (those valuesof x1 and x2 that satisfy maximum allowableproduction constraints.

3. Find point or points in feasible region thatmaximize f = 8.1 x1 + 10.8 x2; this can befound by plotting the line 8.1 x1 + 10.8 x2 = P,where P can vary, showing different profitlevels.

Page 11: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

11

Ch

apte

r 7

Page 12: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

12

Ch

apte

r 19

Page 13: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

13

Ch

apte

r 19

Page 14: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

14

Ch

apte

r 19

Page 15: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

15

Ch

apte

r 7

Page 16: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

16

Ch

apte

r 7

Page 17: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

17

Ch

apte

r 7

Page 18: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

18

Ch

apte

r 7

Page 19: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

19

Ch

apte

r 7

Page 20: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

20

Ch

apte

r 7

Page 21: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

21

Ch

apte

r 7

Convert inequalities to equalities using slack variables

Page 22: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

22

Ch

apte

r 7

Minimize: f = cTx (7.6)

Subject to: Ax = b (7.7)

and I < x < u (7.8)

Page 23: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

23

Ch

apte

r 7

Page 24: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

24

Ch

apte

r 7

DEFINITION 1: A feasible solution to the linear programmingproblem is a vector x = (x1, x2, …., xn) that satisfies all constraints and bounds (7.8).

DEFINITION 2. A basis matrix is an m x m nonsingular matrixformed from some m columns of the constraint matrix A.

DEFINITION 3. A basic solution to a linear program is theunique vector determined by choosing a basis matrix, andsolving the resulting system of equations for the remainingm variables.

DEFINITION 4. A basic feasible solution is a basic solutionin which all variables satisfy their bounds (7.8).

DEFINITION 6. An optimal solution is a feasible solutionthat also minimizes f in Equation (7.6).

Page 25: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

25

Ch

apte

r 7

Page 26: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

26

Slack variables

1

r

ij i ij

a x b

1

0r

i j i i i ij

a x s b s

refinery example: 2 variables r = 23 constraints p = 3 (3 slacks)

n = r + p = 5 total variablesm = q + p = 3 total constraints (q = 0 = no. equality constraints)3 eqns / 5 unknowns set 2 variables = 0

basic feasible sol’nset (n – m) variables = 0 non-basic m variables ≠ 0 basic

(could have infinite # soln’sIf variables can assume any value)

possible solutions! =

with 2 variables = 0!( - )!

n n

m m n m

510 possible constraint interactions

3

(constraint intersections)

Ch

apte

r 7

Page 27: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

27

Ch

apte

r 7

Page 28: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

28

Ch

apte

r 7

Page 29: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

29

In initiating the simplex algorithm, we treat the objective function

As just another equation, that is,

The basic variables are the first m, that is x1 … xm and –f.Find values of x1 > 0, x2 > 0, . . . . Xn > 0 and min f satisfying

1 1 2 2 n nf c x c x c x

1 1 2 2 0n nf c x c x c x (7.11)

Ch

apte

r 7

Page 30: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

30

Ch

apte

r 7

Page 31: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

31

Ch

apte

r 7

Assume that we know that x5, x1, -f can be used as basicvariables. We can pivot successively on the terms x5 (firstequation) and x1 (second equation)

Page 32: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

32

Ch

apte

r 7

Reduced cost coefficient = -24 (< 0): not optimalIncreasing x3 causes f to decrease

f = 28 -24 x3 (7.21)

Maximum value of x2 ? Check constraints (x2 = x4 = 0)

x3 = 5 -3x3

x1 = 3 -2 x3 (7.22)

3c

Page 33: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

33

Ch

apte

r 7

Is f optimal ? x3 replaces x1 as a basic variable using pivot transformation.

Page 34: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

34

Ch

apte

r 7

5 1 2 4

3 1 2 4

1 2 4

1.5 0.875 0.375 0.5

0.5 0.375 0.125 1.5

12 2 8

x x x x

x x x x

f x x x

(7.25)

5 2

3 2

2

0.5 0.875

= 1.5 0.375

8

x x

x x

f x

is not optimal because 1 Check how much can be increased.2 2f c x

(7.26)

Page 35: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

35

Ch

apte

r 7

Page 36: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

36

Ch

apte

r 7

Page 37: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

37

1 2Ex min f x x

1 2 1 2 3

1 2 1 2 4

1 2 1 2 5

(A) 2 2 2 2

(B) 3 2 3 2

(C) 4 4

x x x x x

x x x x x

x x x x x

start at 1 2

1 2

0, 0

( 0, 0)

x x

x x

which variable when increased will improve obj. fcn more? 1 2( or )x x 1x

1 2

f x x

How far can be increased? 1x2

hold

0x

constraint (1) no limit (2) (3)

1 2.0 limiting constraintx

1 4.0x

(see Figure of feasible region)

calculate new basic feasible sol’n and repeat above analysis – iterate untilobj. fcn cannot be improved further (row operations)

add slacksC

hap

ter

7

Page 38: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

38

Sensitivity Analysis

• How does the value of the optimum solution change when coefficients in the obj. fcn. or

constraints change?• Why is sensitivity analysis important?

- Coefficients and/or limits in constraints may be poorly known

- Effect of expanding capacity, changes in costs of raw materials or selling prices of products.

• Market demand of products vary• Crude oil prices fluctuate

Sensitivity information is readily available in the final Simplex solution. Optimum does not have to be recomputed.

Ch

apte

r 7

Page 39: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

39

Sensitivity Analysis (Constraints)

Shadow price: The change in optimum value of obj. fcn. per unit change in

the constraint limit.

Final Set of Equations of Refinery Blending Problem

x3 = 0 x4 = 0

x5 + 0.14 x3 – 4.21 x4 = 896.5

x1 + 1.72 x3 – 7.59 x4 = 26,207

x2 – 0.86 x3 + 13.79 x4 = 6,897

f – 4.66 x3 – 87.52 x4 = -286,765 ↑

gasolineconstraint

keroseneconstraint

Ch

apte

r 7

Page 40: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

40

Sensitivity Analysis

3

4

5

x = 0 gasoline constraint active

x = 0 kerosene constraint active

x = 896.5 fuel oil constraint active

Which constraint improves obj. fcn. more(when relaxed)?

• = 1 bbl (x3 = -1) $4.66 f = 4.66 x3

(x4 = -1) $87.52 f = 87.52 x4

• No effect of fuel oil (x5); x5 ≠ 0 Inactive constraint

ShadowpricesC

hap

ter

7

Page 41: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

41

Sensitivity Analysisgasoline capacity is worth $4.66/bbl

kerosene capacity is worth $87.52/bbl

fuel oil capacity is worth $0/bbl←No effect

Capacity limit in original constraints * shadow

prices

4.66 (24,000) + 87.52 (2,000) = 286,880

Same as $286,740 Duality (roundoff)

Ch

apte

r 7

Page 42: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

42

Sensitivity Analysis (Obj. Fcn.)

small changes use solution (matrix)

large changes ("ranging" of the coefficients)

recompute optimum.

From final tableau

opt1

opt2

x = 26,207

x = 6,897

Crude oil prices change (Coeff. in obj. fcn.)Max. profit = 8.1 x1 + 10.8 x2

$1.009.1 x1 or

11.8 x2

x1 profit coefficient.

Ch

apte

r 7

Page 43: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

43

Duality• One dual variable exists for each primal

constraint• One dual constraint exists for each primal

variable

• The optimal solution of the decision variables (i.e., the Dual Problem) will correspond to the Shadow Prices obtained from solution of the Primal Problem.

• Commercial Software will solve the Primal and Dual Problems.

i.e., it provides sensitivity information.

Ch

apte

r 7

Page 44: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

44

Ch

apte

r 7

LP Software Companies

Page 45: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

45

Ch

apte

r 7

Page 46: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

46

Ch

apte

r 7

Page 47: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

47

Ch

apte

r 7

Page 48: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

48

Ch

apte

r 7

Page 49: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

49

Ch

apte

r 7

Page 50: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

50

Ch

apte

r 7

Page 51: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

51

Ch

apte

r 7

Page 52: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

52

Ch

apte

r 7

Page 53: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

53

Ch

apte

r 7

Page 54: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

54

Ch

apte

r 7

Page 55: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

55

Ch

apte

r 7

Page 56: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

56

Ch

apte

r 7

Page 57: 1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.

57

Ch

apte

r 7