Helping Material LP
Helping Material LP
Linear programming is a process that is used to determine the best outcome of a linear function.
It is the best method to perform linear optimization by making a few simple assumptions. The
linear function is known as the objective function. Real-world relationships can be extremely
complicated. However, linear programming can be used to depict such relationships, thus,
making it easier to analyze them.
Linear programming can be defined as a technique that is used for optimizing a linear function in
order to reach the best outcome. This linear function or objective function consists of linear
equality and inequality constraints. We obtain the best outcome by minimizing or maximizing
the objective function.
Suppose a postman has to deliver 6 letters in a day from the post office (located at A) to different
houses (U, V, W, Y, Z). The distance between the houses is indicated on the lines as given in the
image. If the postman wants to find the shortest route that will enable him to deliver the letters as
well as save on fuel then it becomes a linear programming problem. Thus, LP will be used to get
the optimal solution which will be the shortest route in this example.
Objective Function: Z = ax + by
Non-negative restrictions: x ≥ 0, y ≥ 0
The simplex method in lpp can be applied to problems with two or more decision variables.
Suppose the objective function Z = 40x1
+ 30x2
x1
+ x2
≤ 12
2x1
+ x2
≤ 16
x1
≥ 0, x2
≥0
Step 1: Add another variable, known as the slack variable, to convert the inequalities into
equations. Also, rewrite the objective function as an equation.
- 40x1
- 30x2
+Z=0
x1
+ x2 + y1
=12
2x1
+ x2 + y2
=16
y1
and y2
⎡⎢ ⎢ ⎢⎣x1x2y1y2Z11100122101016−40−300010⎤⎥ ⎥ ⎥⎦
Step 3: Identify the column with the highest negative entry. This is called the pivot column. As -
40 is the highest negative entry, thus, column 1 will be the pivot column.
Step 4: Divide the entries in the rightmost column by the entries in the pivot column. We
exclude the entries in the bottom-most row.
12 / 1 = 12
16 / 2 = 8
The row containing the smallest quotient is identified to get the pivot row. As 8 is the smaller
quotient as compared to 12 thus, row 2 becomes the pivot row. The intersection of the pivot row
and the pivot column gives the pivot element.
Step 5: With the help of the pivot element perform pivoting, using matrix properties, to make all
other entries in the pivot column 0.
/ 2)
⎡⎢ ⎢ ⎢ ⎢⎣x1x2y1y2Z111001211/201/208−40−300010⎤⎥ ⎥ ⎥ ⎥⎦
Now apply R1
= R1 - R2
⎡⎢ ⎢ ⎢ ⎢⎣x1x2y1y2Z01/21−1/20411/201/208−40−300010⎤⎥ ⎥ ⎥ ⎥⎦
Finally R3
= R3 + 40R2
⎡⎢ ⎢ ⎢ ⎢⎣x1x2y1y2Z01/21−1/20411/201/2080−100201320⎤⎥ ⎥ ⎥ ⎥⎦
Step 6: Check if the bottom-most row has negative entries. If no, then the optimal solution has
been determined. If yes, then go back to step 3 and repeat the process. -10 is a negative entry in
the matrix thus, the process needs to be repeated. We get the following matrix.
⎡⎢ ⎢ ⎢⎣x1x2y1y2Z012−10810−11040020101400⎤⎥ ⎥ ⎥⎦
Writing the bottom row in the form of an equation we get Z = 400 - 20y1
- 10y2. Thus, 400 is the highest value that Z can achieve when both y1 and y2
are 0.
Also, when x1
= 4 and x2
Thus, x1
= 4 and x2
= 8 are the optimal points and the solution to our linear programming problem.
If there are two decision variables in a linear programming problem then the graphical method
can be used to solve such a problem easily.
where, x ≥ 0 and y ≥ 0.
To solve this problem using the graphical method the steps are as follows.
x + 4y = 24
3x + y = 21
x+y=9
x + 4y = 24 is a line passing through (0, 6) and (24, 0). [By substituting x = 0 the point (0, 6) is
obtained. Similarly, when y = 0 the point (24, 0) is determined.]
Step 3: Identify the feasible region. The feasible region can be defined as the area that is
bounded by a set of coordinates that can satisfy some particular system of inequalities.
Any point that lies on or below the line x + 4y = 24 will satisfy the constraint x + 4y ≤ 24.
The feasible region is represented by OABCD as it satisfies all the above-mentioned three
restrictions.
Step 4: Determine the coordinates of the corner points. The corner points are the vertices of the
feasible region.
O = (0, 0)
A = (7, 0)
B = (6, 3). B is the intersection of the two lines 3x + y = 21 and x + y = 9. Thus, by substituting y
= 9 - x in 3x + y = 21 we can determine the point of intersection.
D = (0, 6)
Step 5: Substitute each corner point in the objective function. The point that gives the greatest
(maximizing) or smallest (minimizing) value of the objective function will be the optimal point.
Corner Points Z = 2x + 5y
O = (0, 0) 0
A = (7, 0) 14
B = (6, 3) 27
C = (4, 5) 33
D = (0, 6) 30