Integer programming - cs.tut.fi · Probability p = N M = 45 253 ˇ0:178. Integer programming...

32
Integer programming Outline Problem formulation Branch-and- bound Cutting-plane algorithm Integer programming Olga Galinina olga.galinina@tut.fi ELT-53656 Network Analysis and Dimensioning II Department of Electronics and Communications Engineering Tampere University of Technology, Tampere, Finland February 19, 2014

Transcript of Integer programming - cs.tut.fi · Probability p = N M = 45 253 ˇ0:178. Integer programming...

Page 1: Integer programming - cs.tut.fi · Probability p = N M = 45 253 ˇ0:178. Integer programming Outline Problem formulation Branch-and-bound Cutting-plane algorithm Mental break There

Integerprogramming

Outline

Problemformulation

Branch-and-bound

Cutting-planealgorithm

Integer programming

Olga [email protected]

ELT-53656 Network Analysis and Dimensioning IIDepartment of Electronics and Communications Engineering

Tampere University of Technology, Tampere, Finland

February 19, 2014

Page 2: Integer programming - cs.tut.fi · Probability p = N M = 45 253 ˇ0:178. Integer programming Outline Problem formulation Branch-and-bound Cutting-plane algorithm Mental break There

Integerprogramming

Outline

Problemformulation

Branch-and-bound

Cutting-planealgorithm

1 Problem formulation

2 Branch-and-bound

3 Cutting-plane algorithm

Page 3: Integer programming - cs.tut.fi · Probability p = N M = 45 253 ˇ0:178. Integer programming Outline Problem formulation Branch-and-bound Cutting-plane algorithm Mental break There

Integerprogramming

Outline

Problemformulation

Branch-and-bound

Cutting-planealgorithm

Outline

1 Problem formulation

2 Branch-and-bound

3 Cutting-plane algorithm

Page 4: Integer programming - cs.tut.fi · Probability p = N M = 45 253 ˇ0:178. Integer programming Outline Problem formulation Branch-and-bound Cutting-plane algorithm Mental break There

Integerprogramming

Outline

Problemformulation

Branch-and-bound

Cutting-planealgorithm

Optimization Problem

minimize f (x), x ∈ Rn

subject to x ∈ Ω.

Pure integer programming problem

An integer programming problem in which all variables arerequired to be integer

Mixed integer programming problem

If some variables are restricted to be integer and some are not

Pure (mixed) binary integer programming problems(0-1 programming)

The integer variables are restricted to be 0 or 1

Integer programming is NP-hard.

Page 5: Integer programming - cs.tut.fi · Probability p = N M = 45 253 ˇ0:178. Integer programming Outline Problem formulation Branch-and-bound Cutting-plane algorithm Mental break There

Integerprogramming

Outline

Problemformulation

Branch-and-bound

Cutting-planealgorithm

Optimization Problem

minimize f (x), x ∈ Rn

subject to x ∈ Ω.

Pure integer programming problem

An integer programming problem in which all variables arerequired to be integer

Mixed integer programming problem

If some variables are restricted to be integer and some are not

Pure (mixed) binary integer programming problems(0-1 programming)

The integer variables are restricted to be 0 or 1

Integer programming is NP-hard.

Page 6: Integer programming - cs.tut.fi · Probability p = N M = 45 253 ˇ0:178. Integer programming Outline Problem formulation Branch-and-bound Cutting-plane algorithm Mental break There

Integerprogramming

Outline

Problemformulation

Branch-and-bound

Cutting-planealgorithm

Optimization Problem

minimize f (x), x ∈ Rn

subject to x ∈ Ω.

Pure integer programming problem

An integer programming problem in which all variables arerequired to be integer

Mixed integer programming problem

If some variables are restricted to be integer and some are not

Pure (mixed) binary integer programming problems(0-1 programming)

The integer variables are restricted to be 0 or 1

Integer programming is NP-hard.

Page 7: Integer programming - cs.tut.fi · Probability p = N M = 45 253 ˇ0:178. Integer programming Outline Problem formulation Branch-and-bound Cutting-plane algorithm Mental break There

Integerprogramming

Outline

Problemformulation

Branch-and-bound

Cutting-planealgorithm

Optimization Problem

minimize f (x), x ∈ Rn

subject to x ∈ Ω.

Pure integer programming problem

An integer programming problem in which all variables arerequired to be integer

Mixed integer programming problem

If some variables are restricted to be integer and some are not

Pure (mixed) binary integer programming problems(0-1 programming)

The integer variables are restricted to be 0 or 1

Integer programming is NP-hard.

Page 8: Integer programming - cs.tut.fi · Probability p = N M = 45 253 ˇ0:178. Integer programming Outline Problem formulation Branch-and-bound Cutting-plane algorithm Mental break There

Integerprogramming

Outline

Problemformulation

Branch-and-bound

Cutting-planealgorithm

Optimization Problem

minimize f (x), x ∈ Rn

subject to x ∈ Ω.

Pure integer programming problem

An integer programming problem in which all variables arerequired to be integer

Mixed integer programming problem

If some variables are restricted to be integer and some are not

Pure (mixed) binary integer programming problems(0-1 programming)

The integer variables are restricted to be 0 or 1

Integer programming is NP-hard.

Page 9: Integer programming - cs.tut.fi · Probability p = N M = 45 253 ˇ0:178. Integer programming Outline Problem formulation Branch-and-bound Cutting-plane algorithm Mental break There

Integerprogramming

Outline

Problemformulation

Branch-and-bound

Cutting-planealgorithm

Example: knapsack problem

Maximize the sum of the values of the items in the knapsack sothat the sum of the weights must be less than the knapsack’scapacity.

minimize cT x , xj ∈ 0, 1, ..., nisubject to wT x ≤W

1 number of items, each with a weight wi and a value ci

2 to maximize the total value of the items in the knapsack

3 knapsack problems are (usually) easy to solve

Page 10: Integer programming - cs.tut.fi · Probability p = N M = 45 253 ˇ0:178. Integer programming Outline Problem formulation Branch-and-bound Cutting-plane algorithm Mental break There

Integerprogramming

Outline

Problemformulation

Branch-and-bound

Cutting-planealgorithm

Relationship to Linear Programming

minimize cT x , xj ∈ 0, 1, ..., nisubject to Ax = b, x ∈ Zn

+

An associated linear program (the linear relaxation):minimize cT x , xj ∈ 0, 1, ..., nisubject to Ax = b, x ∈ Rn

+

1 The optimal objective value for (LR) is less than or equalto the optimal objective for (IP)

2 If (LR) is infeasible, then so is (IP)

3 If (LR) is optimized by integer variables, then that solutionis feasible and optimal for (IP)

4 (LP) gives a bound on the optimal value of (IP)

Rounding the solution of LR will not in general give theoptimal solution of (IP)

Page 11: Integer programming - cs.tut.fi · Probability p = N M = 45 253 ˇ0:178. Integer programming Outline Problem formulation Branch-and-bound Cutting-plane algorithm Mental break There

Integerprogramming

Outline

Problemformulation

Branch-and-bound

Cutting-planealgorithm

Integer programming

Whereas the simplex method is effective for solving linearprograms, there is no single technique for solving integerprograms.Three approaches:

enumeration techniques, including the branch-and-boundprocedure

cutting-plane techniques

group-theoretic techniques

Page 12: Integer programming - cs.tut.fi · Probability p = N M = 45 253 ˇ0:178. Integer programming Outline Problem formulation Branch-and-bound Cutting-plane algorithm Mental break There

Integerprogramming

Outline

Problemformulation

Branch-and-bound

Cutting-planealgorithm

Computational Complexity: LP vs. IP

Including integer variables increases enormously themodeling power, at the expense of more complexity

LP’s can be solved in polynomial time with interior-pointmethods (ellipsoid method, Karmarkar’s algorithm)

Integer Programming is an NP-complete problem

There is no known polynomial-time algorithmThere are little chances that one will ever be foundEven small problems may be hard to solve

Page 13: Integer programming - cs.tut.fi · Probability p = N M = 45 253 ˇ0:178. Integer programming Outline Problem formulation Branch-and-bound Cutting-plane algorithm Mental break There

Integerprogramming

Outline

Problemformulation

Branch-and-bound

Cutting-planealgorithm

Example: Traveling salesman problem

Starting from his home, a salesman wishes to visit each of (n1)other cities and return home at minimal cost. He must visiteach city exactly once and it costs cij to travel from city i tocity j . What route should he select?

minimize∑n

i ,j=1 cijxijsubject to

∑nj=1 xij = 1∑ni=1 xij = 1, xij ∈ 0, 1

The constraints require that the salesman must enter and leaveeach city exactly once.

Page 14: Integer programming - cs.tut.fi · Probability p = N M = 45 253 ˇ0:178. Integer programming Outline Problem formulation Branch-and-bound Cutting-plane algorithm Mental break There

Integerprogramming

Outline

Problemformulation

Branch-and-bound

Cutting-planealgorithm

Outline

1 Problem formulation

2 Branch-and-bound

3 Cutting-plane algorithm

Page 15: Integer programming - cs.tut.fi · Probability p = N M = 45 253 ˇ0:178. Integer programming Outline Problem formulation Branch-and-bound Cutting-plane algorithm Mental break There

Integerprogramming

Outline

Problemformulation

Branch-and-bound

Cutting-planealgorithm

General idea of Branch-and-bound

strategy of ’divide and conquer’

divide the feasible region into more manageablesubdivisions

there are a number of branch-and-bound algorithms

Utilizes:

the value of the objective function (LP) is a lower boundon the (IP)

any integer feasible point is always an upper bound onthe optimal (LP) value

Page 16: Integer programming - cs.tut.fi · Probability p = N M = 45 253 ˇ0:178. Integer programming Outline Problem formulation Branch-and-bound Cutting-plane algorithm Mental break There

Integerprogramming

Outline

Problemformulation

Branch-and-bound

Cutting-planealgorithm

Example

maximize z = 5x1 + 8x2

subject to x1 + x2 ≤ 65x1 + 9x2 ≤ 45x1, x2 ≥ 0, x1, x2 ∈ Z

Page 17: Integer programming - cs.tut.fi · Probability p = N M = 45 253 ˇ0:178. Integer programming Outline Problem formulation Branch-and-bound Cutting-plane algorithm Mental break There

Integerprogramming

Outline

Problemformulation

Branch-and-bound

Cutting-planealgorithm

Example

maximize z = 5x1 + 8x2

subject to x1 + x2 ≤ 65x1 + 9x2 ≤ 45x1, x2 ≥ 0, x1, x2 ∈ Z

In an example as simple as this, almost any solution procedurewill be effective (even exhaustive search)

Page 18: Integer programming - cs.tut.fi · Probability p = N M = 45 253 ˇ0:178. Integer programming Outline Problem formulation Branch-and-bound Cutting-plane algorithm Mental break There

Integerprogramming

Outline

Problemformulation

Branch-and-bound

Cutting-planealgorithm

Example

Linear-programming solution has x1 = 2 14 and x2 = 3 3

4 , z∗ ≤ 41First subdivision is into the regions where x2 ≤ 3 and x2 ≥ 4Subdividing the feasible region:

Page 19: Integer programming - cs.tut.fi · Probability p = N M = 45 253 ˇ0:178. Integer programming Outline Problem formulation Branch-and-bound Cutting-plane algorithm Mental break There

Integerprogramming

Outline

Problemformulation

Branch-and-bound

Cutting-planealgorithm

Example

Consider L1 first: (4, 95 ), z = 41

Not integer ⇒ we subdivide L1 further, into the regions:L3 with x1 ≥ 2 (infeasible) and L4 with x1 ≤ 1

Consider L4: (1, 409 ), z = 41

Not integer ⇒ we subdivide L4 further, into the regions:L5 with x2 ≤ 4 (infeasible) and L4 with x2 ≤ 5

Consider L5: (1, 4), z = 37Integer ⇒ no integer x in subdivision can give larger value

New bound z∗ ≥ 37 ⇒ 37 ≤ z∗ ≤ 41

Consider L6: (0, 5), z = 40 ⇒ 40 ≤ z∗ ≤ 41

Consider L6: (3, 3), z = 39, no optimal points in L6

Page 20: Integer programming - cs.tut.fi · Probability p = N M = 45 253 ˇ0:178. Integer programming Outline Problem formulation Branch-and-bound Cutting-plane algorithm Mental break There

Integerprogramming

Outline

Problemformulation

Branch-and-bound

Cutting-planealgorithm

Example

Subdividing the feasible region:

Page 21: Integer programming - cs.tut.fi · Probability p = N M = 45 253 ˇ0:178. Integer programming Outline Problem formulation Branch-and-bound Cutting-plane algorithm Mental break There

Integerprogramming

Outline

Problemformulation

Branch-and-bound

Cutting-planealgorithm

Enumeration tree

Page 22: Integer programming - cs.tut.fi · Probability p = N M = 45 253 ˇ0:178. Integer programming Outline Problem formulation Branch-and-bound Cutting-plane algorithm Mental break There

Integerprogramming

Outline

Problemformulation

Branch-and-bound

Cutting-planealgorithm

Heuristics in Branch-and-Bound

Possible choices in Branch-and-Bound

Choosing a pending problem

Depth-first search Breadth-first searchBest-first search (select node with best cost value)

Choosing a branching variable

closest to halfway two integer valueswith least cost coefficientwhich is important in the model (0-1 variable)which is biggest in a variable ordering

No known strategy is best for all problems!

Page 23: Integer programming - cs.tut.fi · Probability p = N M = 45 253 ˇ0:178. Integer programming Outline Problem formulation Branch-and-bound Cutting-plane algorithm Mental break There

Integerprogramming

Outline

Problemformulation

Branch-and-bound

Cutting-planealgorithm

Summary

To subdivide the feasible region to develop boundsz1 < z∗ < z2 on minimum value.

the upper bound z is the highest value of any feasibleinteger point

the lower bound is given by the optimal value of theassociated linear program

after subdivision, move to another subdivision and analyze

subdivision need not be subdivided if

the linear program over Lj is infeasiblethe optimal linear-programming solution over Lj is integerthe value of the linear-programming solution zj over Ljsatisfies zj ≥ z (for min)

Can the linear programs corresponding to the subdivisions besolved efficiently?

yes, use dual simplex algorithm (few operations)

Page 24: Integer programming - cs.tut.fi · Probability p = N M = 45 253 ˇ0:178. Integer programming Outline Problem formulation Branch-and-bound Cutting-plane algorithm Mental break There

Integerprogramming

Outline

Problemformulation

Branch-and-bound

Cutting-planealgorithm

Mental break

If a test for a disease is 99% accurate, and someone’s test ispositive, what is the probability the person actually has thedisease?.

Page 25: Integer programming - cs.tut.fi · Probability p = N M = 45 253 ˇ0:178. Integer programming Outline Problem formulation Branch-and-bound Cutting-plane algorithm Mental break There

Integerprogramming

Outline

Problemformulation

Branch-and-bound

Cutting-planealgorithm

Mental break

If a test for a disease is 99% accurate, and someone’s test ispositive, what is the probability the person actually has thedisease?.

Page 26: Integer programming - cs.tut.fi · Probability p = N M = 45 253 ˇ0:178. Integer programming Outline Problem formulation Branch-and-bound Cutting-plane algorithm Mental break There

Integerprogramming

Outline

Problemformulation

Branch-and-bound

Cutting-planealgorithm

Outline

1 Problem formulation

2 Branch-and-bound

3 Cutting-plane algorithm

Page 27: Integer programming - cs.tut.fi · Probability p = N M = 45 253 ˇ0:178. Integer programming Outline Problem formulation Branch-and-bound Cutting-plane algorithm Mental break There

Integerprogramming

Outline

Problemformulation

Branch-and-bound

Cutting-planealgorithm

Cutting plane algorithm

solves integer programs by modifying LP until the integersolution is obtained

works with a single linear program, which it refines byadding new constraintsnew constraints successively reduce the feasible regionuntil an integer optimal solution is found

BB almost always outperform the cutting-plane algorithm

the first algorithm for IP that could be proved to convergein a finite number of steps

Page 28: Integer programming - cs.tut.fi · Probability p = N M = 45 253 ˇ0:178. Integer programming Outline Problem formulation Branch-and-bound Cutting-plane algorithm Mental break There

Integerprogramming

Outline

Problemformulation

Branch-and-bound

Cutting-planealgorithm

Cutting plane algorithm

A cut relative to a current fractional solution satisfies thefollowing criteria:a) No feasible integer solutions are excludedb) Each constraint reduces the feasible solution regionc) Each constraint passes through an integer pointd) An optimum solution is eventually found

Page 29: Integer programming - cs.tut.fi · Probability p = N M = 45 253 ˇ0:178. Integer programming Outline Problem formulation Branch-and-bound Cutting-plane algorithm Mental break There

Integerprogramming

Outline

Problemformulation

Branch-and-bound

Cutting-planealgorithm

Cutting away the linear-programming solution

Page 30: Integer programming - cs.tut.fi · Probability p = N M = 45 253 ˇ0:178. Integer programming Outline Problem formulation Branch-and-bound Cutting-plane algorithm Mental break There

Integerprogramming

Outline

Problemformulation

Branch-and-bound

Cutting-planealgorithm

Summary

1958, Gomory: IP can be solved by some linear program(the associated linear program plus the added constraints)

number of cuts to be added, though finite, is usually quitelarge

BB almost always outperform the cutting-plane algorithm

Page 31: Integer programming - cs.tut.fi · Probability p = N M = 45 253 ˇ0:178. Integer programming Outline Problem formulation Branch-and-bound Cutting-plane algorithm Mental break There

Integerprogramming

Outline

Problemformulation

Branch-and-bound

Cutting-planealgorithm

Mental break

There are 10 red balls in a pool of 23 different balls. Anexperiment is to draw two ball from the pool.What is the probability, that both are red?

The number of all possible outcomes and the number of soughtoutcomes:

N =

(2

23

)= 253,N =

(2

10

)= 45

Probability p = NM = 45

253 ≈ 0.178

Page 32: Integer programming - cs.tut.fi · Probability p = N M = 45 253 ˇ0:178. Integer programming Outline Problem formulation Branch-and-bound Cutting-plane algorithm Mental break There

Integerprogramming

Outline

Problemformulation

Branch-and-bound

Cutting-planealgorithm

Mental break

There are 10 red balls in a pool of 23 different balls. Anexperiment is to draw two ball from the pool.What is the probability, that both are red?

The number of all possible outcomes and the number of soughtoutcomes:

N =

(2

23

)= 253,N =

(2

10

)= 45

Probability p = NM = 45

253 ≈ 0.178