LPoverall
LPoverall
LPoverall
T.T. Narendran
Department of Management Studies Indian Institute of Technology Madras
Plant II 5 4 2 40 hrs
Maximize
Z = 10X1 +13X2 + 12X3 Objective Function
Subject to 3X1 + 4X2 + 4X3 < 40 5X1 + 4X2 + 2X3 < 40 X1 > 0, X2 > 0, X3 > 0 X 1, X 2 , X 3
. .
10
Cost
Vitamin A
Vitamin B
Vitamin D
Rs 1.50/unit 15 mg/unit 40 mg/unit 10 mg/unit Rs. 14.00/lit Rs. 18/unit (kg) 30 mg/lit 10 mg/kg 100 mg 25 mg/lit 55 mg/kg 250mg 20 mg/lit 30 mg/kg 120mg
11
Formulate
linear
programme
to
determine th quantity of each f d th t d t i the tit f h food that the woman needs to buy in order to minimize her total expenditure, ensuring at the same time that she meets her daily d il requirements of vitamins. i t f it i
12
13
14
"Invest a certain sum (in lakhs of rupees) in any month, invest half of that amount in the next month and you will get twice the amount invested originally in the first month". This scheme is available for the next six months months. The returns received at the end of any month can be used immediately for reinvesting either as a fresh investment or as a follow-up investment follow up investment.
15
(t = 1 2 3 4 5) (in lakhs of Rs ) 1,2,3,4,5) Rs.) Noting that, in any month, the cash outflow g y must not exceed the cash on hand, the following linear programme is formulated ;
16
17
At the end of the 6 month, the cash on hand must be a maximum. Hence the objective function is
18
19
Ingredient
20
Formulate a linear programme to maximize the total revenue of the brewery brewery.
TTN DoMS, IIT Madras, 3-Sep-09
21
22
23
24
Example 5:
A shipping company has to lift three types of cargo whose details are given below.
Type of Cargo A B C Quantity (tons) 300 500 400 Volume per ton 1.2 m3 0.8 0 8 m3 1 m3 Profit per ton Rs. 10,000 Rs. 7,000 Rs 7 000 Rs. 8,000
25
26
Weight in aft, center, forward must be in the same proportion as the holding capacities by weight, i.e., weight i e 100 : 200 : 75 Formulate a linear programme to maximize the revenues of the shipping company.
27
28
29
30
Paper strips can be cut and pasted lengthwise but not widthwise. widthwise
TTN DoMS, IIT Madras, 3-Sep-09
31
Formulate a linear programme to minimize the trim losses incurred while cutting and pasting the q g p p required lengths of paper.
32
33
35 X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 0 0 0 1 2 4 4 2 2 6
60 0 1 2 3 2 1 0 0 1 0
64 3 2 1 0 0 0 1 2 1 0
Loss 23 27 31 0 25 15 11 17 21 5
34
Let Xj be the length, in meters, of the jth pattern cut out from the given roll of paper. t tf th i ll f
35
36
They have concluded that the coefficients ey a e co c uded a e coe c e s have to add up to 1. They wish to determine the values of the coefficients such th t th sum of th modulus of th h that the f the d l f the
.
37
Minimize total absolute error in calculating a,b,c a b c and d d. i.e., Minimize the sum of the moduli of error
TTN DoMS, IIT Madras, 3-Sep-09
38
We have to minimize
39
We introduce a term yi which is designed to take the positive difference between and
The problem is now formulated as follows :
40
A final product is assembled with 4 units of component A and 3 units of component B. The man fact ring shop r ns three different processes manufacturing runs processes, each of which requires varying amounts of raw materials and produce different amounts of A and B B. Two types of raw materials are used. 100 units of raw material I (RM I) and 200 units of raw material II (RM II) t i l d it f t i l are available to the shop each day
41
The following table gives the information on the quantities of raw materials consumed by each process and the yield of A and B from each of them
TTN DoMS, IIT Madras, 3-Sep-09
42
Shop
No. of runs X1 X2 X3
I II III
7 4 2 100
Formulate a linear programme to maximize the number of completed assemblies produced each day day.
TTN DoMS, IIT Madras, 3-Sep-09
43
44
45
We have to maximize the above expression. This is Thi i accomplished b f li h d by formulating the l i h problem as follows :
46
T.T. Narendran
Department of Management Studies Indian Institute of Technology Madras
47
sequentially in two work centers. The associated profits and the man hours required by each product at each work center q y p are shown in the table below :
TTN DoMS, IIT Madras, 3-Sep-09
48
Furniture Shop
Tables
Chairs
8 4 2
6 2 4 60 48
Formulate a linear programme to determine the p g optimal number of tables and chairs to be p manufactured so as to maximize the profit.
TTN DoMS, IIT Madras, 3-Sep-09
49
This problem can be solved graphically. The f ll i figure shows th constraints ; Th following fi h the t i t
TTN DoMS, IIT Madras, 3-Sep-09
50
51
Before we indicate the procedure to solve this problem, a few concepts are introduced. introduced
52
Convex Set:
If there exists a set in which a straight line joining any two points in the set is also contained in the set, then such a set is called a convex set
53
The extreme of a convex set will always lie e e e e o co e se a ays e at a corner point. This property is used for determining the solution to the given linear programme. The expression
54
A series of parallel lines for various assumed values of Z can be drawn. These are called Isoprofit lines. The profit Z along each line is the same. The value of Z is seen to increase as the isoprofit lines move farther away from the origin. The Th corner point th i t through which th l t i h hi h the last isoprofit fit line passes, gives the optimal solution. In the figure OABC, the corner points are evaluated as follows:
TTN DoMS, IIT Madras, 3-Sep-09
55
56
Z0 = 0 ZA = 72 ZB = 132 ZC = 120 For the given problem, the optimal solution g p p occurs at corner point B (12,6) i.e., i e X1 = 12 X2 = 6 with the corresponding profit 12, of 132 which is the maximum.
TTN DoMS, IIT Madras, 3-Sep-09
57
Note: The graphical method, obviously, can g y solve problems with just two variables. The need, however, is for a method that can solve problems of realistic size. p For this purpose, there exists a method called the Simplex Algorithm developed by George.B. Dantzig.
58
59
There are four variables and two equations. Hence this thi cannot b solved as simultaneous equations. t be l d i lt ti However, it is possible to find a set of solutions called basic solutions which are obtained as follows In the given system of equations if we set the 'extra' equations, extra variables = 0, we can solve for the remaining variables. i bl
60
For instance, if we set o s a ce, e se We get This is called a basic solution solution. We can see that there are as many as solutions. . Of these, the solutions that also satisfy the , y non-negativity condition are called basic feasible solutions
61
In general if we have a system of m general, equations with n variables (where n > m), we can obtain basic solutions by setting (n - m) variables = 0 and solving for the remaining variables. i i i bl There will be basic solutions
62
Canonical form :
If there exists a system of equations such that each equation h one variable with coefficient h ti has i bl ith ffi i t of 1 in that equation and a coefficient of 0 in all the other equations, such a system is said to be in Canonical form form. The given system is seen to be in Canonical form since satisfy this condition.
63
Other Definitions :
The variables that are set = 0 are called non basic variables while the remaining variables are called basic variables. Now let us consider the same example:
64
Remove the inequalities and rewrite the constraints as equations b i i by introducing ''slack variables'' are d i l k i bl shown below
This is a system of two equations with four variables. Choose the variables in canonical form, i.e., as the basic variables for the initial solution. Rewrite the equations, expressing the basic variables in terms of non-basic variables variables.
TTN DoMS, IIT Madras, 3-Sep-09
65
Both the non basic variables have positive coefficients in the objective function and hence have the potential to increase the value of Z . l f
66
Let us now consider making X1 a basic variable. , g To do this, one of the existing basic variables must become non basic since there can be only two basic variables at any stage. i bl t t To find out which variable is to be replaced, we find the maximum possible value for X1 in equations (1) and (2) (2).
67
68
Of these, only the lower value will satisfy both these the constraints. Hence
2
TTN DoMS, IIT Madras, 3-Sep-09
69
70
When we examine for the maximum possible value of X2 i (3) and (4) we see that X2 l f in d (4), h displaces X4 as basic variable.
71
Here, Here the coefficients of both the non nonbasic variables in the objective function are negative negative. Hence, there is no further scope for increasing the value of Z. So the final solution is
72
73
implemented in a tabular form for greater p g working convenience. This form is also easier for coding and automation purposes. The key features of the tabular form are as follows:
TTN DoMS, IIT Madras, 3-Sep-09
74
Each variable is represented as column. The corresponding coefficients appear in the boxes of the table table. CB = Coefficient of Basic Variable It can be seen that the tabular form is just another way of representing the same set of equations used above
75
76
77
In the row Cj Zj , the positive coefficients for the non basic variables X1 and X2 indicate that the value of Z will increase if one of these variables becomes a basic variable. We choose X1to become the basic variable. This requires one of the existing basic s equ es o e o t e e st g bas c variables to become non basic. In th I other words, X1i th entering variable. W d is the t i i bl We have to find the departing variable.
TTN DoMS, IIT Madras, 3-Sep-09
78
Now, evaluate the ratio bi / aij for all aij >0 in this column. The ratios are 60 / 4 = 15 and 48 / 2 = 24 The minimum ratio determines the departing variable. Hence, i this case X3 i the d H in hi is h departing variable. i i bl The coefficient 4 corresponding operation is called the pivot. to this
79
The next table is obtained by performing the following operations. In the 'basis' column X1 replaces X3. Divide the pivotal row (4 2 1 0 | 60) by the pivot (4). 15) We get (1 0 |
80
To get the X4 row, do the following : Multiply the M lti l th new row j t obtained b th just bt i d by the coefficient in the pivotal column (2). We get (2 1 0 t | 30) Subtract corresponding elements from the old X4 row. That is
81
This constitutes the new X4 row in the table. The Cj Zj row is evaluated as follows :
Zj = CB aij
For example, Z2 = 8 () + 0 (3) = 4 and C2-Z2 = 6-4 = 2 In this manner, all the values of Cj Zj are computed
TTN DoMS, IIT Madras, 3-Sep-09
82
83
At the end of this iteration, the solution reads as X1 = 15 X4 = 18 Z = 120 15, 18, 120, Since the X2 column in the Cj Zj row shows a positive value, we now bring in X2 as the entering variable. t i i bl Proceeding as before, we find 18 / 3 = 6 is less than 15 / () = 30
TTN DoMS, IIT Madras, 3-Sep-09
84
Therefore, 3 is the pivot and X4 is the departing variable. p g The next table is obtained using the same steps described earlier
85
86
Now th solution reads N the l ti d , , X1 = 12, X2 = 6, Z = 132 The coefficients of the non basic variables in the th Cj Zj row are all non positive. ll iti , p Therefore, there is no further scope for increasing the value of Z. Hence th algorithm stops at thi stage. Th H the l ith t t this t The given solution is the optimal solution
TTN DoMS, IIT Madras, 3-Sep-09
87
88
Determine the departing variable as the row p g in which the aij coefficient yields the minimum positive bi / aij (aij >0). 0). The aij corresponding to the departing variable is called the pi ot ariable pivot. In order to obtain the next table, perform the following steps. Divide the pivotal row throughout by the pivot.
TTN DoMS, IIT Madras, 3-Sep-09
89
Multiply this new row by coefficients in the pivotal column and subtract the product from the corresponding old row; Repeat this process till the table is complete. Check if there is any Cj Zj > 0. If so, repeat steps (3) - (7). If not, read off the optimal solution from the last table table.
90
91
(1) Minimization:
One of the most important variations to be p addressed is the minimization problem Consider the following example :
92
We remove the inequalities and rewrite the constraints using 'surplus variables' X3 and X4 as shown below.
93
Unfortunately, we still do not have a canonical form to get this simplex algorithm started. Therefore, Therefore we introduce one more set of variables called 'artificial variables' to create the required canonical form. However, However we also ensure that the artificial variables will eventually leave the basis by assigning them highly unfavorable coefficient values in the objective function function.
TTN DoMS, IIT Madras, 3-Sep-09
94
95
We now proceed to construct the simplex table as p p shown below. The steps are the same except for the following: f ll i (i) The criterion for choosing the entering variable is 'most negative Cj
Zj Zj
(ii) The criterion for optimality is that all Cj coefficients must be > 0 0.
96
97
98
The surplus variable in the second e su p us a ab e e seco d constraint does not give the canonical form. Hence we introduce an artificial variable in this constraint. In the objective function the artificial function, variable has a coefficient -M in order to make it undesirable variable in the final solution.
99
100
3) N Negative bi : ti
101
The negative sign in the R.H.S of constraint (1) posses a problem. Hence it is rewritten, equivalently, as
102
4) E Equation constraint : ti t i t
Consider the following example
103
Either manipulate the existing constraints to obtain a canonical form or simply introduce or, as artificial variable as shown below:
104
105
106
Let X2 = X3 X4, and X3 > 0, X4 > 0. e a d 0 Now rewrite the problem as follows :
107
108
109
110
111
112
113
Here, Here the optimal solution exists but a basic variable has take a zero value. Such a solution is called a degenerate basic feasible solution. Degeneracy occurs whenever we encounter D h t a tie for the departing variable.
114
115
We can see that Constraint 2 is totally redundant redundant. Constraint 3 is redundant but it touches one corner point point.
116
117
118
119
Though we have reached the optimal solution, we see that Cj Zj = 0 for a non-basic variable. This is unusual. If we force X1 as an entering variable and iterate further, we get the following solution
120
121
The solution is different but the value of Z is the same. Plotting the constraints on a graph we find graph, that any point between (0,3) and (7/3, 7/3) is optimal; this is not indicated by 'Simplex' which Simplex gives only corner points.
122
123
In general alternative optimal solution is general, detected whenever for a non basic variable in the optimal simplex variable. We can iterate and find another corner point solution that is optimal. Any point on the line joining those two corner points also gives th optimum. i t l i the ti
124
125
126
After one iteration, we get a table in which , g the optimality condition seems to be satisfied, i.e., satisfied i e all Cj Zj < 0 . However, since the artificial variable is still there in the basis, no feasible solution exists. exists Consider the graphical solution to the problem:
127
128
C ea y, eas b e eg o Clearly, a feasible region does not exist. o e s In general, the presence of one or more artificial variable in the final table confirms infeasibility.
129
130
131
After the first iteration we find that there iteration, is scope to improve the value of Z but
we are unable to find a pivot since there is no aij > 0 the entering variable column. When we plot the constraint, constraint the
132
133
We see that there is no feasible finite optimum since the solution space is unbounded and Z p g y keeps on increasing indefinitely. Generally, the inability to find a pivot indicates unbounded solution solution. But unbounded solution space does not mean infeasibility. i f ibilit Besides, there are problems with unbounded solution space and a finite solution. p Most minimization problems can be seen to be of this kind.
TTN DoMS, IIT Madras, 3-Sep-09
134
Note: In rare cases, a situation like this may indicate infeasibility. While unbounded ness nbo nded true. non-existence non e istence of a pivot, the converse is not always
135
136
137
138
139