introduction to mixed integer linear programming

21
Introduction to Mixed Integer Linear Programming

Upload: tobias-bradley

Post on 22-Dec-2015

340 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Introduction to Mixed Integer Linear Programming

Introduction to Mixed Integer Linear Programming

Page 2: Introduction to Mixed Integer Linear Programming

2

LP formulation of Economic Dispatch

© 2011 D. Kirschen & the University of Washington

1 2 3 L

x1P1MAX

x2P2MAX

x3P3MAX

P1MIN

P2MIN

P3MIN

• Objective function is linear • All constraints are linear• All variables are real• Problem can be solved using

standard linear programming

Page 3: Introduction to Mixed Integer Linear Programming

3

Can we use LP for unit commitment?

© 2011 D. Kirschen & the University of Washington

x1P1MAX

x2P2MAX

x3P3MAX

P1MIN

P2MIN

P3MIN

The variables no longer havea contiguous domain (Non-convex set)Standard linear programming is no longer applicable

Page 4: Introduction to Mixed Integer Linear Programming

4

Mixed Integer Linear Programming (MILP)

• Some decision variables are integers– Special case: binary variables {0,1}

• Other variables are real• Objective function and constraints are linear

© 2011 D. Kirschen & the University of Washington

Page 5: Introduction to Mixed Integer Linear Programming

5

Example

© 2011 D. Kirschen & the University of Washington

Except for the fact that the variables are integer, this looksvery much like a linear programming problem.

Page 6: Introduction to Mixed Integer Linear Programming

6

Example

© 2011 D. Kirschen & the University of Washington

4x1 + 2x2 = 15

x1 + 2x2 = 8

x1 + x2 = 5

x1

x28

6

4

2

0 2 4 6 8

Page 7: Introduction to Mixed Integer Linear Programming

7

LP relaxation

© 2011 D. Kirschen & the University of Washington

4x1 + 2x2 = 15

x1 + 2x2 = 8

x1 + x2 = 5

x1

x28

6

4

2

0 2 4 6 8

Let us relax the constraint that thevariables must be integer.

The problem is then a regular LP

Solution of the relaxed LPx1 = 2.5; x2 = 2.5; Objective = 12.5

Page 8: Introduction to Mixed Integer Linear Programming

8

LP relaxation

© 2011 D. Kirschen & the University of Washington

4x1 + 2x2 = 15

x1 + 2x2 = 8

x1 + x2 = 5

x1

x28

6

4

2

0 2 4 6 8

Solution of the relaxed LPx1 = 2.5; x2 = 2.5; Objective = 12.5

The solution of the relaxed problemis always better than the solution oforiginal problem!(Lower objective for minimizationproblem, higher for maximization)

Page 9: Introduction to Mixed Integer Linear Programming

9

Solution of the integer problem

© 2011 D. Kirschen & the University of Washington

4x1 + 2x2 = 15

x1 + 2x2 = 8

x1 + x2 = 5

x1

x28

6

4

2

0 2 4 6 8

Solution of the relaxed LPx1 = 2.5; x2 = 2.5; Objective = 12.5

Page 10: Introduction to Mixed Integer Linear Programming

10

Solution of the integer problem

© 2011 D. Kirschen & the University of Washington

4x1 + 2x2 = 15

x1 + 2x2 = 8

x1 + x2 = 5

x1

x28

6

4

2

0 2 4 6 8

Solution of the relaxed LPx1 = 2.5; x2 = 2.5; Objective = 12.5

Solution of the original problemx1 = 2; x2 = 3; Objective = 12.0

Page 11: Introduction to Mixed Integer Linear Programming

11

Naïve rounding off

© 2011 D. Kirschen & the University of Washington

x1

x2

LP solutionIP solution

The optimal integer solution can be far away from the LP solution“Far away” can be difficult to find when there are many dimensions

Page 12: Introduction to Mixed Integer Linear Programming

12

Finding the integer solution

• Large number of integer variables• Vast number of possible integer solutions• Need a systematic procedure to search this

solution space• Fix the variables to the nearest integer one at

a time• “Branch and Bound” algorithm

© 2011 D. Kirschen & the University of Washington

Page 13: Introduction to Mixed Integer Linear Programming

13

Another example

© 2011 D. Kirschen & the University of Washington

Relaxed LP solution: (1.75, 0.75)

Page 14: Introduction to Mixed Integer Linear Programming

14

Branch on x1

© 2011 D. Kirschen & the University of Washington

Problem 0

Problem 2Problem 1

Page 15: Introduction to Mixed Integer Linear Programming

15

Branch on x1

© 2011 D. Kirschen & the University of Washington

Problem 2Problem 1

Solution of Problem 2Solution of Problem 1

Page 16: Introduction to Mixed Integer Linear Programming

16

Search Tree: first layer

© 2011 D. Kirschen & the University of Washington

Solution of Problem 1:• x1 integer• x2 real• Not a feasible solution yet• Can still branch on x2

Solution of Problem 2:• x1 & x2 integer• Feasible solution of

the original problem• Bound on the optimum• Best solution so far

Page 17: Introduction to Mixed Integer Linear Programming

17

Branch on x2

© 2011 D. Kirschen & the University of Washington

Problem 1

Problem 3 Problem 4

Page 18: Introduction to Mixed Integer Linear Programming

18

Search Tree: second layer

© 2011 D. Kirschen & the University of Washington

No solutionNo integer solution yet

Page 19: Introduction to Mixed Integer Linear Programming

19

Branch and Bound: what next?

© 2011 D. Kirschen & the University of Washington

No solution

Can’t go any further in this direction

Solution of relaxed problem 4 is bounded by solution of problem 2. No point in going further

Optimal solution

Page 20: Introduction to Mixed Integer Linear Programming

20

Comments on Branch and Bound

• Search tree gets very big if there are more than a few integer or binary variables

• Even with the bounds provided by the relaxed solutions, exploring the tree usually takes a ridiculous amount of time

• Clever mathematicians have developed techniques to identify “cuts”– Constraints based on the structure of the problem

that eliminate part of the search tree– “Branch and Cut” algorithm

© 2011 D. Kirschen & the University of Washington

Page 21: Introduction to Mixed Integer Linear Programming

21

Duality Gap

• Finding the optimal solution for a large problem can take too much time even with branch and cut

• Best solution of relaxed problem provides a bound on the solution

• Duality gap: Difference between best solutions of relaxed problem and actual problem

• Stop searching the tree if duality gap is sufficiently small

© 2011 D. Kirschen & the University of Washington