Sunteți pe pagina 1din 4

Standard maximization problems are special kinds of linear programming problems. Q Remind me what a linear programming problem is.

A A linear programming (LP) problem is a problem in which we are asked to find the maximum (or minimum) value of a linear objective function p = ax + by + cz + ... Example: p = 3x - 2y + z

Step 3: Select the pivot column. The rule for the selecting a pivot column is this: Look at all the numbers in the bottom row, excluding the Answer column. From these, choose the negative number with the largest magnitude. Its column is the pivot column. (If there are two candidates, choose either one.) If all the numbers in the bottom row are zero or positive, then you are done, and the basic solution is the optimal solution. Example In the initial tableau you just analyzed, the most negative number in the bottom row is the -3, and hence the pivot column is the z-column. This means that the pivot will be somewhere in the z-column. Step 4: Select the pivot in the pivot column.= Here is what we are told to do in Section 4.3 of Finite Mathematics and Finite Mathematics and Applied Calculus Selecting the Pivot 1) The pivot must always be a positive number. (This rules out zeros and negative numbers, such as the -3 in the bottom row.) 2) For each positive entry b in the pivot column, compute the ratio a/b, where a is the number in the rightmost column in that row. We call this a test ratio. 3) Of these ratios, choose the smallest one. The corresponding number b is the pivot. Example In the following tableau, the pivot column is the "t"-column. Since neither zeros nor negative numbers can serve as a pivot, we must choose between the 3 and the 1 in the "t"-column. The test ratios are shown on the side. x 0 4 0 0 y Ans -3 3 1 10 1 10 3 15 z s t 3 u 0 0 2 0 p 0 0 0 5

Subject to one or more linear constraints of the form

Ax + By + Cz + . . . (or ) N Example: x + y - 3z 12 The desired largest (or smallest) value of the objective function is called the optimal value, and a collection of values of x, y, z, . . . that gives the optimal value constitutes an optimal solution. The variables x, y, z, . . . are called the decision variables. Q Ok, now what is a "standard maximization problem?" Standard Maximization Problem A linear programming (LP) problem is called a standard maximization problem if: We are to find the maximum (not minimum) value of the objective function. All the variables x, y, z, ... are constrained to be non-negative. All further constraints have the form Ax + By + Cz + . . . N (and not ). Example The following is a standard maximization problem: Maximize p = 2x - 3y + 4z subject to the constraints 4x - 3y + z 3 x + y + z 10 2x + y - z 10, where x, y, and z are non-negative. The following is not a standard maximization problem: Maximize p = 2x - 3y + z subject to 4x - 3y + z 3 x + y + z 10 The method most frequently used to solve LP problems is the simplex method. Here is a step-by-step approach.

1 1 test ratio = 3/3 = 1

0 0 1 test ratio = 10/1 =10 0 0 -10 0 0 -4

Since 3/3 = 1 is the smaller of the two test ratios, the pivot is the 3 (which is why it is blinking). Step 5: Use the pivot to clear the pivot column in the normal manner. This gives the next tableau. To do this, we follow the exact prescription for formulating the row operations described in Section 2.2 of Finite Mathematics or Finite Mathematics and Applied Calculus This method is also summarized on-line. For quick instructions on how to pivot, press here. For a detailed tutorial which shows you how to pivot, press here.) Example In the following tableau, the pivot is shown in color, and we clear its column using the given row operations.

(step1) Example The constraints 4x - 3y + z 3 x + y + z 10 2x + y - z 10 in the above LP problem are written as equations by adding a new "slack" variable to the left-hand side of each to "take up the slack." In addition, the objective function p = 2x - 3y + 4z is rewritten with all the unknowns on the left-hand side. This gives the following system of equations. 4x-3y+z +s=3 x+y+z +t=10 2x+y-z +u=10 -2x+3y-4z +p=0 (step2) Example For the system 4x-3y+z +s=3 x+y+z +t=10 2x+y-z +u=10 -2x+3y-4z +p=0 the initial tableau is as follows (notice how we separate the last row using a line). x y z s t u p Ans 4 1 2 -2 -3 3 1 10 1 10 3 0 1 1 -1 -4 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1

x 0 4 0 0

y Ans -3 3 1 10 1 10 3 15

z 1 0 3R2 - R1 0

s 1 0 -10

t 3 1 0 -4

u 0 0 2 0

p 0 0 0 5

0 0 3R4 + 4R1

This gives the next tableau: x 0 12 0 0 y Ans -3 3 6 27 1 10 -3 57 z 1 -1 0 4 s 1 -1 -10 4 t 3 0 0 0 u 0 0 2 0 p 0 0 0 15

Step 6: Repeat Steps 3-5 until there are no more negative numbers in the bottom row (with the possible exception of the Answer column). Minimization to! Example:

x + s1=12 Assume that a pharmaceutical firm is to produce exactly 40 gallons of mixture in which the basic ingredients, x and y, cost $8 per gallon and $15 per gallon, respectively, No more than 12 gallons of x can be used, and at least 10 gallons of y must be used. The firm wants to minimize cost. The cost function objective can be written as: C = 8x + 15y C = Cost The problem illustrates the three types of constraints, =, , and , as follows: x + y = 40 -m x 12 y 10 The optimum solution is obvious. Since x is cheaper, as much of it as possible should be used, i.e., 12 gallons. Then enough y, or 28 gallons, should be used to obtain the desired total quantity of 40 gallons. Simplex Method: In more realistic problems, a solution may not be obvious, especially if there are many ingredients each having constraints. A simple procedure is needed to generate an optimal solution no matter how complex the problem. The steps towards a solution in the cost minimization problem are similar to those taken in the contribution margin maximization example where the simplex method is used and slack variables are introduced in order to arrive at the first feasible solution which gives a zero contribution margin. I addition to the slack variables, a different type of variable known as and artificial variable is introduced. Artificial variables allow two types of restrictions or constraints to be treated: the equal-to type and the greater-than-or-equal-to type. Artificial variables are of value only as computational devices in maximization and minimization problems. In this minimization problem, an artificial variable, a1, is introduced in the first constraint, which is of the equal-to type. A new equality is written as follow: x + y + a1 = 40 gallons The new ingredient, a1, must be thought of as a very expensive item which would not be part of the optimum solution. I a costs $999 per gallon, for example, 40 gallons would cost $39,960. This high cost is noted by the coefficient m in the objective function. (For a maximization problem, the notion of a very low contribution margin is denoted by the symbol -m.) This symbol is added merely to intimate the simplex method, since the constraint is already an equality. The second constraint is the less-than-or-equal-to type, and a slack variable, s1, is added to form an equation: x + s1 = 12 gallons. The s1 represents the difference between 12 gallons of x and the actual number of gallons of x in the final solution. The third constraint is the greater-than-or-equal-to type, and a variable s2, is introduced to form and equation: y - s2 = 10 gallons. The variable s2 must be thought of as the amount by which the actual number of gallons of y in the final solution must be reduced to arrive at 10 gallons. For example, if y should be 18 gallons, than s2 would be 8 gallons (18 - 8 = 10 gallons). However, if y appears in the first solution as 0, than 0 - s2 = 10 or s2 = -10. This equation is not feasible because -10 gallons of an ingredient is not possible. To prevent s2 from entering the first solution, in which only slack and artificial variables are introduced, a second artificial variable, a2, is utilized. Thus, y - s2 +a2 +10 gallons. Similar to a1, a high cost (m) is assigned to a2 in the objective function.As a rule, there must be the same number of entries in the variable (mix) column as there are constraints. Before a2 is introduced in this example, there are three constraints, one artificial variable (a1), and two slack variables (s1 ands2), of which s2 has a negative coefficient. The introduction of the artificial variable, a2, gives a set of four variables, from which the three with positive coefficients (s1, a1, and a2) can be chosen to enter into the variable column of the first tableau. The new cost equation is: C = 8x + 15y - 0s2 + ma1 +0s1 + ma2 For minimizing cost, the objective function must be multiplied by -1. This transformed function enters the first tableau as the objective row. the resulting equation is: C = - 8x - 15y + 0s2 - ma1 - 0s1 - ma2 The new constraints for the simplex solution are: -m 0 Mix -m Quantity x a1 0 s1 0 a2 1 0 First simplex tableau and first solution Explanation and Computations for the First Tableau: The explanation of the arrangement is identical with that given for the first tableau of the maximization model. Observe that variables not included in a constraint are assigned zero coefficients in the problem rows. The index row is computed as follows: Steps 1 and 2 Step 3 -m (40) + 0 (12) + (-m) (10) = -50m -50m - 0 = -50m -m (1) + 0 (1) + (-m) (0) = -m -m - (-8) = -m + 8 -m (1) + 0 (0) + (-m) (1) = -2m -2m - (-15) = -2m + 15 -m (0) + 0 (0) + (-m) (-1) = m m-0=m -m (1) + 0 (0) + (-m) (0)= -m -m - (-m) = 0 -m (0) + 0 (1) + (-m) (0) = 0 0-0=0 -m (0) + 0 (0) + (-m) (1)= -m -m - (-m) = 0 In the simplex method the optimum solution has not been reached if the index row carries any negative values (except for the quantity column which denotes total cost of this solution) at the completion of an iteration. Consequently, since negative values appear in the index row, the optimum solution has not been found, and a second tableau must be set up. Explanation and Computation for the Second Tableau: Since the objective is to minimize cost, the key column is found by selecting that column with the negative value having the highest absolute value in the index row, i.e., that variable whose value will most decrease cost. The index row shows only two negative values: -m + 8 and -2m + 15. Observe that the quantity column value in the index row, -50m, is not considered. This figure denotes total cost of this solution and is negative by convention. The negative number with the highest absolute value in the index row is -2m + 15; therefore, y is the key column. The row to be replaced, the key row, is a2, determined as follows: a1 row, 40/1 = 40 s1 row, 12/0 is not considered (not defined mathematically) a2 row, 10/1 = 10 Again, as in the maximization discussion, the smallest positive ratio identifies the equation which operates as the limiting constraint. Since the key number (the crossing cell of the key column y and the key row a2) is 1, the values of the main row (y) do not change, as indicated by the following computations: 10/1 = 10; 0/1 = 0; 1/1 = 1; -1/1 = -1; 0/1 = 0; 0/1 = 0; and 1/1 = 1. The values in the other rows are determined as follows: a1 Row 40 - 1 (10) = 30 1 - 1 (0) = 1 1 - 1 (1) = 0 0 - 1 (-1) = 1 1 - 1 (0) = 1 0 - 1 (0) = 0 0 - 1 (1) = -1 Index Row Step 1 and 2 Step 3 -m (30) + 0 (12) + (-15) (10) = -30m - 150 -m (1) + 0 (1) + (-15) (0) = -m -m (0) + 0 (0) + (-15) (1) = - 150 x + y +a1=40 s1 Row 12 - 0 (10) = 12 1 - 0 (0) = 1 0 - 0 (1) = 0 0 - 0 (-1) = 0 0 - 0 (0) = 0 1 - 0 (0) = 1 0 - 0 (1) = 0 0 y 40 12 10 -50m -8 s2 1 1 0 -m+8 -15 a1 1 0 1 -2m+15 0 s1 0 0 -1 m -m a2 1 0 0 0 0 1 0 0 0 y - s2 + a2=10

The first tableau can be set up as shown below:

(-30m - 150) - 0 = -30m - 150

(-m) - (-8) = -m + 8 (-15) - (-15) = 0 (-m + 15) - 0 = -m + 15

-m (1) + 0 (0) + (-15) (-1) = -m + 15

-m (1) + 0 (0) + (-15) (0) = -m -m (0) + 0 (1) + (-15) (0) = 0

(-m) - (-m) = 0 (0) - 0 = -m + 0

a1 row, 18/1 = 18 x row, 12/0 is not defined mathematically y row, 10/-1 = -10

-m (-1) + 0 (0) + (-15) (1) = m - 15 (m - 15) - (-m) = 2m - 15

Mix -m Quantity x -m 0 -15 a1 -1 s1 0 y 1 2m - 15

0 y 30 12 10

-8 s2 1 1 0

-15 a1 0 0 1 0

0 s1 1 0 -1 -m + 15

-m a2 1 0 0 0

The values in the s2 row (replacing the a1 row), the x row, and the index row are determined as follows: s2 Row 18/1 = 18 0/1 = 0 0/1 = 0 1/1 = 1 1/1 = 1 -1/1 = -1 -1/1 = -1 Index Row Step 1 and 2 Step 3 0 (18) + (-8) (12) + (-15) (28) = -516 -516 - 0 = -516 0 (0) + (-8) (1) + (-15) (0) = -8 -8 - (-8) = 0 0 (0) + (-8) (0) + (-15) (1) = -15 -15 - (-15) = 0 0 (1) + (-8) (0) + (-15) (0) = 0 0-0=0 0 (1) + (-8) (0) + (-15) (1) = -15 -15 - (-m) = m - 15 0 (-1) + (-8) (1) + (-15) (-1) = 7 7-0=7 0 (-1) + (-8) (0) + (-15) (0) = 0 0 - (-m) = m x Row y Row 12 - 0 (18) = 12 1 - 0 (0) = 1 0 - 0 (0) = 0 0 - 0 (1) = 0 0 - 0 (1) = 0 1 - 0 (-1) = 1 0 - 0 (-1) = 0

0 1 0 0

-30m - 150 -m + 8

10 - (-1) (18) = 28 0 - (-1) (0) = 0 1 - (-1) (0) = 1 -1 - (-1) (1) = 0 0 - (-1) (1) = 1 0 - (-1) (-1) = -1 1 - (-1) (-1) = 0

Second simplex tableau and second solution Since negative values appear in the index row, excluding the quantity column, the optimum solution has not yet been found, and a third tableau must be set up. Explanation and Computations for the Third Tableau: Since -m + 8 is the negative number with the highest absolute value in the index row of the second tableau, x is the key column. The row to be replaced, the key row, is s1, determined as follows: a1 row, 30/1 = 30 s1 row, 12/1 = 12 y row, 10/0 not defined mathematically The following computations determine the values in the x row that replaces the s1 row, as well as the values in the other rows: x Row 1/1 = 1 0/1 = 0 0/1 = 0 0/1 = 0 1/1 = 0 0/1 = 0 Index Row -m (18) + (-8) (12) + (-15) (10) = -18m - 246 -m (0) + (-8) (1) + (-15) (0) = -8 -m (0) + (-8) (0) + (-15) (1) = -15 -m (1) + (-8) (0) + (-15) (0) = -m -m (-1) + (-8) (1) + (-15) (0) = m - 8 -m (-1) + (-8) (0) + (-15) (1) = m - 15 Mix -m Quantity x -m -8 -15 a1 -1 x 0 y 1 2m - 15 0 y 18 12 10 -8 s2 0 1 0 -8 - (-8) = 0 -15 - (-15) = 0 (-m + 15) - 0 = -m + 15 (m - 8) - 0 = m - 8 (m - 15) - (-m) = 2m - 15 -15 a1 0 0 1 0 0 s1 1 0 -1 -m + 15 -m a2 1 0 0 0 -1 1 0 m 0 -m - (-m) = 0 (-18m - 246) - 0 = -18m - 246 a1 Row y Row 10 - 0 (12) = 10 0 - 0 (1) = 0 1 - 0 (0) = 1 -1 - 0 (0) = -1 0 - 0 (0) = 0 0 - 0 (1) = 0 1 - 0 (0) = 0

Mix -m Quantity x 0 s2 -1 -8 x 0 -15 y 0

0 y 18 12 28

-8 s2 0 1 0

-15 a1 0 0 1

0 s1 1 0 0

-m s2 1 0 1

-1 1 -1

12/1 = 12 30 - 1 (12) = 18 1 - 1 (1) = 0 0 - 1 (0) = 0 1 - 1 (0) = 1 1 - 1 (0) = 1 0 - 1 (1) = -1 -1 - 1 (0) = -1

-516 0 0 0 m - 15 7 m Fourth simplex tableau and the optimal solution No negative values remain in the index row of the fourth tableau, except the minimum cost figure which is negative (-516) by convention. The following optimum solution has been reached: 12 gals. of x @ $ 8 per gal. = $96 28 gals. of y @ $15 per gal. = 420 -----------40 gals. of mixture $516 The lowest cost combination ________________________________________________________ Resolve using the Simplex Method the following problem: Maximize Z = f(x,y) = 3x + 2y subject to: 2x + y 18 2x + 3y 42 3x + y 24 x 0,y 0 Are considerated the following phases: 1. Turning the inequalities into equalities Introduce a slack variable for each restrictions of the type equalities, giving the following linear equation system: 2x + y + r = 18 2x + 3y + s = 42 3x +y + t = 24 2. Equaling the objective function to zero - 3x - 2y + Z = 0 3. Writing the initial board simplex At columns will appear all basic variables of the problem and the slack/surplus variables. At rows you can observe, for each restriction the slack variables with its coefficients of obtained equalities, and the last row with the values resulting of substitute the value of every variable at function objetive, and operate just as was explained in the theory to get the left values from the row: Board I . 1st iteration to turn them into

-m (1) + (-8) (0) + (-15) (-1) = -m + 15

-18m - 246 0 -8

Third simplex tableau and third solution Since a negative value, -m + 15 appears in the index row, excluding the quantity column, the optimum solution has not been found, and a fourth tableau must be set up. Explanation and Computations for the Fourth Tableau: Since -m +15 is the only negative number in the index row of the third tableau, excluding the quantity column, s2 is the key column. The smallest positive ratio in the following computation identifies the row to be replaced as a1

Base Cb P3 0 P4 0 P5 0 Z 4. Halt condition

P0 18 42 24 0

3 P1 2 2 3 -3

2 P2 1 3 1 -2

0 P3 1 0 0 0

0 P4 0 1 0 0

0 P5 0 0 1 0

When at the Z row there aren't negatives values , the optimal solution of the problem has been reached. In such a case, the algorithm has finished. If it were not so, the following steps must be executed. 5. Input-output base condition A. First, we must know the variable that enters into the base. For it we choose that value's column that in the row the Z is the minor of the presents negatives values. In this case would be the variable x (P1) of coefficient - 3. If two or more equal coefficients exist that obey the previous condition (tie case), then we will choose that variable that be basic. The column of the variable that goes into the base is named pivot column (In green color). Once the variable that goes into the base was obtained, we are in condition to deduce what will be the variable that goes out . For it, divide each independent term (P0) among the correspondent element of the pivot column, taking care that the result must be bigger than zero, and the minimum of this values is chosen. In our case: 18/2 [=9] , 42/2 [=21] y 24/3 [=8] If any less or equal to zero element exist, such divide will not be do, or if every elements that belongs to pivot column are zero we are in the case of unbounded solution, and the problem just would be finished (See theory). The term of the pivot column that gives the lowest positive quotient in previous division, the 3, right now than 8 is the lower quotient, indicates the row of the slack variable that goes out the base, t (P5). This row is named the pivot row (In green color). If two or more quotients are equals when they are being calculated (tie case), make a choice for a non basic variable (if possible). At intersection of pivot row with pivot column we have the pivot element, 3. 6. Calculating the coefficients of the new board. The new coefficients of the pivot row , t (P5), are obtained dividing all of the coefficients from such row among the pivot element, 3, that is the one necessary to turn into 1. Following, with Gaussian reduction we do zeros the remainders terms of that column, with it we get the new coefficients from the other rows including that belong to the objective function row Z. Also, it can be done in the following way: Pivot row: New pivot row = (Old pivot row) / (Pivot) Remainders rows: New row = (Old row) - (Coefficients from old row placed at incoming variable's colum) x (New pivot row) Lets see an example, once the pivot row has been calculated (x's (P1) row at Board II): Old row P4 42 Coefficient 2 x New pivot row 1/3 = New row P4 2/3 2 2 x 8 = 26 3 2 x 1 = 0 0 2 x 1/3 = 7/3 1 2 x 0 = 0 0 2 x 0 = 1

B. To calculate the variable that goes out, we divide the terms from last column among the ones correspondent to the new pivot column: 2 / 1/3 [=6] , 26 / 7/3 [=78/7] and 8 / 1/3 [=24] and as the lower positive quotient is 6, we have that the variable that goes out is r (P3). The pivot element, that we must do it 1, is 1/3. Working of analogous form that before, we obtain the board: Board III . 3rd iteration 3 2 Base Cb P0 P1 P2 P2 2 6 0 1 P4 0 12 0 0 P1 3 6 1 0 Z 30 0 0 As you can see, there is a element with minus sign in we have not come still to the optimal solution. It is process: 0 0 0 P3 P4 P5 3 0 -2 -7 1 4 -1 0 1 3 0 -1 Z row, - 1, it means that necessary to repeat the

The variable that comes to the base is t (P5) , because is the variable that correspond to the -1 coefficient. To calculate the variable that goes out, we divide the terms from the last colum among the terms correspondent from new pivot colum: 6/(-2) [=-3] , 12/4 [=3], and 6/1 [=6] and like the lower positive quotient is 3, we get s (P4) as the variable that goes out from base. The pivot element, that we must do it 1, is 4. We get the board: Board IV . 4th iteration 3 Base Cb P0 P1 P2 2 12 0 P5 0 3 0 P1 3 3 1 Z 33 0 As in the last row, all the coefficients are obey, getting the optimal solution. 2 0 0 0 P2 P3 P4 P5 1 -1/2 1/2 0 0 -7/4 1/4 1 0 3/4 -1/4 0 0 5/4 1/4 0 positive, then the halt condition is

The optimal solution is given by the Z value, at the column of the solution values, in this case: 33. In the same column, you can notice the point where it is reached, watching the rows correspondents to the decision variables that come at base: (x,y) = (3,12)

Board II . 2nd iteration Base P3 2/3 P4 2/3 P1 Cb 0 0 3 1/3 P0 2 26 8 3 P1 0 0 1 2 P2 1/3 7/3 1/3 0 P3 1 0 0 0 P4 0 1 0 0 P5 -

Z 24 0 -1 0 0 1 Notice that we have not attained the halt condition because at Z row, there is one negative, -1. We must do iteration: The incoming variable is y (P2), in order to be the variable that corresponds to the column where is the -1 coefficient.

S-ar putea să vă placă și