21
1 5.7 Initialization 5.7 Initialization Revisited Revisited Motivation : : a solution for the transformed system a solution for the transformed system is feasible for the original system if is feasible for the original system if and only if all the and only if all the artificial variables are equal to zero . . Two methods are available for this Two methods are available for this purpose: purpose: Big M Big M Two-Phase Two-Phase They look quite different but are They look quite different but are essentially equivalent. essentially equivalent.

5.7 Initialization Revisited

  • Upload
    dinesh

  • View
    54

  • Download
    2

Embed Size (px)

DESCRIPTION

5.7 Initialization Revisited. Motivation : a solution for the transformed system is feasible for the original system if and only if all the artificial variables are equal to zero . Two methods are available for this purpose: Big M Two-Phase - PowerPoint PPT Presentation

Citation preview

Page 1: 5.7 Initialization Revisited

1 5.7 Initialization Revisited5.7 Initialization Revisited5.7 Initialization Revisited5.7 Initialization Revisited

Motivation::

a solution for the transformed system is feasible a solution for the transformed system is feasible for the original system if and only if all the for the original system if and only if all the artificial variables are equal to zero ..

Two methods are available for this purpose:Two methods are available for this purpose:

Big MBig M

Two-PhaseTwo-Phase They look quite different but are essentially They look quite different but are essentially

equivalent.equivalent.

Page 2: 5.7 Initialization Revisited

2 Big MBig MBig MBig M Associate with each Associate with each artificial variable a very a very

unattractive cost coefficient (c cost coefficient (cjj).).

Since we try to optimize the objective Since we try to optimize the objective function, the optimal solution generated by function, the optimal solution generated by such a model will make the artificial variables such a model will make the artificial variables as as small as possible. as possible.

If the problem is feasible, the smallest feasible If the problem is feasible, the smallest feasible value of any artificial variable is value of any artificial variable is zero..

Page 3: 5.7 Initialization Revisited

3

Thus, if the problems is feasible, this Thus, if the problems is feasible, this approach will yield an optimal solution with approach will yield an optimal solution with all the artificial variables equal to zero ..

Page 4: 5.7 Initialization Revisited

4

ExampleExampleExampleExample

x x

x x

x x x x

x x x x x x

1 4

2 5

1 2 3 6

1 2 3 4 5 6

4

2 12

3 2 18

0

, , , , ,

max 'xZ x x Mx M x 3 51 2 5 6

(5.41)

Page 5: 5.7 Initialization Revisited

5

Initial tableau isInitial tableau is not in canonical form:in canonical form: Have to set the reduced costs of the Have to set the reduced costs of the

artificial variables to artificial variables to zero.. We use (legal)We use (legal) row operations for this for this

purpose.purpose.

BV Eq. # x1 x2 x3 x4 x5 x6 RHSx4 1 1 0 0 1 0 0 4x5 2 0 2 0 0 1 0 12x6 3 3 2 - 1 0 0 1 18Z' Z' 3 5 0 0 M M 0

Page 6: 5.7 Initialization Revisited

6

BV Eq. # x1 x2 x3 x4 x5 x6 RHSx4 1 1 0 0 1 0 0 4x5 2 0 2 0 0 1 0 12x6 3 3 2 - 1 0 0 1 18Z Z - 3M+3 - 4M+5 M 0 0 0 - 30M

BV Eq. # x1 x2 x3 x4 x5 x6 RHSx4 1 1 0 0 1 0 0 4x5 2 0 2 0 0 1 0 12x6 3 3 2 - 1 0 0 1 18Z' Z' 3 5 0 0 M M 0

Page 7: 5.7 Initialization Revisited

7

BV Eq. # x1 x2 x3 x4 x5 x6 RHSx4 1 1 0 0 1 0 0 2x2 2 0 1 0 0 1/2 0 6x6 3 3 0 - 1 0 - 1 1 2Z Z - 3M+3 0 M 0 2M- 5/2 0 - 6M- 30

BV Eq. # x1 x2 x3 x4 x5 x6 RHSx4 1 1 0 0 1 0 0 4x5 2 0 2 0 0 1 0 12x6 3 3 2 - 1 0 0 1 18Z Z - 3M+3 - 4M+5 M 0 0 0 - 30M

BV Eq. # x1 x2 x3 x4 x5 x6 RHSx4 1 0 0 1/3 1 1/3 - 1/3 4x2 2 0 1 0 0 1/2 0 6x1 3 1 0 - 1/3 0 - 1/3 1/3 6Z' Z' 0 0 1 0 M- 3/2 M- 1 - 36

Page 8: 5.7 Initialization Revisited

8

Note that, as expected, all the artificial Note that, as expected, all the artificial variables are nonbasic (thus equal to zero).variables are nonbasic (thus equal to zero).

The optimal solution isThe optimal solution is

x=(6,6,0,4,0,0)x=(6,6,0,4,0,0)

BV Eq. # x1 x2 x3 x4 x5 x6 RHSx4 1 0 0 1/3 1 1/3 - 1/3 4x2 2 0 1 0 0 1/2 0 6x1 3 1 0 - 1/3 0 - 1/3 1/3 6Z' Z' 0 0 1 0 M- 3/2 M- 1 - 36

Page 9: 5.7 Initialization Revisited

9RemarkRemarkRemarkRemark

Once an artificial variable is out of the basis, Once an artificial variable is out of the basis, we we never put it back into the basis.into the basis.

Thus, once an artificial variable is out of the Thus, once an artificial variable is out of the basis, we can “basis, we can “ignore” its column.” its column.

If you want to handle M numerically (i.e set If you want to handle M numerically (i.e set it to a given value) make sure that it is not it to a given value) make sure that it is not too large, but also not too smalltoo large, but also not too small

The Big M method is “not nice”.The Big M method is “not nice”. What happens if opt=What happens if opt=min ? ?

Page 10: 5.7 Initialization Revisited

10

2-Phase Method2-Phase Method2-Phase Method2-Phase Method

Phase 1: Find a basic feasible solution to : Find a basic feasible solution to the original problem (i.e. take the artificial the original problem (i.e. take the artificial variables out of the basis).variables out of the basis).

Phase 2: Find an optimal solution to the : Find an optimal solution to the original problem, ignoring the artificial original problem, ignoring the artificial variables.variables.

Page 11: 5.7 Initialization Revisited

11Phase 1Phase 1Phase 1Phase 1

LetLet

w := sum of the artificial variables

w* := minimum value of w subject to the constraints.

Because the artificial variables must satisfy the Because the artificial variables must satisfy the nonnegativity constraint, w*=0 if and only if all nonnegativity constraint, w*=0 if and only if all the artificial variables are equal to the artificial variables are equal to zero..

Thus, the goal in Phase 1 is toThus, the goal in Phase 1 is to minimize w (regardless of what is the value of opt in the (regardless of what is the value of opt in the original problem)original problem)

Page 12: 5.7 Initialization Revisited

12 Case 1: Case 1: w*>0

The problem is The problem is not feasible!!! (why!)!!! (why!) Case 2: Case 2: w*=0 and all the artificial variables are and all the artificial variables are

non-basic

A basic feasible solution to the original A basic feasible solution to the original problem has been generated. Continue with problem has been generated. Continue with Phase 2.Phase 2.

Case 3: Case 3: w*=0, but at least one artificial , but at least one artificial variable is variable is in the basis..

Using pivot operations, take all the artificial Using pivot operations, take all the artificial variables out of the basis.variables out of the basis.

Page 13: 5.7 Initialization Revisited

13

5.7.3 Example5.7.3 Example5.7.3 Example5.7.3 Example

x x

x x

x x x x

x x x x x x

1 4

2 5

1 2 3 6

1 2 3 4 5 6

4

2 12

3 2 18

0

, , , , ,

max 'xZ x x 3 51 2

Page 14: 5.7 Initialization Revisited

14

Phase 1Phase 1Phase 1Phase 1

minxw x x 5 6

x x

x x

x x x x

x x x x x x

1 4

2 5

1 2 3 6

1 2 3 4 5 6

4

2 12

3 2 18

0

, , , , ,

Page 15: 5.7 Initialization Revisited

15

We have to restore the canonical form (by We have to restore the canonical form (by legal row operations)legal row operations)

BV Eq. # x1 x2 x3 x4 x 5 x 6RHS

x4 1 1 0 0 1 0 0 4 x 5 2 0 2 0 0 1 0 12x 6

3 3 2 - 1 0 0 1 18w w 0 0 0 0 - 1 - 1 0

Page 16: 5.7 Initialization Revisited

16 BV Eq. # x1 x2 x3 x4 x 5 x 6 RHSx4 1 1 0 0 1 0 0 4 x 5 2 0 2 0 0 1 0 12x 6 3 3 2 - 1 0 0 1 18w w 0 0 0 0 - 1 - 1 0

BV Eq. # x1 x2 x3 x4 x 5 x 6 RHSx4 1 1 0 0 1 0 0 4 x 5 2 0 2 0 0 1 0 12x 6 3 3 2 - 1 0 0 1 18w w 3 4 - 1 0 - 1 - 1 300 0

corrections!!!

Page 17: 5.7 Initialization Revisited

17 BV Eq. # x1 x2 x3 x4 x5 x 6 RHSx4 1 1 0 0 1 0 0 4x2 2 0 1 0 0 1/2 0 6x 6 3 3 0 - 1 0 - 1 1 6w w 3 0 - 1 0 - 2 0 6

BV Eq. # x1 x2 x3 x4 x5 x 6 RHSx4 1 0 0 1/3 1 1/3 0 2x2 2 0 1 0 0 1/2 0 6x1 3 1 0 - 1/3 0 - 1/3 1 2w w 0 0 0 0 - 1 0 0

End of Phase 1: All the artificial All the artificial variables are out of the basis.variables are out of the basis.

Page 18: 5.7 Initialization Revisited

18

BV Eq. # x1 x2 x3 x4 x5 x6 RHS

x4 1 0 0 1/3 1 2x2 2 0 1 0 0 6x1 3 1 0 - 1/3 0 2Z' Z' 0 0 1 0 - 36

BV Eq. # x1 x2 x3 x4 x5 x 6 RHSx4 1 0 0 1/3 1 1/3 0 2x2 2 0 1 0 0 1/2 0 6x1 3 1 0 - 1/3 0 - 1/3 1 2w w 0 0 0 0 - 1 0 0

Phase 2Phase 2Phase 2Phase 2

We now have to restore the original objective We now have to restore the original objective function:function:

z’ = z’ = 3x3x11 5x 5x22

3 5 0 0

Page 19: 5.7 Initialization Revisited

19BV Eq. # x1 x2 x3 x4 x5 x6 RHS

x4 1 0 0 1/3 1 2x2 2 0 1 0 0 6x1 3 1 0 - 1/3 0 2Z' Z' 0 0 1 0 - 36

This is not in canonical form, so we use legal This is not in canonical form, so we use legal row operations to restore the canonical form.row operations to restore the canonical form.

3 5 0 0

BV Eq. # x1 x2 x3 x4 x5 x6 RHSx4 1 0 0 1/3 1 2x2 2 0 1 0 0 6x1 3 1 0 - 1/3 0 2Z' Z' 0 0 1 0 - 36

Page 20: 5.7 Initialization Revisited

20

RemarkRemarkRemarkRemark

Read the material in the lecture notes Read the material in the lecture notes concerning the relationship between the Big concerning the relationship between the Big M method and the 2-Phase Method and M method and the 2-Phase Method and make sure you understand why there are make sure you understand why there are “equivalent” and why the 2 Phase Method “equivalent” and why the 2 Phase Method is better. (end of section 5.7)is better. (end of section 5.7)

Page 21: 5.7 Initialization Revisited

21

5.8 Algorithm Complexity5.8 Algorithm Complexity5.8 Algorithm Complexity5.8 Algorithm Complexity

Worst case is very badis very bad In In practice : surprisingly well!!! : surprisingly well!!!