• 沒有找到結果。

Pivot in the Entering Variable

在文檔中 An Introduction to Model Building (頁 143-148)

Right-hand side of row

Returning to our example, we know that the largest we can make x1is 4. For x1to equal 4, it must become a basic variable. Looking at rows 1–4, we see that if we make x1a basic variable in row 1, then x1will equal 4

8

8  6; in row 2, x1will equal 2 4

0  5; in row 3, x1

will equal 8

2  4. Also, because x1does not appear in row 4, x1cannot be made a basic vari-able in row 4. Thus, if we want to make x1 4, then we have to make it a basic variable in row 3. The fact that row 3 was the winner of the ratio test illustrates the following rule.

In Which Row Does the Entering Variable Become Basic?

Always make the entering variable a basic variable in a row that wins the ratio test (ties may be broken arbitrarily).

To make x1a basic variable in row 3, we use elementary row operations to make x1have a coefficient of 1 in row 3 and a coefficient of 0 in all other rows. This procedure is called pivoting on row 3; and row 3 is the pivot row. The final result is that x1replaces s3as the basic variable for row 3. The term in the pivot row that involves the entering basic variable is called the pivot term. Proceeding as we did when we studied the Gauss–Jordan method in Chapter 2, we make x1a basic variable in row 3 by performing the following EROs.

ERO 1 Create a coefficient of 1 for x1in row 3 by multiplying row 3 by 1

2 . The resulting row (marked with a prime to show it is the first iteration) is

x1 0.75x2 0.25x3 0.5s3 4 (row 3) ERO 2 To create a zero coefficient for x1in row 0, replace row 0 with 60(row 3)  row 0.

z 15x2 5x3 30s3 240 (row 0) ERO 3 To create a zero coefficient for x1in row 1, replace row 1 with 8(row 3)  row 1.

x3 s1 4s3 16 (row 1)

ERO 4 To create a zero coefficient for x1in row 2, replace row 2 with 4(row 3)  row 2.

x2 0.5x3 s2 2s3 4 (row 2) Because x1 does not appear in row 4, we don’t need to perform an ero to eliminate x1

from row 4. Thus, we may write the “new” row 4 (call it row 4 to be consistent with other notation) as

x2 s4 5 (row 4)

Putting rows 0–4 together, we obtain the canonical form shown in Table 6.

Looking for a basic variable in each row of the current canonical form, we find that BV  {z, s1, s2, x1, s4} and NBV  {s3, x2, x3}

T A B L E 6 Canonical Form 1

Basic

Row Variable

Row 0 z 0.15x20.25x3 s1 s2.30s3 s4 240 z 240 Row 1 z1 0.15x20.25x3 s1 s2.34s3 s4 16 s1 16 Row 2 z10.15x200.5x3 s1 s2.32s3 s4 4 s2 4 Row 3 x1 0.75x2 0.25x3 s1 s2 0.5s3 s4 4 x1 4 Row 4 z1 0.15x2 0.25x3 s1 s2 .30s3 s4 5 s4 5

Thus, canonical form 1 yields the basic feasible solution z 240, s1 16, s2 4, x1 4, s4 5, x2 x3 s3 0. We could have predicted that the value of z in canonical form 1 would be 240 from the fact that each unit by which x1is increased increases z by 60. Because x1was increased by 4 units (from x1 0 to x1 4), we would expect that

Canonical form 1 z-value  initial z-value  4(60)

 0  240  240

In obtaining canonical form 1 from the initial canonical form, we have gone from one bfs to a better (larger z-value) bfs. Note that the initial bfs and the improved bfs are adjacent.

This follows because the two basic feasible solutions have 4  1  3 basic variables (s1, s2, and s4) in common (excluding z, which is a basic variable in every canonical form). Thus, we see that in going from one canonical form to the next, we have proceeded from one bfs to a better adjacent bfs. The procedure used to go from one bfs to a better adjacent bfs is called an iteration (or sometimes, a pivot) of the simplex algorithm.

We now try to find a bfs that has a still larger z-value. We begin by examining canon-ical form 1 (Table 6) to see if we can increase z by increasing the value of some nonba-sic variable (while holding all other nonbanonba-sic variables equal to zero). Rearranging row 0 to solve for z yields

z 240  15x2 5x3 30s3 (11)

From (11), we see that increasing the nonbasic variable x2by 1 (while holding x3 s3 0) will decrease z by 15. We don’t want to do that! Increasing the nonbasic variable s3by 1 (holding x2 x3 0) will decrease z by 30. Again, we don’t want to do that. On the other hand, increasing x3by 1 (holding x2 s3 0) will increase z by 5. Thus, we choose to enter x3into the basis. Recall that our rule for determining the entering variable is to choose the variable with the most negative coefficient in the current row 0. Because x3is the only variable with a negative coefficient in row 0, it should be entered into the basis.

Increasing x3by 1 will increase z by 5, so it is to our advantage to make x3as large as possible. We can increase x3as long as the current basic variables (s1, s2, x1, and s4) re-main nonnegative. To determine how large x3can be, we must solve for the values of the current basic variables in terms of x3(holding x2 s3 0). We obtain

From row 1: s1 16  x3

From row 2: s2 4  0.5x3

From row 3: x1 4  0.25x3

From row 4: s4 5

These equations tell us that s1 0 and s4 0 will hold for all values of x3. From row 2, we see that s2 0 will hold if 4  0.5x3 0, or x3 04.5  8. From row 3, x1 0 will hold if 4  0.25x3 0, or x3 0.425  16. This shows that the largest we can make x3is min { 0

4 .5 , 0.

4

25 }  8. This fact could also have been discovered by using (10) and the ratio test, as follows:

Row 1: no ratio (x3has negative coefficient in row 1) Row 2:

0 4

.5  8 Row 3:

0.

4 25  16

Row 4: no ratio (x3has a nonpositive coefficient in row 4)

Thus, the smallest ratio occurs in row 2, and row 2 wins the ratio test. This means that we should use EROs to make x3a basic variable in row 2.

ERO 1 Create a coefficient of 1 for x3in row 2 by replacing row 2 with 2(row 2):

2x2 x3 2s2 4s3 8 (row 2) ERO 2 Create a coefficient of 0 for x3in row 0 by replacing row 0 with 5(row 2)  row 0:

z 5x2 10s2 10s3 280 (row 0) ERO 3 Create a coefficient of 0 for x3 in row 1 by replacing row 1 with row 2  row 1:

2x2 s1 2s2 8s3 24 (row 1) ERO 4 Create a coefficient of 0 for x3in row 3, by replacing row 3 with  14 (row 2)  3:

x1 1.25x2 0.5s2 1.5s3 2 (row 3) Because x3already has a zero coefficient in row 4, we may write

x2 s4 5 (row 4)

Combining rows 0– 4 gives the canonical form shown in Table 7.

Looking for a basic variable in each row of canonical form 2, we find BV  {z, s1, x3, x1, s4} and NBV  {s2, s3, x2}

Canonical form 2 yields the following bfs: z 280, s1 24, x3 8, x1 2, s4 5, s2 s3 x2 0. We could have predicted that canonical form 2 would have z  280 from the fact that each unit of the entering variable x3increased z by 5, and we have increased x3by 8 units. Thus,

Canonical form 2 z-value  canonical form 1 z-value  8(5)

 240  40  280

Because the bfs’s for canonical forms 1 and 2 have (excluding z) 4  1  3 basic vari-ables in common (s1, s4, x1), they are adjacent basic feasible solutions.

Now that the second iteration (or pivot) of the simplex algorithm has been completed, we examine canonical form 2 to see if we can find a better bfs. If we rearrange row 0 and solve for z, we obtain

z 280  5x2 10s2 10s3 (12)

From (12), we see that increasing x2by 1 (while holding s2 s3 0) will decrease z by 5; increasing s2by 1 (holding s3 x2 0) will decrease z by 10; increasing s3by 1 (hold-ing x2 s2 0) will decrease z by 10. Thus, increasing any nonbasic variable will cause z to decrease. This might lead us to believe that our current bfs from canonical form 2 is

T A B L E 7 Canonical Form 2

Basic

Row Variable

0 z 0.15x2 x3 s1.10s2.10s3 s4 280 z 280 1 z10.12x2 x3 s10.2s2.38s3 s4 24 s1 24 2 z10.12x2 x3 s10.2s2.34s3 s4 8 x3 8 3 x1 1.25x2 x3 s1 0.5s2 1.5s3 s4 2 x1 2 4 z1 0.15x2 x3 s1 0.5s2 .30s3 s4 5 s4 5

an optimal solution. This is indeed correct! To see why, look at (12). We know that any feasible solution to the Dakota Furniture problem must have x2 0, s2 0, and s3 0, and 5x2 0, 10s2 0, and 10s3 0. Combining these inequalities with (12), it is clear that any feasible solution must have z 280  terms that are  0, and z  280.

Our current bfs from canonical form 2 has z 280, so it must be optimal.

The argument that we just used to show that canonical form 2 is optimal revolved around the fact that each of its nonbasic variables had a nonnegative coefficient in row 0.

This means that we can determine whether a canonical form’s bfs is optimal by applying the following simple rule.

Is a Canonical Form Optimal (Max Problem)?

A canonical form is optimal (for a max problem) if each nonbasic variable has a non-negative coefficient in the canonical form’s row 0.

R E M A R K S 1 The coefficient of a decision variable in row 0 is often referred to as the variable’s reduced cost.

Thus, in our optimal canonical form, the reduced costs for x1and x3are 0, and the reduced cost for x2is 5. The reduced cost of a nonbasic variable is the amount by which the value of z will decrease if we increase the value of the nonbasic variable by 1 (while all the other nonbasic variables remain equal to 0). For example, the reduced cost for the variable “tables” (x2) in canonical form 2 is 5.

From (12), we see that increasing x2by 1 will reduce z by 5. Note that because all basic variables (except z, of course) must have zero coefficients in row 0, the reduced cost for a basic variable will always be 0. In Chapters 5 and 6, we discuss the concept of reduced costs in much greater detail.

These comments are correct only if the values of all the basic variables remain nonnegative af-ter the nonbasic variable is increased by 1. Increasing x2to 1 leaves x1, x3, and s1all nonnegative, so our comments are valid.

2 From canonical form 2, we see that the optimal solution to the Dakota Furniture problem is to manufacture 2 desks (x1 2) and 8 chairs (x3 8). Because x2 0, no tables should be made.

Also, s1 24 is reasonable because only 8  8(2)  24 board feet of lumber are being used. Thus, 48  24  24 board feet of lumber are not being used. Similarly, s4 5 makes sense because, al-though up to 5 tables could have been produced, 0 tables are actually being produced. Thus, the slack in constraint 4 is 5  0  5. Because s2 s3 0, all available finishing and carpentry hours are being utilized, so the finishing and carpentry constraints are binding.

3 We have chosen the entering variable to be the one with the most negative coefficient in row 0, but this may not always lead us quickly to the optimal bfs (see Review Problem 11). Actually, even if we choose the variable with the smallest (in absolute value) negative coefficient, the simplex al-gorithm will eventually find the LP’s optimal solution.

4 Although any variable with a negative row 0 coefficient may be chosen to enter the basis, the pivot row must be chosen by the ratio test. To show this formally, suppose that we have chosen to enter xiinto the basis, and in the current tableau xiis a basic variable in row k. Then row k may be written as

akixi  bk

Consider any other constraint (say, row j) in the canonical form. Row j in the current canonical form may be written as

ajixi  bj

If we pivot on row k, row k becomes

xi  a b

k k i

The new row j after the pivot will be obtained by adding ajitimes the last equation to row j of the current canonical form. This yields a new row j of

0xi  bj b a

ka

ki

ji

We know that after the pivot, each constraint must have a nonnegative right-hand side. Thus, aki 0 must hold to ensure that row k has a nonnegative right-hand side after the pivot. Suppose aji 0. Then, to ensure that row j will have a nonnegative right-hand side after the pivot, we

must have

bj ak

b

i kaji  0 or (because aji 0)

a b

j j i

 a b

k k i

Thus, row k must be a “winner” of the ratio test to ensure that row j will have a nonnegative right-hand side after the pivot is completed.

If aji 0, then the right-hand side of row j will surely be nonnegative after the pivot. This fol-lows because

 b a

ka

ki

 0ji

will now hold.

As promised earlier, we have outlined an algorithm that proceeds from one bfs to a better bfs. The algorithm stops when an optimal solution has been found. The convergence of the simplex algorithm is discussed further in Section 4.11.

在文檔中 An Introduction to Model Building (頁 143-148)