CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil...

39
CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP Professor Scott Moura Civil & Environmental Engineering University of California, Berkeley Fall 2014 Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 1

Transcript of CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil...

Page 1: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

CE 191: Civil and Environmental EngineeringSystems Analysis

LEC 03 : Graphical Solutions to LP

Professor Scott MouraCivil & Environmental EngineeringUniversity of California, Berkeley

Fall 2014

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 1

Page 2: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Graphical Solutions of Linear Programs

Example:

min J = 140x1 + 160x2

s. to 2x1 + 4x2 ≤ 28

5x1 + 5x2 ≤ 50

x1 ≤ 8

x2 ≤ 6

x1 ≥ 0

x2 ≥ 0

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 2

Page 3: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Construction of the feasible set

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 3

Page 4: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Construction of the feasible set

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 4

Page 5: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Construction of the feasible set

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 5

Page 6: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Construction of the feasible set

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 6

Page 7: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Construction of the feasible set

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 7

Page 8: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Construction of the feasible set

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 8

Page 9: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Construction of the feasible set

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 9

Page 10: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Feasible Set Final Result

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 10

Page 11: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Isolines

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 11

Page 12: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Isolines

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 12

Page 13: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Isolines

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 13

Page 14: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Gradient of the cost function

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 14

Page 15: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Uniqueness (or not) of the cost function

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 15

Page 16: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Features of the feasible set

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 16

Page 17: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Features of the feasible set

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 17

Page 18: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Features of the feasible set

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 18

Page 19: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Features of the feasible set

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 19

Page 20: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Feasible set is unbounded

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 20

Page 21: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Objective function might be unbounded too

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 21

Page 22: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Objective function might be bounded

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 22

Page 23: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Optimum may be non-unique

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 23

Page 24: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Feasible set might be empty

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 24

Page 25: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Feasible set might be empty

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 25

Page 26: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Feasible set might be empty

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 26

Page 27: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Feasible set might be empty

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 27

Page 28: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Constraint domination

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 28

Page 29: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Constraint domination

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 29

Page 30: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Constraint domination

dominated

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 30

Page 31: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Graphical solution of LPs: A General Method

Write  your  LP  

Successively  eliminate  half-­‐spaces  

Feasible  Set  Empty?  

Problem  Infeasible  

Objec?ve  Bounded?  

Infinite  Solu?on  Solu?on  

Unique?  

Feasible  Set  Bounded?  

YES   NO  

NO  

NO  YES  

Corner  Point  Solu?on  

Boundary  Solu?on  

YES   NO  

YES  

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 31

Page 32: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Insights from Graphical LP

Linear constraints Ax ≤ b form feasible set (possibly empty)

Feasible set is a (possibly unbounded) convex polytope

Optimal solution exists along edges (corner point or line segment)

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 32

Page 33: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Danzig’s Simplex Algorithm

1 Define feasible set

2 Start at vertex. Move along vertices until obj. fcn. stops decreasing

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 33

Page 34: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Example of Simplex Algorithm

Recall the LP problem:

max J = 140x1 + 160x2

s. to 2x1 + 4x2 ≤ 28

5x1 + 5x2 ≤ 50

x1 ≤ 8

x2 ≤ 6

x1 ≥ 0

x2 ≥ 0

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 34

Page 35: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Feasible Set Final Result

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 35

Page 36: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Start at a Vertex

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 36

Page 37: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Jump to adjacent vertex

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 37

Page 38: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Stop when objective stops decreasing

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 38

Page 39: CE 191: Civil and Environmental Engineering Systems Analysis - Graphical LP.pdf · CE 191: Civil and Environmental Engineering Systems Analysis LEC 03 : Graphical Solutions to LP

Additional Reading

Revelle

Chapter 3 - A Graphical Solution Procedure and Further Examples

Simplex Algorithm

Revelle Chapter 4 - The Simplex Algorithm for Solving Linear Programs

Prof. Moura | UC Berkeley CE 191 | LEC 03 - Graphical Solns to LP Slide 39