0% found this document useful (0 votes)
55 views49 pages

LP

Uploaded by

orodizodanielo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
55 views49 pages

LP

Uploaded by

orodizodanielo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 49
Frames Optimization oe and linear programming Learning outcomes When you have completed this Programme you will be able to: Describe an optimization problem in terms of the objective function and a set of constraints ‘* Algebraically manipulate and graphically describe inequalities # Solve a linear programming problem in two real variables ‘Use the simplex method to describe a linear programming problem in two real variables as a problem in two real variables with two slack variables ‘© Set up the simplex tableau and compute the simplex ‘¢ Use the simplex method to solve a linear programming problem in three real variables with three slack variables Introduce artificial variables into the solution method as and when the need arises ‘* Solve minimisation problems using the simplex method ‘© Construct the algebraic form of the objective function and the constraints for a problem stated in words 940 Optimization and linear programming 941 Optimization An optimization problem is one requiring the determination of the ‘optimal (maximum or minimum) value of a given function, called the objective function, subject to a set of stated restrictions, or constraints, placed on the variables concerned. In practice, for example, we may need to maximise an objective function representing units of output in a manufacturing situation, subject to constraints reflecting the availability of labour, machine time, stocks of raw materials, transport conditions, ete. Linear programming (or linear optimization) Linear programming is a method of solving an optimization problem ‘when the objective function is a linear function and the constraints are Tinear equations or linear inequalities. In this Programme, we shall restrict our considerations to problems of this type that form an important introduction to the much wider study of operational research. Let us consider a simple example, so move on to the next frame A simple linear programming problem may look like this: @ Maximise P=x+2y (objective function) subject to y <3 xHys5 ; weave f onsteaints x20;y20 ‘The last two constraints, Le. x20 and y>0, apply to all linear programming (LP) problems and indicate that the problem variables, x and y, are restricted to non-negative values: they may have zero or positive values, but NOT negative values. These two constraints are often combined and written x, y > 0—or omitted altogether since they are taken for granted in all LP problems. Before we proceed, we will take a brief look at linear inequalities in general. On, then, to Frame 3 942 Programme 23 GD Linear inequalities In most respects, linear inequalities can be manipulated in the same manner as can equations. (a) Both sides may be increased or decreased by a common term, e.g. Q12 3, 2x4+3y>6 But NOTE thi (© If both sides are multiplied or divided by a negative factor, e.g (-1), then the inequality sign must be reversed, Le. > becomes < and vice versa Here, then, is a short exercise. Exercise Simplify the following inequalities so that each right-hand side consists of a positive constant term only. (@ ax-S<4y (©) 2(x+2y) <-8 (© 4x-6y<-10 @ 2x4+3>-Y+4) (© ~(-3y+5) 22x +4y-6 ‘Check the results in the next frame 6 (@) 3x-4y<5 () -x-2y34 © -2x43y25 (@) ~2x-ys7 © axtys1 Graphical representation of linear inequalities Consider the inequality y ~ 2x < 3, Wecan add 2x to each side, so that ys2x43, ‘The equation y=2x+3 can be y represented by a straight line divid- 19 we ing the x-y plane into two parts. xy For all points on the line, 5 3 ya 243. For all points below the line, Optimization and linear programming 943 y< 23 SB y<2x+3 indicates all points on or below the straight line, but ‘excludes all points above It. We can indicate this exclusion zone by shading the upper side of the line. Arguing in much the same way, x—2y <2 can be rewritten as 1 and shade in the y23—1 and we can draw the Tine y= exclsion zone ‘The problem we quoted earlier in Frame 2 was Maximise P=x+2y (objective function) subject to y<3 x+y <5 x= 2y<2 x20;y20 (constraints) Now, on a common pair of x and y axes, we can represent the five constraints and shade in the exclusion zone for each. We then have the composite diagram 944 Programme 23 ‘The coordinates of all points on the boundary of the polygon OABCD, ‘or within the figure so formed, satisfy the system of constraints. The set of variables for each such point is called a feasible point or feasible solution and the figure OABCD is the feasible domain ot feasible polygon. Note these definitions. Our poem now sod the prc pine win ds domain Ghat ates the ebjecve funcon Po'rray 2 maximo, The TP 272 parle ins with diferent values of the intercept, equation can be rewritten as and this represents a set of I we draw one sample line ofthis set to cross the feasible polygon we have just obtained, we get, using P= 3 Optimization and linear programming 945 We can increase the value of P and hence raise the objective line up the page until it passes through the extreme point C. Any further increase in the value of P would take the line outside the feasible polygon and hence fail to conform to the given set of constraints. oa tA ae In this example, then, point C gives the optimal solution. From the graph it can be seen that the line with maximal P passes through the point of intersection of the two lines y=3 and y=-x+5. This means that y= 3, x= 2 and 50 Prax = x+2y =8. A graphical method of solution is clearly limited to linear programming problems involving two variables only. However, it is a useful introduction to other techniques, so let us deal with another example, Example 2 Maximise P=x-+4y subject to -x+2y <6 Sx44y < 40 nuy20 First of all, plot the appropriate straight line graphs to obtain the feasible polygon. This gives, The objective function P=a+4y an be expres nthe fom 52 and its raph aed tothe feasible pejgon, 2s belo. We then ota Optimization and linear programming 947 fom the graph it canbe seen thatthe le with maximal P pases through the point of ineection of the two Ine y=2-+3 and yo Spotty 8 nd Pn +4y = 24, As easy as that. Now this one. Example 3 Minimise At oy subject to —x + 6y>24 2x-y<7 x48) <80 x20 Itis very much as before. Complete it on your own. Prin =6 with x @ To obtain the minimum optimal value of P, the graph of the objective function is, of course, lowered to the appropriate extreme point. In practice, linear programming problems usually contain many more variables than the two we have so far considered and a computational method is then required. One such technique is the simplex method and the remainder of this Programme will be devoted to the steps necessary to put it into practice. So move on to Frame 14 948 Programme 23 The simplex method ‘The first step in the simplex method is to ensure that each constraint is written with a positive right-hand side constant term. Then we express all inequalities as equations by the introduction of slack variables. For example, —x+2y<6 canbewritten —x+2y+m =6 and Sx+4y <40 can be written Sx+4y +» = 40 where w; and w2 are positive (or zero) variables with unit coefficients, required to make up the left-hand side to the value of the right-hand side constant term. The new variables, w: and wz, are called slack variables. Let us look again at the problem we solved earlier Example 1 Maximise = P=x+4y subject to —x+2¥<6 Sx+4y<40 (as always, x, y>0) ‘The constraints now become -x+2y+w: =6 Sx+4y +2 =40 and the objective function P—x~4y =0 From this, we can now begin to form the simplex tableau (or table). So make a note of the above information ~ and then move on (GBD setting up the simplex tableau (@) Framework First construct a framework with the headings shown. Next, we enter, in the framework, the coefficients of the problem variables and of the slack variables in the constraints, together with the right-hand side constants in the column headed b. (ignore the check column for the time being.) So we have Optimization and linear programming 949 Problem Slack (ig) variables variables Const. xy mw | b | check | a2 1 ~«0/6 5 o 1} 4 body unity matrix (b) Check column The right-hand side column Is included to provide a check on the numerical calculations as we develop the simplex, so, for each row, total up the entries in that row, Including the constant column, and enter the sum in the check column. Do that 50. (©) Starting basic solution The two constraints now contain four variables, but if we start by letting x and y each be zero, then we have the temporary solutions, ws these variables in the extra left-hand and w2 = 40, and we indicate side column, as shown, ‘The columns with the slack variables form a unity Note (1) matrix. (2) There are now four variables, x,y, wi, We (n= 4) @) There are two constraints (m = 2). @) equal to zero as a start. We put (n—m) variables, Le. two variables (x and y), Finally, we have to deal with the objective function, (@) The objective function The objective function, P written P — x — 4y = O and the coeffici 0 move on to the next frame x+4y, is jents of this form the bottom. tow, or index row, of the tableau, thus [lise [xy wwe [> | ek Jw |-1 21 0f6] 6s m | s 40 2 [wo] 9 P [1-400 fo [-s ‘Complete your tableau, if you have not already done so, and then wwe will see how the computation is ¢: arried out. ‘Computation of the simpl Programme 23 1. First we select the column containing the most negative entry in the index row: in this case ~4. This is called the key column and we enclose it as shown. Basis | xy wi _w2 [|b | check wm [-1;2]1 0]6| 8 w | s|4{o 1 |40 | so Pp [-ilalo o [0 [-s key column. 2 In each row, we now divide the value in the b column by the positive entry in the key column: the smaller ratio determines the key row. 6 For row 1 (m1), 1 a *. row 1 is the key row. row 2(0s), r=f0= 10 Baclse tas shown Blow. prot rass | xy fmm |d | crak wi T[2] 1 0 |6| 8)+~keyrow We. 4/0 1 |40| so P 1[-aJ oo fo |-s ‘The number at the intersection of the key column and key row is, the key number or pivot: in this case the number 2. 3 Wenow divide all entries in the key row by the pivot to reduce the pivot to unity - which we then circle. The new version of the key row is sometimes called the main row. The rest of the tableau remains unchanged, so we then get (Go) unit pivot Basis | x_y Jwn_wa |b | check wm P @ 403) 4 [man row w | s 4 0 1 |40 | 50 P_[-1 -4 0 0 | 0 [-s [index So far, so good. Now we deal with the actual calculations. Next frame Optimization and linear programming 951 4. Using the main row, we now operate on the remaining rows of the tableau, including the index row, to reduce the other entries in the key column to zeto. Note that the main row remains unaltered. The new value in any position in the other rows, including the b column and the check column, can be calculated as follows: ‘New number = old number — the product of the corresponding entries in the main row and key column O] | maniow K is replaced by K — (A x B) BrK For example, in the second row (w:): S is replaced by 5 —(—})(4)= 5+ 4isreplaced by 4-(1)(4) =4- 0 is replaced by 0-(3)(4) =0- Lis replaced by 1-(0)(4) =1-0 40 is replaced by 40— (3) 4) = 40-1: ‘80 is replaced by 50 —(4)(4) =50- and, in the third row ( =1is replaced by ~ 1 ~ (~}) (4) = -1-2=-3. Completing the operations for rows (ws) and (P), we have Basis [xy wi we [b | check m f'a g0 fa] 4 wm | 70 -2 1 |28 | 34 Pp [-30 20/2] nu ‘Now confirm that the new values in the check column are, indeed, the sums of the entries in the corresponding rows. Ifnot, there is a mistake somewhere in the working to be corrected before we proceed. If all is well, move on to the next frame 952 Programme 23 5 Change of basic variables In its final form, the key column consists of a single 1 and the remaining entries zero. This is in the column headed y which indicates that the basic variable w; in the main row can be replaced by y. Basis | xy wi we [b | check ym [dir yof3] 4 w | 7 0 -2 1 |28 | 34 Pp [30 20 fez] u Note that there are two columns containing a single 1 and the rest 0. These are headed y and wz which are now also the basic variables in the left-hand side column. Reading the values in the column therefore gives a basic solution y = 3 and w = 28, and at this stage P = 12. Any variable not listed in the basis column is zero. One basic solution at this stage is therefore x=0, y= 3, Ww, = 28. However, we are not finished. ‘The index row (P) still contains another negative entry, so we have to repeat the simplex process using the same steps as before. Basis check es “| we 34] |= key row P 1 Now divide the key row by the key number (7) to reduce the pivot to a unit pivot. This gives Basis w2 [b | check y 0 4 We, 4 3 | main row P oj2i[u Using the main row, operate on the remaining rows (including the Index row) to reduce the other entries in the key column to zero. Complete that stage and we have Optimization and linear programming 953 Basis [x ym we [b | check] 5) y ot eas #| w {10-7 3} 4] ¥) P_[oo § # || # | Again, at this stage, check your working by totalling up the entries in each row and satisfy yourself that the sum agrees with the value in the check column. Note that wz in the basis column can now be replaced by x which was the heading of the column containing the last unit pivot. So finally, we have Basis |x y wi ws |b | check y for aals| ¥ x |10 33/4] ¥# bo oo § 3 ja | me Anew basic solution now emerges as x = 4, y = 5. Furthermore, since there is no further negative entry in the index row, this is also the optimal solution and the optimal value of Pis given in the b column, Le. Pmx = 24. For interest, you may wish to compare this result with that obtained in Frame 12. ‘We have been through the simplex operation in some detail by way of explanation. Many problems involve more than just two variables, but the method of computation is basically the same, being an iterative process which is repeated until the index row contains no negative entry, at which point the optimal value of the objective function has, been attained. ‘The problem we have just solved would normally look like this: Maximise P=x+4y subject to. -x+2y<6 Sx+4y<40 (x, y>0) ‘ables, etc, this is written Entering slack v. a+ 2y hw 6 Sx+4y +w2=40 Pox-4y =0 ‘The complete tableau is given in the next frame w @ 1 oO ym 0 we 1 P 0 ym 0 me i P po 20 {2] nn y of 3] 4 m pial ¥ P| 3 20 {2 { y otaal sl # xm | 10-73 | 4] # P oo § 3 iu] R Paay = 24 with x=4, y= 5 ‘Now for another example - so move on to Frame 28 Here is one for you to do on your own. The method is just the same as before so you will have no difficulty. Example 2 Maximise P= 4x+3y subject to —x+ y<4 x42y <4 2+ yE16 (%y>0) We have three inequalities this time, so we shall need to introduce three slack variables. Converting the inequalities into equations, we obtain Optimization and linear programming 955 ‘Then we set out the simplex framework with appropriate headings, i Basis | x y wi we ws | b | check Remembering that the index row uses P ~ 4x ~ 3y = 0, we can set out the first tableau. Choosing x and y, as usual, to be zero for a start, we have Basis [xy wi Wa ws | b | check wm i-1 1 1 00f[4] 5s w | 1 2 0 1 0 || ws | 2 1 0 0 1 |16 | 20 Pp [-4-3 0 0 0 | of-7 | Carry on now and complete the working on this first tableau, Check with the next frame 956 Programme 23 (33) Here is the working so f | [Basis [xy wi w2 ws | b | check ™ lpipira oo fa] s w |fa] 201 0 |u| a ” 001 a6 | “20 ? oo 0 | o|-7 wm [1110 0] 4] s w | 1 201 0 |u| ae Low @ioo 3} 10 p_[-4 30 0 0 | o| 7 wi 0 10 4 | wl] os We 0 o 1-3 6| 8 xs 1 oo 4 10 SO (a) The basic variable (ws) of the unit pivot can now be replaced by the variable at the heading of the unit pivot (2). (b) We see there is still a negative value in the index row, so we repeat the process for this second tableau. ‘Now you can finish it off Optimization and linear programming 957 Check to see if you agree. (33) Basis [xy wi wm [b | check m | 0 1 0 3 /2fis we \[o] 3[ 0 1-4 | 3] x |a/3f0.0 43 10 P| ol-1 o 0 2 | 32 33 aa) ro ¢ |els m | 0 og -} | al ¥ x 1 oo ¢ 8 | 10 ° oo 2 || x m fo oO 2 1 [67 ywe o 1 0 § =} ip x [1 0 0 -} 3 2 Pp [oo 0 % § [3 | 4 ‘The basic variable (w2) can now be replaced by y, being the heading of the unit pivot column. ‘There is no further negative entry in the index row: therefore, the ‘optimal value of P has been attained. Px =36 with x=6,y=4. Note: We also see that wi = 6, since the unity matrix has headings x, y, ‘w;. The full result, therefore, is Pox =36 with x=6,y=4, w, =6, W2=0, 3 =0 though we do not normally require this extra information. ‘The meaning of w;=0 and wz =0 is that the second and third constraints become x42y=14 and 2x+y=16 respectively rather than x42y<1dand 2x+y<16. ‘The meaning of wi = 6 gives the first constraint as —x-+y < 14 rather than -x+y < 14. ‘Now we will extend the simplex method to an example involving three problem variables. Next frame 958 (84) simplex with three problem v: Programme 23 Maximise P = pix+ poy + p3z subject to anx-+aray + arsz
[ae Bela] Rel me Bh of] = 9. 0 0 1 0 0 0 1 0 0 ° 1 0 0 ° é 0 Be rt 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 9 eB) ero] 0B ry t s 4 2 3 s —4 @lelo © 3 6 1 2 g 4 1 2 Se pln] oe ae t Ifo, on to the next frame 42 3x4 4y +52 %Y,220 5. Pmax = 60 with x=0,y Axt y+ 2548 a+ y+22< 40 P 2x+4y +32 < 80 It Is much the same as before. Work through it carefully and then check with the next frame. Do you agree? Example 2 Maximise subject to (39) 961 Optimization and linear programming = : = : asad ea aga j a © ah ailghle [R] 8 |] ate oe | ree te ately |g aislels 2 aclela aigiz x alg/lelslsl=- e/alse ze gle o_o |e © fe beep melee pfeil eae meme a an tle +Jclele « cfele|- olele = ofe/o|-/olo g) afele|= 2 2//=]o o/lm © ofc fell lela neal tas Fase] <@lylele «ele o =lelele|=|ele o «Jojo o alo ale lale|= se ERO mbelnlolelo[=o efe|+ © ele ' ' 7 ' Refer cel eallep |ea se en] ep braalnas caalalran ete cal -aeloto ste ewe tel tn) sunlranlo mt © o> Else elaleselaleg glleeslalg eg sfalae 5 ye Dan", y 113 with x=5, ‘Now let us meet a further complication. Pax Next frame 962 Programme 23 Ww Artificial variables So far, our approach to each problem has been the same. (@) We first ofall convert the ‘less than’ inequalities into equations by the inclusion of slack variables. (b) If there are now n variables and m constraints, then atleast (n—m) variables are equated to zero ~ usually x, y, z, etc. ~ so that the initial basic solution is given by the slack variables, the coefficients ‘of which form the unity matrix in the tableau. (©) We then proceed by the simplex method to convert the basic solution to one containing the problem variables, the tableau entries for which now form a new unity matrix. (@) The method is repeated as necessary. When no negative entry remains in the index row, the value of P denoted in the constant column is the optimal value of the objective function. Now let us look at this example. Example 1 Maximise P= 7x-+4y subjectto 2x+ y< 150 4x43y < 350 x+ yz 80 (,y>0) Converting the inequalities to equations, we have @) 2x+ ytw 50. ax43y +e xt y aws= Also, of course, P— 7x ~ 4y =0. NOTE that since the third constraint is a ‘greater than’ statement, we ‘must subtract the slack positive variable (ws) to form the equation. Alternatively, we could have written the inequality as —x— y < -80 so that —x—y-+ wy = —80 and so x+y ~ ws = 80. Forming the first tableau, in the usual manner, we obtain Optimization and linear programming Basis [xy wi wa ws | b | check m | 2 11 0 0 | 150 | 154 w | 4 3.0 1 0 | 350] 358 ws 1 10 0-1] 8] 81 p [7-40 0 0| of 1 Now we are stuck, for we do not have a unity matrix to start off with, The entry in the ws column is -1 and not the necessary +1, and no amount of manipulation will help since the entries in the constant column (b) are, by definition, positive. So how can we find a starting technique? Let us restate the problem. Maximise P= 7x+4y subject to 2x y+ 4x4 3y xty The trouble comes in the third constraint by virtue of the negative sign of the slack variable. To save the situation, we introduce a new small positive variable (w,) so that w1,w2 and w4 will give rise to a unity matrix and the simplex computation can then proceed. Of course, ws is ficticious, is extremely small and cannot appear in the final basic solution. To establish this, we include in the objective function a new term —Mwi, where M is an extremely large positive value which will ensure that ws will ultimately vanish. So we now write = 7x4 4y —Mivg ‘The new variable, ws, is called an artificial variable: itis introduced solely so that the simplex procedure can be carried out; and it must not appear in the final basic solution listed in the basis column. ‘The third constraint above now becomes x+y = ws +4 = 80 Next frame 964 Programme 23 s) We now have 2x yew 150 4x+3y =350 xy -w+ w= 80 P-7x—4y +My = 0 Forming the tableau in the usual way: Basis | x y mi W2 ws wa | b | check mi 2110 0 0 | 180 154 We 43.0 1 0 0 | 350 388 ™ 110 0-1 1] 8% 82 p [-7-4 0 0 0 M{ o|m-u Note that: (2) The columns headed w1,12, Ws now form the unity matrix. (2) There are now 6 variables and 3 constraints, ie. n= 6 and m= At least (n"— m), Le. 6 —3 = 3, variables are put equal to zero. We start off with x, y, ws as zero and w;,W2,ws form the first basic solution with the values given in the b column. ‘We now proceed in the normal way. Solve the first tableau and check the results so far in the following frame. Optimization and linear programming x yw we we wm | b | check | » [[2]i 1 0 0 0 | 150] 1s4 wm |[4[3 0 1 0 0 | 350] 358 wm |[al)1 0 o-+ 1] 8 | 2% P [e740 0 0 M| of wu wh @} 3} 0000 78 7 m | 4 3 0 1 0 0 | 350] 358 m | 1 1 0 o-+ 1] 8 | 8 ep [7-4 000ml] ol mu xm [| 1 $$ 000) 5; 7 m | 0 1 -2 100] so} 50 wm | o 4 -} o-r 1] 5 8 Pp |o-} 4 0 0 m | 25 | M+s28 The basic variable w can be replaced by x and we continue as before to remove the further negative entry in the index row. Do that Basis | xy wi Wz ws wa |b | check x [ips] 20 0 0 | sl 7 w |o|1| 21 0 0 | so] 50 » |fo[$[ $03 2 5 5 P [old] 3.0 0 M | sas | Mssa8 x $+ $0 0 0 | | 7 wm }o 1 -2 1 0 © | so] 50 m |o @ 10-2 2 | w| Pp [o-} $0 0 ™M_| s2s | m+sa8 x {1 0 10 2 4 | | 7 wm |o 0 11 2 -2 | | 40 ym |o 1 10 2 2 | w{ P [0 0 3 0 -1 M+i | s30 | m+s33 ‘The basic variable ws is now replaced by y (the column of the last unit pivot). We now have another negative entry in the index row, so we have to perform the simplex calculation yet again. For the next round, we get 966 Programme 23 x 7-1 || 7 we 2) -2 || 4 y =f 2 [10] 10 P =1|M+1 | 530 | M+533 F 1 1 || 7 we @® a || 2» y 2 2 || P Tr Mt [530 | as x oo [so] s wm 1 -1 | 2] 2 , oo | so| 5 P om [580 | mrss No further negative entry remains in the index row. The optimal solution has been found, i Prax = 550 with x= 50, y = 50. In addition, we see that ws = 20 while w; = w2 = w= 0 since they do not occur in the basic variable column. Notice, also, that ws, the artificial variable, does not figure in the optimal solution ~ as indeed it must not. Next frame wy Here is one for you to do in the same way. Example 2 Maximise P= 2x + Sy subject to x+4y<60 Be42y <40 x+ y212 (wy20) Work right through it, just as before. The result is 967 Optimization and linear programming Because aay tn 3r+2y xt y P-2x-Sy B|8 3[= B]ee |S) et] S)nl sal S| on ae cee fae ae el = = = = = sig sisfolsj2 sig/> 2 sjg/-iejejei- + slele + sle slo el-lairl9 jel 9 <[tltlejelala © efa|q ols gle elalelFls s/4JOs s]4|-Jelele|= © e]e|n © ole sie -lefele|= efele = ejele|=jelele mofo fee om -p]ne t 25 (x,y 20) Inserting the slack variables and artificial variable as required, we have ) 2x4 3y + =120 ay tM 45 ax45y 28 P—8r—4y ° ‘That Is very much as before, so wotk through it and check with the next frame, GS) teens [Basis [ x yw wy] Dc m |Pa.31_0 0 0 | 120 | 126 » |[@10 1 0 0) | 4 w |[-sfs 0 0-1 1 | 2 | a > |bsl-a 0 0 0 w | o| M-1 ™ | 0 11-20 0] 9%] 2 xm | 1 101 00/45] 48 whim | oo 80 3-1 1] 160] im > [0 4.0 8 0 m | 360 | mare There is no further negative entry In the index row, so it looks as though the optimal solution has been attained. However, the artificial variable w, still remains in the basic variable column at * and thus ‘must be removed. Therefore, we take the entry at the junction of the y column and the w, row as the pivot and proceed to eliminate ws by simplifying the tableau a stage further. If we do that, we get Optimization and linear programming 969 is b check ey Basis | xy wi We we m [O1i2 0 0 | 30] 30 x |1101 0 0 | a] 4 view |ofs}o 3-1 1 | 160 | am Pp [040 8 0 M | 360 | M+a72 m [o11-2 0 0 | 30] 30 x |1101 0 0 | a] 4s sm |oMo fF -} & 20 yt Pp [o4 0 8 0 M | 360 | M+372 m foo 1-e yf -F [ wl F | x {100% g -§ | sl] @ | yu [O10 g-2 fF | sol Pp [000 ¥ } M-}| 20 | +e ‘The artificial variable, ws, is now replaced by y in the basic variable column and the optimal solution has been reached. 80 with x=25, y =20. Powe = Next frame ‘Now here is one for you to deal with. (5) Example 4 Maximise P= 10x+2y subject to -x+2y< 60 Sx+4y < 260 14872 80 (20) ‘Work through it as before and see if you agree with the solution in the next frame. Programme 23 970 = 0 wt m= 80 +My 5 ; eee tat at & i g 1 “ mesls ex glSle § i Be (Rja|s 25 5/2/83 3 as]C lee als = = = = =/8/g/3/° 29 slgjs a zigje s zg ce) Z}oljol-a|= © oO A] R]o oO oR] S [NRE oR] PFI slelelele 2 2 g]e]e 2 sfelan esl gle|-lole an can cancun ean ex fey ots et slnlolele myer =|=fela|=|etetele ale |sfefe th wo [a e@lelo o -lo Tse 2 « elele = clele ~ ole AT Pre | | 2 Ble gf sis = alex giale os gle f y= 15. 1. Prax = 430 with x ‘Now for another example Optimization and linear programming 971 Exampl ‘This one is slightly different, so take note. Maximise P= 11x+Isy subject to 3x+Sy < 130 ~4x + Sy > 25 x+5y2 75 (420) In this problem, notice that there are two ‘greater than’ inequalities so that there will be two slack variables to be subtracted and two artificial variables to be incorporated. In the objective function, we can use the same factor, M, for both artificial variables, since neither of those two variables will appear in the final optimal solution. So, we have: But Sytm = 130 mat Sy mt xt Sy —Ws P-x-1sy +My +Mws= 0 ‘W1, Wa, Ws now form the unity matrix from which to start. The method is just the same as in previous examples, so finish it off. Programme 23 972 ale 8 2 8 a Ey El 1} B/S a B43 He Si t]s is a] s ie = a] tle aes a a a a a a a oie” #l°|8 “[ajele * 8/e)aie lala 2 elgia sig = = = |= = Be = o|a|zlo oc =|xlo of-|sle > +| rere £ | 37 : ofzle = elz]7 -ls]2]s 412 z P zlele 2 slele ol-fele > ele ie : elefe welo|= aala|= ple wanna fe : ° on clofe|= 2 cfofale ofolmo ole fm xfer] a ule slofele = clofe|- clelo = elele ~ ele ‘ | TF lsle v-leh alals Olalele [ele © -lele © |e | ale = sisfe g gls|e g elaje ~ glaje ~ glale = «ales «le =15, y=17. 20 with x Prax So there itis. 2 i = i = Incidentally, also, ws = 25 and wy Optimization and linear programming Our examples on the use of artificial variables have so far concerned only two problem variables, x and y. The method, however, is exactly the same when more problem variables are involved, though, naturally, the solution then becomes somewhat longer. Here is one for you to work through: it brings in most of what we have covered and provides excellent revision. The result is given in the next frame. Example 6 Maximise P = 24x + 21y +302 subject to 12x-+4y +82 < 240 8x4 3y 432 < 140 6x+2y+3z2 110 (x, y, 220) Prax = 750 with, 10, y=10,2=10 ‘The simplex technique is designed to maximise a given objective function in the light of stated constraints. However, a problem requiring the minimisation of an objective function (denoting costs, machine idling time, etc.) can easily be converted for solution by the same method. For this, move on to the next frame jisation If P denotes the objective function to be minimised, we write Qas the negative of this function. Qnax is then determined by the usual simplex method and, finally, the negative value of Qnax is the value of ‘the required Prin. Write Q = ~P. Determine Qnax in the normal way. Then Pain = ~(Qaus) Example 1 Minimise P= —3x+4y subjectto x43) <54 Bet ys34 -x+2y212 (x, y20) First write Q=-P, ie. Q=3x~4y, and maximise Q Inserting the usual slack variables and artificial variable as needed, we have 973 974 Programme 23 B x34 = 54 Bet y tw 34 x4 2y -Ws+ ma =12 Q-3x44y +Miny = 0 Now we just carry out the usual simplex routine to evaluate Quax and hence Pmin, SiNC€ Prin = ~(Qmaz)- Poin = -- &) Prin =16 with x=8,y=10 Because Qnax = —16 and hence Pain = —(Qnue) = 16. ‘The full working is available in the next frame, should you need to refer to it. If not, move straight on to Frame 65 (4) {Basis a b check xy ™ [ja 10 0 0 54 59 w [37 o 70 0 34 39] 2 1 2 B 4 M o | wat 31 0 4 39 40 ° ¥ 1B 20 1 2 13 Q |-3 40 mu | o | Mei wm [OF 1 0 ra 46 xm | 14 0 o ¥ 13 +e im | 0] 0 1 g 26 @ [oso M34 [om [oer oO x |1qgo 0 ™ |0@o } @ [oso M m [001 J x [100 + ym | 01 0 3 @ fooo M-§ | 16 [™—3 | Optimization and linear programming 975 Minimise P= -2x+8y subject to 3x +4y <80 -3u+4y> 8 x+4y240 (x,y 20) Note that we have two constraints that are ‘greater than’ inequalities, so, beside the slack variables, we shall need two artificial variables. ‘The three constraints in their new form therefore become 3x4 4y + ~3x+4y x+4y and, in the subsequent manipulation, we must see that ws and ws disappear from the basic solution before the optimal solution is obtained, ‘The objective function P is now replaced by Q form of Q is written as Q— 2h B+ Ming + Mins = 0 @ Q=-P=2x-~8y and with the artificial variables Q = 2x ~ 8y ~ Mw Q- 2x4 8y + Mwy +Mws =0 In this example, w;, 4, ws will form the unity matrix, so work ‘through the solution in the usual way. Simplify the initial tableau and then refer to the next frame. =P) and the new Mws. 976 Programme 23 x ym Wa wm ws » [341 0 00 0 ™ [3)4 0 a 01 0 ws [if4 0 0-101 @ [aso MM m [Os 4 oo wm |-3 4 0 -1 010 w |14 0 0-10 1/40] 4 q@ [28 0 0 om ™M| 0| am+6 xm [1 $ 4 oo} ? vtem [08 1-1 01 0 | 88] 97 sim [og-} oro ile] ¥ q [o#% 0 om m | @ | ams [At this stage, there is no further negative entry in the index row, but ‘we still must get rid of ws and ws from the basic variable column. Let us start by dealing with ws ‘We will take the entry § at the intersection of the ws row and the y column as the next pivot and launch forth on the next stage. ‘Complete the second stage and then again refer to the next frame. ez) Here is the working of stage 2. Basis |x y Wi W2 Ws Wa ws |b | check x {1$ $000 0/8 3 wm |o8 1-1 0 1 0 | 8] 9% ws |ofg]-} 0-1 0 1 | 4 g q [oF 3 MoM | i@ | om4ig x Jagd oo || # wm |o8 1 1 0 | ss] 97 ws, o@ -} o $s 4g q [oF ¢% MM | 3@ | om+ie x 10 43 o -} | 2 = tem | 00 2 1 -3 | 8] so ys, o1 -} o Ss ¥ Q@ [oo 2 M M-4| 0 | 2M+2 Optimization and linear programming 977 [At this point, ws is replaced by y in the basic variable column. Now we deal with w, by taking the entry 2 at the junction of the ws row and the w; column as the next pivot. That should do the trick, so finish off the Solution and check with the next frame. Prin = 48 with (70) [Basis |x y wi we Ws Wa Ws b check x |10 3 03 0 4 2] stem [00 B]-1 3 1 3 4s | 50 y |O1-) 0 -% 0 a $s = q@ [oo 2 04 M 0 | M42 “x [10 4 0 $ oO. | 2] m [oo @-+ 2 3 ma] 25 y |o1-} 0 -3 0 s|_ ¢ q@ [oo 2 04 mM 0 [ 2ms2 x [|10 0 4-4 -4 8 9 nw [OO 1 -$ 3 2a] 2s y [o1 0-$-% 4 8 9 q@ [00 0 1 1 M-1 M-1| 48 | 2-48 wq in the basic variable column is now replaced by wi, so the conditions are satisfied at last. From the final tableau, we have Qrax=—48 But Poin = —(Qoosx) = 48 » Pain =48 with x=8, y=8. By this means, then, we can solve minimisation problems by the simplex method and so widen the scope of this valuable technique. Applications So far we have seen how to solve a typical linear programming problem by the simplex method, when the data are presented as a linear objective function and a number of linear constraints in the form of equations or inequalities. A practical problem, however, must first be interpreted into algebraic form and we conclude the Programme with a brief reference to this initial requirement. Let us consider the following example. 978 Programme 23 Example 4 A firm manufactures two types of couplings, A and B, each of which requires processing time on lathes, grinders and polishers. The machine times needed for each type of coupling are given in the table. Coupling | __Time required (hours) pe Lathe | Grinder | Polisher a 2 8 5 B s 5 2 ‘The total machine time available is 250 hours on lathes, 310 hours on grinders and 160 hours on polishers. The net profit per coupling of type A is £9 and of type B £10. Determine (@) the number of each type to be produced to maximise profit (b) the maximum profit. If we let x = the number of type A units to be produced = the number of type B units to be produced. the objective function to be maximised can be expressed as (E23) P=9x+10y "Now we have to sort out the constraints from the given data. Total time available on lathes = 250 hours 5, 2x+Sy < 20 (lathes) Similar statements for the grinders and polishers are ... ® or+5y = 310 (ginder) 5x+2y < 160 (polishers) ‘The problem now can be expressed as Maximise P= 9x +10y subject to 2x+Sy < 250 8x+5y < 310 Sx+2y <160 (x,y >0) Then we go through the usual process. Inserting slack variables to convert the inequalities into equations, we have Optimization and linear programming 979 2x4 Sytm = 250 4 and the solution then develops in the usual way. Work through it carefully - itis all good practice ~ and see if you agree with the result given in the ‘The result is The maximum profit of £550 occurs with a manufacturing schedule of, 8x+ Sy tm, = 310 Sx4 2y +W3 = 160 next frame. P—9x—10y 0 Pmax = 550 with x= 10,y=46 10 couplings of type A and 46 couplings of type B. Now for another, so move on. Example 2 A firm produces three types of pumps, A, B, C, each of which requires the four processes of turning, drilling, assembling and testing, Pump Process time (hours) per pump Profit per 9 Taming | Dring | assmbing | Teng | PMP A 2 1 3 | 4 84 » | ada 4 3] 2 eee 2 2| 2 Total waite 8 | 60 | us | 160 time (h/week) From the information given in the table, determine (a) the weekly output of each type of pump to maximise profit (b) the maxis So, if we let imum profit. the number of pumps, type A y= the number of pumps, type B the number of pumps, type C ‘we can interpret the problem into its algebraic form, which is (75) 980 Programme 23 Bw Maximise P= 84x-+72y-+52z subject to 2x+ y-+22< 98 xt yt zs 60 3x4 dy +22 < 145 Ax+3¥422<160 (x, 9,220) Inserting the slack variables and expressing the problem we have as equations, a) Qxt yh Qt = xt yt 2 Bxt Ay 22 4x4 By 22 P= 84x ~ 72y — S22 +m +m Now you can proceed to set up the simplex tableau and solve the problem on your own in the usual manner. It is very similar to the other examples you have worked earlier in the Programme. ‘The result you no doubt get is wy Poax = 3652 with x=23, y=8,2=22 L.e. by producing 23 pumps, type 8 pumps, type 22 pumps, type the maximum profit of & 3652 is A B i} attained. Care with the calculations and constant use of the check column, provide the key to avoiding errors in the working. That completes the Programme. Check down the Revision sum- mary that comes next, in conjunction with the Can You? checklist, before working through the Test exercise that follows thereafter. As ‘usual, a set of Further problems provides further necessary practice in these useful techniques, Optimization and linear programming 981 Revision summary 23 a) 1. Optimization — determination of an optimal value (maximum or minimum) of an objective function subject to a set of constraints, 2 Linear programming (linear optimization) ~ optimization where the objective function is a linear function and the constraints are linear equations or linear inequalities. 3 Inequalities - multiplying or dividing both sides by a negative factor (—K) reverses the inequality, ie. > becomes < and < becomes >, 4 Problem variables (x, y, z, etc.) are always non-negative. 5 Feasible solution — a set of variables that satisfies all the given constraints 6 Optimal solution - a feasible solution for which the objective function becomes a maximum (or minimum) within the constraints, 7 Basic feasible solution ~ a feasible solution for which at least (n ~ m) of the total variables are zero, where total number of variables in the constraints ‘number of constraints. 8 Basis — collection of the m variables which are not put equal to zet0. 9 Basic solution ~ solution obtained by equating ( ~ m) variables to zero and solving for the remaining m variables. 10. Graphical sotution (@) Constraints — graphs of constraints form the feasible polygon or feasible domain, ° a 7 Feasible point or feasible solution — coordinates of all points within the feasible polygon or on its boundary (OABCD) (© Objectvefuncion P= ary y= ta represented 8 rep tne thous by a set of parallel lines, slope — B the extreme point C gives Pinax, the optimal value of P. 982 Programme 23 1. Slack variable ~ non-negative variable added to, or subtracted from, a linear inequality to form a linear equation. 412 Simplex method of solution — computation. Refer back to Frame 34. Where necessary, we multiply an inequality by (-1), with consequent reversal of inequality sign, to ensure that the right- hand side constant term by > 0. 13. Artifical variable - to convert a ‘greater than’ inequality to an equation, the slack variable required must be subtracted. To complete the unity matrix in the tableau, a further artificial variable w; is included to allow the simplex procedure to continue. Such artificial variables must be eliminated before the optimal solution is finally attained. ‘The objective function P = ax + by becomes P = ax + by ~ Mu, 14 Minimisation ~ If P is the objective function to be minimised (@) write Q=-P () maximise Q by the usual simplex method (©) then Quax = (~P)max = ~(Pain) fe, Pain = ~(Qoax) % Can You? (84) checitist 23 (Check this list before and after you try the end of Programme test, On a scale of 1 to § how confident are you that Frames you can: # Describe an optimization problem in terms of the objective function and a set of constraints? ow Ys O O O O ODO No @ Algebraically manipulate and graphically describe inequalities? ew vy O OF O O G wo ‘ Solve a linear programming problem in two real variables? eS-wa Ys O O GO QO O W ‘ Use the simplex method to describe a linear programming problem in two real variables as a problem in two real variables with two slack variables? (GI) vs O GO GO OO wo (Optimization and linear programming 983 « Set up the simplex tableau and compute the simplex? vs O O O O GO Wo ‘¢ Use the simplex method to solve a linear programming problem in three real variables with three slack variables? Bo ys O O O O OQ Wo ‘* Introduce artificial variables into the solution method as and when the need arises? ae vs O O O GO GO Bw ‘* Solve minimisation problems using the simplex method? tof ys O OF O O OO No ‘* Construct the algebraic form of the objective function and the constraints for a problem stated in words? Ys O OF O GO QO No Bez3) {g] Test exercise 23 L_ Using a graphical method, maximise P = x + 2y subject to the constraints, (82) e+ 4y <8 x+4y S16 Bx+2y < 18 nye 0. Note: Use the simplex method to solve Exercises 2 to 6. In each case, all variables are non-negative. 2 Maximise ~3x+4y 3 Maximise P= 8x+ 12y-+107 subjectto 3x—2y <15 subject to 4x-+3y +22 < 64 x4 y<10 Qe yor c48 mx44y <15 x+2y4 2524 Wtxt ys 2 4 Maximise P= 44x-+20y S Minimise P= 3y—4x subject to 12+ 6y <84 subjectto x+4y < 60 Bet 2y > 24. 2e+ ys22 x4 yz 7. 984 Programme 23 6 A firm makes two types of containers, A and B, each of which requires cutting, assembly and finishing. The maximum available machine capacity in hours per week for each process is: cutting SO, assembly 84, finishing 72. ‘The process times for one unit of each type are as follows: Time in hours Process A B Cutting 2 5 Assembly 4 8 Finishing 4 Ss If the profit margin is £600 per unit A and £1000 per unit B, determine (@) the optimum weekly output of containers (b) the maximum profit. ( Further problems 23 (83) All variables in the following problems are non-negative. Graphical Solution 1 Maximise P= —x+8y 2 Maximise P= ~4x+8y subject to -3x+4y < 10 subjectto x+3y< 87 -xt4y 40 Bet y<70 a+ ay 232, 2x4 y 24D x44y 284. 16 Maximise P= 65x—23y 17 Maximise P= 24x—8y subjectto Sx- y< 30 subjectto x4 3y $360 10x +4y > 150. 2+ y $850 ~Sx+ 25y > 320. Programme 23 18 Maximise subject to 19 Maximise subject to 20° Maximise subject to 21 Maximise subject to Minimisation 22. Minimise subject to 24 Minimise subject to 26 Minimise subject to 27 Minimise subject to Paden 2y x4 2y <60 3x4 2y<80 ~3x+ 10y > 40. P = 18x+ 40y +242 Sx 2y +42 <63 2x4 4y +22< 42 2x4 3+ 2235. P= 60x-+ A5y +252 4x4 By +22 < 160 6x4 By +42 < 168 Ax 3y +322 128. P= 12x+8y 107 4x+2y-32< 210 xs 8y+ 75630 2x- y4az>210 x y+ 2< 180, P= —tx43y x+4y $20 2x+ ysi2 x- ys 3 P=-4x+8y 5x4 4y < 32 Ix+4y $80 -x+8y > 40. P= 4x-8y +52 2x4 3y4 2570 x4 29-4225 60 Bxt4y+ 2584 x4 y+ 2233. P =6x-Sy—3z Sx+8y +47 < 220 2x4 y+ 6r< 154 axt2y+ 22 77 Xt y+22> 55. 23 25 Minimise subject to Minimise subject to P= ~Sx4 87 x+2y <40 But 2y 548 x4 4y > 40. P=2x+8y x4 2y< 24 Txt Oy < 132 -x+2y> 4 x+2y2 12, Optimization and linear programming 987 Applications 28 A firm manufacturing two types of switching module, A and B, is under 29 contract to produce a daily output of at least 35 modules in all. Assembly and testing times for each type of module are as follows: ‘Module type Processing time (hours) ‘Assembly Testing A 10 20 B 2.0 10 Available staff resources provide a daily maximum of 80 hours for assembly and $5 hours for testing. ‘The profit on the sale of each A-module is £40 and of each B-module £80. Determine (@) the daily production schedule for maximum profit. (©) the maximum daily profit. ‘Three different types of coupling units are produced by a firm, The times required for machining, polishing and assembling a unit of each type are included in the information given in the following table. ‘Type Process time (hours) per unit Profit @) ef unit | Machining | Polishing | Assembling | Pe" writ A 4 1 2 110 B 2 3 1 100 c 3 2 4 120 Available time 320 250 280 (h/vweek) ‘The firm {s required to supply a total of at least 100 units of mixed types each week. Determine (@) the weekly output of each type to maximise profit (b) the maximum weekly profit. 988 Programme 23 30 A firm makes three types of wooden cabinets, A, B, C, with profit margins of £35, £30, £24 per unit respectively. Time in hours per cabinet Process A B Cc Preparation 2 5 4 Assembly 2 3 2 Finishing s 4 3 ‘The manufacturer has 25 men available for preparation, 20 men for assembly and 30 men for polishing, and all staff work a 40 hour week. To remain competitive, at least 300 cabinets in all must be produced each week. Determine (@) the number of each model to be manufactured each week in order ‘to maximise the profit, (b) the maximum weekly profit.

You might also like