LPP

23
Abstract A linear programming problem is simply an optimization problem. (A maximization or minimization problem). A large number of optimization problems fall into the subcategory linear programming problems. In order to solve a real world mathematical problem using linear programming, first of all the wording or problem statement in words should be translated into a set of inequalities or equations. It should have certain constraints for a solution to exist. Also some assumptions will have to be made when formulating the mathematical model for a LPP. It is possible to represent a linear programming problem geometrically and solve it while also using a method named Simplex method. In some cases even MatLAB is used to find solutions for LPP. What needed to be known of a LPP are What the components of the problem are-objective and variables affecting the problem. How to formulate the problem-is it a minimization or maximization problem? 1

Transcript of LPP

Page 1: LPP

Abstract

A linear programming problem is simply an optimization problem. (A maximization or

minimization problem). A large number of optimization problems fall into the subcategory

linear programming problems. In order to solve a real world mathematical problem using

linear programming, first of all the wording or problem statement in words should be

translated into a set of inequalities or equations. It should have certain constraints for a

solution to exist. Also some assumptions will have to be made when formulating the

mathematical model for a LPP. It is possible to represent a linear programming problem

geometrically and solve it while also using a method named Simplex method. In some cases

even MatLAB is used to find solutions for LPP. What needed to be known of a LPP are

• What the components of the problem are-objective and variables affecting the

problem.

• How to formulate the problem-is it a minimization or maximization problem?

• What assumptions are underlying

• How to find a solution to a 2-dimensional problem graphically.

• How to find a solution using simplex method

The prerequisites for solving a LPP are knowledge of geometrical representation and the

knowledge in solving linear equations and linear inequalities.

1

Page 2: LPP

Problem description

A company manufactures and sells two models of lamps L1, L2 the profit being $15 and $10,

respectively. The process involves two workers W1 and W2 who are available for this kind of

work 100 and 80 hours per month, respectively. W1 assembles L1 in 20 minutes and L2 in 30

minutes. W2 paints L1 in 20 minutes and L2 in 10 minutes. It is assumed for this problem that

all lamps made can be sold without difficulty. The objective is to find the figures of L 1 and L2

for which the maximum profit is obtained.

This problem is a common problem for production departments. Managers need to determine

how much products they need to manufacture for a month in order to get the maximum profit,

while utilizing the presently available resources (both material and human resources).

The questions we need to answer for this problem is how many L1 and L2 need to be produced

for the maximum profit.

Simplification

Take that the quantity of L1 for maximum profit as also L1 and similarly quantity of L2 for

maximum profit is L2. Taking the profit as f (L1, L2) the equation for profit can be written as

f ( L1,L2) = ( unit profit of L1* L1) + (unit profit of L2* L2) PROFIT

Assumption: Here it is assumed that all manufactured number of lamps is sold by the end of

the month.

This assumption is made in order to further simplify this mathematical model.

f (L1, L2) = $ (15* L1 + 10*L2) -----------------------------------------(A)

2

Page 3: LPP

Considering the work done by worker W1 and the time constraints for that worker we can

identify that the time taken for his work possibly won’t exceed 100 hours per month.

(20 minutes * L1)+ (30 minutes*L2) ≤ (100* 60 minutes) PROCESSING TIME

20*L1 + 30*L2 ≤ 6000 -------------------------------------------------- (B)

Next considering the W2 worker and his time constraints,

(20 minutes * L1) + (10 minutes * L2) ≤ (80 * 60 minutes) PROCESSING TIME

20*L1 + 10*L2 ≤ 4800---------------------------------------------------- (C)

Also as the number of L1 and L2 cannot be lesser than zero anyway the constraints for these

conditions are,

L1 ≥0--------------------------------------------------------------------------- (D)

L2 ≥0--------------------------------------------------------------------------- (E)

General Statement of the Linear Programming Problem:

Objective Function:

Maximize f (L1, L2) = $ (15* L1 + 10*L2) ----------------------------------------- (A)

Constraint Equations:

Subject to:   

20*L1 + 30*L2 ≤ 6000 -------------------------------------------------- (B)

20*L1 + 10*L2 ≤ 4800---------------------------------------------------- (C)

3

Page 4: LPP

L1 ≥0--------------------------------------------------------------------------- (D)

L2 ≥0--------------------------------------------------------------------------- (E)

The number of lamps sold can be different in the practical world. However by assuming that

all the lamps manufactured are sold there is no need to calculate the percentage of lamps sold.

There is no record about that. So this assumption is justified. Also since the number of lamps

sold of each type can never be lesser than zero the constraints (D) and (E) are justified.

Mathematical Model

The standard representation of a linear programming problem is

Maximize/minimize OBJECTIVE FUNCTION

Subject to CONSTRAINTS

Since in our problem we have only two variables number of L1 lamps = x and number of L2

lamps= y, rewriting the simplified problem in the form of a Linear Programming Problem

Model we get

Maximize f (x, y) = $ (15* x + 10*y) ----------------------------------------- (A)

Subject to:   

20*x + 30*y ≤ 6000 -------------------------------------------------------------- (B)

20*x + 10*y ≤ 4800--------------------------------------------------------------- (C)

x ≥0---------------------------------------------------------------------------------- (D)

y≥0----------------------------------------------------------------------------------- (E)

4

Page 5: LPP

Solution of the Mathematical Problem

Graphical Method

In the graphical method following steps are followed.

Convert the constraint inequalities into equations. (Simply replace the unequal sign with equal

sign)

a. 20*x + 30*y =6000 -------------------------------------------------------------- (p)

b. 20*x + 10*y = 4800--------------------------------------------------------------- (q)

c. x =0---------------------------------------------------------------------------------- (r)

d. y=0----------------------------------------------------------------------------------- (s)

Draw the graphs for these linear equations on the x, y coordinate system.

Figure 1:- Graphs consisting the constraint equations

5

Feasible region

Page 6: LPP

2. Identify the feasible area for the solution. In this case the shaded region contains the

solution for the possible values for objective function. However in order to determine

the maximum value for the objective function, the corner points should be identified.

Corner points are points at which each of above graphs intersect each other.

Corner points:

a. The corner point at which equation p and q intersect, A is obtained by solving

the two graph equations parallel.

20*x + 30*y =6000 -------------------------------------------------------------- (p)

20*x + 10*y = 4800--------------------------------------------------------------- (q)

In matrix form the parallel equation can be written as,

=

By solving above equation we get values for x and y as,

x=210

y=60

6

20 30

20 10

6000

4800

x

y

Page 7: LPP

Figure 2: Corner point A found

Similarly the other four corner points at which the rest of the three graphs intersect can be

calculated.

Corner pint D at which p and r equations intersect y=0, x=200 D= (200, 0)

Corner point at C= (0, 0) and Corner point at B= (0,240)

Next by calculating the value of the objective function at the corner points the maximum and

minimum values for the object function can be found.

Results

Table 1:- Value of objective function at the corner points

Corner Points

Objective Function value

($)

(0,0) 0

7

A= (210, 60)B

C D

Page 8: LPP

(210,60) 3750

(200,0) 3000

(0,240) 2400

According to Table 1 It can be seen that the maximum value for the objective function is at

Corner point (210, 60), at which the objective function value i.e. Maximum profit of company

is $3750.

Therefore from this graphical method the figures of L1 and L2 for which the maximum profit

can be obtained is calculated as

Number of L1(x) = 210

Number of L2(y) = 60

Simplex method

In simplex method first of all the constraint inequalities of the problem statement should be

rewritten as equations by introducing a slack variables. Slack variables are the variables that

“pick up” the extra value needed to convert the inequalities into equalities. So by taking the

slack variables as u and v we rewrite the problem statement as,

Objective Function:

Maximize z = 15* x + 10*y ----------------------------------------- (A)

Number of L1=x, number of L2=y

8

Page 9: LPP

Subject to:   

20*x + 30*y + u = 6000 -------------------------------------------------- (B)

20*x + 10*y + v = 4800---------------------------------------------------- (C)

x ,y, u, v ≥0--------------------------------------------------------------------------- (D)

Next we have to form the simplex tableau. For that we have to write above system of linear

equations in 3 rows as following.

Z - 15* x + 10*y = 0 Row 0

20*x + 30*y + u = 6000 Row 1

20*x + 10*y + v = 4800 Row 2

These equations have to be solved in terms of basic variables and non-basic variables. The

variables (other than the special variable z) which appear in only one equation are the basic

variables. Other variables except z are non-basic variables.

Basic variables= u, v

Non-Basic variables= x, y

A basic solution is obtained from the system of equations by setting the non-basic variables to

zero. This gives

x=0

y=0

u=6000

v=4800

9

Page 10: LPP

The simplex tableau

Next according to the first rule of Simplex method the row 0 has to be observed carefully. If If

all variables have a nonnegative coefficient in Row 0, the current basic solution is optimal. If

not, for speedy convergence the most negative coefficient is chosen. In this example as the

row zero contains negative coefficients. Therefore this basic solution IS NOT optimal. So we

pick the most negative coefficient -15. We call the variable containing this coefficient as the

‘entering variable’. In this case it is x. The idea is to pivot in order to make the non-basic

variable x become a basic variable. When choosing the pivot element first the values in the

right most column should be divided by the relevant pivot column element and the pivot

column element which gives the smallest value has to be chosen. This is the second rule of the

simplex method.

10

x y u v z |

20 30 1 0 0 | 6000

20 10 0 1 0 | 4800

-15 -10 0 0 1 | 0 Row 0

Row 1

Row2

x y u v z |

20 30 1 0 0 | 6000

20 10 0 1 0 | 4800

-15 -10 0 0 1 | 0

6000/20= 300

4800/20= 240

Page 11: LPP

Hence the coefficient 20 in the 2nd row is chosen as the pivoting element. And pivoting around

that value gives us the following solution.

Next we again check the row 0 for any negative coefficients according to first rule. In this

case again row 0 has a -2.5 negative coefficient. So the column y is our new pivot column.

Again applying the second rule we divide the right most column values by the pivot column

values and select the pivot element for which the above division is smallest.

Thus we can see that the value 20 in row 1 is our new pivot element. Therefore pivoting

around that element we obtain the following solution.

11

x y u v z |

0 20 1 -1 0 | 1200

1 0.5 0 0.05 0 | 240

0 -2.5 0 0.75 1 | 3600

x y u v z |

0 20 1 -1 0 | 1200

1 0.5 0 0.05 0 | 240

0 -2.5 0 0.75 1 | 3600

1200/20= 60

240/0.5= 480

x y u v z |

0 1 0.05 -0.05 0 | 60

1 0 -0.025 0.075 0 | 210

0 0 0.125 0.625 1 | 3750

Page 12: LPP

Now we can see that the last row (row 0) doesn’t have any negative coefficients.

Hence this solution is optimal according to the first rule of simplex method. Therefore as we

can see the variables x and y are now basic. Whereas, the variables u and v are now non-basic

variables.

All the above computations can be represented very compactly in tableau form .

Table 2: compact solution tableau

z x y u v RHS Basic solution

1 -15 -10 0 0 0 Basic u=6000,v=4800

0 20 30 1 0 6000 Non basic x=0 y=0

0 20 10 0 1 4800 Z=0

1 0 -2.5 0 0.75 3600 Basic x=240,u=1200

0 0 20 1 -1 1200 Non basic y=0 v=0

0 1 0.5 0 0.05 240 Z=3600

1 0 0 0.125 0.625 3750 Basic x=210,y=60

0 0 1 0.05 -0.05 60 Non basic u=0 v=0

0 1 0 -0.025 0.075 210 Z=3750

Results

From the simplex method by two pivoting steps we obtain the optimum solution for the

objective function which is the maximum monthly profit of the lamp manufacturing company.

12

Page 13: LPP

Also the production figures for L1 and L2 is also finally obtained as the basic variables of the

simplex method as x=210 and y=60.

It means the number of L1 lamps and number of L2 lamps needed to get the maximum profit

is 210 and 60 respectively.

In both methods we followed this result was obtained without any discrepancies.

The problem we solved has a feasible solution. It had a feasible region for solutions even

when the graphs of constraints were plotted. However there are cases in which a solution

cannot be founded for linear programming problems. The reasons for this are

1. The linear program is unbounded: this happens when there is no positive entry in the

entry variable column. So there can be no ratio calculated at the RHS column. Hence a

optimum solution is not possible to find either graphically or by simplex method.

2. The program is degenerate: In the Simplex Method there is an improvement in the

objective function in each step as the algorithm converges to the optimum. However, a

situation can arise where there is no improvement in the objective function from an

application of the algorithm, and this is referred to as degeneracy. Also there is a

possibility that cycling could occur, and the optimum would not be reached. This

occurs when the basic solution has a basic variable with the coefficient of zero. By

pivoting the same basic solution will be obtained with interchanged basic variable

values.

In order to a solution to exist the following conditions should be satisfied

1. The LPP must have a unique optimum solution : the basic solution itself

2. The LPP must have an alternative optimum solution: by the above two methods the

alternative optimum solution can be obtained

Improvements

These two methods are the frequently used methods for solving linear programming

problems. Apart from these two methods MatLAB can be used. By using MatLAB the

calculations can done using the optimization toolbox in several specifies iteration.

13

Page 14: LPP

In MatLAB the syntax linprog solves linear programming problems.

x = linprog(f,A,b) solves min/max f'*x such that A*x ≤ b. where A is the inequality matrix, b is a vector.

Conclusions

In this report we have presented how to solve a real world optimization problem using linear

programming model. Linear programming problems are either a maximization problem or

minimization problem. In this case the problem we chose is a maximization problem. To

obtain the maximum value of the objective function of our Model we followed two well

known mathematical methods. Namely, the graphical Method and the Simplex tableau

method. Both methods yielded the same values for the variables in order to get the optimum

solution. We followed both methods step by step by describing each step simply so that

anyone can follow these to solve any linear programming problem. Further we have

mentioned that by referring to the graphs of the constraints or by referring to the basic

solution of the simplex tableau without calculating we can determine whether any LPP has a

solution, if the solution is Feasible, or if the problem’s solution is unbound or degenerate.

The conditions for a LPP to have a solution is also mentioned in this report, after doing some

research on it.

References

© 1984-2011- The Math Works, Inc, Product Documentation,linprog [online]

http://www.mathworks.in/help/toolbox/optim/ug/f10534.html

[Accessed 09 November 2011]

Linear Programming. Chapter 4 [online]

http://www.mpri.lsu.edu/textbook/Chapter5.htm

[Accessed 09 November 2011]

Thomas S. Ferguson,2008, LINEAR PROGRAMMING,A Concise Introduction,

[pdf]

14

Page 15: LPP

Walter J. Mayer,1984, Concepts of Mathematical Modeling,[pdf] Dover

Publications,Inc,Mineola, NY

Jennifer Whitfield,Linear Programming, Sample Simplex Problem,[pdf],College Of

Science IT LAB.

Robert J. Vanderbei ,October 17, 2007, Linear Programming: Chapter 2 ,The

Simplex Method, Operations Research and Financial Engineering ,Princeton University,Princeton, NJ 08544http://www.princeton.edu/_rvdb

15