1 5.6 no-standard formulations what do you do if your problem formulation doeshave the standard...

34
1 5.6 No-Standard 5.6 No-Standard Formulations Formulations What do you do if your problem What do you do if your problem formulation does formulation does not have the Standard have the Standard Form? Form? This is an important issue because the This is an important issue because the simplex procedure we described simplex procedure we described relies very much on the standard form, eg on the standard form, eg the RHS coefficients are non-negative the RHS coefficients are non-negative availability of m slack variables availability of m slack variables opt=max opt=max and so on. and so on.

Post on 21-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

1 5.6 No-Standard Formulations5.6 No-Standard Formulations5.6 No-Standard Formulations5.6 No-Standard Formulations

What do you do if your problem formulation doesWhat do you do if your problem formulation does not have the Standard Form?have the Standard Form?

This is an important issue because the simplex This is an important issue because the simplex procedure we described procedure we described relies very much on the on the standard form, egstandard form, eg– the RHS coefficients are non-negativethe RHS coefficients are non-negative

– availability of m slack variablesavailability of m slack variables

– opt=maxopt=max

– and so on.and so on.

2 Standard Form

• opt=max

• ~ ∫• bi ≥ 0 , for all i.

a11x1 a12x2 . .. a1nxn b1

a21x1 a22x2 . .. a2 nxn b2

. ... . .. .. . .. . ... .

. ... . .. .. . .. . ... .

am1x1 am2x2 .. . amnxn bm

x j 0 , j 1,.. .,n

maxxZ c jx j

j1

n

3Violation # 1Violation # 1

MinimizationMinimizationViolation # 1Violation # 1

MinimizationMinimization

Observe that the problem Observe that the problem

z*:= minz*:= minxxŒŒXX f(x) f(x)

is equivalent to the problemis equivalent to the problem

z’:= maxz’:= maxxxŒŒXX f(x)f(x)

in that both have the in that both have the same set of optimal solutions. Also, z’= . Also, z’= z*.z*.

4 RemediesRemediesRemediesRemedies

1. Multiply the coefficients of the objective 1. Multiply the coefficients of the objective function by -1 and maximize the new objective function by -1 and maximize the new objective function.function.

2. Change the simplex algorithm a bit.2. Change the simplex algorithm a bit. Remark:: Australia is a Australia is a free country so in principle you can country so in principle you can

use either of these two approaches.use either of these two approaches. In his notes, Moshe prefers the In his notes, Moshe prefers the second approach. I approach. I

prefer the first.prefer the first.

5

5.6.1 Example5.6.1 Example5.6.1 Example5.6.1 Example

minxZ x x x 1 2 32

x x x

x x x

x x x

x x x

1 2 3

1 2 3

1 2 3

1 2 3

2 10

2 4 2 40

2 3 30

0

, ,

6 The coefficients of the objective function The coefficients of the objective function areare

cc11=1 ; c=1 ; c22=-1 ; c=-1 ; c33 = -2 = -2

so using the first appraoch, we multiply so using the first appraoch, we multiply them by -1 to obtainthem by -1 to obtain

c’c’11= -1 ; c’= -1 ; c’22= 1 ; c’= 1 ; c’33 = 2 = 2

We now use these new coefficients with We now use these new coefficients with opt=opt=maxmax. Thus the . Thus the equivalent form is: form is:

7

max 'xZ x x x 1 2 32

x x x

x x x

x x x

x x x

1 2 3

1 2 3

1 2 3

1 2 3

2 10

2 4 2 40

2 3 30

0

, ,

8

After setting the simplex tableau and conducting two After setting the simplex tableau and conducting two pivot operations we obtain the above final tableau.pivot operations we obtain the above final tableau.

The optimal solution is thus:The optimal solution is thus:

x*=(10/3,0,70/3,30,0,0)x*=(10/3,0,70/3,30,0,0)

The optimal value of the modified objective function The optimal value of the modified objective function is: Z’ = 130/3is: Z’ = 130/3

Thus the optimal value of the original objective Thus the optimal value of the original objective function is equal to function is equal to

Z* = - Z’ = - 130/3.Z* = - Z’ = - 130/3.

BV Eq. # x1 x2 x3 x4 x5 x6 RHS

x4 1 0 4 0 1 1/2 0 30x3 2 0 7/3 1 0 1/3 1/3 70/3x1 3 1 1/3 0 0 - 1/6 1/3 10/3Z' Z' 0 10/3 0 0 5/6 1/3 130/3

9

Thus the optimal value of the Thus the optimal value of the original objective function is equal original objective function is equal to to

Z* = - Z’ = - 130/3.Z* = - Z’ = - 130/3.

10

The Second ApproachThe Second ApproachThe Second ApproachThe Second Approach

Modification in the Simplex Algorithm for Modification in the Simplex Algorithm for opt=min:opt=min:

1.1. Optimality Test::

– Stop if all the reduced costs areStop if all the reduced costs are nonpositive..

2. 2. Greedy Rule::

– Select the variable with the most Select the variable with the most positive reduced cost.reduced cost.

11

ExampleExample(Continued)(Continued)

ExampleExample(Continued)(Continued)

minxZ x x x 1 2 32

x x x

x x x

x x x

x x x

1 2 3

1 2 3

1 2 3

1 2 3

2 10

2 4 2 40

2 3 30

0

, ,

12 We do not change the data, only modify theWe do not change the data, only modify the optimality test and and greedy rule. Thus, the initial tableau is the same for . Thus, the initial tableau is the same for opt=max and opt=min.opt=max and opt=min.

Step 2Step 2 (Optimality Test): (Optimality Test):

Since there are Since there are positive reduced costs, we continue. reduced costs, we continue. Step 3Step 3 (Variable in): (Variable in):

We select xWe select x33 as the new basic variable because its reduced costs as the new basic variable because its reduced costs

is the is the largest. .

13 Step 4Step 4 (Variable out): (Variable out): The (usual) Ratio Test identifies xThe (usual) Ratio Test identifies x55 as the as the

leaving basic variable.leaving basic variable. Step 5 Step 5 (Pivoting):(Pivoting): As usualAs usual New tableau:New tableau:BV Eq. # x1 x2 x3 x4 x5 x6 RHSx4 1 0 4 0 1 1/2 0 30x3 2 - 1 2 1 0 1/2 0 20x6 3 3 1 0 0 - 1/2 1 10Z Z 1 - 3 0 0 - 1 0 - 40

14

BV Eq. # x1 x2 x3 x4 x5 x6 RHSx4 1 0 4 0 1 1/2 0 30x3 2 - 1 2 1 0 1/2 0 20x6 3 3 1 0 0 - 1/2 1 10Z Z 1 - 3 0 0 - 1 0 - 40

BV Eq. # x1 x2 x3 x4 x5 x6 RHSx4 1 0 4 0 1 1/2 0 30x3 2 0 7/3 1 0 1/3 1/3 70/3x1 3 1 1/3 0 0 - 1/6 1/3 10/3Z Z 0 - 10/3 0 0 - 5/6 - 1/3 - 130/3

All the reduced costs are All the reduced costs are nonpositive, so we stop., so we stop. Optimal solution: x=(10/3,0,70/3,30,0,0)Optimal solution: x=(10/3,0,70/3,30,0,0) Optimal value of the objective function: Z* = -Optimal value of the objective function: Z* = -

130/3.130/3.

15 Violation #2Violation #2

Varaibles allowed to be negativeVaraibles allowed to be negativeViolation #2Violation #2

Varaibles allowed to be negativeVaraibles allowed to be negative Use the following fact:Use the following fact: Any number (positive or negative) can be expressed Any number (positive or negative) can be expressed

as the as the difference of two positive numbers. Thus, if say xThus, if say xjj is not required to be nonnegative, we is not required to be nonnegative, we

can introduce two additional variables, say x’can introduce two additional variables, say x’ jj and and

x”x”jj and set and set

xxjj = x’ = x’jj-x”-x”jj

with x’with x’jj,x”,x”jj >= 0. >= 0.

16

Clearly, if x’Clearly, if x’jj > x” > x”jj then x then xjj>0, whereas if >0, whereas if

x’x’jj<x”<x”jj then x then xjj<0. And if x’<0. And if x’jj=x”=x”jj then then

xxjj=0.=0.

Thus, xThus, xjj is indeed unrestricted in sign is indeed unrestricted in sign

((URS))

17

Example 5.6.3Example 5.6.3Example 5.6.3Example 5.6.3

maxxZ x x 4 31 2

2 40

30

15

1 2

1 2

1

1 2

x x

x x

x

x x

, urs

18

wherewhere

max , ,, , ,,

xx x x x4 4 3 31 1 2 2

2 2 40

30

15

0

1 1 2 2

1 1 2 2

1 1

1 1 2 2

x x x x

x x x x

x x

x x x x

, ,, , ,,

, ,, , ,,

, ,,

, ,, , ,,, ,

x x x1 1 1 , ,,

x x x2 2 2 , ,,

19Violation #3Violation #3

Negative RHSNegative RHSViolation #3Violation #3

Negative RHSNegative RHS

This is handled by multiplying the This is handled by multiplying the respective constraint by respective constraint by -1 and taking care and taking care of the inequality sign if necessary (changing of the inequality sign if necessary (changing <= to >= and >= to <=).<= to >= and >= to <=).

20

Example 5.6.4Example 5.6.4Example 5.6.4Example 5.6.4

Observe that in fixing this violation we Observe that in fixing this violation we created another one!created another one!

4 3 131 2 3x x x

4 3 131 2 3x x x

21Violation # 4Violation # 4

<= constraint<= constraintViolation # 4Violation # 4

<= constraint<= constraint

We convert a “>=“ constraint to a “=“ We convert a “>=“ constraint to a “=“ constraint by introducing a constraint by introducing a surplus variable. .

In many respects surplus variables are In many respects surplus variables are similar to similar to slack variables..

22

Example 5.6.5Example 5.6.5Example 5.6.5Example 5.6.5

Convince yourself that (a) is equivalent to Convince yourself that (a) is equivalent to (b).(b).

4 3 131 2 3x x x

4 3 131 2 3 4x x x x

x4 0

(a)

} (b)=

Correction(old notes)

23Violation #5Violation #5 = constraint = constraintViolation #5Violation #5 = constraint = constraint

There are two strategies to handle this There are two strategies to handle this violation:violation:

1. Use the “=“ constraint to 1. Use the “=“ constraint to eliminate one one of the variables (Assignment # 2 !!!!)of the variables (Assignment # 2 !!!!)

2. Use 2. Use artificial variables.. In 620-261 we prefer the In 620-261 we prefer the second approach..

24

These variables are called “artificial” These variables are called “artificial” because they are used temporarily, and because they are used temporarily, and ultimately will disappear from the model (be ultimately will disappear from the model (be set to zero).set to zero).Their sole purpose in life is to facilitate the Their sole purpose in life is to facilitate the construction of a construction of a basic feasible solution..

25 Example 5.6.6Example 5.6.6Example 5.6.6Example 5.6.6

Convince yourself that the first is equivalent to the Convince yourself that the first is equivalent to the second provided the artificial variable (second provided the artificial variable (xx33) is ) is equal to equal to

zerozero!!!!!!!!!! If you are not convinced see your ophthalmologist!If you are not convinced see your ophthalmologist! How do we force How do we force xx33 to be equal to to be equal to zero ????

This is a This is a good question that will be addressed that will be addressed shortly.shortly.

2 401 2x x

2 40 01 2 3 3x x x x ,

26

An Overall Example 5.6.7An Overall Example 5.6.7An Overall Example 5.6.7An Overall Example 5.6.7

minxZ x x 3 51 2

x

x

x x

x x

1

2

1 2

1 2

4

2 12

3 2 18

0

,

27 There are a number of violations here!There are a number of violations here! Opt = min Opt = min An equality constraintAn equality constraint A >= constraintA >= constraint A negative RHSA negative RHS

28 To fix the “min” violation, we consider a To fix the “min” violation, we consider a modified objective function, namelymodified objective function, namely

Z’ = - Z = -3xZ’ = - Z = -3x11 - 5 x - 5 x22

so the objective now is:so the objective now is:

max -3xmax -3x11 - 5 x - 5 x22

Constraints::

The first is in standard form (xThe first is in standard form (x11 <= 4). To <= 4). To

bring it to the canonical form we simply bring it to the canonical form we simply use ause a slack variable, say x, say x33, and write , and write

xx11 + x + x33 = 4 = 4

29

The second constraints (-2xThe second constraints (-2x22 = -12) has two = -12) has two

violations. The negative RHS is handled by violations. The negative RHS is handled by a multiplication by -1 to produce 2xa multiplication by -1 to produce 2x22 = 12. = 12.

So we just have to deal with the “=“ So we just have to deal with the “=“ violation.violation.

30 The “=“ violation is handled by an artificial The “=“ violation is handled by an artificial variable, say variable, say xx44. The resulting canonical . The resulting canonical

form of the constraint is thus form of the constraint is thus

2x2x22 + + xx44 = 12 = 12

The third constraint (3xThe third constraint (3x11 + 2x + 2x22 >= 18) violates >= 18) violates

the “<=“ condition. It is handled by a the “<=“ condition. It is handled by a surplus variable and an and an artificial variable. . The surplus variable, say x The surplus variable, say x55, will produce , will produce

an “=“ constraint:an “=“ constraint:

3x3x11 + 2x + 2x22 - x - x55 = 18 = 18

31

The “=“ violation” is then handled by an The “=“ violation” is then handled by an artificial variable, say artificial variable, say xx66. This yields the . This yields the

following canonical form:following canonical form:

3x3x11 + 2x + 2x22 - x - x55 + + xx66 = 18 = 18

32

Complete ReformulationComplete ReformulationComplete ReformulationComplete Reformulation

x x

x x

x x x x

x x x x x x

1 3

2 4

1 2 5 6

1 2 3 4 5 6

4

2 12

3 2 18

0

, , , , ,

maxxZ x x 3 51 2

33

Important RemarkImportant RemarkImportant RemarkImportant Remark

Moshe wrote “We (all of us!) shall adopt Moshe wrote “We (all of us!) shall adopt the convention that the auxiliary variables the convention that the auxiliary variables (slack, surplus, artificial) are “named” in (slack, surplus, artificial) are “named” in such a way that the initial basis appears in such a way that the initial basis appears in the the last m columns last m columns of the “LHS”.”of the “LHS”.”

I don’t like this and would prefer that the I don’t like this and would prefer that the variables kept their original names.variables kept their original names.

34

_ In any case, observe that the initial basis In any case, observe that the initial basis consists of:consists of:

Slack variablesSlack variables

Artificial variables Artificial variables