the simplex method exception handling
play

The Simplex Method: Exception Handling Marco Chiarandini - PowerPoint PPT Presentation

DM545 Linear and Integer Programming Lecture 3 The Simplex Method: Exception Handling Marco Chiarandini Department of Mathematics & Computer Science University of Southern Denmark Tableaux and Dictionaries Outline Exception Handling


  1. DM545 Linear and Integer Programming Lecture 3 The Simplex Method: Exception Handling Marco Chiarandini Department of Mathematics & Computer Science University of Southern Denmark

  2. Tableaux and Dictionaries Outline Exception Handling 1. Tableaux and Dictionaries 2. Exception Handling 2

  3. Tableaux and Dictionaries Outline Exception Handling 1. Tableaux and Dictionaries 2. Exception Handling 3

  4. Tableaux and Dictionaries Tableaux and Dictionaries Exception Handling n � n max c j x j x n + i = b i − � a ij x j , i = 1 , . . . , m j = 1 n j = 1 n � a ij x j ≤ b i , i = 1 , . . . , m z = � c j x j j = 1 j = 1 x j ≥ 0 , j = 1 , . . . , n Tableau Dictionary   x r = ¯ b r − � a rs x s , ¯ r ∈ B ¯ ¯ I A N 0 b s �∈ B   z = ¯ d + � c s x s ¯     s �∈ B − ¯ 0 ¯ c N 1 d pivot op.: c N reduced costs ¯ choose col with r.c. >0 choose row with negative sign update: express entering variable and substitute in other rows 4

  5. Tableaux and Dictionaries Example Exception Handling max 6 x 1 + 8 x 2 5 x 1 + 10 x 2 ≤ 60 4 x 1 + 4 x 2 ≤ 40 x 1 , x 2 ≥ 0 x 1 x 2 x 3 x 4 − z b x 3 = 60 − 5 x 1 − 10 x 2 x 3 5 10 1 0 0 60 x 4 = 40 − 4 x 1 − 4 x 2 x 4 4 4 0 1 0 40 z = + 6 x 1 + 8 x 2 6 8 0 0 1 0 ... x 1 x 2 x 3 x 4 − z b x 1 = 2 − 1 / 5 x 3 + 1 / 4 x 4 x 2 0 1 1 / 5 − 1 / 4 0 2 x 2 = 8 + 1 / 5 x 3 − 1 / 2 x 4 x 1 1 0 − 1 / 5 1 / 2 0 8 z = 64 − 2 / 5 x 3 − 1 x 4 0 0 − 2 / 5 − 1 1 − 64 5

  6. Tableaux and Dictionaries Outline Exception Handling 1. Tableaux and Dictionaries 2. Exception Handling 7

  7. Tableaux and Dictionaries Exception Handling Exception Handling 1. F = ∅ 1. Unboundedness 2. F � = ∅ and ∃ solution 2. More than one solution 1. one solution 2. infinite solution 3. Degeneracies 3. F � = ∅ and � ∃ solution ◮ benign ◮ cycling 4. Infeasible starting 8

  8. Tableaux and Dictionaries Unboundedness Exception Handling max 2 x 1 + x 2 x 2 ≤ 5 − x 1 + x 2 ≤ 1 x 1 , x 2 ≥ 0 ◮ Initial tableau | | x1 | x2 | x3 | x4 | -z | b | |----+----+----+----+----+----+---| | x3 | 0 | 1 | 1 | 0 | 0 | 5 | | x4 | -1 | 1 | 0 | 1 | 0 | 1 | |----+----+----+----+----+----+---| | | 2 | 1 | 0 | 0 | 1 | 0 | ◮ x 2 entering, x 4 leaving | | x1 | x2 | x3 | x4 | -z | b | |-------------+----+----+----+----+----+----| | II’=II-I’ | 1 | 0 | 1 | -1 | 0 | 4 | | I’=I | -1 | 1 | 0 | 1 | 0 | 1 | |-------------+----+----+----+----+----+----| | III’=III-I’ | 3 | 0 | 0 | -1 | 1 | -1 | − x 1 + x 2 + x 4 = 1, x 1 can increase without restriction, θ = min { b i a is : a is > 0 , i = 1 . . . , n } 9

  9. Tableaux and Dictionaries Exception Handling ◮ x 1 entering, x 3 leaving | | x1 | x2 | x3 | x4 | -z | b | |--------------+----+----+----+----+----+-----| | I’=I | 1 | 0 | 1 | -1 | 0 | 4 | | II’=II+I’ | 0 | 1 | 1 | 0 | 0 | 5 | |--------------+----+----+----+----+----+-----| | III’=III-3I’ | 0 | 0 | -3 | 2 | 1 | -13 | x 4 was already in basis but for both I and II ( x 3 + 0 x 4 = 5), x 4 can increase arbitrarily x 2 x 1 ? ? 10

  10. Tableaux and Dictionaries ∞ solutions Exception Handling max x 1 + x 2 5 x 1 + 10 x 2 ≤ 60 4 x 1 + 4 x 2 ≤ 40 x 1 , x 2 ≥ 0 ◮ Initial tableau | | x1 | x2 | x3 | x4 | -z | b | |----+----+----+----+----+----+----| | x3 | 5 | 10 | 1 | 0 | 0 | 60 | | x4 | 4 | 4 | 0 | 1 | 0 | 40 | |----+----+----+----+----+----+----| | | 1 | 1 | 0 | 0 | 1 | 0 | ◮ x 2 enters, x 3 leaves | | x1 | x2 | x3 | x4 | -z | b | |-------------+-----+----+------+----+----+----| | I’=I/10 | 1/2 | 1 | 1/10 | 0 | 0 | 6 | | II’=II-4Ix4 | 2 | 0 | -2/5 | 1 | 0 | 16 | |-------------+-----+----+------+----+----+----| | III’=III-I | 1/2 | 0 | -1/6 | 0 | 1 | -6 | 11

  11. Tableaux and Dictionaries Exception Handling ◮ x 1 enters, x 4 leaves | | x1 | x2 | x3 | x4 | -z | b | |----------------+----+----+------+------+----+-----| | I’=I-II’/2 | 0 | 1 | 1/5 | -1/4 | 0 | 2 | | II’=II/2 | 1 | 0 | -1/5 | 1/2 | 0 | 8 | |----------------+----+----+------+------+----+-----| | III’=III-II’/2 | 0 | 0 | 0 | -1/4 | 1 | -10 | � x = ( 8 , 2 , 0 , 0 ) , z = 10 nonbasic variables typically have reduced costs � = 0. Here x 3 has r.c. = 0. Let’s make it enter the basis ◮ x 3 enters, x 2 leaves | | x1 | x2 | x3 | x4 | -z | b | |----------------+----+----+----+------+----+-----| | I’=5I | 0 | 5 | 1 | -5/4 | 0 | 10 | | II’=II+I’/5 | 1 | 1 | 0 | 4 | 0 | 10 | |----------------+----+----+----+------+----+-----| | III’=III | 0 | 0 | 0 | -/14 | 1 | -10 | � x = ( 10 , 0 , 10 , 0 ) , z = 10 There are 2 optimal solutions � all their convex combinations are optimal solutions: 12

  12. Tableaux and Dictionaries Exception Handling x 1 = ( 8 , 2 , 0 , 0 ) � � x = α i � x i � x 1 = 8 α + 10 ( 1 − α ) x 2 = ( 10 , 0 , 10 , 0 ) i x 2 = 2 α � α i ≥ 0 x 3 = 10 ( 1 − α ) � α i = 1 x 4 = 0 i x 2 x 1 13

  13. Tableaux and Dictionaries Degeneracy Exception Handling max x 2 − x 1 + x 2 ≤ 0 x 1 ≤ 2 x 1 , x 2 ≥ 0 ◮ Initial tableau | | x1 | x2 | x3 | x4 | -z | b | |----+----+----+----+----+----+---| | x3 | -1 | 1 | 1 | 0 | 0 | 0 | | x4 | 1 | 0 | 0 | 1 | 0 | 2 | |----+----+----+----+----+----+---| | | 0 | 1 | 0 | 0 | 1 | 0 | b i = 0 (one basic var. is zero) might lead to cycling ◮ degenerate pivot step: not improving, the entering variable stays at zero | | x1 | x2 | x3 | x4 | -z | b | |---+----+----+----+----+----+---| | | -1 | 1 | 1 | 0 | 0 | 0 | | | 1 | 0 | 0 | 1 | 0 | 2 | |---+----+----+----+----+----+---| | | 1 | 0 | -1 | 0 | 1 | 0 | 14

  14. Tableaux and Dictionaries Exception Handling ◮ now nondegenerate: | | x1 | x2 | x3 | x4 | -z | b | |---+----+----+----+----+----+----| | | 0 | 1 | 0 | 1 | 0 | 2 | | | 1 | 0 | 0 | 1 | 0 | 2 | |---+----+----+----+----+----+----| | | 0 | 0 | -1 | -1 | 1 | -2 | x 1 = 2 , x 2 = 2 , z = 2 x 2 ≥ n + 1 constraints meet at a vertex x 1 15

  15. Tableaux and Dictionaries Exception Handling Def: Improving variable, one with positive reduced cost Under certain pivoting rules cycling can happen. So far we chose an arbitrary improving variable to enter. Degenerate conditions may appear often in practice but cycling is rare and some pivoting rules prevent cycling. (Ex. 2 Sheet 2 shows the smallest possible example) Theorem If the simplex fails to terminate, then it must cycle. Proof: ◮ there is a finite number of basis and simplex chooses to always increase the cost ◮ hence the only situation for not terminating is that a basis must appear again. Two dictionaries with the same basis are the same (related to uniqueness of basic solutions) 16

  16. Tableaux and Dictionaries Pivot Rules Exception Handling Rules for breaking ties in selecting entering improving variables (more important than selecting leaving variables) ◮ Largest Coefficient: the improving var with largest coefficient in last row of the tableau. Original Dantzig’s rule, can cycle ◮ Largest increase: absolute improvement: argmax j { c j θ j } computationally more costly ◮ Steepest edge the improving var whose entering into the basis moves the current basic feasible sol in a direction closest to the direction of the vector � c (ie, maximizes the cosine of the angle between the two vectors): max c T ( x new − x old ) a · b = � a � � b � cos θ = ⇒ � x new − x old � 17

  17. Tableaux and Dictionaries Exception Handling ◮ Bland’s rule choose the improving var with the lowest index and, if there are more than one leaving variable, the one with the lowest index Prevents cycling but is slow ◮ Random edge select var uniformly at random among the improving ones ◮ Perturbation method perturb values of b i terms to avoid b i = 0, which must occur for cycling. To avoid cancellations: 0 < ǫ m ≪ ǫ m − 1 ≪ · · · ≪ ǫ 1 ≪ 1 can be shown to be the same as lexicographic method, which prevents cycling 18

  18. Tableaux and Dictionaries Efficiency of Simplex Method Exception Handling ◮ Trying all points is ≈ 4 m ◮ In practice between 2 m and 3 m iterations ◮ Klee and Minty 1978 constructed an example that requires 2 n − 1 iterations: ◮ random shuffle of indexes + lowest index for entering + lexicographic for √ leaving: expected iterations < e C n ln n 19

  19. Tableaux and Dictionaries Efficiency of Simplex Method Exception Handling ◮ unknown if there exists a pivot rule that leads to polynomial time. ◮ Clairvoyant’s rule: shortest possible sequence of steps Hirsh conjecture O ( n ) but best known n 1 + ln n ◮ smoothed complexity: slight random perturbations of worst-case inputs D. Spielman and S. Teng (2001), Smoothed analysis of algorithms: why the simplex algorithm usually takes polynomial time O ( max ( n 5 log 2 m , n 9 log 4 n , n 3 σ − 4 )) 20

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend