Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Brief journey in the big world of Integer Programming with the Knapsack

Brief journey in the big world of Integer Programming with theย Knapsack

Presentation for the oral exam of "INFO-F424 Combinatorial optimization" (ULB).

https://bitbucket.org/OPiMedia/brief-journey-in-the-big-world-of-integer-programming-with-the

More Decks by ๐ŸŒณ Olivier Pirson โ€” OPi ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ซ๐Ÿ‡ท๐Ÿ‡ฌ๐Ÿ‡ง ๐Ÿง ๐Ÿ‘จโ€๐Ÿ’ป ๐Ÿ‘จโ€๐Ÿ”ฌ

Other Decks in Science

Transcript

  1. Brief journey in the big world of Integer Programming with

    the Knapsack Olivier Pirson Presentation for the oral exam of INFO-F424 Combinatorial optimization Computer Science Department Universitรฉ Libre de Bruxelles June 1st, 2017 (Cosmetic correction November 26, 2017) Last version: https://bitbucket.org/OPiMedia/ brief-journey-in-the-big-world-of-integer-programming-with-the/
  2. Brief journey. . . with the Knapsack Problem Primal and

    dual bounds Branch and Bound References 1 Problem 2 Primal and dual bounds 3 Branch and Bound 4 References Brief journey. . . with the Knapsack 2 / 13
  3. Brief journey. . . with the Knapsack Problem Primal and

    dual bounds Branch and Bound References 0 โˆ’ 1 Knapsack Problem formulation Let a set of n items, for each i โˆˆ {1, 2, . . . , n} a weight ai a value ci a knapsack of capacity b Find the subset of {1, 2, . . . , n} that it may be contained in the knapsack and maximizes the value. The canonical Binary Integer Program formulation: Variables: xi โˆˆ {0, 1}, xi = 1 if item i is selected 0 otherwise Constraint: n i=1 ai xi โ‰ค b Objective function: max n i=1 ci xi Brief journey. . . with the Knapsack 3 / 13
  4. Brief journey. . . with the Knapsack Problem Primal and

    dual bounds Branch and Bound References 1 Problem 2 Primal and dual bounds 3 Branch and Bound 4 References Brief journey. . . with the Knapsack 4 / 13
  5. Brief journey. . . with the Knapsack Problem Primal and

    dual bounds Branch and Bound References Greedy heuristic algorithm โ€“ primal/lower bound Sort variables by decreasing order of density value weight : ci ai In this order, pick each possible item. That ๏ฌll the knapsack with the best independent choice. For example: max 45x1 + 48x2 + 9x3 subject to 5x1 + 12x2 + 3x3 โ‰ค 16 density 9 4 3 Give the solution: (1, 0, 1) with value 45 + 9 = 54. 54 is a lower bound of the problem. Indeed (0, 1, 1) is a better solution (in fact the optimal solution 1) of value 48 + 9 = 57. 1In simple example like this it is very easy to perform an exhaustive search. Brief journey. . . with the Knapsack 5 / 13
  6. Brief journey. . . with the Knapsack Problem Primal and

    dual bounds Branch and Bound References Linear relaxation โ€“ dual/upper bound The idea is to permit piece of item, and then ๏ฌll completely the knapsack. Of course the relaxed problem is an other problem and its solution is not a solution of the initial problem. But this solution is an upper bound for the initial problem. With the same example: max 45x1 + 48x2 + 9x3 subject to 5x1 + 12x2 + 3x3 โ‰ค 16 and now xi โˆˆ [0, 1] instead โˆˆ {0, 1} 5 + ฮฑ12 = 16 =โ‡’ ฮฑ = 11 12 Give (1, 11 12 , 0) with value 45 + 11 12 48 = 89. We known now that the optimal solution xโ‹† of the initial problem is such that: 54 โ‰ค xโ‹† โ‰ค 89 We obtained theses two bound in O(n). Brief journey. . . with the Knapsack 6 / 13
  7. Brief journey. . . with the Knapsack Problem Primal and

    dual bounds Branch and Bound References General principle of relaxation For the Integer Programming z = max{c(x) | x โˆˆ X โŠ† Rn} zR = max{f (x) | x โˆˆ T โŠ† Rn} is a relaxation if X โŠ† T c(x) โ‰ค f (x) โˆ€x โˆˆ X So zR is an upper bound for the initial problem. Brief journey. . . with the Knapsack 7 / 13
  8. Brief journey. . . with the Knapsack Problem Primal and

    dual bounds Branch and Bound References 1 Problem 2 Primal and dual bounds 3 Branch and Bound 4 References Brief journey. . . with the Knapsack 8 / 13
  9. Brief journey. . . with the Knapsack Problem Primal and

    dual bounds Branch and Bound References Exhaustive search We can break the problem into two subproblems, and so forth. That give this kind of binary tree representation: Figure: Discrete Optimization Brief journey. . . with the Knapsack 9 / 13
  10. Brief journey. . . with the Knapsack Problem Primal and

    dual bounds Branch and Bound References Contain the Exponential Explosion There is 2n possibilities, so an exhaustive search is quickly impossible. In fact, it is a NP-hard problem. (The decision problem is already NP-complete.) The goal is to push as far as possible the exponential curve. Figure: Discrete Optimization How avoid the impossible (in practice) exhaustive search? Brief journey. . . with the Knapsack 10 / 13
  11. Brief journey. . . with the Knapsack Problem Primal and

    dual bounds Branch and Bound References Depth-First Branch and Bound Pruning. . . Figure: Discrete Optimization We have the optimal solution 80 with only 7 nodes visited, instead 24 โˆ’ 1 = 15. Brief journey. . . with the Knapsack 11 / 13
  12. Brief journey. . . with the Knapsack Problem Primal and

    dual bounds Branch and Bound References 1 Problem 2 Primal and dual bounds 3 Branch and Bound 4 References Brief journey. . . with the Knapsack 12 / 13
  13. Brief journey. . . with the Knapsack Problem Primal and

    dual bounds Branch and Bound References References References: Pascal Van Hentenryck. Discrete Optimization. MOOC, University of Melbourne, https://www.coursera.org/learn/discrete-optimization Laurence A. Wolsey. Integer Programming. Wiley, 1998 NP-Complete, xkcd Brief journey. . . with the Knapsack 13 / 13