linear programming problems(llp)

37
LINEAR PROGRAMMING PROBLEMS(LLP) Dr. O.M. Ogunlaran Mathematics Programme, Bowen University, Iwo, Nigeria Email: [email protected] June 9, 2021 1 / 37

Upload: others

Post on 24-Jan-2022

11 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: LINEAR PROGRAMMING PROBLEMS(LLP)

LINEAR PROGRAMMING PROBLEMS(LLP)

Dr. O.M. OgunlaranMathematics Programme,

Bowen University, Iwo, NigeriaEmail: [email protected]

June 9, 2021 1 / 37

Page 2: LINEAR PROGRAMMING PROBLEMS(LLP)

Learning Objectives

At the end of the lesson, students should be able to

Identify/Define terminologies use in linear programming;

Formulate Linear Programming Problems;

Solve LPPs using graphical and simplex methods;

Interpret solution of LPPs.

Linear Programming Problems June 9, 2021 2 / 37

Page 3: LINEAR PROGRAMMING PROBLEMS(LLP)

Introduction

Linear programming is a mathematical tool for maximizing or minimizing aquantity (usually profit or cost of production), subject to certainconstraints.It is used to determine the values of the decision variables such that all theconstraints are satisfied and gives the maximum or minimum value for theobjective function.The maximum or minimum value of the objective function is called anOptimum value.The objective function, the set of constraints and the non-negativerestrictions together form a Linear Programming Problem (LPP).

Linear Programming Problems June 9, 2021 3 / 37

Page 4: LINEAR PROGRAMMING PROBLEMS(LLP)

Introduction (cont’d)

Graphical method is applicable for solving LPP where two variables areinvolved. However, Simplex method, developed by George B. Dantzig in1947, is commonly used for solving LPP problems consisting of anynumber of variables.

Linear Programming Problems June 9, 2021 4 / 37

Page 5: LINEAR PROGRAMMING PROBLEMS(LLP)

Formulation of LPP

The following steps guide the mathematical formulation of a LPP:

Identification of decision variables

Formation of objective function which is to be either maximize orminimize.

Formation of various constraints involved due to the limitedavailability of resources.

Linear Programming Problems June 9, 2021 5 / 37

Page 6: LINEAR PROGRAMMING PROBLEMS(LLP)

General Form of LPP

The general form of the LPP is given as follows:

max or min z = c1x1 + c2x2 + · · · + cnxn.

Subject to the constraints:

a11x1 + a12x2 + · · · + a1nxn = b1

a21x1 + a22x2 + · · · + a2nxn = b2...

am1x1 + am2x2 + · · · + amnxn = bm

Linear Programming Problems June 9, 2021 6 / 37

Page 7: LINEAR PROGRAMMING PROBLEMS(LLP)

General Form of LPP

where the constraints may be in the form of inequalities ≤ or ≥ or in theform of equations = (as above) and finally LLP must satisfy thenon-negative restrictions:

x1 ≥ 0, x2 ≥ 0, · · · , xn ≥ 0.

Linear Programming Problems June 9, 2021 7 / 37

Page 8: LINEAR PROGRAMMING PROBLEMS(LLP)

In the LPP, the variables xi are called decision variables, the function z iscalled the objective function and c1, c2, · · · , cn are called the costvariables.

Definitions

The variables which are added to constraints to change them frominequalities to equations are called slack variables while the variableswhich are subtracted to change them to equations are called surplusvariables.

An n-tuple(x1, x2, · · · , xn) of real numbers which satisfies the linearconstraints and the non-negative restriction of the given LPP is calledfeasible solution.

Linear Programming Problems June 9, 2021 8 / 37

Page 9: LINEAR PROGRAMMING PROBLEMS(LLP)

Definitions (cont’d)

An n-tuple(x1, x2, · · · , xn) of real numbers which satisfies the linearconstraints and the non-negative restriction of the given LPP andoptimize the objective function is called optimum feasible solution.

A basic solution to the system AX = b is called degenerate if one ormore of the basic variables are zero.

Linear Programming Problems June 9, 2021 9 / 37

Page 10: LINEAR PROGRAMMING PROBLEMS(LLP)

LPP Applications

Example 1

A manufacturer produces two types of models M1 and M2. Each model ofthe type M1 requires 4 hours of grinding and 2 hours of polishing; whereaseach model of the type M2 requires 2 hours of grinding and 5 hours ofpolishing. The manufacturer has 2 grinders and 3 polishers. Each grinderworks 40 hours a week and each polisher works for 60 hours a week. Profiton M1 model is N3.00 and on model M2 is N4.00. Whatever is producedin a week is sold in the market. How should the manufacturer allocate hisproduction capacity to the two types of model, so that he may make themaximum profit in a week?

Linear Programming Problems June 9, 2021 10 / 37

Page 11: LINEAR PROGRAMMING PROBLEMS(LLP)

LPP Applications

Solution to Example 1

Decision variables: Let x1 and x2 be the number of units of M1 and M2.Objective function: The profit can be maximized viz:max z = 3x1 + 4x2.Constraints: There are two constraints involved -one for grinding and theother for polishing. The grinding constraint is given by: 4x1 + 2x2 ≤ 80Similarly,polishing constraint is given by: 2x1 + 5x2 ≤ 180Hence, we have

max z = 3x1 + 4x2.

Subject to:

4x1 + 2x2 ≤ 80

2x1 + 5x2 ≤ 180

x1, x2 ≥ 0.

Linear Programming Problems June 9, 2021 11 / 37

Page 12: LINEAR PROGRAMMING PROBLEMS(LLP)

LPP Applications

Example 2

A person requires 10, 12 and 12 units of chemicals A, B and Crespectively, for his garden. A liquid product contains 5,2, and 1 units ofA, B and C respectively, per jar. A dry product contains 1,2 and 4 units ofA, B and C per carton. If the liquid product sell for N3 per jar and the dryproduct sells for N2 per carton, how many of each should be purchased, inorder to minimize the cost and meet the requirements?

Linear Programming Problems June 9, 2021 12 / 37

Page 13: LINEAR PROGRAMMING PROBLEMS(LLP)

LPP Applications

Solution to Example 2

Decision variables: Let x1 and x2 be the number of units of liquid anddry products.Objective function: We need to minimize the cost: min z = 3x1 + 2x2Constraints: The constraints for the three chemicals are as follows:5x1 + x2 ≥ 102x1 + 2x2 ≥ 12x1 + 4x2 ≥ 12

Linear Programming Problems June 9, 2021 13 / 37

Page 14: LINEAR PROGRAMMING PROBLEMS(LLP)

LPP Applications

Finally, we have:min z = 3x1 + 2x2

Subject to:

5x1 + x2 ≥ 10

2x1 + 2x2 ≥ 12

x1 + 4x2 ≥ 12

x1, x2 ≥ 0.

Linear Programming Problems June 9, 2021 14 / 37

Page 15: LINEAR PROGRAMMING PROBLEMS(LLP)

LPP Applications

Example 3

A firm manufactures 3 products A, B and C . The profits are N3, N2 andN4 respectively. The firm has 2 machines and given below is the requiredprocessing time in minutes for each machine on each product

Table: Table 1.1

ProductsA B C

Machines M1 4 3 5M2 3 2 4

Machines M1 and M2 have 2, 000 and 2,500 machines minutesrespectively. The firm must manufacture 100A’s, 200 B’s and 50 C ’s butno more than 150 A’s. Set up a LP problem to maximize the profit

Linear Programming Problems June 9, 2021 15 / 37

Page 16: LINEAR PROGRAMMING PROBLEMS(LLP)

LPP Applications

Solution to Example 3

The LLP to maximize profit is obtained as follows:max z = 3x1 + 2x2 + 4x3

Subject to:

4x1 + 3x2 + 5x3 ≤ 2, 000

3x1 + 2x2 + 4x3 ≤ 2500

100 ≤ x1 ≤ 150

x2 ≥ 200

x3 ≥ 50

x1, x2, x3 ≥ 0

Linear Programming Problems June 9, 2021 16 / 37

Page 17: LINEAR PROGRAMMING PROBLEMS(LLP)

Graphical Method

Example 4

Use graphical method to solve the following LPP:max z = 2x1 + 5x2

s.t.

x1 + 2x2 ≤ 16

5x1 + 3x2 ≤ 45

x1, x2 ≥ 0

solution

Replace inequality constraints by equality constraints,x1 + 2x2 = 16 passes through (0,8) and (16,0)5x1 + 3x2 = 45 passes through (0,15) and (9,0)

Linear Programming Problems June 9, 2021 17 / 37

Page 18: LINEAR PROGRAMMING PROBLEMS(LLP)

Graphical Method

Solution to Example 4

The feasible region is ABCD. See Figure 1Point C (6, 5) is obtained by solving x1 + 2x2 = 16 and 5x1 + 3x2 = 45simultaneously

Table: Table 1.2

Corner Points z = 2x1 + 5x2A(0,0) 0B(0,8) 40C(6,5) 37D(9,0) 18

The maximum value of z occurs at B(0,8). Therefore, the optimal solutionis x1 = 0, x2 = 8.

Linear Programming Problems June 9, 2021 18 / 37

Page 19: LINEAR PROGRAMMING PROBLEMS(LLP)

Figure 1

Linear Programming Problems June 9, 2021 19 / 37

Page 20: LINEAR PROGRAMMING PROBLEMS(LLP)

Graphical Method

Example 5

Use graphical method to solve the following LPP:min z = 20x1 + 10x2

s.t.

x1 + 2x2 ≤ 40

3x1 + x2 ≥ 30

4x1 + 3x2 ≥ 60

x1, x2 ≥ 0

solution

Replace inequality constraints by equality constraints,x1 + 2x2 = 40 passes through (0,20) and (40,0)3x1 + x2 = 30 passes through (0,30) and (10,0)4x1 + 3x2 = 60 passes through (0,20) and (15,0)

Linear Programming Problems June 9, 2021 20 / 37

Page 21: LINEAR PROGRAMMING PROBLEMS(LLP)

Graphical Method

Solution to Example 5 cont’d

Plot the three constraints on the same graph, we obtainSee Figure 2

ABCD is the Feasible Region.Points A and B are points of intersection.We obtain A(4, 18) by solving x1 + 2x2 = 40 and 3x1 + x2 = 30simultaneously.Similarly, point B(6, 12) is obtained by solving simultaneously3x1 + x2 = 30 and 4x1 + 3x2 = 60.

Linear Programming Problems June 9, 2021 21 / 37

Page 22: LINEAR PROGRAMMING PROBLEMS(LLP)

Figure 2

Linear Programming Problems June 9, 2021 22 / 37

Page 23: LINEAR PROGRAMMING PROBLEMS(LLP)

Graphical Method

Solution to Example 5 cont’d

Table: Table 1.2

Corner Points z = 20x1 + 10x2A(4,18) 260B(6,12) 240C(15,0) 300D(40,0) 800

The minimum value of z is attained at B(6,12). Therefore, the optimalsolution is x1 = 6, x2 = 12.

Linear Programming Problems June 9, 2021 23 / 37

Page 24: LINEAR PROGRAMMING PROBLEMS(LLP)

Simplex Method

Example 6

Solve the following linear programming problem using the Simplexmethod. max z = 12x1 + 16x2

s.t.

10x1 + 20x2 ≤ 120

8x1 + 8x2 ≤ 80

x1, x2 ≥ 0

Solution

Introduce slack variables in the objective function and constraints asfollows:

Linear Programming Problems June 9, 2021 24 / 37

Page 25: LINEAR PROGRAMMING PROBLEMS(LLP)

Simplex Method

Solution to Example 6

max z = 12x1 + 16x2 + 0s1 + 0s2s.t.

10x1 + 20x2 + s1 = 120

8x1 + 8x2 + s2 = 80

x1, x2, s1, s2 ≥ 0

Note that:

zj =n∑

i=1

(CBi )(aij), where n is the number of constraints

Optimality Conditions:For maximization problems, all cj − zj ≤ 0.For minimization problems, all cj − zj ≥ 0.

Linear Programming Problems June 9, 2021 25 / 37

Page 26: LINEAR PROGRAMMING PROBLEMS(LLP)

Simplex Method

Example 6

Table: Initial Simplex Table

cj 12 16 0 0CBj BV x1 x2 s1 s2 Solution Ratio

0 s1 10 20 1 0 120 12020 =6

0 s2 8 8 0 1 80 808 =10

zj 0 0 0 0 0cj − zj 12 16 0 0

Linear Programming Problems June 9, 2021 26 / 37

dothe
Highlight
dothe
Highlight
dothe
Highlight
dothe
Highlight
Page 27: LINEAR PROGRAMMING PROBLEMS(LLP)

Simplex Method

Table: Iteration I

cj 12 16 0 0CBj BV x1 x2 s1 s2 Solution Ratio

16 x21

21

1

200 6

6

1/2=12

0 s2 4 0 -2

51 32

32

4=8

zj 8 164

50

cj − zj 4 0 -4

50

New element = Old element − Product of elements in the key row and column

Key element

Linear Programming Problems June 9, 2021 27 / 37

dothe
Highlight
dothe
Highlight
dothe
Highlight
dothe
Highlight
dothe
Highlight
dothe
Highlight
dothe
Highlight
dothe
Highlight
dothe
Highlight
dothe
Highlight
dothe
Highlight
Page 28: LINEAR PROGRAMMING PROBLEMS(LLP)

Simplex Method

Table: Iteration II

cj 12 16 0 0CBj BV x1 x2 s1 s2 Solution

16 x2 0 11

10-1

82

12 x1 1 0 -1

10

1

48

zj 12 162

51 128

cj − zj 0 0 -2

5-1

The Optimality condition for maximization problems is now satisfied.Therefore, the optimal solution is x1 = 8, x2 = 2 with z = 128.

Linear Programming Problems June 9, 2021 28 / 37

Page 29: LINEAR PROGRAMMING PROBLEMS(LLP)

Simplex Method

Example 7

Solve the following linear programming problem using the Simplexmethod. min z = 2x1 − 36x2 + 6x3

s.t.

3x1 − x2 + 2x3 ≤ 7

2x1 + 4x2 ≥ −12

−4x1 + 3x2 + 8x3 ≤ 10

x1, x2, x3 ≥ 0

Remark: The RHS of the constraints of any LLP must be a non-negativevalue.Therefore we rewrite the above LLP as follows:

Linear Programming Problems June 9, 2021 29 / 37

Page 30: LINEAR PROGRAMMING PROBLEMS(LLP)

Simplex Method

Solution to Example 7 cont’d

min z = 2x1 − 36x2 + 6x3s.t.

3x1 − x2 + 2x3 ≤ 7

−2x1 − 4x2 ≤ 12

−4x1 + 3x2 + 8x3 ≤ 10

x1, x2, x3 ≥ 0

Linear Programming Problems June 9, 2021 30 / 37

Page 31: LINEAR PROGRAMMING PROBLEMS(LLP)

Simplex Method

Solution to Example 7 cont’d

Introduce slack variables in the objective function and constraints asfollows:

min z = 2x1 − 3x2 + 6x3 + 0s1 + 0s2 + 0s3s.t.

3x1 − x2 + 2x3 + s1 = 7

−2x1 − 4x2 + s2 = 12

−4x1 + 3x2 + 8x3 + s3 = 10

Linear Programming Problems June 9, 2021 31 / 37

Page 32: LINEAR PROGRAMMING PROBLEMS(LLP)

Simplex Method

Example 7

cj 2 -3 6 0 0 0CBj BV x1 x2 x3 s1 s2 x3 Solution Ratio

0 s1 3 -1 2 1 0 0 7 7−1=-7

0 s2 -2 -4 0 0 1 0 12 12−4=-3

0 s3 -4 3 8 0 0 1 10 103

zj 0 0 0 0 0 0 0cj − zj 2 -3 6 0 0 0

Linear Programming Problems June 9, 2021 32 / 37

dothe
Highlight
dothe
Highlight
dothe
Highlight
dothe
Highlight
dothe
Highlight
dothe
Highlight
dothe
Highlight
dothe
Highlight
dothe
Highlight
dothe
Highlight
Page 33: LINEAR PROGRAMMING PROBLEMS(LLP)

Simplex Method

Table: Iteration I

cj 2 -3 6 0 0 0CBj BV x1 x2 x3 s1 s2 x3 Solution Ratio

0 s153 0 14

3 1 0 13

313

313 × 3

5 = 315

0 s2 −223 0 32

3 0 1 43

763

763 ×− 3

22 = −3811

-3 x2 -43 1 83 0 0 1

3103

103 ×−3

4 = −52

zj 4 -3 -8 0 0 -1 -10cj − zj -2 0 14 0 0 1

Linear Programming Problems June 9, 2021 33 / 37

dothe
Highlight
dothe
Highlight
dothe
Highlight
dothe
Highlight
dothe
Highlight
dothe
Highlight
dothe
Highlight
dothe
Highlight
Page 34: LINEAR PROGRAMMING PROBLEMS(LLP)

Simplex Method

cj 2 -3 6 0 0 0CBj BV x1 x2 x3 s1 s2 x3 Solution

2 x1 1 0 145

35 0 1

5315

0 s2 0 0 1565

225 1 14

53455

-3 x2 0 1 325

45 0 3

5585

zj 2 -3 -685 -65 0 -75 -1125cj − zj 0 0 98

565 0 7

5

The Optimality condition for minimization problems is now satisfied.Therefore, the optimal solution is x1 = 31

5 , x2 = 585 , x3 = 0.

Linear Programming Problems June 9, 2021 34 / 37

Page 35: LINEAR PROGRAMMING PROBLEMS(LLP)

Tutorial Questions

A grower has 50 acres of land for which she plans to raise three crops.It costs N200 to produce an acre of carrots and the profit is N60 peracre. It costs N80 to produce an acre of celery and the profit is N20per acre. Finally, it costs N140 to produce an acre of lettuce and theprofit is N30 per acre. Use the simplex method to find the number ofacres of each crop she should plant in order to maximize her profit.Assume that her cost cannot exceed N10,000.

A merchant plans to sell two models of home computers at costs ofN250 and N400, respectively. The N250 model yields a profit of N45and the N400 model yields a profit of N50. The merchant estimatesthat the total monthly demand will not exceed 250 units. Find thenumber of units of each model that should be stocked in order tomaximize profit. Assume that the merchant does not want to investmore than N70,000 in computer inventory.

Linear Programming Problems June 9, 2021 35 / 37

Page 36: LINEAR PROGRAMMING PROBLEMS(LLP)

Tutorial Questions cont’d

A small petroleum company owns two refineries. Refinery 1 costsN25,000 per day to operate, and it can produce 300 barrels ofhigh-grade oil, 200 barrels of medium-grade oil, and 150 barrels oflow-grade oil each day. Refinery 2 is newer and more modern. It costsN30,000 per day to operate, and it can produce 300 barrels ofhigh-grade oil, 250 barrels of medium-grade oil, and 400 barrels oflow-grade oil each day. The company has orders totaling 35,000barrels of high-grade oil, 30,000 barrels of medium-grade oil, and40,000 barrels of low-grade oil. How many days should the companyrun each refinery to minimize its costs and still meet its orders?

A steel company has two mills. Mill 1 costs N70,000 per day tooperate, and it can produce 400 tons of high-grade steel, 500 tons ofmedium-grade steel, and 450 tons of low-grade steel each day. Mill 2costs N60,000 per day to operate, and it can produce 350 tons ofhigh-grade steel, 600 tons of medium-grade steel, and 400 tons oflow-grade steel each day. The company has orders totaling 100,000tons of high-grade steel, 150,000 tons of medium-grade steel, and124,500 tons of low-grade steel. How many days should the companyrun eachmill tominimize its costs and still fill the orders?

Linear Programming Problems June 9, 2021 36 / 37

Page 37: LINEAR PROGRAMMING PROBLEMS(LLP)

Tutorial Questions cont’d

Solve the following linear programming problems using graphical andSimplex methods:

min z = 4x1 + 6x2s.t.

x1 + x2 ≥ 8

6x1 + x2 ≥ 12

x1, x2 ≥ 0

max z = 5x + 8ys.t.

x + y ≤ 36

x + 2y ≤ 20

3x + 4y ≤ 42

x , y ≥ 0Linear Programming Problems June 9, 2021 37 / 37