daniel kroening and ofer strichman 1 decision procedures an algorithmic point of view deciding ilps...

22
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Deciding ILPs with Branch & Bound ILP References: ‘Integer Programming’ / Laurence Wolsey ‘Intro. To mathematical programming’ / Hillier, Lieberman

Upload: albert-allen

Post on 26-Dec-2015

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Deciding ILPs with Branch & Bound ILP References: ‘Integer Programming’

Daniel Kroening and Ofer Strichman 1

Decision ProceduresAn Algorithmic Point of View

Deciding ILPs with Branch & Bound

ILP References:

‘Integer Programming’ / Laurence Wolsey

‘Intro. To mathematical programming’ / Hillier, Lieberman

Page 2: Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Deciding ILPs with Branch & Bound ILP References: ‘Integer Programming’

Decision Procedures - An algorithmic point of view2

We will see…

Solving a linear (continues) system Good old Gaussian Elimination for linear equations.

Feasibility test a-la Simplex for linear inequalities.

Fourier-Motzkin for linear inequalities.

Solving a linear (discrete) system Branch and Bound for integer linear inequalities.

The Omega-Test method for integer linear inequalities.

Page 3: Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Deciding ILPs with Branch & Bound ILP References: ‘Integer Programming’

Decision Procedures - An algorithmic point of view3

Integer Linear Programming

Problem formulation

max cx

Ax · b

x 2 Z

Where A is an m £ n coefficients matrix

x an n - dimensional column vector of variables.

b an m - dimensional column vector

Page 4: Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Deciding ILPs with Branch & Bound ILP References: ‘Integer Programming’

Decision Procedures - An algorithmic point of view4

Feasibility of a linear system

The decision problem associated with ILP is NP-hard.

But once again… we are not actually interested in ILP: we do not have an objective…

All we want to know is whether a given system is feasible.

Ax · b

x 2 Z

Still, NP-hard…

Page 5: Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Deciding ILPs with Branch & Bound ILP References: ‘Integer Programming’

Decision Procedures - An algorithmic point of view5

How different can it be from LP ?

x1

x2

LP Solution

Integer Solution

Objective line

Feasible region

Rounding cannot help!

Page 6: Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Deciding ILPs with Branch & Bound ILP References: ‘Integer Programming’

Decision Procedures - An algorithmic point of view6

How different can it be from LP ?

The LP problem can be feasible, whereas its ILP version is not.

x1

x2

Feasible region

Page 7: Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Deciding ILPs with Branch & Bound ILP References: ‘Integer Programming’

Decision Procedures - An algorithmic point of view7

From hereon we will assume that all variables are finite.

Enumerate all solutions with a tree

Guaranteed to find a feasible solution if it exists

But, exponential growth in the size of the tree / computation time

A naïve solution strategy

x1=0

x2=0 x2=2x2=1

x1=1 x1=2

x2=0 x2=2x2=1x2=0 x2=2x2=1

Page 8: Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Deciding ILPs with Branch & Bound ILP References: ‘Integer Programming’

Decision Procedures - An algorithmic point of view8

A family of algorithms: Branch & Bound

Probably the most popular method for solving Integer Linear Programming (ILP) problems (First presented in 1960) is B & B.

That is, the optimization problem.

Recall, however, that we are interested in deciding feasibility of a linear system.

In practice that’s a little easier. The algorithm is quite similar.

Page 9: Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Deciding ILPs with Branch & Bound ILP References: ‘Integer Programming’

Decision Procedures - An algorithmic point of view9

Branch and Bound

The main idea: Solve the ‘relaxed’ problem, i.e. no integrality constraints.

If the relaxed problem is infeasible – backtrack (there is no integer solution in this branch)

If the solution is integral – terminate (‘feasible’).

Otherwise split on a variable for which the assignment is non-integral, and repeat for each case.

More details to come…

Page 10: Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Deciding ILPs with Branch & Bound ILP References: ‘Integer Programming’

Decision Procedures - An algorithmic point of view10

x2≤1

Splitting on non-integral LP solutions.

x1

x2

x1

x2

Solve LP Relaxation to get fractional solutions

Create two sub-branches by adding constraints

x2≥2

Feasible real solution

Page 11: Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Deciding ILPs with Branch & Bound ILP References: ‘Integer Programming’

Decision Procedures - An algorithmic point of view11

Example

Suppose our system A has variables x1… x4, and that the LP

solver returned a solution (1, 0.7, 2.5, 3).

Choose one of x2, x3. Suppose we choose x2.

Solve two new problems: A1 = A [ {x2 · 0}

A2 = A [ {x2 ¸ 1}

Clearly A1 or A2 are satisfiable iff A is.

Page 12: Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Deciding ILPs with Branch & Bound ILP References: ‘Integer Programming’

Decision Procedures - An algorithmic point of view12

x2≤2

Splitting on non-integral LP solutions.

x1

x2

x1

x2

The linear relaxation can also be infeasible…

…which prunes the search for an integral solution.

x2≥3

Feasible real solution This branch is not feasible

Page 13: Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Deciding ILPs with Branch & Bound ILP References: ‘Integer Programming’

Decision Procedures - An algorithmic point of view13

The branch and bound tree

A

A2 A1

A12 A11

(1,0 .7,2.5,3)

(1,-1.5,1.5,4.1)

x2 · 0 x2 ¸ 1

x3 ¸ 1

(1,3,0.5,2)

(1,3,0.5,2)

x3 · 0

(1,3,4,1) x

Sub trees can be pruned away before reaching a leaf…

Each leaf is a feasible solution.

Pruned due to infeasibility

Page 14: Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Deciding ILPs with Branch & Bound ILP References: ‘Integer Programming’

Decision Procedures - An algorithmic point of view14

Aside: B & B for optimality

More reasons to prune the search.

In a maximality problem:

Prune a branch if an over-approximation of the largest solution under this branch is still smaller than an under-approximation of the solution in another branch.

If the solution at the node is integral, update lower bound on the optimal solution, and backtrack.

Page 15: Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Deciding ILPs with Branch & Bound ILP References: ‘Integer Programming’

Decision Procedures - An algorithmic point of view15

Termination

x

y

Does B & B guaranteed to terminate ? No.

Well, not in the way we presented it, anyway.

Consider a constraint like y + 0.1 · x · y + 0.2

Page 16: Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Deciding ILPs with Branch & Bound ILP References: ‘Integer Programming’

Decision Procedures - An algorithmic point of view16

Termination

The constraint y + 0.1 · x · y + 0.2 has no integral solution, but

an unbounded real solution space.

We need a way to bound the search space.

Page 17: Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Deciding ILPs with Branch & Bound ILP References: ‘Integer Programming’

Decision Procedures - An algorithmic point of view17

Bounds

Let S be the input integer linear system with coefficient matrix A of size M £ N and constants vector b.

If there is a solution, there is a solution x0 bounded as follows:

where µ is the maximal element in the coefficient matrix A or the vector b.

Page 18: Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Deciding ILPs with Branch & Bound ILP References: ‘Integer Programming’

Decision Procedures - An algorithmic point of view18

Preprocessing (LP)…

Constraints can be removed…

Example: x1 + x2 · 2, x1 · 1, x2 · 1

First constraint is redundant.

In general, for a set:

is redundant if

Page 19: Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Deciding ILPs with Branch & Bound ILP References: ‘Integer Programming’

Decision Procedures - An algorithmic point of view19

Preprocessing (LP)…

…and bounds can be tightened… Example:

2x1 + x2 · 2, x2 ¸ 4, x1 · 3 From 1st and 2nd constraints: x1 · -1

In general, if a0 > 0

And, if a0 < 0

Page 20: Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Deciding ILPs with Branch & Bound ILP References: ‘Integer Programming’

Decision Procedures - An algorithmic point of view20

Preprocessing (ILP)

Clearly Consider a 0-1 ILP constraint:5x1 – 3x2 · 4

x1 = 1 implies x2 = 1 Hence, we can add x1 · x2

(Again, a 0-1 ILP problem) Combine pairs:

from x1 + x2 · 1 and x2 ¸ 1 conclude x1 = 0;

More simplifications and preprocessing is possible… The rule is: preprocess as long as it is cost-effective.

Page 21: Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Deciding ILPs with Branch & Bound ILP References: ‘Integer Programming’

Decision Procedures - An algorithmic point of view21

Improvement - Cutting Planes

Eliminate non-integer solutions by adding constraints to LP (i.e. improve tightness of relaxation).

All feasible integer solutions remain feasible

Current LP solution is not feasible

x1

x2

Added Cut

Page 22: Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Deciding ILPs with Branch & Bound ILP References: ‘Integer Programming’

Decision Procedures - An algorithmic point of view22

Cutting planes

Adding valid inequalities

Examples:

1. x1, x2 , x3 ,x4 2 B

From x1 – x2 + x3 – x4 · -1

… we can conclude x2 + x4 ¸ 1

2. x 2 Z

From 2x · 11

…we can conclude x · 5