linear programming problems : dr. purnima pandit

42
Linear Programming Problems Dr. Purnima Pandit Assistant Professor Department of Applied Mathematics Faculty of Technology and Engg. The Maharaja Sayajirao University of Baroda

Upload: purnima-pandit

Post on 06-May-2015

681 views

Category:

Education


4 download

DESCRIPTION

Linear Programming Problems.

TRANSCRIPT

Page 1: Linear Programming Problems : Dr. Purnima Pandit

Linear Programming Problems

Dr. Purnima Pandit

Assistant Professor Department of Applied Mathematics

Faculty of Technology and Engg.

The Maharaja Sayajirao University of Baroda

Page 2: Linear Programming Problems : Dr. Purnima Pandit

Different Kinds of Optimization

Page 3: Linear Programming Problems : Dr. Purnima Pandit

Elements

Variables

Objective function

Constraints

Obtain values of the variables

that optimizes the objective function

( satisfying the constraints )

Page 4: Linear Programming Problems : Dr. Purnima Pandit

Linear Programming (LP)

LP is a mathematical modeling

technique used to achieve an objective,

subject to restrictions called constraints

Page 5: Linear Programming Problems : Dr. Purnima Pandit

Types of LP

Page 6: Linear Programming Problems : Dr. Purnima Pandit

LP Model Formulation

Decision variables mathematical symbols representing levels of activity of an

operation

Objective function a linear relationship reflecting the objective of an operation

most frequent objective of business firms is to maximize profit

most frequent objective of individual operational units (such as a production or packaging department) is to minimize cost

Constraint a linear relationship representing a restriction on decision

making

Page 7: Linear Programming Problems : Dr. Purnima Pandit

LP Model Formulation (cont.)

Max/min z = c1x1 + c2x2 + ... + cnxn

subject to:

a11x1 + a12x2 + ... + a1nxn (≤, =, ≥) b1

a21x1 + a22x2 + ... + a2nxn (≤, =, ≥) b2

:

am1x1 + am2x2 + ... + amnxn (≤, =, ≥) bm

xj = decision variables

bi = constraint levels

cj = objective function coefficients

aij = constraint coefficients

Page 8: Linear Programming Problems : Dr. Purnima Pandit

LP Model: Example

Labor Clay Revenue

PRODUCT (hr/unit) (lb/unit) ($/unit)

Bowl 1 4 40

Mug 2 3 50

There are 40 hours of labor and 120 pounds of clay

available each day

Decision variables

x1 = number of bowls to produce

x2 = number of mugs to produce

RESOURCE REQUIREMENTS

Page 9: Linear Programming Problems : Dr. Purnima Pandit

LP Formulation: Example

Maximize Z = $40 x1 + 50 x2

Subject to

x1 + 2x2 40 hr (labor constraint)

4x1 + 3x2 120 lb (clay constraint)

x1 , x2 0

Solution is x1 = 24 bowls x2 = 8 mugs

Revenue = $1,360

Page 10: Linear Programming Problems : Dr. Purnima Pandit

Graphical Solution Method

1. Plot model constraint on a set of coordinates

in a plane

2. Identify the feasible solution space on the

graph where all constraints are satisfied

simultaneously

3. Plot objective function to find the point on

boundary of this space that maximizes (or

minimizes) value of objective function

Page 11: Linear Programming Problems : Dr. Purnima Pandit

Convex Hull

A set C is convex if

every point on the line

segment connecting x

and y is in C.

The convex hull for a

set of points X is the

minimal convex set

containing X.

Page 12: Linear Programming Problems : Dr. Purnima Pandit

Graphical Solution: Example

4 x1 + 3 x2 120 lb

x1 + 2 x2 40 hr

Area common to both constraints

50 –

40 –

30 –

20 –

10 –

0 – |

10

|

60

|

50

|

20

|

30

|

40 x1

x2

Page 13: Linear Programming Problems : Dr. Purnima Pandit

Computing Optimal Values

x1 + 2x2 = 40

4x1 + 3x2 = 120

4x1 + 8x2 = 160

-4x1 - 3x2 = -120

5x2 = 40

x2 = 8

x1 + 2(8) = 40

x1 = 24

4 x1 + 3 x2 120 lb

x1 + 2 x2 40 hr

40 –

30 –

20 –

10 –

0 – |

10

|

20

|

30

|

40

x1

x2

Z = $50(24) + $50(8) = $1,360

24

8

Page 14: Linear Programming Problems : Dr. Purnima Pandit

Extreme Corner Points

x1 = 224 bowls

x2 =8 mugs

Z = $1,360 x1 = 30 bowls

x2 =0 mugs

Z = $1,200

x1 = 0 bowls

x2 =20 mugs

Z = $1,000

A

B

C |

20

|

30

|

40

|

10 x1

x2

40 –

30 –

20 –

10 –

0 –

Page 15: Linear Programming Problems : Dr. Purnima Pandit

4x1 + 3x2 120 lb

x1 + 2x2 40 hr

40 –

30 –

20 –

10 –

0 –

B

|

10

|

20

|

30

|

40 x1

x2

C

A

Z = 70x1 + 20x2 Optimal point:

x1 = 30 bowls

x2 =0 mugs

Z = $2,100

Objective Function

Page 16: Linear Programming Problems : Dr. Purnima Pandit

Minimization Problem

CHEMICAL CONTRIBUTION

Brand Nitrogen (lb/bag) Phosphate (lb/bag)

Gro-plus 2 4

Crop-fast 4 3

Minimize Z = $6x1 + $3x2

subject to

2x1 + 4x2 16 lb of nitrogen

4x1 + 3x2 24 lb of phosphate

x1, x2 0

Page 17: Linear Programming Problems : Dr. Purnima Pandit

14 –

12 –

10 –

8 –

6 –

4 –

2 –

0 – |

2

|

4

|

6

|

8

|

10

|

12

|

14 x1

x2

A

B

C

Graphical Solution

x1 = 0 bags of Gro-plus

x2 = 8 bags of Crop-fast

Z = $24

Z = 6x1 + 3x2

Page 18: Linear Programming Problems : Dr. Purnima Pandit

18

Two type of Constraints

Binding and Nonbinding constraints:

A constraint is binding if the left-hand and right-

hand side of the constraint are equal when the

optimal values of the decision variables are

substituted into the constraint.

A constraint is nonbinding if the left-hand side

and the right-hand side of the constraint are

unequal when the optimal values of the decision

variables are substituted into the constraint.

Page 19: Linear Programming Problems : Dr. Purnima Pandit

19

Special Cases of Graphical Solution

• Some LPs have an infinite number of solutions

(alternative or multiple optimal solutions).

• Some LPs have no feasible solution (infeasible

LPs).

• Some LPs are unbounded: There are points in

the feasible region with arbitrarily large (in a

maximization problem) z-values.

Page 20: Linear Programming Problems : Dr. Purnima Pandit

20

Alternative or Multiple Solutions

Any point (solution)

falling on line segment

AE will yield an optimal

solution with the same

objective value

X1

X2

10 20 30 40

10

20

30

40

50

Feasible Region

F50

60

z = 60

z = 100

z = 120

A

B

C

D

E

Page 21: Linear Programming Problems : Dr. Purnima Pandit

21

No feasible solution

X1

X2

10 20 30 40

10

20

30

40

50

No Feasible Region

50

60

x1 >= 0

x2 >=0

No feasible region exists

Some LPs have no

solution. Consider

the following

formulation:

Page 22: Linear Programming Problems : Dr. Purnima Pandit

22

Unbounded LP

X11 2 3 4

1

2

3

4

X2

5

6

5 6

A

B

C

Feasible Region

z = 4

z = 6

D

The constraints are

satisfied by all points

bounded by the x2 axis

and on or above AB and

CD.

There are points in the

feasible region which

will produce arbitrarily

large z-values

(unbounded LP).

Page 23: Linear Programming Problems : Dr. Purnima Pandit

Higher Dimensional Problems

Graphical Method is useful for two dimensional Problems.

Simplex method for 2 and higher

dimensional problems

Page 24: Linear Programming Problems : Dr. Purnima Pandit

Cannonical form

Standard form is a basic way of describing a LP problem.

It consists of 3 parts: A linear function to be maximized

maximize c1x1 + c2x2 + … + cnxn

Problem constraints

subject to a11x1 + a12x2 + … + a1nxn < b1

a21x1 + a22x2 + … + a2nxn < b2

am1x1 + am2x2 + … + amnxn < bm

Non-negative variables

x1, x2 ,…, xn > 0

Page 25: Linear Programming Problems : Dr. Purnima Pandit

Obtain Standard Form

General Simplex LP model:

min (or max) z = ci xi

s.t.

A x = b

x 0

In order to get and maintain this form, use

slack, if x b, then x + slack = b

surplus, if x b, then x - surplus = b

artificial variables (sometimes need to be added to ensure all variables 0 )

IMPORTANT: Simplex only deals with equalities

Page 26: Linear Programming Problems : Dr. Purnima Pandit

Different "components" of a LP model

LP model can always be split into a basic and a non-basic part.

“Transformed” or “reduced” model is another good way to show this.

This can be represented in mathematical terms as well as in a LP or simplex tableau.

Page 27: Linear Programming Problems : Dr. Purnima Pandit

Simplex

A simplex or n-simplex is

the convex hull of a set of

(n +1) . A simplex is an n-

dimensional analogue of a

triangle.

Example:

a 1-simplex is a line segment

a 2-simplex is a triangle

a 3-simplex is a tetrahedron

a 4-simplex is a pentatope

Page 28: Linear Programming Problems : Dr. Purnima Pandit

Given any basis we move to an adjacent extreme point (another basic feasible solution) of the solution space by exchanging one of the columns that is in the basis for a column that is not in the basis.

Two things to determine:

1) which (nonbasic) column of A should be brought into the basis so that the solution improves?

2) which column can be removed from the basis such that the solution stays feasible?

Movement to Adjacent Extreme Point

Page 29: Linear Programming Problems : Dr. Purnima Pandit

Entering and Departing Vector (Variable) Rules

General rules:

The one non-basic variable to come in is the one which provides the highest reduction in the objective function.

The one basic variable to leave is the one which is expected to go infeasible first.

NOTE: THESE ARE HEURISTICS!!

Variations on these rules exist, but are rare.

Page 30: Linear Programming Problems : Dr. Purnima Pandit

Example Problem

Maximize Z = 5x1 + 2x2 + x3

subject to

x1 + 3x2 - x3 ≤ 6, x2 + x3 ≤ 4, 3x1 + x2 ≤ 7, x1, x2, x3 ≥ 0.

Page 31: Linear Programming Problems : Dr. Purnima Pandit

Simplex and Example Problem

Step 1. Convert to Standard Form

a11 x1 + a12 x2 + ••• + a1n xn ≤ b1,

a21 x1 + a22 x2 + ••• + a2n xn ≥ b2,

am1 x1 + am2 x2 + ••• + amn xn ≤ bm,

a11 x1 + a12 x2 + ••• + a1n xn + xn+1 = b1,

a21 x1 + a22 x2 + ••• + a2n xn - xn+2 = b2,

am1 x1 + am2 x2 + ••• + amn xn + xn+k = bm,

In our example problem:

x1 + 3x2 - x3 ≤ 6, x2 + x3 ≤ 4, 3x1 + x2 ≤ 7, x1, x2, x3 ≥ 0.

x1 + 3x2 - x3 + x4 = 6, x2 + x3 + x5 = 4, 3x1 + x2 + x6 = 7, x1, x2, x3, x4, x5, x6 ≥ 0.

Page 32: Linear Programming Problems : Dr. Purnima Pandit

Simplex: Step 2

Step 2. Start with an initial basic feasible solution (b.f.s.) and set up the initial tableau.

In our example

Maximize Z = 5x1 + 2x2 + x3

x1 + 3x2 - x3 + x4 = 6, x2 + x3 + x5 = 4, 3x1 + x2 + x6 = 7, x1, x2, x3, x4, x5, x6 ≥ 0.

cj

5 2 1 0 0 0

cB Basis

x1 x2 x3 x4 x5 x6

Constants

0 x4 1 3 -1 1 0 0 6

0 x5 0 1 1 0 1 0 4

0 x6 3 1 0 0 0 1 7

c row 5 2 1 0 0 0 Z=0

Page 33: Linear Programming Problems : Dr. Purnima Pandit

Step 2: Explanation Adjacent Basic Feasible Solution If we bring a nonbasic variable xs into the basis, our system changes from the basis, xb, to the following :

x1 + ā1sxs= xr + ārsxr= xm + āmsxs=

1b

rb

sb

xi = for i =1, …, m isi ab

xs = 1

xj = 0 for j=m+1, ..., n and js

The new value of the objective function becomes:

m

1i

sisii c)ab(cZ

Thus the change in the value of Z per unit increase in xs is

sc = new value of Z - old value of Z

=

m

1i

ii

m

1i

sisii bcc)ab(c

m

1i

isis acc=

This is the Inner Product rule

Page 34: Linear Programming Problems : Dr. Purnima Pandit

Simplex: Step 3

Use the inner product rule to find the relative profit coefficients

cj

5 2 1 0 0 0

cB Basis

x1 x2 x3 x4 x5 x6

Constants

0 x4 1 3 -1 1 0 0 6

0 x5 0 1 1 0 1 0 4

0 x6 3 1 0 0 0 1 7

c row 5 2 1 0 0 0 Z=0

jBjj Pccc

c1 = 5 - 0(1) - 0(0) - 0(3) = 5 -> largest positive c2 = …. c3 = ….

Step 4: Is this an optimal basic feasible solution?

Page 35: Linear Programming Problems : Dr. Purnima Pandit

Simplex: Step 5

Apply the minimum ratio rule to determine the basic variable to leave the basis.

The new values of the basis variables:

xi = for i = 1, ..., m sisi xab

is

i

0as

a

bmin xmax

is

In our example:

cB Basis cj Constants

5 2 1 0 0 0

x1 x2 x3 x4 x5 x6

0 x4 1 3 -1 1 0 0 6

0 x5 0 1 1 0 1 0 4

0 x6 3 1 0 0 0 1 7

c row 5 2 1 0 0 0 Z=0

Row Basic Variable Ratio 1 x4 6 2 x5 - 3 x6 7/3

Page 36: Linear Programming Problems : Dr. Purnima Pandit

cj

5 2 1 0 0 0

cB Basis

x1 x2 x3 x4 x5 x6

Constants

0 x4 0 8/3 -1 1 0 0 11/3

0 x5 0 1 1 0 1 0 4

5 x1 1 1/3 0 0 0 1/3 7/3

c row 0 1/3 1 0 0 -5/3 Z=35/3

Simplex: Step 6 Perform the pivot operation to get the new tableau and the b.f.s.

cj

5 2 1 0 0 0

cB Basis

x1 x2 x3 x4 x5 x6

Constants

0 x4 1 3 -1 1 0 0 6

0 x5 0 1 1 0 1 0 4

0 x6 3 1 0 0 0 1 7

c row 5 2 1 0 0 0 Z=0

jBjj Pccc

c2 = 2 - (0) 8/3 - (0) 1 - (5) 1/3 = 1/3 c3 = 1 - (0) (-1) - (0) 1 - (5) 0 = 1 c6 = 0 - (0) 0 - (0) 0 - (5) 1/3 = -5/3

cB = (0 0 5)

New iteration: find entering variable:

Page 37: Linear Programming Problems : Dr. Purnima Pandit

Final Tableau

cj

5 2 1 0 0 0

cB Basis

x1 x2 x3 x4 x5 x6

Constants

0 x4 0 8/3 -1 1 0 0 11/3

0 x5 0 1 1 0 1 0 4

5 x1 1 1/3 0 0 0 1/3 7/3

c row 0 1/3 1 0 0 -5/3 Z=35/3

cB Basis cj Constants

5 2 1 0 0 0

x1 x2 x3 x4 x5 x6

0 x4 0 11/3 0 1 1 0 23/3

1 x3 0 1 1 0 1 0 4

5 x1 1 1/3 0 0 0 1/3 7/3

c row 0 -2/3 0 0 -1 -5/3 Z=47/3

x3 enters basis, x5 leaves basis

Page 38: Linear Programming Problems : Dr. Purnima Pandit

Computational Considerations

Unrestricted variables (unboundedness)

Redundancy (linear dependency, modeling errors)

Degeneracy (some basic variables = 0)

Round-off errors

Page 39: Linear Programming Problems : Dr. Purnima Pandit

Simplex Variations

Various variations on the simplex method exist:

"regular" simplex

two-phase method: Phase I for feasibility and Phase II for optimality

Condensed / reduced / revised method: only use the non-basic columns to work with

(revised) dual simplex, etc.

Page 40: Linear Programming Problems : Dr. Purnima Pandit

Limitations of Simplex

1. Inability to deal with multiple objectives

2. Inability to handle problems with integer variables

Problem 1 is solved using Multiplex

Problem 2 has resulted in:

Cutting plane algorithms (Gomory, 1958)

Branch and Bound (Land and Doig, 1960)

However,

solution methods to LP problems with integer or Boolean variables are still far less efficient than those which include continuous variables only

Page 41: Linear Programming Problems : Dr. Purnima Pandit

Primal and Dual LP Problems

•Economic theory indicates that scarce (limited) resources

have value. In LP models, limited resources are allocated, so

they should be, valued.

•Whenever we solve an LP problem, we implicitly solve two

problems: the primal resource allocation problem, and the

dual resource valuation problem.

•Here we cover the resource valuation, or as it is commonly

called, the Dual LP.

Page 42: Linear Programming Problems : Dr. Purnima Pandit

jallfor0X

iallforbXa..

Xc

j

i

j

jij

j

jj

ts

Max

i allfor 0

j allfor cas.t.

b

i

j

i

iji

i

ii

Y

Y

YMin

Primal

Dual