Lecture 6 Knapsack Problem Quadratic Assignment Problem 1
Lecture 6 Knapsack Problem Quadratic Assignment Problem 1
Outline èknapsack problem èquadratic assignment problem 2
Knapsack Problem 3
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
Problem Statement è n types of products è weight of type i: ai è value of type i: pi i = number of type-i products put in the truck è 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} 5
Common Knapsack Problems èproject selection problems ècapital budgeting allocation problems èinventory stocking problems è… 6
Multi-Dimensional Knapsack Problem è n types of products è weight of type i: ai i = number of type-i products put in the truck è volume of type i: vi è value of type i: pi è capacity of truck è b kg è c m 3 è question: selection of products to maximize the total value in a truck 7
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
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: (ai 1, ai 2, ai 3)T with trim loss ti è e. g. , a 1 = (a 11, a 12, a 13)T = (0, 0, 1) and t 1 = 3 9
Formulation of the Cutting-Stock Problem ètotally 15 cutting patterns Cut Patterns x 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x 10 x 11 x 12 x 13 x 14 x 15 1. 5 -meter segment 0 1 0 2 1 0 4 3 2 1 2 -meter segment 0 0 1 0 3 2 2 2 1 1 1 0 0 4 -meter segment 1 1 0 0 0 trim loss (meter) 3 1. 5 1 0 1. 5 3 2 3. 5 5 1 2. 5 4 5. 5 10
Formulation of the Cutting-Stock Problem è xi = the # of steel pipes cut in the ith pattern 11
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 1 a 1 + 2 a 2 + 3 a 3, èmax è s. t. 1. 5 a 1 + 2 a 2 + 4 a 3 7, èwhere j = value of the jth dual variable of the current basic feasible solution 12
Solution of the Cutting-Stock Problem Formulate a LP Solve the LP to get a BFS Resolve the LP to get a new BFS Get dual variables j of the BFS Solve a knapsack problem to get a new, valuable cutting pattern Add a cutting pattern (i. e. , new column) to the LP Yes any new cutting pattern? No Stop. Current BFS is optimum 13
Solution of the Knapsack Problem èdynamic program: more appropriate èbranch and bound: not as appropriate 14
Quadratic Assignment Problem 15
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 Inbound Doors Amount of Goods from Suppliers to Retailers Outbound Doors Door A Door a Door B Door b Retailer 1 Retailer 2 Supplier 1 7 0 Supplier 2 4 6 Distances Among the Doors Door a Door b Door A 2 3 Door B 3 2 16
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 A B 2 3 3 2 7 A B 4 6 a b total goods-distance = (2)(7) + (3)(4) + (2)(6) formulate an optimization to find the door assignment that minimizes the total goods-distance Inbound Doors Outbound Doors Door A Door a Door B Door b Distances Among the Doors Door a Door b Door A 2 3 Door B 3 2 Amount of Goods from Suppliers to Retailers Retailer 1 Retailer 2 Supplier 1 7 0 Supplier 2 4 6 17
Formulation of the Door Assignment Problem Distances Among the Doors Cost Coefficients cijkl, for xij = ykl = 1 y 1 a y 1 b y 2 a y 2 b x 1 A 14 21 0 0 x 1 B 21 14 0 0 x 2 A 8 12 12 18 x 2 B 12 8 18 12 Door a Door b Door A 2 3 Door B 3 2 Amount of Goods from Suppliers to Retailers Retailer 1 Retailer 2 Supplier 1 7 0 Supplier 2 4 6 18
Formulation of the Door Assignment Problem y 1 a y 1 b y 2 a y 2 b x 1 A 14 21 0 0 x 1 B 21 14 0 0 x 2 A 8 12 12 18 x 2 B 12 8 18 12 19
Quadratic Assignment Problem è four sets S 1, T 1, S 2, T 2, S 1 and T 1 of m items, Sn and Tn of n items è two groups of assignments èthe pairing of items in S 1 and T 1 èthe pairing of items in S 2 and T 2 è cost of assigning item i S 1, j T 1, k S 2, l T 2 = cijkl 20
Quadratic Assignment Problem 21
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
Another Quadratic Assignment Problem 23
Example Quantities Shipped Among the Factories èthree factories a, b, c èthree cities A, B, C a b c a 10 15 b 18 c Distance Between the Cities A B C A 14 8 B 11 C 24
Distance Between the Cities A B C A 14 8 B 11 C Quantities Shipped Among the Factories Example a b c a 10 15 b 18 c a. A a. B a. C b. A b. B b. C c. A c. B c. C a. A 140 80 210 120 a. B 140 110 210 a. C 80 110 b. A b. B b. C c. A c. B c. C 165 120 165 252 144 252 198 144 198 25
Example 26
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
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
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
Linearization of the Quadratic Assignment Problem è three cross-products 2 1 2+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
Linearization of the Quadratic Assignment Problem è let w = 2 1 2+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
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
- Slides: 32