340 likes | 421 Views
Lecture 6 Knapsack Problem Quadratic Assignment Problem. Outline. knapsack problem quadratic assignment problem. Knapsack Problem. Knapsack Problem. very useful sub-problems books Knapsack Problems by Hans Kellerer, Ulrich Pferschy, and David Pisinger (2004)
E N D
Outline knapsack problem quadratic assignment problem 2
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 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
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 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
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: (ai1, ai2, ai3)T with trim loss ti e.g., a1 = (a11, a12, a13)T = (0, 0, 1) and t1 = 3 9
Formulation of the Cutting-Stock Problem totally 15 cutting patterns 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 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
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 jof the BFS Solve a knapsack problem to get a new, valuable cutting pattern any new cutting pattern? Yes Add a cutting pattern (i.e., new column) to the LP No Stop. Current BFS is optimum 13
Solution of the Knapsack Problem dynamic program: more appropriate branch and bound: not as appropriate 14
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 Amount of Goods from Suppliers to Retailers Inbound Doors Outbound Doors Door a Door A Distances Among the Doors Door b Door B 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 B b b a a B A A Distances Among the Doors 7 2 total goods-distance = (2)(7) + (3)(4) + (2)(6) Amount of Goods from Suppliers to Retailers 3 Inbound Doors Outbound Doors 4 3 6 2 Door a Door A formulate an optimization to find the door assignment that minimizes the total goods-distance Door b Door B 17
Formulation of the Door Assignment Problem Distances Among the Doors Cost Coefficients cijkl, for xij = ykl = 1 Amount of Goods from Suppliers to Retailers 18
Quadratic Assignment Problem four sets S1, T1, S2, T2, S1 and T1 of m items, Sn and Tnof 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
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
Example three factories a, b, c three cities A, B, C Quantities Shipped Among the Factories Distance Between the Cities 24
Distance Between the Cities Example Quantities Shipped Among the Factories 25
Example 26
Linearization of the Quadratic Assignment Problem non-linear objective function with terms such as ijkl to linearize the non-linear term ijkl 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(n1)/2 cross products for nij’s any method to add less variables or less constraints 29
Linearization of the Quadratic Assignment Problem three cross-products 212+31314 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 = 212+31314 = 1(22+334) hope to have: 1 = 1 w = 22+334, and 1 = 0 w= 0 possible values of w {-1, 0, 1, 2, 3, 4, 5} 1 = 0 w = 0: w 51 how to model 1 = 1 w = 22+334? 31
Linearization of the Quadratic Assignment Problem to model 1 = 1 w = 22+334 w = 22+334 w 22+334 and w 22+334 1 = 1 w 22+334 and w 22+334 when 1 = 1: two valid constraints w 22+334 and w 22+334 when 1 = 0: two redundant constraints w 22+334+551 and w 22+334+515 32