Advanced linear programming http://www.staff.science.uu.nl/~akker103/alp/ Chapter 10: Integer linear programming models Marjan van den Akker 1
Intro. Marjan van den Akker Master Mathematics TU/e PhD Mathematics of Operations Research TU/e Engineer Netherlands Aerospace Center (NLR) Lecturer/researcher Computer Science UU: Research on planning algorithms, integer linear programming and simulation Master courses : Algorithms for decision support (COSC), Advanced Linear Programming (Mastermath) Coordination Software- and Gameproject 2
Method of working Lectures Self study material Slides and your own notes Book Some lecture notes (under construction) Additional reading material Exercises (if you hand in a solution I can check, good solutions can be made available on the course website) Slides and reading material published on website http://www.staff.science.uu.nl/~akker103/alp/ Written exam at the end. ONE retake 3 3/20/2017
Topics of part 2 Large-scale LP (Ch 6) Column generation and Dantzig-Wolfe decomposition Benders decomposition Integer Linear Programming (ILP) (Ch 10 + 11): Modelling Solving by branch-and-bound Cutting planes, branch-and-cut Lagrangean relaxation (Ch 11) Since column generation and Benders have their main applications in ILP, we will do ILP first. 4
This lecture ILP models Remarks on complexity LP and ILP Solving ILP by branch-and-bound Model choice matters: strength of LP-relaxation 5
Knapsack problem Knapsack with volume 15 What should you take with you to maximize utility? Item 1:paper 2:book 3:bread 4:smart -phone Utility 8 12 7 15 12 Volume 4 8 5 2 6 5:water 6
Knapsack problem (2) x 1 = 1 if item 1 is selected, 0 otherwise, x 2, max z= 8 x 1 + 12 x 2 + 7 x 3 + 15 x 4 + 12 x 5 subject to 4 x 1 + 8 x 2 + 5 x 3 + 2 x 4 + 6 x 5 15 x 1, x 2, x 3, x 4, x 5 Є {0,1} 7
(Mixed) Integer linear programming Min c T x + d T y s.t. Ax + By b x,y 0 x integral (or binary) Extension of LP: Good news: more possibilities for modelling Bad news: larger solution times 8
Combinatorial optimization Find feasible solution with minimal cost, maximal revenue Number of possible solutions is finite but very, very large Many combinatorial optimization problem can be modeled as ILP ILP is NP-hard 9
NP-hardness NP-hard!!!! P: problem can be solved in polynomial time NP: check solution for feasibility is polynomial, optimization is not provably faster than enumeration of all solutions. (non-deterministic polynomial) P vs NP $ 1 million Millenium Prize problem http://www.claymath.org/millennium/p_vs_np 10
A long time ago Sissa ben Dahir, the Grand Vizer to the Indian king, Shirham, presented his latest creation to his ruler. It was a game called chess. The king was so pleased, that he told Sissa that he could name his own reward. Sissa replied, "Majesty, give me the sum of 10,000 rupees; or give me some rice in the following manner: 1 grain to place on the first square of the chessboard, 2 grains to place on the second square, 4 grains for the third square, and 8 grains for the 4th square; and to continue in like manner, Cover Netherlands and Belgium with a layer of 1 m oh Mighty and Generous One, let me cover each of the 64 squares of the board." 11
(Mixed) Integer linear program Min c T x + D T y s.t. Ax + By b x,y 0 x integral (or binary) LP-relaxation Min c T x+ D T y s.t. Ax + By b x,y 0 Lower bound (or upper bound in case of maximization) 12
Solution method for linear programming Simplex method Slower than polynomial Practical Ellipsoid method (previous lecture) Polynomial (Khachian, 1979) Not practical Interior points methods Polynomial (Karmakar, 1984) Outperforms Simplex for very large instances LP P 13
Knapsack problem revisited since we use it to demonstrate branch-and-bound for ILP Knapsack volume b Item i has profit c i and weight a i x i = 1 if item i is selected, 0 otherwise max s. t. i= 1 x n i a i n i= 1 x i c i {0,1} x b i ( i = 1,2,..., n) 14 14
Knapsack problem: elements needed in branch-and-bound LP-relaxation: Greedy algorithm Step 0.Order variables such that c a 1 1 c a 2 2... c a n n Step1. x i 0 i ; restcapacity b = b; i = 1 Step 2. If a i b, then x j 1, else x j b a i.set b b a x i i ; j j + 1 Step 3. If b > 0, go to Step 2. Feasible solution: rounding down solution of LP-relaxation 15 15
Solving ILP by branch-and-bound Let x* be the best known feasible solution 1. Select an active sub problem F i (unevaluated node) 2. If F i is infeasible: delete node 3. Compute upper bound Z LP (F i ) by solving LP-relaxation and feasible solution x f (by rounding) If Z LP (F i ) value x* delete node (bounding) If x f is better than x*: update x* If solution x LP to LP-relaxation is integral, then If x LP is better than x*: update x* and node finished, otherwise split node into two new subproblems (branching) 4. Go to step 1 Optional This if for maximization problem, the book uses a minimization problem. 16
Modeling Objective function Constraints Decision variables 17
Facility location Possible locations: n Customers:m 18
Capacitated facility location Data: m customers, n possible locations of depot c ij unit cost of serving customer i by depot j Customer demand: D i Capacity depot: C j Fixed cost for opening depot DC: F j Which depots are opened and which customer is served by which depot? 19
Capacitated facility location: Our example shows modelling possibilities with binary variables Our model uses binary variables for fixed cost constraints Our model uses binary variables forcingconstraints: depot can only be used when it is open. 20
Uncapacitated facility location Data: m customers, n possible locations of depot Each customer is assigned to one depot d ij cost of serving customer i by depot j Fixed cost for opening depot DC: F j Which depots are opened and which customer is served by which depot? 21
Uncapacitated facility location Two formulations: (FL) and (AFL) P F is defined as the feasible set corresponding to the LP-relaxation of F (P F is a polyhedron) We show that P P FL AFL This means that (FL) gives a stronger lower bound However, (FL) has more constraints 22
Strength (quality) of an ILP formulation T set of feasible integral solutions For formulation F, P F is defined as the feasible set of solutions of the LP-relaxation of F P F is a polyhedron Ideal situation: P F is the convex hull of T Formulation A is stronger than formulation B if P A P B Hence, the bound is better This is likely to reduce the number of nodes in the branchand-bound tree This shows that model choices matter! 23
24
Minimum spanning tree G=(N,E) N set of n nodes E set of m edges C e cost of edge e Tree is a subgraph without cycles Spanning tree is a tree containing all nodes Find a spanning tree with minimum cost We compare formulations (Subtour) and (Cut) and show that (Subtour) is stronger. 25
Procurement problem Computer-manufacturer wants to buy 600 hard-disks Offers: Fixed cost Minimum amount to order Price per item Discount Threshold Discount price Available number of items A 100 50 24 250 18 500 B 75 50 28 150 20 700 What is the optimal procurement plan? 26
Procurement problem Contains important ILP modelling features: Already seen in facility location: Fixed cost Forcing contraints Other features: Linearize piece-wise linear cost Choice constraints 27
Treasure island Diamonds are buried on an island Numbers give number of diamonds in neighboring positions (include diagonal) At most one diamond per position No diamond at position with number 28
Treasure island with pitfall Like treasure island but exactly one given number is incorrect. 29
Wrap-up Integer linear programming (ILP) has many modelling possibilities ILP can be solved by branch-and-bound Soemtimes there are different ILP formulation for the same problem. Formulation makes a difference, e.g. because of the strength of the LP-relaxation. 30