chapter 2 - linear programming

85
Chapter 2 Chapter 2 Li P i Li P i Linear P rogramming Linear P rogramming

Upload: wubied

Post on 24-Oct-2015

377 views

Category:

Documents


19 download

DESCRIPTION

operation resource material

TRANSCRIPT

Page 1: Chapter 2 - Linear Programming

Chapter 2Chapter 2pp

Li P iLi P iLinear ProgrammingLinear Programming

Page 2: Chapter 2 - Linear Programming

Linear Programming (LP)

1.1. LinearLinear ProgrammingProgramming (LP)(LP) isis aa mathematicalmathematical procedureprocedure

forfor determiningdetermining optimaloptimal allocationallocation ofof scarcescarce resourcesresources

2.2. LPLP dealsdeals withwith aa classclass ofof programmingprogramming problemsproblems wherewhere

bothboth thethe objectiveobjective functionfunction toto bebe optimizedoptimized isis linearlinear

andand allall relationsrelations amongamong thethe variablesvariables correspondingcorresponding toto

resourcesresources areare linearlinearresourcesresources areare linearlinear..

3.3. AnyAny LPLP problemproblem consistsconsists ofof anan objectiveobjective functionfunction andand aa

tt ff t i tt i t II tt t i tt i tsetset ofof constraintsconstraints.. InIn mostmost cases,cases, constraintsconstraints comecome

fromfrom thethe environmentenvironment inin whichwhich youyou workwork toto achieveachieve

youryour objectiveobjectiveAmare Matebu (Dr.) ‐ BDU IOT

Page 3: Chapter 2 - Linear Programming

Some of the major application areas to which LP can be

li dapplied are:

Work scheduling

P d ti l i & P d ti Production planning & Production process

Capital budgeting

Financial planning Financial planning

Blending (e.g. Oil refinery management)

Farm planning Farm planning

Distribution

Multi-period decision problems Multi-period decision problems • Inventory model

• Financial models

• Work scheduling

Amare Matebu (Dr.) ‐ BDU IOT

Page 4: Chapter 2 - Linear Programming

Facility Location DecisionsFacility Location Decisions

LP as a “What-If” Tool

Amare Matebu (Dr.) ‐ BDU IOT

Page 5: Chapter 2 - Linear Programming

Facility Location Problem

LP-based techniques can be used to locate

manufacturing facilities,g ,

distribution centres,

areho se/storage facilities etcwarehouse/storage facilities etc.

taking into consideration factors such as

facility/distribution capacities,

customer demand,custo e de a d,

budget constraints,

lit f i t t t quality of service to customers etc.

Amare Matebu (Dr.) ‐ BDU IOT

Page 6: Chapter 2 - Linear Programming

Linear Programming Model

Obj i h l f LP d l i i i iObjective: the goal of an LP model is maximization or

minimization

Decision variables: amounts of either inputs or

outputs

Feasible solution space: the set of all feasible

combinations of decision variables as defined by they

constraints

Constraints: limitations that restrict the availableConstraints: limitations that restrict the available

alternatives

Parameters: numerical valuesParameters: numerical values

Amare Matebu (Dr.) ‐ BDU IOT

Page 7: Chapter 2 - Linear Programming

Linear Programming Assumptions

Linearity: the impact of decision variables is

linear in constraints and objective functionlinear in constraints and objective function.

Divisibility: non-integer values of decision

variables are acceptable.

Certainty: values of parameters are known andCertainty: values of parameters are known and

constant.

Non-negativity: negative values of decision

variables are unacceptable.variables are unacceptable.

Amare Matebu (Dr.) ‐ BDU IOT

Page 8: Chapter 2 - Linear Programming

2. Linear programming (LP)

Formulation of a LP Model

1.1. IdentifyIdentify thethe decisiondecision variablesvariables andand expressexpress themthem ininyy pp

algebraicalgebraic symbolssymbols.. (like(like XX11,, XX22,, etcetc....))

22 Id tifId tif llll thth t i tt i t li it tili it ti dd2.2. IdentifyIdentify allall thethe constraintsconstraints oror limitationslimitations andand

expressexpress asas equationsequations (scares(scares resourcesresources likelike time,time,

labor,labor, rawraw materialsmaterials etcetc ……))

33 IdentifyIdentify thethe ObjectiveObjective FunctionFunction andand expressexpress itit asas aa33.. IdentifyIdentify thethe ObjectiveObjective FunctionFunction andand expressexpress itit asas aa

linearlinear functionfunction (the(the decisiondecision makermaker wantwant toto achieveachieve

it)it)..Amare Matebu (Dr.) ‐ BDU IOT

Page 9: Chapter 2 - Linear Programming

Requirements of a LP Problem

1.1. LPLP problemsproblems seekseek toto maximizemaximize oror minimizeminimize

somesome quantityquantity (usually(usually profitprofit oror cost)cost)

dd bj tibj ti f tif tiexpressedexpressed asas anan objectiveobjective functionfunction..

22 TheThe presencepresence ofof restrictionsrestrictions oror2.2. TheThe presencepresence ofof restrictions,restrictions, oror

constraints,constraints, limitslimits thethe degreedegree toto whichwhich wewe,, gg

cancan pursuepursue ourour objectiveobjective..

Amare Matebu (Dr.) ‐ BDU IOT

Page 10: Chapter 2 - Linear Programming

2. Linear programming (LP)

1.1. LP model formulationLP model formulation

An LP is one of the bedrocks of ORAn LP is one of the bedrocks of ORAn LP is one of the bedrocks of ORAn LP is one of the bedrocks of OR

It is a tool for solving optimization problemsIt is a tool for solving optimization problems

2.2. Any linear program consists of 4 parts: Any linear program consists of 4 parts:

a set of decision variables,a set of decision variables,a set of decision variables,a set of decision variables,

the objective function, the objective function,

and a set of constraints and a set of constraints

Sign RestrictionsSign Restrictionsgg

Amare Matebu (Dr.) ‐ BDU IOT

Page 11: Chapter 2 - Linear Programming

2. Linear programming (LP)

G l M h i l F l i f LPGeneral Mathematical Formulation of LP

Optimize (Maximize or Minimize) Optimize (Maximize or Minimize) Z = c1 x1 + c2 x2+…+cn xn

Subject to: Subject to: a11 x1 + a12 x2 +…+ a1n xn (≤, =, ≥ ) b1

a x + a x + + a x (≤ = ≥ ) ba21 x1 + a22 x2 +…+ a2n xn (≤, =, ≥ ) b2

. . . . . . . . . . . . . .

am1 x1 + am2 x2 +…+ amn xn (≤, =, ≥ ) bm

and x x x ≥ 0 and x1, x2, …xn ≥ 0

Amare Matebu (Dr.) ‐ BDU IOT

Page 12: Chapter 2 - Linear Programming

Example 11. The KADISCO company owns a small paint factory that produces both

i t i d t i h i t f h l l di t ib ti T b iinterior and exterior house paints for wholesale distribution. Two basicraw materials, A and B, are used to manufacture the paints. Themaximum availability of A is 6 tons a day; that of B is 8 tons a day. Thedaily requirements of the raw materials per ton of interior and exteriordaily requirements of the raw materials per ton of interior and exteriorpaints are summarized in the following table.

Tons of Raw Material per Ton of Paint Exterior Interior Maximum Availability (tons) Raw Material A 1 2 6 Raw Material B 2 1 8

A market survey has established that the daily demand for the interiorpaint cannot exceed that of exterior paint by more than 1 ton. Thesurvey also showed that the maximum demand for the interior paint is

y plimited to 2 tons daily.The wholesale price per kg is $3000 for exterior paint and $2000 perinterior paint. How much interior and exterior paint should the companyp p p yproduce daily to maximize gross income?

Amare Matebu (Dr.) ‐ BDU IOT

Page 13: Chapter 2 - Linear Programming

Define

XE = Tons of exterior paint to be produced

XI = Tons of interior paint to be produced

Maximize Z = 3000XE + 2000XI

Subject to:

XE + 2XI ≤ 6 (1) (availability of raw material A)XE + 2XI ≤ 6 (1) (availability of raw material A)

2XE + XI ≤ 8 (2) (availability of raw material B)

XE + XI ≤ 1 (3) (Restriction in production)_XE XI ≤ 1 (3) (Restriction in production)

XI ≤ 2 (4) (demand restriction)

X X 0 XE, XI ≥ 0

Amare Matebu (Dr.) ‐ BDU IOT

Page 14: Chapter 2 - Linear Programming

LP ApplicationsLP Applications

E l 2 P d ti Mi E lExample 2. Production-Mix ExampleDepartmentDepartment

ProductProduct WiringWiring DrillingDrilling AssemblyAssembly InspectionInspection Unit ProfitUnit ProfitProductProduct WiringWiring DrillingDrilling AssemblyAssembly InspectionInspection Unit ProfitUnit Profit

XJ201XJ201 .5.5 33 22 .5.5 $ 9$ 9XM897XM897 1.51.5 11 44 1.01.0 $12$12TR29TR29 1 51 5 22 11 55 $15$15TR29TR29 1.51.5 22 11 .5.5 $15$15BR788BR788 1.01.0 33 22 .5.5 $11$11

CapacityCapacity MinimumMinimumCapacityCapacity MinimumMinimumDepartmentDepartment (in hours)(in hours) ProductProduct Production LevelProduction Level

WiringWiring 1,5001,500 XJ201XJ201 150150WiringWiring 1,5001,500 XJ201XJ201 150150DrillingDrilling 2,3502,350 XM897XM897 100100AssemblyAssembly 2,6002,600 TR29TR29 300300InspectionInspection 1,2001,200 BR788BR788 400400

Amare Matebu (Dr.) ‐ BDU IOT

Page 15: Chapter 2 - Linear Programming

LP Applications

X = number of units of XJ201 producedX1 = number of units of XJ201 producedX2 = number of units of XM897 producedX3 = number of units of TR29 produced3 pX4 = number of units of BR788 produced

Maximize profit = 9XMaximize profit = 9X11 + 12X+ 12X22 + 15X+ 15X33 + 11X+ 11X44pp 11 22 33 44

subject to .5X1 + 1.5X2 + 1.5X3 + 1X4 ≤ 1,500 hours of wiring3X1 + 1X2 + 2X3 + 3X4 ≤ 2,350 hours of drilling3X1 1X2 2X3 3X4 ≤ 2,350 hours of drilling2X1 + 4X2 + 1X3 + 2X4 ≤ 2,600 hours of assembly

.5X1 + 1X2 + .5X3 + .5X4 ≤ 1,200 hours of inspectionX ≥ 150 units of XJ201X1 ≥ 150 units of XJ201X2 ≥ 100 units of XM897X3 ≥ 300 units of TR29XX 400 it f BR788 400 it f BR788XX44 ≥ 400 units of BR788≥ 400 units of BR788

Amare Matebu (Dr.) ‐ BDU IOT

Page 16: Chapter 2 - Linear Programming

Example 3 : Advertisement

3. Dorian makes luxury cars and jeeps for high-income

men and women. It wishes to advertise with 1

minute spots in comedy shows and football games.

E h d t t $50 d i b 7M highEach comedy spot costs $50 and is seen by 7M high-

income women and 2M high-income men. Each

football spot costs $100 and is seen by 2M high-

income women and 12M high-income men How canincome women and 12M high income men. How can

Dorian reach 28M high-income women and 24M high-

income men at the least cost.Amare Matebu (Dr.) ‐ BDU IOT

Page 17: Chapter 2 - Linear Programming

Amare Matebu (Dr.) ‐ BDU IOT

Page 18: Chapter 2 - Linear Programming

Example 4: Post Office

A PO requires different numbers of employees on

different days of the week. Union rules statedifferent days of the week. Union rules state

each employee must work 5 consecutive days and

then receive two days off. Find the minimum

number of employees needed.number of employees needed.

Monday Tuesday Wednesday Thursday Friday Saturday Sunday

Staff Needed

17 13 15 19 14 16 11

Amare Matebu (Dr.) ‐ BDU IOT

Page 19: Chapter 2 - Linear Programming

The decision variables are xi (number of

l demployees starting on day i)

Amare Matebu (Dr.) ‐ BDU IOT

Page 20: Chapter 2 - Linear Programming

2. Linear Programming (LP)Example 5: A Diet ProblemExample 5: A Diet Problem

Suppose the only foods available in your local store arepotatoes and steak The decision about how much ofpotatoes and steak. The decision about how much ofeach food to buy is to made entirely on dietary andeconomic considerations. We have the nutritional andcost information in the following table:

Per unit Per unit Minimum Per unit of potatoes

Per unitof steak

Minimum requirements

Units of carbohydrates Units of carbohydrates 33 11 88Units of vitaminsUnits of vitaminsUnits of proteinsUnits of proteinsUnit costUnit cost

4411

$25$25

3333

$50$50

191977

Unit costUnit cost $25$25 $50$50

Page 21: Chapter 2 - Linear Programming

The problem is to find a diet (a choice of thep (

numbers of units of the two foods) that meets all

i i t iti l i t t i i lminimum nutritional requirements at minimal

cost. Formulate the problem LP.

Mini {Z = $25X1 + $50X2}

3X1 + X2 ≥ 84X + 3X ≥ 194X1 + 3X2 ≥ 19X1 + 3X2 ≥ 7X1 , X2 ≥ 0 X1 , X2 ≥ 0

Page 22: Chapter 2 - Linear Programming

Example 6: Blending Problem

Bryant's Pizza, Inc. is a producer of frozen pizza products.The company makes a net income of $1.00 for eachregular pizza and $1 50 for each deluxe pizza producedregular pizza and $1.50 for each deluxe pizza produced.The firm currently has 150 pounds of dough mix and 50pounds of topping mix. Each regular pizza uses 1 pound ofdough mix and 4 ounces (16 ounces= 1 pound) of toppingmix. Each deluxe pizza uses 1 pound of dough mix and 8ounces of topping mix Based on the past demand perounces of topping mix. Based on the past demand perweek, Bryant can sell at least 50 regular pizzas and atleast 25 deluxe pizzas. The problem is to determine thep pnumber of regular and deluxe pizzas the company shouldmake to maximize net income. Formulate this problem as

LP blan LP problem.

Page 23: Chapter 2 - Linear Programming

Solution: A Blending Problemg

Let X1 and X2 be the number of regular and deluxe i pizza,

then the LP formulation is:

Maximize: { Z = X1 + 1.5 X2 }

S bj t tSubject to:X1 + X2 ≤ 150

0.25 X1 + 0.5 X2 ≤ 500.25 X1 0.5 X2 ≤ 50X1 ≥ 50X2 ≥ 25X X 0 X1 , X2 ≥ 0

Page 24: Chapter 2 - Linear Programming

h l l

3. Solving Linear programming (LP)

Steps for Graphical Solution

A. Corner Point Method

1.Define the problem mathematically

2.Graph by constraints by treating each inequality asp y y g q y

equality

3 Locate the feasible region and the corner points3. Locate the feasible region and the corner points

4. Find out the value of objective function at these

i tpoints

5. Find out the optimal solution and the optimal value

of objective function if it existsAmare Matebu (Dr.) ‐ BDU IOT

Page 25: Chapter 2 - Linear Programming

B. Iso-Profit or Iso-Cost Line Method

1.Define the problem mathematically

2. Graph by constraints by treating each inequality as

equality

3 Locate the feasible region and the corner points3. Locate the feasible region and the corner points

4.Draw out a line having the slope of Objective

i i ( hi i ll d C / P fiFunction Equation (this is called Iso-Cost / Profit

Line in Minimization and Maximization problems

respectively) somewhere in the middle of the

feasible region.feasible region.

Amare Matebu (Dr.) ‐ BDU IOT

Page 26: Chapter 2 - Linear Programming

3. Solving Linear programming (LP)

Move this line away from origin (in case of

Maximization) or towards Origin (in case of ) g (

Minimization) until it touches the extreme point of

th f ibl gi the feasible region

6. If a single point is encountered, that reflects

optimality and its coordination is the solution. If

Iso-Profit/ Cost line coincides with any constraintIso Profit/ Cost line coincides with any constraint

line at the extreme, then this is the case of

multiple optimum solutions.Amare Matebu (Dr.) ‐ BDU IOT

Page 27: Chapter 2 - Linear Programming

Formulating LP Problems

Example1. The product-mix problem at Shader Electronics

Two products

1. Shader X-pod, a portable music player

2. Shader BlueBerry, an internet-connected y,

color telephone

D i h i f d h ill d Determine the mix of products that will produce

the maximum profit

Amare Matebu (Dr.) ‐ BDU IOT

Page 28: Chapter 2 - Linear Programming

Formulating LP Problems

Hours Required to Produce 1 Unit

X-pods BlueBerrys Available HoursDepartment (X1) (X2) This WeekElectronic 4 3 240Assembly 2 1 100Profit per unit $7 $5

Decision Variables:Decision Variables:

X1 = number of X-pods to be produced

X2 = number of BlueBerrys to be producedAmare Matebu (Dr.) ‐ BDU IOT

Page 29: Chapter 2 - Linear Programming

Formulating LP ProblemsFormulating LP Problems

Objective Function:Maximize Profit = $7X + $5XMaximize Profit = $7X1 + $5X2

There are three types of constraintsThere are three types of constraintsUpper limits where the amount used is ≤ theamount of a resourceamount of a resourceLower limits where the amount used is ≥ theamount of the resourceEqualities where the amount used is = theamount of the resource

Amare Matebu (Dr.) ‐ BDU IOT

Page 30: Chapter 2 - Linear Programming

Formulating LP Problems

First Constraint:ElectronicElectronic Electronic

time availableElectronictime used is ≤

Second Constraint:Second Constraint:

4X1 + 3X2 ≤ 240 (hours of electronic time)

Assemblytime available

Assemblytime used is ≤

2X1 + 1X2 ≤ 100 (hours of assembly time)

Amare Matebu (Dr.) ‐ BDU IOT

Page 31: Chapter 2 - Linear Programming

Graphical Solution

Can be used when there are two decision

variablesvariables

1. Plot the constraint equations at their limits by

i h i liconverting each equation to an equality

2. Identify the feasible solution space

3. Create an iso-profit line based on the

objective functionj

4. Move this line outwards until the optimal point

is identifiedis identified

Amare Matebu (Dr.) ‐ BDU IOT

Page 32: Chapter 2 - Linear Programming

Graphical SolutionGraphical Solution

100 –

XX22

80 80 –

–Berr

ys

60 60 –

40 40 – of

Blue

B

Assembly (constraint B)

40 40 –

20 20 –

Num

ber

Electronics (constraint A)

Feasible region

–| | | | | | | | | | |00 2020 4040 6060 8080 100100

Number of X-pods

XX11

Electronics (constraint A)

Number of X-pods

Amare Matebu (Dr.) ‐ BDU IOT

Page 33: Chapter 2 - Linear Programming

Graphical Solution

100 –

XX22

Iso‐Profit Line Solution Method–

80 80 –

h TV

sh

TVs Assembly (constraint B)Assembly (constraint B)Choose a possible value for the objective function

$60 60 –

40 40 –r of W

atch

r of W

atch $210 = 7X1 + 5X2

20 20 –

Num

ber

Num

ber

Electronics (constraint A)Electronics (constraint A)

Feasible region

Solve for the axis intercepts of the function and plot the line

–| | | | | | | | | | |00 2020 4040 6060 8080 100100

Number of XNumber of X--podspods

XX11

region

Figure .3Figure .3X2 = 42       X1 = 30

pp

Amare Matebu (Dr.) ‐ BDU IOT

Page 34: Chapter 2 - Linear Programming

Graphical Solution

100 –

XX22

100

80 80 –er

rys

60 60 –

40 40 of

Blue

Be

(0, 42)

$210 = $7X1 + $5X2

40 40 –

20 20 –Num

ber

(0, 42)

(30, 0))–

–| | | | | | | | | | |00 2020 4040 6060 8080 100100

N b f X d

XX11

Number of X-pods Figure .4

Amare Matebu (Dr.) ‐ BDU IOT

Page 35: Chapter 2 - Linear Programming

Graphical SolutionGraphical Solution

100 –

XX22

80 80 –

–Bery

ys$350 = $7X$350 = $7X11 + $+ $5X2

$280 = $$280 = $7X1 + $5X+ $5X22

60 60 –

40 40 –er o

f Bl

ueB

$210 = $7X1 + $5X2

20 20 –

Num

be

$420 = $7X1 + $5X2

–| | | | | | | | | | |00 2020 4040 6060 8080 100100

Number of X-pods

XX11

Figure .5p Figure .5

Amare Matebu (Dr.) ‐ BDU IOT

Page 36: Chapter 2 - Linear Programming

Graphical Solution

100

X2

100 –

80 80 –

erry

s

Maximum profit line

60 60 –

of B

lueB

e

Optimal solution point(X1 = 30, X2 = 40)

40 40 –

20 20 –Num

ber o

$410 = $7X1 + $5X2

–| | | | | | | | | | |00 2020 4040 6060 8080 100100

X1

Number of X-pods Figure .6

Amare Matebu (Dr.) ‐ BDU IOT

Page 37: Chapter 2 - Linear Programming

Corner-Point Method

100 –

X2

2

80 80 –

eBer

rys

3

60 60 –

40 40 –er o

f Blu

e

20 20 –

Num

be

Figure .7

1 –| | | | | | | | | | |00 2020 4040 6060 8080 100100

Number of X pods

X1

4

Number of X-pods

Amare Matebu (Dr.) ‐ BDU IOT

Page 38: Chapter 2 - Linear Programming

CornerCorner--Point MethodPoint Method

The optimal value will always be at a corner pointpFind the objective function value at each corner point and choose the one with the highest profitp g p

Point  1  : (X1 = 0, X2 = 0) Profit $7(0) + $5(0) = $0

Point  2  : (X1 = 0, X2 = 80) Profit $7(0) + $5(80) = $400

Point  4  : (X1 = 50, X2 = 0) Profit $7(50) + $5(0) = $350

Amare Matebu (Dr.) ‐ BDU IOT

Page 39: Chapter 2 - Linear Programming

Corner-Point Method

The optimal value will always be at a corner p ypointFind the objective function value at each corner 

Solve for the intersection of two constraints

4X1 + 3X2 ≤ 240 (electronics time)jpoint and choose the one with the highest profit2X1 + 1X2 ≤ 100 (assembly time)

4X1 + 3X2 = 240 4X1 + 3(40) = 240

Point  1  : (X1 = 0, X2 = 0) Profit $7(0) + $5(0) = $0

P i t 2 (X 0 X 80) P fit $7(0) $5(80) $400

- 4X1 - 2X2 = -200+ 1X2 = 40

4X1 + 120 = 240X1 = 30

Point  2  : (X1 = 0, X2 = 80) Profit $7(0) + $5(80) = $400

Point  4  : (X1 = 50, X2 = 0) Profit $7(50) + $5(0) = $350

Amare Matebu (Dr.) ‐ BDU IOT

Page 40: Chapter 2 - Linear Programming

Corner-Point Method

The optimal value will always be at a cornerp ypointFind the objective function value at each cornerjpoint and choose the one with the highest profit

$ $ $Point  1  : (X1 = 0, X2 = 0) Profit $7(0) + $5(0) = $0

Point  2  : (X1 = 0, X2 = 80) Profit $7(0) + $5(80) = $400

Point  4  : (X1 = 50, X2 = 0) Profit $7(50) + $5(0) = $350

Point  3  : (X1 = 30, X2 = 40) Profit $7(30) + $5(40) = $410( 1 , 2 ) $ ( ) $ ( ) $

Amare Matebu (Dr.) ‐ BDU IOT

Page 41: Chapter 2 - Linear Programming

Solving Minimization Problems

Formulated and solved in much the same way

as maximization problems

In the graphical approach an iso-cost line isg p pp

used

Th bj ti i t th i t liThe objective is to move the iso-cost line

inwards until it reaches the lowest cost corner

point

Page 42: Chapter 2 - Linear Programming

Example 2: Minimization

X1 = number of tons of black-and-white picture chemical producedproduced

X2 = number of tons of color picture chemical produced

Minimize total cost = 2,500X1 + 3,000X2

Subject to:

X1 ≥ 30 tons of black-and-white chemical

X2 ≥ 20 tons of color chemical

X1 + X2 ≥ 60 tons total

X1, X2 ≥ $0 non-negativity requirements1, 2 $ g y q

Page 43: Chapter 2 - Linear Programming

Minimization ExampleMinimization Example

X

60 60 –

X2

X1 + X2 = 60

50 –

40 40 –Feasible region

30 –

Table .9

20 20 –

10 – X1 = 30X2 = 20

bb

–| | | | | | |00 1010 2020 3030 4040 5050 6060

X1

aa

Page 44: Chapter 2 - Linear Programming

4. (LP) Simplex Method

Realistic linear programming problems often have

several decision variables and many constraints.several decision variables and many constraints.

Such problems cannot be solved graphically;

instead an algorithm such as the simplex

procedures is used.procedures is used.

Simplex method is thus the most effective

analytical method of solving linear programming

problems.p

Amare Matebu (Dr.) ‐ BDU IOT

Page 45: Chapter 2 - Linear Programming

The simplex method is an ITERATIVE or “stepThe simplex method is an ITERATIVE or step

by step” method or repetitive algebraic

approach that moves automatically from one

basic feasible solution to another basicbasic feasible solution to another basic

feasible solution improving the situation

each time until the optimal solution is

h d treached at.

Amare Matebu (Dr.) ‐ BDU IOT

Page 46: Chapter 2 - Linear Programming

4. (LP) Simplex Method

Objective Function

Optimize (Max. or Min.) z = Σ cj xj for j = 1..n

Subject to: (Constraints)j ( )

Σ a ij xj (≤, =, ≥) bi ; for j = 1 ..n, i = 1,2, …m

(Non negativity restrictions)

xj ≥ 0 ; j= 1, 2, …, n

Amare Matebu (Dr.) ‐ BDU IOT

Page 47: Chapter 2 - Linear Programming

4. Simplex methods

G l M th ti l F l ti f LPGeneral Mathematical Formulation of LPOptimize (Maximize or Minimize)

Z = c1 x1 + c2 x2+…+cn xn

Subject to: a11 x1 + a12 x2 +…+ a1n xn (≤, =, ≥) b1

a21 x1 + a22 x2 +…+ a2n xn (≤, =, ≥) b2

..

( ) bam1 x1 + am2 x2 +…+ amn xn (≤, =, ≥ ) bm

and x x x ≥ 0 and x1, x2, …xn ≥ 0 Amare Matebu (Dr.) ‐ BDU IOT

Page 48: Chapter 2 - Linear Programming

4. (LP) Simplex Method

1 Th t d d f f LP bl1. The standard form of LP problemi. All the constraints should be expressed as

equations by slack or surplus and/or artificialequations by slack or surplus and/or artificialvariables

ii The right hand side of each constraint should beii. The right hand side of each constraint should bemade non-negative; if it is not, this should bedone by multiplying both sides of the resultingdone by multiplying both sides of the resultingconstraint by -1

Example:Example:2X1+3X2-4X3+X4 ≤ -50, that gives -2X1-3X2+4X3-X4 ≤ 50we multiply both sides by negativewe multiply both sides by negative

Amare Matebu (Dr.) ‐ BDU IOT

Page 49: Chapter 2 - Linear Programming

4. (LP) Simplex Method

iii Th f ddi i l i bl l iii. Three types of additional variables, namely

a. Slack Variable (S)

b. Surplus variable (-S), and

c. Artificial variables (A)

are added in the given LP problem to convert it into

standard form for two reasons:

To convert an inequality into equation to have a

standard form of an LP model andstandard form of an LP model, and

To get an initial feasible solution represented

by the columns of an identity matrixby the columns of an identity matrix.

Amare Matebu (Dr.) ‐ BDU IOT

Page 50: Chapter 2 - Linear Programming

4. (LP) Simplex Method

The summery of the extra variables needed toadd in the given LP problem to convert it intostandard form is given below.

Types of Extra variables to be Coefficient of extra Presence of constraint added variables in the objective

functionMax Z Min Z

variables in the initial solution mix

≤ Add only slack variable 0 0 Yes

≥ Subtract surplus variable and

0 0 Novariable and

Add artificial variable -M +M Yes

= Add artificial variable -M +M Yes

Amare Matebu (Dr.) ‐ BDU IOT

Page 51: Chapter 2 - Linear Programming

4. (LP) Simplex Method

S D fi itiSome DefinitionsSolution: pertains to the values of decisionvariables that satisfies constraintsFeasible solution: Any solution that also satisfiesthe non negativity restrictionsBasic Solution: For a set of m simultaneousequations in n unknowns (n>m), a solutionobtained by setting n- m of the variables equalobtained by setting n m of the variables equalto zero and solving the m equation in munknowns is called basic solutionunknowns is called basic solution.

Amare Matebu (Dr.) ‐ BDU IOT

Page 52: Chapter 2 - Linear Programming

Basic Feasible solution: A feasible solution that is

also basic

Optimum Feasible solution: Any basic feasible

solution which optimizes the objective function

Degenerate Solution: when one or more basicg

variable becomes equal to zero.

2 Test of optimality2. Test of optimalityi. If all Zj - Cj > 0, then the basic feasible solution is

ti l (M i i ti )optimal (Maximization case)

ii. If all Zj - Cj < 0, then the basic feasible solution is

optimal (Minimization case)optimal (Minimization case)

Amare Matebu (Dr.) ‐ BDU IOT

Page 53: Chapter 2 - Linear Programming

4. (LP) Simplex Method

3. Variable to enter the basis

i. A variable that has the highest negative value ing g

the Zj-Cj row (Maximization case)

ii A variable that has the most positive value inii. A variable that has the most positive value in

the Zj-Cj row(Minimization case)

4. Variable to leave the basis

The row with the worst negative/largest positive

and minimum replacement ratio (or both

maximization & minimization cases respectively)maximization & minimization cases respectively).

Amare Matebu (Dr.) ‐ BDU IOT

Page 54: Chapter 2 - Linear Programming

4. (LP) Simplex Method

Steps in simplex methods:Steps in simplex methods:

Step 1: Formulate LP Model

Step 2: Standardize the problem

Step 3: Obtain the initial simplex tableau

Step 4: check optimality (optimality test)

Step 5: Choose the “incoming” or “entering” variables

Step 6: Choose the “leaving “or “outgoing” variable

Step 7:Repeat step 4-6 till optimum basic feasible solution is

obtained. Or go to step 3 and repeat the procedure

until all entries in the Cj – Zj row are either negative

or zero. Amare Matebu (Dr.) ‐ BDU IOT

Page 55: Chapter 2 - Linear Programming

4. (LP) Simplex Method

E l 1Example:1Solve the problem using the simplex approachMax. Z=300x1 +250x2

Subject to:Subject to:2x1 + x2 < 40 (Labor )

3 45 (M hi )x1+3x2 < 45 (Machine)x1 < 12 (Marketing)x1, x2 > 0

Example:2 Simplex MethodExample:2 Simplex Method

Amare Matebu (Dr.) ‐ BDU IOT

Page 56: Chapter 2 - Linear Programming

5. Big M-method

Mi i i Z ith i liti f t i t iMinimize Z with inequalities of constraints in

“> “form.

There are two methods to solve minimization LP

blproblems:

1. Direct method/Big M-method/: Using artificial

variables

2 Conversion method: Minimization by maximizing2. Conversion method: Minimization by maximizing

the dual

Amare Matebu (Dr.) ‐ BDU IOT

Page 57: Chapter 2 - Linear Programming

Surplus Variable (-s):- A variable inserted in a greater than or equal to

constraint to create equality. It represents the

amount of resource usage above the minimum

required usage.required usage.

- Surplus variable is subtracted from a > constraint

in the process of converting the constraint toin the process of converting the constraint to

standard form.

Neither the slack nor the surplus is negative

value. They must be positive or zero.

Amare Matebu (Dr.) ‐ BDU IOT

Page 58: Chapter 2 - Linear Programming

5. Big M-method

E l l id 5 2 20Example: let us consider 5x1+2x2 ≥ 20

When x1 = 4.5 and x2 = 2 ==>5(4.5)+2(2)-s = 20 ==> s=11

When x1= 2 and x2= 5 ==> s= 0

But when x1= 0 and x2= 0 (No production)1 2 ( p )

==> s = -20 (This is mathematically unaccepted).

Thus, in order to avoid the mathematical contradiction,, ,

we have to add artificial variable (A)

Artificial variable (A): Artificial variable is a variable thatArtificial variable (A): Artificial variable is a variable that

has no meaning in a physical sense but acts as a tool to

create an initial feasible LP solutioncreate an initial feasible LP solution.

Amare Matebu (Dr.) ‐ BDU IOT

Page 59: Chapter 2 - Linear Programming

Note that:Note that:

Type of constrain To put into standard form

≤ ----------------------- Add a slack variable

= ----------------------- Add an artificial variable= ----------------------- Add an artificial variable

≥ ---------------------- Subtract a surplus variable

& add artificial variable

Amare Matebu (Dr.) ‐ BDU IOT

Page 60: Chapter 2 - Linear Programming

5. Big M-method

Following are the characteristics of Big-M Method:

1. High penalty cost (or profit) is assumed as M

2. M is assigned to artificial variable A in the

objective function Z.j

Amare Matebu (Dr.) ‐ BDU IOT

Page 61: Chapter 2 - Linear Programming

3. Big-M method can be applied to minimization asg pp

well as maximization problems with the

f ll i di ti tifollowing distinctions:

Minimization problems: -Assign +M as coefficient

of artificial variable A in an objective function Z.

M i i ti bl H M i ig dMaximization problems: -Here –M is assigned as

coefficient of artificial variable A in the

objective function Z.

Amare Matebu (Dr.) ‐ BDU IOT

Page 62: Chapter 2 - Linear Programming

5. Big M-method

4. Coefficient of S (slack/surplus) takes zero values

in the objective function Zin the objective function Z

5. For minimization problem, the incoming variable

corresponds to a highest positive value of Zj- Cj.

6. Solution is optimal when all the values of Zj- Cj6. Solution is optimal when all the values of Zj Cj

non positive (For minimization case)

Amare Matebu (Dr.) ‐ BDU IOT

Page 63: Chapter 2 - Linear Programming

Example 1: Big method

The ABC printing company is facing a tight financial squeezeThe ABC printing company is facing a tight financial squeezeand is attempting to cut costs wherever possible. At presentit has only one printing contract, and luckily the book isselling well in both the hardcover and paper back editions Itselling well in both the hardcover and paper back editions. Ithas just received a request to print more copies of this bookin either the hardcover or paperback form. The printing costf h d b k i bi 600 100 hil th t ffor hardcover books is birr 600 per 100 while that forpaperback is only birr 500 per 100. Although the company isattempting to economize, it does not wish to lay off anyemployee. Therefore, it feels oblized to run its two printingpresses at least 80 and 60 hours per week, respectively. PressI can produce 100 hardcover books in 2 hours or 100ppaperback books in 1 hour. Press II can produce 100 hardcoverbooks in 1 hour or 100 paperbacks books in 2 hours.Determine how many books of each type should be printed inDetermine how many books of each type should be printed inorder to minimize costs.

Amare Matebu (Dr.) ‐ BDU IOT

Page 64: Chapter 2 - Linear Programming

Example 2 : Big - method

Minimize Z= 25x1 +30x2

Subject to:Subject to:

20x1+15x2 > 100

2x1+ 3x2 > 15

x1, x2 > 0

Amare Matebu (Dr.) ‐ BDU IOT

Page 65: Chapter 2 - Linear Programming

6. Duality and Sensitivity

Every LP has another LP associated with it, which is

ll d it d l Th fi t f t ti licalled its dual. The first way of starting a linear

problem is called the primal of the problem. The

second way of starting the same problem is called

the dual The optimal solutions for the primal andthe dual. The optimal solutions for the primal and

the dual are equivalent, but they are derived

through alternative procedures.

Amare Matebu (Dr.) ‐ BDU IOT

Page 66: Chapter 2 - Linear Programming

6.1 Primal and Duality

The dual contains economic information useful to

management, and it may also be easier to solve,g , y ,

in terms of less computation than the primal

problem.

Corresponding to every LP, there is another LP.p g y

The given problem is called the primal.

Th l t d bl t th i bl iThe related problem to the given problem is

known as the dual.

Amare Matebu (Dr.) ‐ BDU IOT

Page 67: Chapter 2 - Linear Programming

The dual of a dual is the primalThe dual of a dual is the primal

If the primal has optimal solution ,the dual will

have optimal solution

If the primal has no optimal solution, the dualIf the primal has no optimal solution, the dual

will not have optimal solution.

Whether we follow the dual or primal system, the

optimal solution will remain equal.optimal solution will remain equal.

Amare Matebu (Dr.) ‐ BDU IOT

Page 68: Chapter 2 - Linear Programming

6.1 Primal and Duality

Primal Dual

Objective is minimization Objective is maximization & vice versaObjective is minimization Objective is maximization & vice versa

≥ type constraints ≤ type constraints

N b f l N b f Number of columns Number of rows

Number of rows Number of columns

Number of decision variables Number of constraints

Number of constraints Number of decision variables

Coefficient of objective function RHS value

RHS values Coefficient of objective functionRHS values Coefficient of objective function

Amare Matebu (Dr.) ‐ BDU IOT

Page 69: Chapter 2 - Linear Programming

Finding the Dual of an LP

Define the variables for a max problem to be z,

x1 x2 x and the variables for a min problem tox1, x2, …,xn and the variables for a min problem to

be w, y1, y2, …, yn.

Finding the dual to a max problem in which all

the variables are required to be nonnegative and all

the constraints are ≤ constraints (called normal max(

problem) is shown on the next slide.

Amare Matebu (Dr.) ‐ BDU IOT

Page 70: Chapter 2 - Linear Programming

Finding the Dual of an LP max z = c1x1+ c2x2 +…+ cnxn

s.t. a11x1 + a12x2 + … + a1nxn ≤ b1

a21x1 + a22x2 + … + a2nxn ≤ b2Normal max problem

… … … …

am1x1 + am2x2 + … + amnxn ≤ bm

Normal max problem

It’s dual

xj ≥ 0 (j = 1, 2, …,n)

min w = b1y1+ b2y2 +…+ bmym

s.t. a11y1 + a21y2 + … + am1ym ≥ c1

a12y1 + a22y2 + … + am2ym ≥ c2Normal min problem

… … … …

a1ny1 + a2ny2 + …+ amnym ≥ cn

y ≥ 0 (i 1 2 m)

p

It’s dual

yi ≥ 0 (i = 1, 2, …,m)

Amare Matebu (Dr.) ‐ BDU IOT

Page 71: Chapter 2 - Linear Programming

Economic Interpretation of the Dual Problem

E l : A D k t k h t t d d k t blExample: A Dakota work shop want to produce desk, table,

and chair with the available resource of: Timber, Finishing

hours and carpenter hours as revised in the table below.

The selling price and available resources are also revised in

the table. Formulate the this problem as Primal and Dual

Problem?

Resource Desk Table Chair Availability

Timmber 8 board ft 6 board ft 1 board ft 48 boards fitTimmber

Finishing

Carpentry

8 board ft 6 board ft 1 board ft

4 hours 2 hours 1.5 hours

2 hours 1.5 hours 0.5 hours

48 boards fit

20 hours

8 hours

Amare Matebu (Dr.) ‐ BDU IOT

Selling price $60 $30 $20

Page 72: Chapter 2 - Linear Programming

Interpreting the Dual of the Dakota (Max) Problem

The primal is:  max z = 60x1 + 30x2 + 20x3

s t 8x1 + 6x2 + x3 ≤ 48 (Timber constraint)s.t.      8x1 +    6x2 +      x3 ≤ 48       (Timber constraint)

4x1 +    2x2 + 1.5x3 ≤ 20       (Finishing constraint)

2x1 + 1.5x2 + 0.5x3 ≤ 8 (Carpentry constraint)2x1 + 1.5x2 +  0.5x3 ≤  8       (Carpentry constraint)

x1, x2, x3 ≥  0

The dual is:    min w = 48y1 + 20y2 + 8y3

s.t.       8y1 +    4y2 +    2y3 ≥ 60 (Desk constraint)

6y1 +    2y2 + 1.5y3 ≥ 30 (Table constraint)

y1 + 1.5y2 + 0.5y3 ≥ 20 (Chair constraint)

y1, y2, y3 ≥ 0

Amare Matebu (Dr.) ‐ BDU IOT

Page 73: Chapter 2 - Linear Programming

Economic Interpretation of the Dual Problem

The first dual constraint is associated with desks,

the second with tables, and the third with chairs.the second with tables, and the third with chairs.

Decision variable y1 is associated with Timber, y2

with finishing hours, and y3 with carpentry hours.

Suppose an entrepreneur wants to purchase all of

Dakota’s resources. The entrepreneur must

determine the price he or she is willing to pay for adetermine the price he or she is willing to pay for a

unit of each of Dakota’s resources.

Amare Matebu (Dr.) ‐ BDU IOT

Page 74: Chapter 2 - Linear Programming

To determine these prices we define:To determine these prices we define:

y1 = price paid for 1 boards ft of lumber

y2 = price paid for 1 finishing hour

y3 = price paid for 1 carpentry houry3 = price paid for 1 carpentry hour

The resource prices y1, y2, and y3 should be

determined by solving the Dakota dualdetermined by solving the Dakota dual.

Amare Matebu (Dr.) ‐ BDU IOT

Page 75: Chapter 2 - Linear Programming

The total price that should be paid for theseThe total price that should be paid for these

resources is 48 y1 + 20y2 + 8y3. Since the cost of

purchasing the resources is to minimized:

Min w = 48y1 + 20y2 + 8y3 is the objective functionMin w = 48y1 + 20y2 + 8y3 is the objective function

for Dakota dual.

In setting resource prices, the prices must be high

enough to induce Dakota to sellenough to induce Dakota to sell.

Amare Matebu (Dr.) ‐ BDU IOT

Page 76: Chapter 2 - Linear Programming

For example, the entrepreneur must offer Dakota

at least $60 for a combination of resources that

includes 8 board feet of timber, 4 finishing hours, includes 8 board feet of timber, 4 finishing hours,

and 2 carpentry hours because Dakota could, if it

i h d h d d k h wished, use the resources to produce a desk that

could be sold for $60. Since the entrepreneur is

offering 8y1 + 4y2 + 2y3 for the resources used to

produce a desk he or she must chose y1 y2 and produce a desk, he or she must chose y1, y2, and

y3 to satisfy: 8y1 + 4y2 + 2y3 ≥ 60.

Amare Matebu (Dr.) ‐ BDU IOT

Page 77: Chapter 2 - Linear Programming

Economic Interpretation of the Dual Problem

Similar reasoning shows that at least $30 must be paid

for the resources used to produce a tablefor the resources used to produce a table.

Thus y1, y2, and y3 must satisfy: 6y1 + 2y2 + 1.5y3 ≥ 30

Likewise, at least $20 must be paid for the

combination of resources used to produce one chair.p

Thus y1, y2, and y3 must satisfy: y1 + 1.5y2 + 0.5y3 ≥ 20

Th l i h D k d l i ld i fThe solution to the Dakota dual yields prices for

timber, finishing hours, and carpentry hours.

Amare Matebu (Dr.) ‐ BDU IOT

Page 78: Chapter 2 - Linear Programming

In summary, when the primal is a normal max

problem, the dual variables are related to the value

of resources available to the decision maker Forof resources available to the decision maker. For

this reason, dual variables are often referred to as

resource shadow prices.

Amare Matebu (Dr.) ‐ BDU IOT

Page 79: Chapter 2 - Linear Programming

6.2 Sensitivity Analysis

In an LP model, the input data (also known as

parameters) such as:parameters) such as:

i) Profit (cost) contribution Cj per unit of decision

variable

ii) Availability of resources (bj)ii) Availability of resources (bj)

iii) Consumption of resources per unit of decision

variables (aij) are assumed constant and known

with certainty during a planning period.y g p g p

Amare Matebu (Dr.) ‐ BDU IOT

Page 80: Chapter 2 - Linear Programming

However, in real-world situations some data mayy

change over time because of the dynamic nature

f b i h h i f thof business: such changes in any of these

parameters may raise doubt on the validity of

the optimal solution of the given LP model.

Th th d i i k i h it ti ldThus, the decision maker in such situation would

like to know how sensitive the optimal solution is

to the changes in the original input data values.

Amare Matebu (Dr.) ‐ BDU IOT

Page 81: Chapter 2 - Linear Programming

Sensitivity analysis and parametric linearSensitivity analysis and parametric linear

programming are the two techniques that

evaluate the relationship between the optimal

solution and the changes in the LP modelg

parameters.

Sensitivity analysis is the study of sensitivity of

the optimal solution of an LP problem due top p

discrete variations (changes)in its parameters.

Amare Matebu (Dr.) ‐ BDU IOT

Page 82: Chapter 2 - Linear Programming

The degree of sensitivity of the solution due to

these variations can range from no change at all

to a substantial change in the optimal solutionto a substantial change in the optimal solution

of the given LP problem.

Thus, in sensitivity analysis, we determine the

range over which the LP model parameters canrange over which the LP model parameters can

change without affecting the current optimal

solution.

Amare Matebu (Dr.) ‐ BDU IOT

Page 83: Chapter 2 - Linear Programming

Example: Sensitivity analysis

A company wants to produce three products: A, B

d C th it fit th d t i Bi 4and C. the unit profit on these products is Birr 4,

Birr 6, and Birr 2 respectively. These products

require two types of resources, human power and

raw material The LP model formulated forraw material. The LP model formulated for

determining the optimal product mix is as follows:

Amare Matebu (Dr.) ‐ BDU IOT

Page 84: Chapter 2 - Linear Programming

Example: Sensitivity analysis

Maximize Z = 4x1 + 6x2 + 2x3

Subject to the constraints:j

i) Human power constraint

X1 + X2 +X3 ≤ 3

ii) Raw material constraint)

X1 + 4X2 + 7X3 ≤ 9

d X X X 0and X1, X2, X3 ≥ 0

Where X1, X2, and X3 = number of units of product A, B and C,

respectively to be produced.Amare Matebu (Dr.) ‐ BDU IOT

Page 85: Chapter 2 - Linear Programming

a. Find the optimal product mix and the corresponding profitf thof the company.

b. Find the range of the profit contribution of product C (i.ecoefficient C of variable X ) in the objective functioncoefficient C3 of variable X3) in the objective functionsuch that current optimal product mix remainsunchangedunchanged.

c. What shall be the new optimal product mix when theprofit per unit from product C is increased from Birr 2 top p pBirr 10?

d. Find the range of the profit contribution of product A (i.ecoefficient C1 of variable X1) in the objective functionsuch that current optimal product mix remainsunchanged.

Amare Matebu (Dr.) ‐ BDU IOT