Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 6 Knapsack Problem Quadratic Assignment Problem

Similar presentations


Presentation on theme: "Lecture 6 Knapsack Problem Quadratic Assignment Problem"— Presentation transcript:

1 Lecture 6 Knapsack Problem Quadratic Assignment Problem
1

2 Outline knapsack problem quadratic assignment problem 2

3 Knapsack Problem 3

4 Knapsack Problem very useful sub-problems books
Knapsack Problems by Hans Kellerer, Ulrich Pferschy, and David Pisinger (2004) Knapsack Problems: Algorithms and Computer Implementations by Silvano Martello and Paolo Toth (1990) 4

5 Problem Statement n types of products
weight of type i: ai value of type i: pi capacity of truck: b kg question: selection of products to maximize the total value in a truck special tpye: 0-1 knapsack problem: i  {0, 1} i = number of type-i products put in the truck 5

6 Common Knapsack Problems
project selection problems capital budgeting allocation problems inventory stocking problems 6

7 Multi-Dimensional Knapsack Problem
n types of products weight of type i: ai volume of type i: vi value of type i: pi capacity of truck b kg c m3 question: selection of products to maximize the total value in a truck i = number of type-i products put in the truck 7

8 Cutting-Stock Problem
knapsack problem: a sub-problem in solving cutting-stock problem by column generation 7-meter steel pipes of a given diameter order 150 pieces of 1.5-meter segments 250 pieces of 2-meter segments 200 pieces of 4-meter segments objective: minimize the amount of trim off 8

9 Formulation of the Cutting-Stock Problem
decisions: how to cut the pipes three types of segments type-1 segment: 1.5 m type-2 segment: 2 m type-3 segment: 4 m aij = the number of j type segments produced by the ith cut pattern the ith cut pattern: (ai1, ai2, ai3)T with trim loss ti e.g., a1 = (a11, a12, a13)T = (0, 0, 1) and t1 = 3 9

10 Formulation of the Cutting-Stock Problem
totally 15 cutting patterns Cut Patterns x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 1.5-meter segment 1 2 4 3 2-meter segment 4-meter segment trim loss (meter) 1.5 3.5 5 2.5 5.5 10

11 Formulation of the Cutting-Stock Problem
xi = the # of steel pipes cut in the ith pattern 11

12 Solution of the Cutting-Stock Problem
for Simplex Method, the reduced cost of the ith variable (i.e., the ith cutting pattern) can be shown to relate to a Knapsack Problem  max 1a1 + 2a2 + 3a3, s.t. 1.5a1 + 2a2 + 4a3  7, where j = value of the jth dual variable of the current basic feasible solution 12

13 Solution of the Cutting-Stock Problem
Formulate a LP Solve the LP to get a BFS Get dual variables j of the BFS Resolve the LP to get a new BFS Solve a knapsack problem to get a new, valuable cutting pattern any new cutting pattern? Add a cutting pattern (i.e., new column) to the LP Yes Stop. Current BFS is optimum No 13

14 Solution of the Knapsack Problem
dynamic program: more appropriate branch and bound: not as appropriate 14

15 Quadratic Assignment Problem
15

16 Door Assignment in a Distribution Center
a DC with two-inbound and two-outbound doors cross-docking operations to handle goods of two suppliers and two retailers objective: to minimize the total goods-distance Door A Door B Door a Door b Inbound Doors Outbound Amount of Goods from Suppliers to Retailers Retailer 1 Retailer 2 Supplier 1 7 Supplier 2 4 6 Distances Among the Doors Door a Door b Door A 2 3 Door B 16

17 Door Assignment in a Distribution Center
goods-distance for supplier 1  Door A, supplier 2  Door B, retailer 1  Door a, retailer 2  Door b Door A Door B Door a Door b Inbound Doors Outbound Distances Among the Doors Door a Door b Door A 2 3 Door B 3 2 A B a b total goods-distance = (2)(7) + (3)(4) + (2)(6) Amount of Goods from Suppliers to Retailers Retailer 1 Retailer 2 Supplier 1 7 Supplier 2 4 6 formulate an optimization to find the door assignment that minimizes the total goods-distance 4 6 7 A B a b 17

18 Formulation of the Door Assignment Problem
Distances Among the Doors Door a Door b Door A 2 3 Door B Cost Coefficients cijkl, for xij = ykl = 1 y1a y1b y2a y2b x1A 14 21 x1B x2A 8 12 18 x2B Amount of Goods from Suppliers to Retailers Retailer 1 Retailer 2 Supplier 1 7 Supplier 2 4 6 18

19 Formulation of the Door Assignment Problem
y1a y1b y2a y2b x1A 14 21 x1B x2A 8 12 18 x2B 19

20 Quadratic Assignment Problem
four sets S1, T1, S2, T2, S1 and T1 of m items, Sn and Tn of n items two groups of assignments the pairing of items in S1 and T1 the pairing of items in S2 and T2 cost of assigning item i  S1, j  T1, k  S2, l  T2 = cijkl 20

21 Quadratic Assignment Problem
21

22 Another Quadratic Assignment Problem
two sets S and T, each of n items the pairing of items in S and T as in an assignment problem cost of pairing i  S with j  T and k  S with l  T: cijkl 22

23 Another Quadratic Assignment Problem
23

24 Quantities Shipped Among the Factories Distance Between the Cities
Example Quantities Shipped Among the Factories three factories a, b, c three cities A, B, C a b c  1 0 15 18 Distance Between the Cities A B C  14 8 11 24

25 Distance Between the Cities
Quantities Shipped Among the Factories A B C  14 8 11 Example a b c  1 0 15 18 aA aB aC bA bB bC cA cB cC  140 80 210 120 110 165 252 144 198 25

26 Example 26

27 Linearization of the Quadratic Assignment Problem
non-linear objective function with terms such as ijkl to linearize the non-linear term ijkl let ijkl = ij kl need to ensure that ijkl = 1  ij kl = 1 27

28 Linearization of the Quadratic Assignment Problem
ijkl = 1  ij kl = 1 ijkl = 1  ij = 1 and kl = 1 two parts ijkl = 1  ij = 1 and kl = 1 ij = 1 and kl = 1  ijkl = 1 tricks ijkl  ij and ijkl   kl ij + kl  1 + ijkl 28

29 Linearization of the Quadratic Assignment Problem
drawback of the method addition of one variable and three constraints for one cross-product n(n1)/2 cross products for n ij ’s any method to add less variables or less constraints 29

30 Linearization of the Quadratic Assignment Problem
three cross-products 212+31314 of four variables 1, 2, 3, 4 the previous method: 3 new variables and 9 new constraints another method with 1 new variable and 3 new constraints 30

31 Linearization of the Quadratic Assignment Problem
let w = 212+31314 = 1(22+334) hope to have: 1 = 1  w = 22+334, and 1 = 0  w = 0 possible values of w  {-1, 0, 1, 2, 3, 4, 5} 1 = 0  w = 0: w  51 how to model 1 = 1  w = 22+334? 31

32 Linearization of the Quadratic Assignment Problem
to model 1 = 1  w = 22+334 w = 22+334  w  22+334 and w  22+334 1 = 1  w  22+334 and w  22+334 when 1 = 1: two valid constraints w  22+334 and w  22+334 when 1 = 0: two redundant constraints w  22+334+551 and w  22+334+515 32


Download ppt "Lecture 6 Knapsack Problem Quadratic Assignment Problem"

Similar presentations


Ads by Google