27

The Multiple Knapsack Problem With Color Constraints

  • Upload
    docong

  • View
    242

  • Download
    0

Embed Size (px)

Citation preview

Page 1: The Multiple Knapsack Problem With Color Constraints

RC 21138 (94508) revised March 24, 1998Computer Science/MathematicsIBM Research ReportThe Multiple Knapsack Problem With Color ConstraintsMilind Dawande Jayant KalagnanamIBM Research DivisionT.J. Watson Research CenterYorktown Heights, New York 10598LIMITED DISTRIBUTION NOTICEThis report has been submitted for publication outside of IBM and will probably be copyrighted if accepted for publica-tion. It has been issued as a Research Report for early dissemination of its contents. In view of the transfer of copyright to theoutside publisher, its distribution outside of IBM prior to publication should be limited to peer communications and speci�crequests. After outside publication, requests should be �lled only by reprints or legally obtained copies of the article (e.g.,payment of royalties).IBM Research DivisionAlmaden � Austin � T.J. Watson � Beijing � Haifa � Tokyo � Zurich

Page 2: The Multiple Knapsack Problem With Color Constraints

The Multiple Knapsack Problem With Color ConstraintsMilind Dawande Jayant KalagnanamIBM, T. J. Watson Research CenterYorktown Heights, NY 10598AbstractIn this paper, we study a new problem which we call the multiple knapsack problemwith color constraints (MKCP). Motivated by a real application from the steel industry [6],we generalize the multiple knapsack problem by adding a new attribute (called \color" inthe paper) to an item and then adding the associated \color" constraints which restrictthe number of distinct colors which can be assigned to a knapsack. The color constraintsprovide a representation for a general class of processing constraints.We consider the MKCP from a polyhedral point of view. Three classes of facet de�ninginequalities and four classes of other valid inequalities are discussed. We establish neces-sary and su�cient conditions under which a color constraint is redundant and also provideseparate necessary conditions and su�cient conditions under which a color constraint isfacet de�ning. In addition, we prove that a basic fractional solution to the linear pro-gramming relaxation can be eliminated by a facet de�ning inequality associated with anindividual knapsack constraint.Key Words: multiple knapsack problem; color constraints; polyhedral structure, validinequalities, facets.1 IntroductionIn this paper we study a multiple knapsack problem with color constraints (MKCP), a for-mulation derived for a real application in the steel industry [6]. The conventional multipleknapsack (MKP) problem considers a set of N items which need to be packed into M knap-sacks to maximize pro�t. We generalize this conventional problem by associating with eachitem a color attribute and restricting the number of colors in any knapsack to be less thantwo. Although the number of allowable colors in any knapsack can in general be any K � N ,the results in this paper are based on allowing no more than two colors in any knapsack.However, some of the results extend to the case when more than two colors are allowed for aknapsack. Additional assignment restrictions are speci�ed in terms of a subset of knapsackswhich can hold any given item. 2

Page 3: The Multiple Knapsack Problem With Color Constraints

(with their associated colors)Orders Slabs

Figure 1: The multiple knapsack problem with colorsThe multiple knapsack problem with color constraints is motivated by our experience withthe surplus inventory matching problem in the steel industry [6]. Production planning beginswith an order book which contains a list of orders that need to be satis�ed. Before planningproduction, an attempt is made to satisfy orders using leftover slabs from surplus inventory.The problem of applying orders against an existing surplus inventory is called the surplusinventory matching problem and can be formulated as a multiple knapsack problem withcolor and assignment constraints. The goal of inventory matching is to maximize the totalweight of the order book that is applied against existing inventory. In the following paragraphswe explain the background for the assignment and color constraints. For pedagogical purposeswe describe the assignment restrictions before the color constraints.For each order in the order book we can identify a set of applicable slabs from the surplusinventory. These assignment restrictions are based on quality and physical dimension consid-erations. For any given order only slabs which are of the same quality or better can be applied.In addition, the thickness and width requirements for each order need to be compatible withthose of each applicable slab. These considerations restrict the number of applicable slabsfor each order. The surplus inventory matching problem can be represented by a undirected3

Page 4: The Multiple Knapsack Problem With Color Constraints

bipartite graph as shown in Figure 1.The assignment constraints can also be thought of as specifying a list of orders that can beapplied against any slab in the surplus inventory. However, not all orders assignable to aslab can be packed together on the slab. Such packing constraints emerge out of processingconsiderations in the �nishing line of a steel mill. Associated with each order is a route thatspeci�es the set of process operations that need to be applied in the �nishing mill. Orders withdi�erent routes require di�erent process operations and are referred to as being of di�erenttype. Slabs packed with di�erent orders types need to be cut before they are processed in the�nishing mill. Since cutting slabs is expensive and often the cutting machine is a bottleneck,strong constraints are posed in terms of the number of allowed cuts per slab. The simplestand most commonly used constraint is to limit the number of required cuts to one, i.e. nomore that two order types are allowed on a slab. In order to describe this constraint formallywe associate a unique color for each route code and restrict the number of colors on a slab tobe no more than two. Notice that this implies that we associate a color with each order basedon its route code. This restricts the number of di�erent order types on a slab to two and thenumber of required cuts to be no more than one.The rest of the paper is organized as follows. The following section provides two formulationsfor the MKCP. Section 3 shows that the dimension of MKCP is the same as the multipleknapsack problem and examines which facets of MKP are also facets for MKCP. In addition, itis shown that the color constraints are also facets of MKCP. Section 4 provides a strengtheningof four classes of valid inequalities for MKP based on the special structure of MKCP. Section5 examines the structure of basic fractional solutions to the linear programming relaxationof MKCP. It is shown that such a solution can be eliminated by a facet de�ning inequalityassociated with an individual knapsack constraint. Section 6 discusses, in brief, the extensionwhen the number of distinct colors allowed for a knapsack is more than 2. Section 7 summarizes4

Page 5: The Multiple Knapsack Problem With Color Constraints

the results of this paper.2 Formulations for MKCPIt is easy to see MKCP is NP-hard since if all items have the same color and we have onlyone knapsack, the MKCP reduces to the well known subset sum problem, which is known tobe NP-hard [7]. In this section, we provide two formulations for MKCP. The �rst formulationis more natural, in the sense that it has a separate set of variables for modeling the colorconstraints of the problem. The second formulation implicitly models the color constraintswithout introducing new variables. The �rst formulation has more variables than the secondformulation but has fewer constraints.n = Total number of items.m = Total number of knapsacks.N = Set of items.M = Set of Knapsacks.Ni = Set of knapsacks incident to item i.Nj = Set of items incident to knapsack j.xij = 1 if item i is assigned to some knapsack; 0 otherwise.Cj = Set of colors incident on knapsack j.ycj = 1 if an item(s) of color c obtains material from knapsack j; 0 otherwise.Oi = Weight of item i.Wj = Capacity of knapsack j. Table 1: List of notationsMax Pni=1Pj2Ni Oixijsubject to Pi2Nj Oixij � Wj 1 � j � mPj2Ni xij � 1 1 � i � nPc2Cj ycj � 2 1 � j � mxij � yc(i)j 1 � i � n; j 2 Ni5

Page 6: The Multiple Knapsack Problem With Color Constraints

xij 2 f0; 1g 1 � i � n; j 2 Niycj 2 f0; 1g 8c 2 Cj ; 1 � j � mThe �rst and second set of constraints are the well known knapsack constraints (for theknapsacks) and assignment constraints (for the items). The third and fourth set of constraintsrestrict the total number of colors incident on a knapsack to less than two. The total numberof variables in this formulation is Pni=1 jNij+Pmj=1 jCj j (= Pmj=1 jNjj+Pmj=1 jCj j) while thetotal number of constraints is Pni=1 jNij+2m+n. In the formulation above, a separate set ofvariables (namely, the ycj variables) are used to model the color constraints. However, using aseparate set of variables is not necessary. Below, we model the problem without introducingnew variables.(P �) Max Pni=iPj2Ni Oixijsubject to Pi2Nj Oixij � Wj 1 � j � mPj2Ni xij � 1 1 � i � nxi1j + xi2j + :::+ xikj � 2 8 maximal sets of size k � 3of items of di�erent colors 8 jxij 2 f0; 1g 1 � i � n; j 2 NiNote that xij = 1 implies that item i has been assigned to knapsack j. If the total numberof distinct colors incident on a knapsack is less than or equal to 2, then, clearly, the colorconstraints are not required for the knapsack. If there are more than two colors incidenton the knapsack j, then, of the jNjj items incident on knapsack j, let jNkj j be the set ofitems of color k, k = 1; :::; jCjj. For every maximal set of items (incident on knapsack j)having di�erent colors, we add a constraint which states that the a maximum of two items6

Page 7: The Multiple Knapsack Problem With Color Constraints

can be assigned from the maximal set. A maximal set of items having di�erent colors involveschoosing exactly one item of each color. Hence, there are a total of �jCj jk=1jNkj j constraints (onefor each maximal set) for knapsack j. These constraints, together, state that the total numberof di�erent colors incident on knapsack j is bounded above by two. Such a constraint set isadded for each knapsack having more than two colors incident on it. For this formulation,the total number of variables is Pni=1 jNij (= Pmj=1 jNj j)). The total number of constraints isbounded above by Pmj=1�jCj jk=1jNkj j+m+ n:We illustrate the above formulations on a small example.Example 1: Consider Figure 2. We have four items I1, I2, I3 and I4 having weights 5, 8,6 and 4 respectively, and two knapsacks, K1 and K2 having capacities 8 and 15 respectively.Items I1 and I2 have the same color (c1) while items I3 and I4 have colors c2 and c3 respectively.Thus, the total number of distinct colors for the items is 3.3

I4

I1

I

I

3

2

K1

K2

5

8

6

4

8

15

Color = c1

Color = c

Color = c

Color = c

1

2 Figure 2: Example 1Formulation 1:Max 5x11 + 5x12 + 8x21 + 8x22 + 6x31 + 6x32 + 4x41 + 4x42subject to 7

Page 8: The Multiple Knapsack Problem With Color Constraints

5x11 + 8x21 + 6x31 + 4x41 � 85x12 + 8x22 + 6x32 + 4x42 � 15x11 + x12 � 1; x21 + x22 � 1x31 + x32 � 1; x41 + x42 � 1yc11 + yc21 + yc31 � 2; yc12 + yc22 + yc32 � 2x11 � yc11 ; x12 � yc12 ; x21 � yc11 ; x22 � yc12x31 � yc21 ; x32 � yc22 ; x41 � yc31 ; x42 � yc32xij 2 f0; 1g; ycj 2 f0; 1gFormulation 2:Max 5x11 + 5x12 + 8x21 + 8x22 + 6x31 + 6x32 + 4x41 + 4x42subject to 5x11 + 8x21 + 6x31 + 4x41 � 85x12 + 8x22 + 6x32 + 4x42 � 15x11 + x12 � 1; x21 + x22 � 1x31 + x32 � 1; x41 + x42 � 1x11 + x31 + x41 � 2; x21 + x31 + x41 � 2x12 + x32 + x42 � 2; x22 + x32 + x42 � 2xij 2 f0; 1g3 Dimension and FacetsIn the traditional multiple knapsack problem [4][2], an item can be assigned (if possible) to anyknapsack. In other words, the bipartite graph, G(V;E) (Figure 1) is complete. In the MKCP,8

Page 9: The Multiple Knapsack Problem With Color Constraints

typically, an item could be assigned to one knapsack among a subset of knapsacks. That is,jNij 6=M , in general. However, without loss of generality, we can assume that G is complete.For if not, a missing edge (i; j) can be added to the bipartite graph and the correspondingvariable xij can be introduced into the formulations with objective function coe�cient zero.With the above modi�cation, we can assume Ni = M 8i 2 N and Nj = N 8j 2M . Call themodi�ed problem (P ). Then, it is easy to see that an optimal solution to (P ) gives an optimalsolution to (P �) with the same objective function value. For simplicity, we assume that forevery item i, Oi � Wj 8j 2 M . We refer to the convex hull of feasible 0-1 solutions to (P )as PMKCP . The corresponding multiple knapsack polytope, obtained by removing the colorrestrictions, will be referred to as PMKP . A single knapsack problem obtained by consideringa knapsack k 2 M and a set of items �N � N will be denoted by SK( �N; �O;Wk) where �O isthe vector of item weights corresponding to items in �N .Theorem 3.1 Dimension of the PMKCP is mn.Proof: Denote the dimension of PMKCP by d. It is well known that the dimension of PMKPis mn [4]. Note that every feasible solution to MKCP is also feasible for the correspondingMKP problem. Hence d � mn.Now, the zero vector and the mn unit vectors are a�nely independent and valid 0-1 solutionsfor PMKCP . Hence, d � mn. The result follows. 2The following result is easy to show.Theorem 3.2 The upper bound constraint xij � 1 de�nes a facet for PMKCP if and only ifOi� +Oi � Wj where Oi� = maxk2Nj�figOk. 9

Page 10: The Multiple Knapsack Problem With Color Constraints

The polyhedral structure of single knapsack and multiple knapsack problems has been widelystudied in the operations research literature [1][8][9][10][4][2]. A well known result, proved in[4], is that all non-trivial facets for the single knapsack problem are facets for the multipleknapsack problem. Given the proximity of the MKCP to the MKP, it is then natural to aska similar question about which facets for the MKP are also facets for MKCP.De�nition: A facet �x � �0 of PMKP is said to be color-feasible for the correspondingPMKCP if there exist mn a�nely independent feasible 0-1 points xi; i = 1; :::; mn for PMKPwith �xi = �0 such that all these points also satisfy the color constraints.Lemma 3.3 A facet �x � �0 of PMKP is also a facet for PMKCP if and only if it is colorfeasible for the corresponding PMKCP .Proof: Suppose a facet �x � �0 of PMKP is also a facet for PMKCP . Then there exists mn0-1 points xi; i = 1; :::; mn which are feasible for PMKCP such that �xi = �0. Note that eachof these points is also feasible for PMKP .Conversely, suppose a facet �x � �0 of PMKP is color feasible for the corresponding PMKCP .Since, PMKCP � PMKP , �x � �0 is valid for PMKCP . Also, there exists mn feasible 0-1points xi; i = 1; :::; mn with �xi = �0 which are valid for PMKP and also satisfy the colorconstraints. Thus, xi; i = 1; :::; mn are valid for PMKCP . It then follows that �xi = �0 de�nesa facet for PMKCP . 2In [4] it has been shown that the non-negativity constraints xij � 0; i 2 M; j 2 N and theassignment constraints Pj2N(i) xij � 1; i 2 M are facets of PMKP . Also, it is easy to seethat these facets are color-feasible for PMKCP . Then, Lemma 3.3 implies the following result.Theorem 3.4 The following inequalities are facets of PMKCP .10

Page 11: The Multiple Knapsack Problem With Color Constraints

� The nonnegativity constraints xij � 0; i 2M; j 2 N .� The assignment constraints Pj2N(i) xij � 1; i 2M:3.1 The Color ConstraintsSince the color constraints are fundamental to the MKCP, we �rst examine these constraintsfor the single knapsack problem with colors (SKCP) and then extend our results to the MKCP.For a single knapsack problem, let k color classes 1; 2; :::; k be incident on the knapsack. Thecolor constraint, then, takes the formxi1 + xi2 + :::+ xik � 2 (1)where item ij has color j. For simplicity, we assume that the dimension of the convex hull,PSKCP , of feasible integer solutions to SKCP is n. Let S = fi1; i2; :::; ikg represent the setof items in the color constraint (1). De�ne Sc = NnS. Each pair of items (ip; iq) in S withOip +Oip � W , where W is the weight of the knapsack, corresponds to a characteristic vectorin f0; 1gn which is feasible and satis�es (1) with equality. If no such pair exists, then, clearly,(1) is redundant. Below, we characterize this.Theorem 3.5 The color constraint (1) is redundant if and only if every collection of threeitems from S which does not appear in any other color constraint is a cover for the knapsack.Proof: Suppose every collection of three items from S which does not appear in any othercolor constraint is a cover. Consider any collection C = fi1; i2; i3g of three items from S. If Cbelongs to some other color constraint then, clearly, xi1+xi2+xi3 � 2. If C does not appear inany other color constraint, then, by the hypothesis, C is a cover and hence xi1 +xi2 +xi3 � 2.Thus, in any case, no more than two items from C can be assigned to the knapsack. This is11

Page 12: The Multiple Knapsack Problem With Color Constraints

the case for every collection of three items from S. Hence, we have xi1 + xi2 + :::+ xik � 2.Conversely, if the constraint (1) is redundant, then, for any collection C = fi1; i2; i3g of threeitems from S, we have xi1 + xi2 + xi3 � 2. Hence, either fi1; i2; i3g is a cover or C appears aspart of some other color constraint. 2On the other hand, if there exists n characteristic vectors tight for (1) such that the resultingn�n matrix of these vectors is nonsingular, the inequality (1) de�nes a facet for SKCP. Below,we present a simple su�cient condition under which the constraint (1) is a facet for SKCP.The condition stated in the theorem is weaker than what is actually required but we presentit here since it is more intuitive and relates well to the standard knapsack terminology.Theorem 3.6 If, for every pair of items fip; iqg from S, the collection of three items fip; iq; ilgis not a cover for every item il 2 Sc, the constraint (1) de�nes a facet for SKCP.Proof: It is easy to see that the condition in the theorem enables us to demonstrate nfeasible 0-1 points which satisfy (1) with equality. First, consider the following k�k matrix Awhose columns are indexed by the items of S (Figure 3). Each row of A contains exactly two1s. It is easy to see that A is non-singular. Now, we construct an n� n matrix A� as follows(see Figure 4): Matrix A is a submatrix of A� and occupies the �rst k rows and k columns.The remaining n� k columns of A� are indexed by items of Sc. For every item ip 2 Sc, sinceS is a maximal collection of items of di�erent colors, there exists an item, say it 2 S, suchthat items ip and it have the same colors. Then, the vector vil 2 f0; 1gn which has three 1scorresponding to items il, it and any other item is 2 Snfitg is feasible due to the hypothesis.We construct such a vector for each item in Sc. These vectors correspond to the remainingn � k rows of A�. Since each of these n � k rows added is linearly independent of the �rst krows, it is easy to verify that the matrix A� is non-singular. Also, note that each row of A� isa 0-1 feasible point for SKCP which satis�es (1) with equality. The result follows. 212

Page 13: The Multiple Knapsack Problem With Color Constraints

1 11 1

1 1....

1 11 1

11

=

1 1

i i i i4321 . . . . ik

k k

0

0

AFigure 3: The k � k matrix A in Theorem 3.4A

k k

s

0

11

1 1

ip

1 111

11

A*

n n =

it

i

Figure 4: The n� n matrix A� in Theorem 3.4As stated above, the su�cient condition provided in Theorem 3.6 is weaker. Below, we state,without proof, a stronger condition.Theorem 3.7 If1. For every item il 2 Sc, there exists a pair of items filp; ilqg in S such that the collectionfilp; ilq; ilg is not a cover and2. There exists k pairs of items fipl; jqlg; l = 1; :::; k from S such that the corresponding kdimensional characteristic vectors are linearly independent in <kthen (1) de�nes a facet for SKCP. 13

Page 14: The Multiple Knapsack Problem With Color Constraints

The following result, which is easy to prove, provides a simple necessary condition for theinequality (1) to de�ne a facet of SKCP.Theorem 3.8 If (1) de�nes a facet for SKCP then for every item il 2 Sc, there exists a pairof items filp; ilqg in S such that the collection filp; ilq; ilg is not a cover.Now, it is easy to extend the above results to MKCP. For the MKCP, for a knapsack, sayknapsack j, the color constraint takes the formxi1j + xi2j + :::+ xikj � 2 (2)De�ne Sj = fi1; i2; :::; ikg and Scj = NjnSj . Theorems 3.4 and 3.5 generalize to the MKCPunder the same conditions.Theorem 3.9 The color constraint (2) is redundant for MKCP if and only if every collectionof three items from Sj which does not appear in any other color constraint for knapsack j isa cover for the knapsack j.Theorem 3.10 If, for every pair of items fip; iqg from Sj, the collection of three itemsfip; iq; ilg is not a cover for every item il 2 Scj , the constraint (2) de�nes a facet for MKCP.Theorem 3.11 If (2) de�nes a facet for MKCP then for every item il 2 Scj , there exists apair of items filp; ilqg in S such that the collection filp; ilq; ilg is not a cover for the knapsack j.4 Strengthening of Valid InequalitiesSince PMKCP � PMKP , all valid inequalities for PMKP are valid for PMKCP . So, the moreinteresting question is: Can these inequalities be strengthened for the special structure of14

Page 15: The Multiple Knapsack Problem With Color Constraints

PMKCP ? Below, we consider some known classes of valid inequalities for PMKP .4.1 Minimal Cover InequalitiesAt set C � N is a cover with respect to some knapsack k 2 M if Pi2C Oi > Wk. The coveris minimal with respect to k if Pi2CnfcgOi � Wk for all c 2 C. Suppose that C � N is aminimal cover with respect to some knapsack k. The inequalityXi2C xik � jCj � 1 (3)is called the minimal cover inequality corresponding to C and k. It was shown in [1],[5] and [9]that the minimal cover inequality corresponding to C and k de�nes a facet for SK(C;O;Wk).[4] shows that all non-trivial facets for SK(C;O;Wk) are facets for PMKP .Suppose the minimal cover C is composed of p � N distinct colors, c1; c2; :::; cp. Let S(c1); S(c2); :::; S(cp)be the sets of items, respectively, corresponding to the colors c1; c2; :::; cp. Thus,jCj = jS(c1)j+ jS(c2)j+ :::+ jS(cp)j (4)Without loss of generality, assume jS(c1)j � jS(c2)j � ::: � jS(cp)j. Then, no more thatjS(c1)j+ jS(c2)j edges can be incident on knapsack k. For if not, then knapsack k will havemore than two colors incident on it. Hence, the constraintXi2C xik � minfjCj � 1; jS(c1)j+ jS(c2)jg (5)is valid for MKCP. Note that due to (4), the inequality (5) can be a considerable strengtheningover the inequality (3). Speci�cally, whenever p � 4, the inequality (5) is stronger than (3).It is instructive to study conditions under which the strengthened inequality (5) is facetde�ning for MKCP. The following result is easy to prove:15

Page 16: The Multiple Knapsack Problem With Color Constraints

Lemma 4.1 If jS(c1)j+ jS(c2)j � jCj � 1 and if 8 i 2 NnC1. item i has the same color as c1 or c2 and2. S(c1) [ S(c2) [ fig is not a cover for knapsack kthen the strengthened inequality (5) de�nes a facet for MKCP.4.2 Multiple Cover InequalitiesA set of items C � N with the property that Pi2C Oi > Pj2J Wj for J � M is called amultiple cover with respect to J . In [10], it was shown that the multiple cover inequalityXj2JXi2C xij � jCj � 1 (6)is valid for PMKP . In [2], Ferreira, Martin and Weismantel examine the question of when themultiple cover inequality is facet de�ning.The strengthening idea for the multiple cover inequality follows the same idea as in the previoussection. So, we refer to the same notation as in the previous section. Here, note that no morethan jJ j(jS(c1j+ jS(c2j) edges can be incident on the knapsacks in the multiple cover becauseotherwise at least one of the knapsacks would have more than jS(c1j+ jS(c2j) colors incidenton it which in turn means that this knapsack has more than two colors incident on it. Thus,the inequalityXj2JXi2C xij � minfjCj � 1; jJ j(jS(c1)j+ jS(c2)jg (7)is valid for MKCP. 16

Page 17: The Multiple Knapsack Problem With Color Constraints

4.3 (1,d)-con�guration InequalitiesA set N 0 [ z with N 0 � N and z 2 NnN 0 is called a (1,d)-con�guration with respect to someknapsack k 2M ifPj2N 0 Oj � Wk and K[fzg is a minimal cover with respect to knapsack kfor all K � N 0 with jKj = d. If N 0 [ z is a (1,d)-con�guration with respect to some knapsackk 2M , the inequalityXi2N 0 xik + (jN 0j � d+ 1)xzk � jN 0jis called a (1,d)-con�guration inequality corresponding to N 0 [ z. It was shown in [4] that thisinequality de�nes a facet for SK(N 0 [ z; O;Wk).Let c� be the color corresponding to item z and let c1; c2; :::; cp be the colors represented inthe item set N 0 . As before, we denote the sets of items corresponding to color ci by S(ci). Tostrengthen the (1,d)-con�guration inequality for MKCP, we consider two mutually exclusivecases:1. No item in the set N 0 has the same color as item z. Then,� If xzk = 0, we haveXi2N 0 xik � minfd� 1; jS(c1)j+ jS(c2jgand henceXi2N 0 xik + (jN 0j � d+ 1)xzk � minfd� 1; jS(c1)j+ jS(c2jg (8)� If xzk = 1, Pi2N 0 xik � minfd� 1; jS(c1)jg and henceXi2N 0 xik + (jN 0j � d+ 1)xzk � minfd� 1; jS(c1)jg+ jN 0j � d+ 1 (9)17

Page 18: The Multiple Knapsack Problem With Color Constraints

From (8) and (9), it then follows that the inequalityPi2N 0 xik + (jN 0j � d+ 1)xzk �maxfminfd� 1; jS(c1)jg+ jN 0j � d+ 1;minfd� 1; jS(c1)j+ jS(c2jggis valid for MKCP.2. Some item in the set N 0 has the same color as item z.� In this case, considering similar cases (i.e. xzk = 0 and xzk = 1) as above, weobtain that the inequality Pi2N 0 xik + (jN 0j � d+ 1)xzk �maxfminfd� 1; jS(c1)j+ jS(c2)jg;minfd� 1; jS(c1)j+ jS(c�)jg+ jN 0j � d+ 1gis valid for MKCP.4.4 Weight InequalitiesRecently, Weismantal [8] introduced the class of weight inequalities for the 0/1 knapsackproblem. It is shown in [8] that these inequalities are needed to describe the knapsack polytopewhen the weight of the items lie in certain intervals. Here, we �rst de�ne the weight inequalitiesand then provide a strengthening.Let T � N with O(T ) < Wk be given and let r = Wk �O(T ). Let Ij denote the set of itemswith weight j. Assuming Sj�r+1 IjnT 6= �, the inequalityXi2T Oixi + Xj�r+1Xi2Ij(j � r)xi � O(T ) (10)is called the weight inequality with respect to T [8].18

Page 19: The Multiple Knapsack Problem With Color Constraints

Suppose the set T is composed of p � N distinct colors c1; c2; :::; cp. Let S(c1); S(c2); :::; S(cp)be the sets of items, respectively, corresponding to the colors c1; c2; :::; cp. Without loss ofgenerality, assume jS(c1)j � jS(c2)j � ::: � jS(cp)j. Then, as mentioned earlier in Section 4.1,no more that jS(c1)j+ jS(c2)j edges can be incident on knapsack k. Also, for a subset of itemsQ � N , let O(Q) denote the weight of items in Q. Consider the disjunctionXj�r+1Xi2Ij xi � 0_ Xj�r+1Xi2Ij xi � 1In the �rst case,Xi2T Oixi + Xj�r+1Xi2Ij(j � r)xi �Xi2T Oixi � O(S(c1)) +O(S(c2))In the second case,Xi2T Oixi + Xj�r+1Xi2Ij(j � r)xi = Xi2T Oixi + Xj�r+1Xi2Ij jxi � r Xj�r+1Xi2Ij xi� Wk � (O(T )� (O(S(c1)) +O(S(c2))))� r= O(S(c1)) +O(S(c2))Thus, the inequalityXi2T Oixi + Xj�r+1Xi2Ij(j � r)xi � O(S(c1)) + O(S(c2)) (11)is valid for MKCP. Note that (11) is a strengthening of (10) whenever the set T consists ofmore than two colors.5 Characteristics of basic fractional solutions to the linear pro-gramming relaxation LPMKCPIn this section, we examine the structure of basic fractional solutions to LPMKCP . The mainresult of the analysis is that a basic fractional solution can be eliminated by a minimal cover19

Page 20: The Multiple Knapsack Problem With Color Constraints

inequality associated with an individual knapsack constraint.Let �x be the optimum solution of the linear programming relaxation of (P ). De�ne RG( �V ; �E),�V � V , �E � E, as the induced subgraph of G(V;E) obtained by considering edges (i; j) 2 Esuch that 0 < �xij < 1. In the following, we refer to RG( �V ; �E) as the residual subgraph of G.We consider two cases: (a) RG does not contain any cycle and (b) RG contains a cycle.Case A: The residual graph does not contain any cycles.Then, RG is a forest and its connected components are trees. First, we assume that eachconnected component contains at least two knapsacks. We carry out the analysis in threesteps: First, Lemma 5.1 shows the existence of a knapsack such that either its knapsackconstraint is tight or one of its color constraints is tight. Then, Theorem 5.2 shows that if theknapsack is tight, then there exits a minimal cover inequality which cuts o� �x. Theorem 5.3shows that we will always �nd a knapsack such that its knapsack constraint is tight.Lemma 5.1 In any connected component (which is a tree), there exists at least one knapsacksuch that either its knapsack constraint or one of its color constraints is tight.Proof: Suppose not. That is, every knapsack has its knapsack constraint as well as allits color constraints slack. Consider a path P containing any two knapsacks Ki and Kj.The path P has the form Ki-Ii1-Kj (see Figure 5). Keeping all other variables �xed, aperturbation of the fractional variables corresponding to P , �xi1;i � � and �xi1;j � � is feasiblefor LPMKCP for some 0 < � < 1. Since the knapsack constraint and the color constraints areslack for Ki and Kj , there exists a feasible perturbation �i > 0, for variable �xi1;i such thatthe knapsack constraint and the color constraints remain valid for Ki if �xi1;i is perturbed to�xi1;i� �i. Similarly, a feasible perturbation �j > 0 exists for variable �xi1;j . Also, note that theproposed perturbations �xi1;i � � and �xi1;j � � also preserve the assignment constraint at item20

Page 21: The Multiple Knapsack Problem With Color Constraints

K

1

i

K j

iFigure 5: A path containing two knapsacks, Theorem 5.1Ii1 so long as � � minfxi1;i; 1 � xi1;i; xi1;j ; 1 � xi1;jg. Hence, it is easy to see that choosing� = minfxi1;i; 1� xi1;i; xi1;j ; 1� xi1;j ; �i; �jg is su�cient. Note that � > 0.Note that we have constructed two feasible solutions to LPMKCP . However, the optimumsolution �x is a convex combination of these two feasible solutions which is a contradiction tothe fact that �x is a basic feasible solution. The result follows. 2Theorem 5.2 For a knapsack such that its knapsack constraint is tight, there exists a minimalcover inequality which cuts o� the fractional solution.Proof: Let Ki be a knapsack whose knapsack constraint is tight. Let Ii1 ; Ii2 ; :::; Iip be theitems incident on Ki in RG. Note that the 0 < xik ;i < 1 for k = 1; :::; p. WLOG, assume thatOi1 � Oi2 � ::: � Oip . Also, let Ij1 ; Ij2 ; :::; Ijq be the items, not in RG, assigned to Ki. Notethat xjk ;i = 1 k = 1; :::; q. Let Wi be the capacity of knapsack Ki. Then,qXk=1Ojk + pXk=1Oikxik ;i = WiIt is easy to see that [qk=1Ijk S [pk=1 Iik is a cover for knapsack Ki. We construct a minimalcover, C, as follows: (a) Include items Ij1 ; Ij2 ; :::; Ijq in C and (b) Continue including items,starting from Ii1 till the knapsack capacity is exceeded. It is easy to see that the cover obtained21

Page 22: The Multiple Knapsack Problem With Color Constraints

is a minimal cover. So, suppose [qk=1Ijk S [lk=1 Iik is the minimal cover where l � p. Then,qXk=1Ojk + lXk=1Oik > Wi (12)We claim thatPqk=1 �xjk ;i+Plk=1 �xik ;i > q+l�1. Because, if not thenPqk=1 �xjk ;i+Plk=1 �xik ;i �q + l � 1 implies that Pqk=1Ojk +Plk=1Oik � Wi which is a contradiction to (12).Thus, the minimal cover inequality corresponding to the cover C is violated at knapsack Ki.This inequality cuts o� the fractional solution �x. 2Theorem 5.3 There always exists a knapsack such that its knapsack constraint is tight,Proof: By Lemma 5.1, there exists a knapsack such that either its knapsack constraintis tight or one of its color constraints is tight. Suppose the knapsack constraint is slack forall the knapsacks. Now consider a knapsack Ki one of whose color constraints is tight. Weconsider two cases:1. Knapsack Ki has an edge e in RG such that �xe appears in a tight color constraint forKi.But then, because of the nature of the color constraint, there exists another edge e�incident on Ki in RG such that �xe� appears in the same tight color constraint. Thus, wehave two edges e = (i1; i) and e� = (j1; i) in RG. If there are any other knapsacks (otherthan Ki) incident to item i1, we choose one of them. Similarly, if there are any otherknapsacks (other than Ki) incident to item j1, we choose one of them. Thus, startingfrom Ki, we continue building a path in two directions (see Figure 6). Note that we willnecessarily end up with a path (for otherwise, RG would contain a cycle). An end pointof the path, P , thus obtained can be an item or a knapsack (see Figure 6 for possiblecon�gurations). Note that all the knapsacks in P have the knapsack constraint slack.22

Page 23: The Multiple Knapsack Problem With Color Constraints

� If both the endpoints of P are knapsacks, then P has the formP = Ki�p � ip �Ki�p�1 ::: i2 �Ki�1 � i1 �Ki � j1 �Kj�1 � j2 � ::: � jq �Kj�qThen, note that the variables �xip;i�p and �xiq ;i�q corresponding to the two endpointsof P are fractional and hence cannot be in any tight color constraint for knapsacksKi�p and Kj�q respectively. Hence, there exists � > 0 such that the two perturbations(�xip;i�p � �; �xip;i�p�1 � �; :::; �xi1;i � �; �xj1;i � �; :::; �xjq;j�q )generate two feasible solutions (all other variables remain at their original value)for LPMKCP . But, since �x is a convex combination of these two solutions, we havea contradiction to the fact that �x is a basic feasible solution.� If one or both the end points of P are items, then note that the assignment con-straint cannot be tight at the item(s) at the endpoint and hence a similar argumentprovides a contradiction to the fact that �x is a basic feasible solution.2. Knapsack Ki does not have any edge in RG which appears in a tight color constraint.Then, we consider a path P from knapsack Ki to a leaf node of the tree. That is, oneend point of P is knapsack Ki while the other end point of P is a leaf node of the treeand can either be an item or a knapsack. In either case, a similar argument shows acontradiction to the fact that �x is a basic feasible solution.Suppose every tree in the forest contains only one knapsack. For a tree, if the only knapsackK it contains has degree one in RG, then it is easy to see that �x is not an optimum solution.If the degree of K is greater than one, a similar argument as above provides a contradictionto the fact that �x is a basic feasible solution.Case B: The residual graph contains a cycle.23

Page 24: The Multiple Knapsack Problem With Color Constraints

(ii)

Ki

Ki K

ij1

i1 i1

j1

i1

j1

(i) (iii)Figure 6: Possible con�gurations for case 1, Theorem 5.3Consider a cycle C in the residual graph. We consider two possibilities:1. C contains a knapsack whose knapsack constraint is tight: Here, Theorem 5.2 is againapplicable and hence we can �nd a minimal cover inequality which cuts o� the fractionalsolution �x.2. C does not contain any knapsack with a tight knapsack constraint: Since each nodeof C has exactly two edges of C incident on it. For every node, of the two fractionalvariables (say having values f1 and f2) corresponding to the two edges incident on it, weperturb the value of one variable (say f1) as f1 � � and the value of the other variableas f1 � �. Since, C is of even length, it is easy to see after such a perturbation for theedges of the cycle, every node will have one edge whose value has been decreased by� and one edge whose value has been increased by �. Notice that, this perturbationdoes not violate the assignment constraints for the items and the color constraints forthe knapsack. However, the knapsack constraints might be violated. But note that theknapsack constraints are slack. So, there exists some � > 0 such that the perturbationsabove are feasible for MKCP (values of the variables not in C are not changed).24

Page 25: The Multiple Knapsack Problem With Color Constraints

We have thus demonstrated two feasible solutions for MKCP such that �x is a convexcombination of these two solutions. This contradicts the fact that �x is a basic feasiblesolution.6 Extension to more than two colorsFor the problem considered in this paper, the number of distinct colors which could be assignedto a knapsack is bounded above to two. For the case when the number of distinct colorsallowed is more than two, some of the results in Sections 3 and 4 can be extended. Forexample, Theorems 3.5 and 3.9, which characterize when a color constraint is redundant,can be easily extended. Also, the results in Section 4 regarding the strengthening of validinequalities can be easily extended. However, the proofs of Theorems 3.6, 3.7, 3.8, 3.10 and3.11, which describe necessary conditions and su�cient conditions for a color constraint tobe facet de�ning, make speci�c use of the fact that the number of distinct colors is boundedabove by 2 and hence it is not trivial to extend them.7 Summary and ConclusionsIn this paper, we studied the multiple knapsack problem with color constraints (MKCP).Motivated by our experience in the steel industry, the MKCP generalizes the multiple knap-sack problem by adding a \color" attribute to each order and including the associated colorconstraints which restrict the number of allowable colors in any knapsack to be no more thantwo. Such constraints capture a large class of processing constraints in the steel industry.We presented three main theoretical results in this paper. The �rst one provides the necessaryand su�cient conditions under which the newly introduced color constraints are redundant.The second set of results provide some su�cient conditions and some necessary conditions25

Page 26: The Multiple Knapsack Problem With Color Constraints

for a color constraint to be a facet. The third result shows that a basic fractional solutionobtained by solving the LP relaxation can be cut o� by a minimal cover inequality. Wealso provide results which consider the color constraints to strengthen four classes of validinequalities which have been well studied for the MKP.Two directions for future research seem promising: (i) Identifying a set of necessary and su�-cient conditions under which a facet for MKP is also a facet for MKCP, and (ii) incorporatingthe results of this paper in a computational framework such as branch-and-cut.Acknowledgements: The authors thank F. Sibel Salman (GSIA, CMU) for her detailedcomments and suggestions.References[1] Balas, E. (1975)Facets of the knapsack polytope, Mathematical Programming, 8, 146-164.[2] Ferreira, C. E., Martin, A. and Weismantel, R. (1996), Solving multiple knapsack problemsby cutting planes, SIAM J. Optimization, 3, 859-877.[3] Garey, M. R. and Johnson, D. S. (1979), Computers and Intractibility: A Guide to theTheory of NP-Completeness, W. H. Freeman and Co., San Francisco.[4] Gottlieb, E.S. and Rao, M.R. (1990), The generalized assignment problem: Valid inequal-ities and facets, Mathematical Programming, 46, 31-52.[5] Hammer, P.L., Johnson, E.L. and Peled, U.N. (1975) Facets of regular 0-1 polytopes,Mathematical Programming, 8, 179-206.[6] Kalagnanam, J., Dawande, M., Trumbo, M. and Lee, H.S. (1997) The surplus inventorymatching problem in the process industry, Technical Report RC21071, IBM T.J. WatsonResearch Center, Yorktown Heights, NY.26

Page 27: The Multiple Knapsack Problem With Color Constraints

[7] Martello, S. and P. Toth (1990) Knapsack Problems: Algorithms and Computer Imple-mentations, Wiley, Chichester, U.K.[8] Weismantal, R. (1997) On the 0/1 knapsack polytope, Mathematical Programming, 1,49-68.[9] Wolsey, L. A. (1975) Faces of linear inequalities with 0-1 variables, Mathematical Pro-gramming, 8, 165-178.[10] Wolsey, L. A. (1990)Valid inequalities for 0-1 knapsacks and MIPS with generalized upperbound constraints, Discrete Applied Mathematics, 29, 251-261.

27