linear integer programming and its application - isical.ac.inacmu/ss2017/school17.pdf · 2017/7/9 8...
TRANSCRIPT
Linear integer programming and its application
Presented by
Dr. Sasthi C. Ghosh Associate Professor
Advanced Computing & Microelectronics Unit
Indian Statistical Institute
Kolkata, India
Outline
Introduction to Integer programming
Linear relaxation
Rounding in linear relaxation
Converting finite-valued integer variables to binary variable
Implementing logical conditions using binary variable
Converting product of binary variable to linear form
Converting non-integer coefficients to integer coefficients
Dealing with probabilistic constraints
Solving integer programs: Branch and bound
Implementation tool: CPLEX
Conclusion
2017/7/9 2
Introduction
Pure integer programming
All variables are integer.
Mixed integer programming
Some variables are restricted to be integer but some are not.
Binary integer programming
When variables are restricted to 0 or 1. It could be pure or mixed.
Maximize 8x1 + 11x2 + 6x3 + 4x4
Subject to
5x1 + 7x2 + 4x3 + 3x4 14
xj {0, 1} j = 1, 2, …, 4
2017/7/9 3
Linear relaxation
Linear relaxation
Can be solved in polynomial time. Polynomial in number of variables and constraints.
Formed by dropping the integrality restrictions.
Maximize 8x1 + 11x2 + 6x3 + 4x4
Subject to
5x1 + 7x2 + 4x3 + 3x4 14
0 xj 1, j = 1, 2, …, 4
It uses 0 xj 1 instead of xj {0, 1}
2017/7/9 4
Rounding in linear relaxation
2017/7/9 5
Rounding does not give optimal solution
Maximize 8x1 + 11x2 + 6x3 + 4x4
Subject to
5x1 + 7x2 + 4x3 + 3x4 14
xj {0, 1} j = 1, 2, …, 4
Solution of linear relaxation
x1=x2=1, x3=0.5, x4=0 and optimal objective: 22
Rounding x3 to 0 gives, optimal objective: 19
Rounding x3 to 1 does not satisfy the constraint
Optimal integer solution
x1 = 0, x1 = x3 = x4 = 1 and optimal objective: 21
2017/7/9 6
Rounding may not be possible at all
Maximize 8x1 + 11x2 + 6x3 + 4x4
Subject to
5x1 + 7x2 + 4x3 + 3x4 = 14
xj {0, 1} j = 1, 2, …, 4
Solution of linear relaxation
x1=x2=1, x3=0.5, x4=0 and optimal objective: 22
Rounding x3 to 0 or 1 does not satisfy the constraint
Optimal integer solution
x1 = 0, x2=x3=x4=1 and optimal objective: 21
Rounding in linear relaxation
Finite-valued integer variables
2017/7/9 7
Converting finite-valued integer variables to binary
Assume a variable xj can only take a finite number of values: xj ∈ {p1, . . . , pm}. Introduce variables z1
j , . . . , zm
j ∈ {0, 1} and add the constraint z1
j + . . . + zmj = 1.
Substitute xj with p1 z
1j + . . . + pm z
mj
in the objective function and all constraints.
2017/7/9 8
Converting finite-valued integer variables to binary
Maximize 8x1 + 11x2 + 6x3 + 4x4 5x1 + 7x2 + 4x3 + 3x4 <= 14 x1 ∈ {1, 2, 3} xj ∈ {0, 1}, j=2, 3, 4.
Solution: x1 = 2, x2 = 0, x3 = 1, x4 = 0, Objective=22
Example: x1 ∈ {1, 2, 3} can be modelled as z1
1 + z21 + z3
1 = 1 where z11 , z
21 , z
31 ∈ {0, 1}
Substituting x1 everywhere by 1 z11 + 2 z2
1 + 3 z31 gives:
Maximize 8 z1
1 + 16 z21 + 24 z3
1 + 11x2 + 6x3 + 4x4 5 z1
1 + 10 z21 + 15 z3
1 + 7x2 + 4x3 + 3x4 <= 14 z1
1 + z21 + z3
1 = 1
Solution: z1
1 = 0, z21 = 1, z3
1 =0, x2 = 0, x3 = 1, x4 = 0, Objective=22 z1
1 = 0, z21 = 1, z3
1 =0 x1=2
Finite-valued integer variables
Implementing logical conditions
2017/7/9 9
Implementing logical conditions using binary variable:
At most one of A and B: a + b ≤ 1 At least one of A and B: a + b ≥ 1 If A then B: b ≥ a If A then not B: 1 - b ≥ a a + b ≤ 1 If not A then B: b ≥ 1 – a a + b ≥ 1 If A then B, and if B then A: a = b If A then B and C: b ≥ a and c ≥ a If A then B or C: b + c ≥ a If B or C then A: a ≥ b and a ≥ c If B and C then A: a ≥ b + c – 1
2017/7/9 10
Converting product of binary variables into linear form without any approximation
c = ab a ≥ c, b ≥ c, and c ≥ a + b -1
If C then A and B: a ≥ c and b ≥ c (ab ≥ c)
If A and B then C: c ≥ a + b – 1 (c ≥ ab)
d = abc a ≥ d, b ≥ d, c ≥ d and d ≥ a + b + c -2
Implementing logical conditions
2017/7/9 11
Implementing “either/or” logical conditions using binary variable:
Maximize x1 + 3x2 subject to either x1 + x2 ≤ 6 (c1) or x1 + 2x2 ≤ 7 (c2) x1 ≥ 0 and x2 ≥ 0
Can be expressed as x1 + x2 - M ≤ 6 and x1 + 2x2 - M(1 - ) ≤ 7 {0, 1} and M is a large number
=0: x1 + x2 ≤ 6, x1 + 2x2 ≤ +∞ c1 is satisfied =1: x1 + x2 ≤ +∞, x1 + 2x2 ≤ 7 c2 is satisfied
Implementing logical conditions
2017/7/9 12
Implementing “either/or” logical conditions using binary variable:
Maximize 2x1 + 3x2 subject to either x1 + 2x2 6 (c1) or 2x1 + x2 9 (c2) x1 ≥ 0 and x2 ≥ 0
Can be expressed as x1 + 2x2 + M 6 and 2x1 + x2 + M(1 - ) 9 {0, 1} and M is a large number
=0: x1 + 2x2 6, 2x1 + x2 -∞ c1 is satisfied =1: x1 + 2x2 -∞, 2x1 + x2 9 c2 is satisfied
Implementing logical conditions
2017/7/9 13
Implementing “either/or but not both” logical conditions using binary variable:
Minimize x1 - x2
subject to x1 + x2 ≤ 4 x1 ≥ 1 ∨ x2 ≥ 1 but not both x1, x2 > 1 x1, x2 ≥ 0. This can be expressed as:
Minimize x1 - x2 subject to x1 + x2 ≤ 4 x1 ≥ 1 −M x2 ≥ 1 −M(1 − ) x1 ≤ 1 +M(1 − ) x2 ≤ 1 +M x1, x2 ≥ 0, ∈ {0, 1} =0: x1 ≥ 1 and x2 ≤ 1 =1: x1 ≤ 1 and x2 ≥ 1
Implementing logical conditions
So, either x1 ≥ 1 or x2 ≥ 1 but not both x1, x2 > 1
Converting to integer coefficient
2017/7/9 14
Converting non-integer coefficients to integer coefficients:
Minimize y = −(1/3)x1 − (1/2)x2 subject to (2/3)x1 + (1/3)x2 ≤ (4/3) (1/2)x1 − (3/2)x2 ≤ (2/3) x1, x2 ≥ 0, x1, x2 ∈ Z. Can be expressed as Minimize y = −2x1 − 3x2 (*6) subject to 2x1 + x2 ≤ 4 (*3) 3x1 − 9x2 ≤ 4 (*6) x1, x2 ≥ 0, x1, x2 ∈ Z.
Solving integer programs
2017/7/9 15
Solving integer programs (IP)
Branch and bound: dividing the problem into a number of smaller problems.
Cutting plane: adding constraints to force integrality
Relationship to linear relaxation (LR)
Since LR is less constrained than IP, the following is immediate:
For maximization, the optimal objective of LR is greater than or equal to the optimal objective of IP.
For minimization, the optimal objective of LR is less than or equal to the optimal objective of IP.
If LR is infeasible, then so is IP
If LR is optimized by integer values, then that solution is optimal for IP.
2017/7/9 16
If objective function coefficients are all integers, then
For maximization, the optimal objective for IP is less than or equal to the round down value of optimal objective of LR.
For minimization, the optimal objective for IP is greater than or equal to the round up value of optimal objective of LR.
Solving LR gives the following information:
A bound on the optimal value and if lucky, may give the optimal solution to IP.
Rounding the solution of LR will not in general give the optimal solution of IP. In fact, rounding may not be feasible for many cases.
Solving integer programs
2017/7/9 17
Solving integer programs
Branch and bound:
Solve the LR of the IP. If solution is integer, we are done. Otherwise, create two subproblems by branching on a fractional variable.
Choose an active subproblem and branch on a fractional variable. Repeat untill there are no active subproblems.
A subproblem is not active when any of the following holds:
You used the subproblem to branch on,
All variables in the solution are integer,
The subproblem is infeasible,
You can mark an subproblem not active by a bounding argument.
Branching rule for binary variable:
x=0 and x=1 for fractional value of x
Branching rule for non-binary variable
x 4 and x 4 for say x=4.2
Conclusion
2017/7/9 21
Integer programming is an effective means to solve many real world problems.
Linear relaxation only gives bounds.
Rounding produces non-optimal results and sometimes may not be possible at all.
Finite-valued integer variable can be converted to binary.
Non-integer coefficients can be converted to integer coefficients.
Many logical conditions can be formulated using integer programming.
Some form of non-linear constraints can be converted to equivalent linear constraints without any approximation while some others can be done so with approximation.