HAL Id: inria-00232782
https://hal.inria.fr/inria-00232782v2
Submitted on 27 Nov 2008
HAL is a multi-disciplinary open access
archive for the deposit and dissemination of
sci-entific research documents, whether they are
pub-lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.
L’archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d’enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.
Knapsack Problems with Setups
Sophie Michel, Nancy Perrot, François Vanderbeck
To cite this version:
Sophie Michel, Nancy Perrot, François Vanderbeck. Knapsack Problems with Setups. European
Journal of Operational Research, Elsevier, 2009, 196, pp.909-918. �inria-00232782v2�
S. Mi hel (1), N. Perrot (2) and F. Vanderbe k (3)
(1) ISEL-LMAH,UniversitéduHavre,mi helsuniv-lehavre.fr
(2)Fran e-Télé om,divisionR&D, nan y.perrotorange-ftgroup. om
(1)InstitutdeMathématiquesdeBordeaux,UniversitéBordeaux1,fvmath.u-bordeaux1.fr
November 27, 2008
Abstra t
Knapsa k problems with setups nd their appli ation in many on rete indus-trialandnan ialproblems. Moreover,they alsoariseassubproblemsina Dantzig-Wolfe de omposition approa h to more omplex ombinatorial optimization prob-lems,wheretheyneedtobesolvedrepeatedlyandthereforee iently. Here,we on-siderthemultiple- lassintegerknapsa kproblemwithsetups. Itemsarepartitioned into lasses whose use implies a setup ost and asso iated apa ity onsumption. Item weights are assumed to be a multiple of their lass weight. The total weight of sele ted items and setups is bounded. The obje tive is to maximize the dier-en ebetween theprotsofsele teditemsandthexed ostsin urredforsetting-up lasses. Aspe ial aseis thebounded integer knapsa kproblemwith setups where ea h lassholdsasingleitemandits ontinuousversionwherea fra tionofan item an be sele ted while in urring a full setup. The paper shows theextent to whi h lassi al resultsfor the knapsa k problem an be generalized to these variants with setups. Inparti ular, an extension of thebran h-and-bound algorithm of Horowitz andSahniis developed for problemswithpositivesetup osts. Ourdire t approa h is ompared experimentallywiththe approa h proposedintheliterature onsisting in onverting the problem into a multiple hoi e knapsa k withpseudo-polynomial size.
Keywords: Knapsa k problem, xed ost, setup, variable upper bound, bran h-and-bound.
The Multiple- lass Integer Knapsa k problem with Setups (MIKS) is dened as fol-lows. The knapsa k has apa ity
W
. There aren
item lasses, indexed byi
= 1, . . . , n
, with asso iated setup ost,f
i
∈ IR
, and setup apa ity onsumption,s
i
∈ IR
+
. Ea h lass is made of itsown items(i, j)
forj
= 1, . . . , n
i
∈ IN
with asso iated protp
ij
∈ IR
and upper bound
u
ij
∈ IN
. The apa ity onsumption of item(i, j)
is assumed to be a multiple of a lass weight,w
i
∈ IR
+
, i.e.w
ij
= m
ij
w
i
for some multipli itym
ij
∈ IN
(assumingw
ij
≤ W
). Moreover, there are lower and upper bounds,a
i
≤ b
i
∈ IN
, on the total multipli ity of items that may be sele ted within ea h lass. The obje tive is to maximize the sum of the prots asso iated with sele ted items minus the xed osts in urred for setting-up lasses.Thus, model MIKStakesthe form:
max
n
X
i=1
n
i
X
j=1
p
i j
x
i j
−
n
X
i=1
f
i
y
i
(1)[
MIKS]
s.t.n
X
i=1
((
n
i
X
j=1
m
i j
w
i
x
i j
) + s
i
y
i
) ≤ W
(2)a
i
y
i
≤
n
i
X
j=1
m
i j
x
i j
≤ b
i
y
i
fori
= 1, . . . n
(3)x
i j
≤ u
i j
y
i
fori
= 1, . . . n
andj
= 1, . . . , n
i
(4)x
i j
∈ IN
fori
= 1, . . . , n
andj
= 1, . . . , n
i
(5)y
i
∈ {0, 1}
fori
= 1, . . . , n ,
(6)where
x
ij
denotes the number of opies of itemj
that are hosen within lassi
andy
i
= 1
i lassi
issetup. Themain developmentsofthe paperare madeunderrestri tive assumptions that simplify the hara terization of extreme solutions of the ontinuous relaxation. In our bran h-and-bound algorithms, we shall assume that xed osts are non-negative:Assumption 1 (restri tive)
f
i
≥ 0
for alli
, and that there are no lass lower bounds:Assumption 2 (restri tive)
a
i
= 0
for alli
.ModelMIKS hasseveral interesting spe ial ases. In abinarymodel, denoted MBKS,
x
i j
∈ {0, 1} ∀ij
. When ea h lass holds a single item, i.e.n
i
= 1 ∀i
, MIKS gives rise tothe integer knapsa k problemwith setups (IKS):
max
n
X
i=1
p
i
x
i
−
n
X
i=1
f
i
y
i
(7)[
IKS]
s.t.n
X
i=1
(w
i
x
i
+ s
i
y
i
) ≤ W
(8)a
i
y
i
≤ x
i
≤ b
i
y
i
fori
= 1, . . . n
(9)x
i
∈ IN
fori
= 1, . . . , n
(10)y
i
∈ {0, 1}
fori
= 1, . . . , n .
(11)Further relaxing the integrality onstraint on
x
i
gives rise to the ontinuous knapsa k problemwithsetups denoted CKS.Observethat, whena
i
= w
i
= 0
andb
i
= 1 ∀i
, allthe above models boil down toa standard binary knapsa k problem (f.i.,for IKS, asw
i
= 0
, it is optimal to setx
i
= b
i
ifp
i
≥ 0
). Hen e, these models are at least as hard as the standard binary knapsa k problem.ModelCKSarises as asub-problemin apa itated multi-item lot sizing problemwhen settingupthema hinefortheprodu tionofanitemrequiressetuptimeand ost: on ethe demand overing onstraints are dualized the problem de omposes into a CKS problem for ea h period. Then,
w
i
,f
i
ands
i
are respe tively the pro essing time, the setup ost andthe setuptimeforitemi
,p
i
isthedieren ebetween thedual valuefor overingitemi
demand and itsprodu tion ost,W
is the ma hine apa ity of that period, and[a
i
, b
i
]
denes aninterval of validprodu tionlevels for itemi
. A lower bounda
i
on produ tion may arise due to a business rule to amortize setup or due to te hni al onstraints that translateinto aminimum bat hsize. Note that,for this appli ation, xed ost naturally satisfyAssumption 1. Goemans [4℄studiedthestru ture ofthe CKS polyhedron, derived fa etdening inequalitiesand proposed a heuristi separation pro edure.Model IKS is en ountered as a sub-problem in solving the utting sto k problem by bran h-and-pri e [10℄. When using bran hing onstraints that enfor e integrality of the numberof uttingpatterns thatinvolveagiven item
i
,the knapsa ksubproblem mustbe modied to in lude a xed ost. Nonzero lower bounds,a
i
, may arise in the ourse of a rounding heuristi when, in order to a hieve a feasible solution to the residual problem, one must impose a minimum produ tion level in remaining utting patterns. A spe ial ase of model IKS was studied by Sural et al. [13℄: they assumef
i
= 0
andw
i
= 1
for alli
. Then, they show how to generalize the Dantzig's upper bound and they propose a primal heuristi . Both are used for setting up a depth-rst sear h bran h-and-bound algorithm. Their motivations for studying this model were appli ations in nan e and in ma hine s heduling. The assumptionw
i
= 1
is not restri tive for IKS but assumingf
i
= 0
is restri tive. However, the Dantzig's upper bound an be generalized tothe asef
i
6= 0
as shown inthis paper.Model MBKSalsoarisesasa sub-probleminabran h-and-pri eapproa htothe ut-ting sto k problem. Most fra tionalsolutions an be ut-o by boundingthe number of utting patterns that involves a spe i binary variable of the knapsa k subproblem in its 0-1 form [14℄
1
. When a bran hing onstraint is added that restri ts the number of
1
Thepri ing problem is normally aninteger knapsa k problem:
max{
P
i
p
i
x
i
:
P
i
w
i
x
i
≤ W, x
i
≤
b
i
, x
i
∈ IN ∀i}
. Astandard0-1transformation onsistsinintrodu ingn
i
= ⌊log
2
b
i
⌋+1
binaryitems(i, j)
forea hintegeritemi
with multipli itym
i j
= 2
j−1
for
j
= 1, . . . , n
i
− 1
andm
i n
i
= b
i
−
P
n
i
−1
olumnsinvolvinga spe i binary item
(i, j)
,the itemdual pri eismodied inthe pri -ingproblem,leadingtoobje tive oe ientsp
i j
6= m
ij
p
i
. Ifone ombinessu hbran hing with that on the number of utting pattern involving a spe i itemi
, then xed osts are also nonzero, giving rise to modelMBKS. Observe that if the binary de omposition of the pri ingproblem is not done apriori but dynami ally asbran hing onstraints are introdu edonspe i binaryitems(see [16℄ fordetails),thenmodelMIKSmust beused.The spe ial ase of model MBKS with no setups is treated in [15℄. Under the as-sumption
f
i
= s
i
= 0 ∀i
, it is shown that the LP-relaxation an be solved by a greedy algorithmin linear time, a result that extends those of Dantzig [3℄ and Balas and Zemel [1℄ for the 0-1 knapsa k problem(this result relies on the assumption that item weights are a multiple of their lass weight); exa t algorithms are derived (bran h-and-bound or dynami programs) by adapting existing algorithmsfor the 0-1knapsa k problem.Variantsof modelMBKS are onsidered in the literature. Chajakis and Guignard[2℄ onsider a model where
m
ij
= 1 ∀ij
, lass bound onstraints are repla ed byP
n
i
j=1
x
i j
≥
y
i
∀i
, and the item weights are not restri ted to be a multiple of a lass weight (hen e, the result of [15℄ on erning a polynomialgreedy solution of the LP relaxation does not extend to the modelof [2℄). The appli ation that motivated their study is the s hedul-ing of parallel unrelated ma hines with setups where this knapsa k problem arises as a subproblem. They propose and test two approa hes: either a dynami programming solver or a two-stage approa h. In the latter, the problem is transformed into a stan-dard multiple hoi e 0-1 knapsa k problem and solved either by dynami programming or bran h-and-bound. The transformation onsists in dening a pseudo-item for ea h dominant feasible solutionswithin a lass. These dominant solutions are the states of a dynami programforsolvingthebinaryknapsa kproblemdenedonasingle lass. There is a pseudo-polynomial numberof them. They found that, for orrelated instan es with small knapsa k apa ity (they assume integer data and onsiderW
≤ 500
), the dire t dynami programming approa h is the most e ient. When the number of families or the knapsa k apa ity in reases, the two-stageapproa h using bran h-and-bound for the se ond stage isthe most e ient.The variant of model MBKS that is onsidered by Jans and Degraeve [5℄ is simpler. They also assume
m
ij
= 1 ∀ij
andw
ij
6= m
ij
w
i
, but their model hasb
i
= 1 ∀i
. This However, this transformation introdu es multiple 0-1 representation of a given integer solution. The alternative0-1de ompositionproposedin[15℄istosetm
i n
i
= 2
n
i
. Then,oneneedstointrodu eexpli it lassupperbounds:
P
n
i
j
=1
m
i j
x
i j
≤ b
i
∀i
. Itguaranteesauniquerepresentationofea hintegersolution. Thisisessentialtoavoidtheenumerationofsymmetri solutions. Anumeri al omparisonof bran h-and-boundapproa hesbasedonthestandard0-1transformationversusthemultiple lassmodelispresented in[15℄;itshowsthein reasebran h-and-boundtreesize thatmayresultfromignoring thissymmetry.It takes the form
max{
X
i
(
X
j
p
ij
x
ij
− f
i
y
i
) :
X
i
(
X
j
w
ij
x
ij
+ s
i
y
i
) ≤ W,
X
j
x
ij
≤ y
i
∀i, x
ij
, y
i
∈ {0, 1}}
where setting
x
ij
= 1
amounts to produ ing itemi
so as to over demands from the urrent periodt
up tot
+ j − 1
. Moreover, their appli ation assumes positive xed ostf
i
≥ 0
. In this spe ial ase, feasible solutions verifyx
ij
= x
ij
y
i
. Therefore, their modelredu es to a standard multiple hoi e knapsa k problem
max{
X
ij
˜
p
ij
z
ij
:
X
ij
˜
w
ij
z
ij
≤ W,
X
j
z
ij
≤ 1 ∀i, z
ij
∈ {0, 1}} ;
where
z
ij
= x
ij
y
i
,p
˜
ij
= p
ij
− f
i
, andw
˜
ij
= w
ij
+ s
i
. Jans and Degraeve [5℄ developed their own bran h-and-bound algorithmfor it.The present paper proposes ananalysis of models CKS and MBKS. Their extensions tomodelsIKSandMIKSare alsodis ussed. The aimistoshowthe extenttowhi h las-si alapproa hfortheknapsa kproblem,su hasthedepth-rst-sear hbran h-and-bound algorithm of Horowitz and Sahni or dynami programs (see [8℄ pages 30-31 or [9℄ pages 455-456) an be generalized to variants with setups. In parti ular, we show that under assumptions slightly less restri tive than Assumptions 1 and 2, the LP solutionto these problems an beobtainedinpolynomialtime byagreedypro edure. Thekeytothese re-sults are reformulationas ontinuous knapsa k problems with multiple hoi e onstraints [6℄or lassbounds[15℄. Theformulationare polynomialinsizewhilepreviouslyproposed reformulations su h as that of [2℄ are pseudo-polynomial. However, our reformulations are onlyvalid for the LP-relaxation: their integer ounterparts are not equivalent to our models. Therefore, the greedy LP solverdoesnot immediatelygive rise to extensions of standard bran h-and-bound pro edures. The other main ontribution of the paper is a spe i enumeration s heme for bran h-and-bound for CKS and MBKS that exploit the property of optimal solutions and the greedy ordering of the LP bound. The resulting bran h-and-bound algorithmsare tested and ompared to existing approa hes.
Dynami programming re ursion an also be derived for these knapsa k models with setups. They are straightforward extensionof resultsforthe standard knapsa k problem. We present them for the sake of establishing the omplexity of the various models. Of ourse,theimprovementsofthe basi te hniquesforknapsa kproblems: lineartime om-putation of upper bound [1℄, improved variants of Dantzig's bounds, improved dynami re ursion (f.i. using bounds to eliminate intermediate states, exploiting the ore, or so- alled balan ed enumeration), more sophisti ated bran h-and-bound (f.i. making use of dominan erules)andhybridmethods[12℄ ouldalsobereviewed forthe ase ofproblems
te hniques toget apoint a ross: todemonstrate thatknapsa k problems withsetups are not mu h harder than standard knapsa k problems.
1 The ontinuous knapsa k problem with setups
In modelCKS, the item sele tionvariables,
x
, are allowed to take ontinuous values. Hen e, the formulationis:max {
n
X
i=1
(p
i
x
i
−
n
X
i=1
f
i
y
i
) :
n
X
i=1
(w
i
x
i
+ s
i
y
i
) ≤ W ,
a
i
y
i
≤ x
i
≤ b
i
y
i
∀i ,
x
i
≥ 0 ∀i ,
y
i
∈ {0, 1} ∀i .}
(12)Here, bounds
a
i
andb
i
are not ne essarily integer, i.e.a
i
andb
i
∈ IR
+
,
∀i
. Assumption 2 an be made withoutlossof generality. Indeed, if
a
i
>
0
forsomei
, one an transform the problem asfollows: leta
′
i
= 0
,b
′
i
= b
i
− a
i
,s
′
i
= s
i
+ w
i
a
i
,f
′
i
= f
i
− a
i
p
i
; its solution(x
′
i
, y
′
i
)
translates intoa solutionfor the originalproblemas follows:x
i
= (a
i
+ x
′
i
) y
i
′
andy
i
= y
i
′
. Moreover, we an assumeAssumption 3 (without loss of generality)
p
i
≥ 0
for alli
.Indeed, if
p
i
<
0
for somei
,x
i
= 0
inany optimalsolution. Also, we have Assumption 4 (without loss of generality)f
i
≤ 0
for alli
.Indeed, if
f
i
≥ p
i
b
i
for somei
, it is optimal tosetx
i
= y
i
= 0
and onsider the problem that remains on the other variables. While, if0 < f
i
< p
i
b
i
for somei
, then, in any optimal solution, eitherx
i
= y
i
= 0
orx
i
≥
f
i
p
i
, be ause a solution where
0 < x
i
<
f
i
p
i
an be improved by settingx
i
= y
i
= 0
. Thus,f
i
p
i
an be interpreted as a lower bound,
a
i
, whi h an be eliminated asexplained above by re-settingb
′
i
= b
i
−
f
p
i
i
,s
′
i
= s
i
+ w
i
f
p
i
i
,f
i
′
= f
i
−
f
p
i
i
p
i
= 0
. Finally,one an also assume
Assumption 5 (without loss of generality)
w
i
= 1
for alli
. Otherwise, one an make a hange of variablesx
′
i
= w
i
x
i
and redene the asso iated oe ients:p
′
i
=
p
i
w
i
,b
′
i
= w
i
b
i
.UnderAssumption 5,problemCKS anbereformulatedasamultiple hoi eknapsa k problem. When data are integer, i.e., when
a
i
, b
i
, s
i
∈ IN ∀i
andW
∈ IN
, observe that the ontinuousvariablesx
takeintegervalue inany feasibleextremesolutions. Therefore, within ea h lass, one an optimize the use levelx
by enumeration. Hen e, the problem an be reformulatedas a multiple hoi e knapsa k problem:max{
X
i
b
i
X
x=a
i
(p
i
x
− f
i
) λ
i
x
:
X
i
b
i
X
x=a
i
(w
i
x
+ s
i
) λ
i
x
≤ W,
b
i
X
x=a
i
λ
i
x
≤ 1 ∀i, λ
i
x
∈ {0, 1} ∀i, x} ,
(13)where
λ
i
x
= 1
ix
i
= x
. This formulation has pseudo-polynomial size but it leads to a possiblesolutionapproa husingasolverforthemultiple hoi e knapsa kproblem,whi h we shall use in numeri al omparison toour algorithm.In the rest ofthis se tion,we makeAssumptions 2to4withoutlossof generality,but we arry
w
i
in the notation for the sake of extending the results to modelMBKS where Assumption 5 is not made. Similarly,when Assumption 1 is made,f
i
= 0 ∀i
(as implied by Assumption 4) but we keepf
i
in the formulation. Thus, our model is given by (12) wherea
i
= 0
,p
i
≥ 0
andf
i
≤ 0
.1.1 Chara terizations of optimal solutions
Some properties of optimal solutions are used to develop bounding pro edure or dy-nami programs. Toanalysethe stru tureof extremesolutions,notethatif onexes
y
to˜
y
∈ {0, 1}
n
,the problem redu es toa ontinuous knapsa k problemthatadmits agreedy solution.
Observation 1 (Dantzig, [3℄) Let
I
= {i : ˜
y
i
= 1}
andW
˜
= W −
P
i∈I
s
i
. The resulting problem in thex
variables is:[
CKP(y
˜
)] ≡ max{
X
i∈I
p
i
x
i
:
X
i∈I
w
i
x
i
≤ ˜
W ,
0 ≤ x
i
≤ b
i
∀i ∈ I}
(14)An optimal solution is obtained as follows. Assume an indexing of the items in
I
su h thatp
1
w
1
≥
p
2
w
2
≥ . . . ≥
p
|I|
w
|I|
.
Let
c
be the index for whi hP
i<c
b
i
w
i
< ˜
W
butP
i≤c
b
i
w
i
≥ ˜
W
. Then, setx
i
= b
i
fori < c,
(15)x
c
=
˜
W
−
P
i<c
w
i
b
i
w
c
,
(16)x
i
= 0
otherwise. (17)This standard observation yieldstothe on lusion that
x
i
∈ {0, b
i
}
for alli
but one. The same observation was made in [13℄ for the asef
i
= 0 ∀i
. Moreover, in that ase, [13℄ adds that the item with0 < x
i
< b
i
, if any, has the smallest ratiop
i
w
i
of non zero items. Thispropertygeneralizestriviallytoour ase. Letusexpli itlystatethis hara terization of extreme solutionsto CKS foreasy referen e.
Observation 2 An optimal solution exists toproblem CKS where, forea h
i
, one of the following ase arises(i)
y
i
= 1
andx
i
= b
i
(ii)y
i
= 1
and0 < x
i
< b
i
(iii)y
i
= x
i
= 0
(iv)
y
i
= 1
andx
i
= 0
Furthermore, ase
(ii)
anonly be assumed byone of the itemswhi h is alled the riti al item. Case(iv)
anonly arise iff
i
<
0
. Moreover,the level of the riti al item,c
, if any, is set so as to ll the remaining apa ity of the knapsa k. It is omputed asx
c
=
(W −W )
w
c
whereW
=
X
k∈I
(w
k
b
k
+ s
k
) + s
c
+
X
k∈J
s
k
for some sets
I
⊆ {k :
p
k
w
k
≥
p
c
w
c
}
andJ
⊆ {k : f
k
<
0
andp
c
w
c
≥
p
k
w
k
}
.Indeed, if
y
i
= 1
andx
i
= 0
butf
i
= 0
,y
i
an feasibly be set tozero withoutde reasing the prot. The rest of the observation results fromthe followingpro edure. Let(x
∗
, y
∗
)
be an optimal solution to problem CKS. Let us x the
y
variables to their optimal0
-1
valuesy
∗
. From observation 1, we derive an asso iated solution
x
′
dened by (15-17). Solution
(x
′
, y
∗
)
is optimum and has the above form.
The ontinuousrelaxationofmodelCKSisgivenby(12) where
y
i
∈ {0, 1}
isrepla ed byy
i
∈ [0, 1] ∀i
. Then,the valueofthe lassi
solutionintheLPsolution anbeanything in the onvex hull of extreme solutions(i)
,(iii)
and(iv)
of Observation 2 (note that ase(ii)
is inthis onvex hull). For instan e, one an generate any prot between0
andp
i
b
i
− f
i
bysettingy
i
=
x
i
b
i
and letting
x
i
varybetween0
andb
i
. The asso iated apa ity onsumptionis(w
i
+
s
i
b
i
) x
i
. Similarly,if
f
i
<
0
, any pair of(p, w) = (−y
i
f
i
, y
i
s
i
)
an be a hieved by settingx
i
= 0
and varyingy
i
∈ [0, 1]
. Therefore, the ontinuousrelaxationof CKS an be reformulatedas follows:max
n
X
i=1
((p
i
b
i
− f
i
)z
i
b
− f
i
z
i
f
)
(18)n
X
i=1
((w
i
b
i
+ s
i
) z
i
b
+ s
i
z
f
i
) ≤ W
(19)z
b
i
+ z
i
f
≤ 1
fori
= 1, . . . , n
(20)z
i
b
∈ [0, 1]
fori
= 1, . . . , n
(21)z
i
f
∈ [0, 1]
fori
= 1, . . . , n
(22) Whenz
f
i
= 0
, lettingz
b
i
varyfrom0 to1allows toa hieveany ontinuous solutionintheonvex hull of extreme solutions
(i)
and(iii)
of Observation 2. Inversely, settingz
b
i
= 0
and letting
z
f
i
vary from 0 to 1 allows to a hieve any ontinuous solution in the onvexhull of extremesolutions
(iii)
and(iv)
. While, settingz
f
ontinuoussolutionsof type
(ii)
inthe onvexhullof extremesolutions(i)
and(iv)
. Any other solution for lassi
has a prot to apa ity onsumption ratio that is worse than those that we onsidered. The mapping from a solutionz
of (18-22) to a solution(x, y)
for the LP relaxationof CKS is given byx
i
= b
i
z
b
i
andy
i
= z
b
i
+ z
f
i
.
Thus, we have shown that
Proposition 1 The LP relaxation of CKS is equivalent to the ontinuous relaxation of binary knapsa k problem with multiple hoi e onstraints (18-22).
Thelatterisknowntoadmitagreedysolution[6℄. Hen e,thisresultextendstoourmodel with setups. Moreover, one an hara terized the onditions under-whi h ontinuous solutionswith
z
f
i
>
0
are dominated: Observation 3 Ifp
i
b
i
−f
i
w
i
b
i
+s
i
≥
−f
i
s
i
,thereexistsanoptimalsolutionto(18-22)where
z
f
i
= 0
.Note that Assumption 1 implies
p
i
b
i
−f
i
w
i
b
i
+s
i
≥
−f
i
s
i
∀i
. Let us write the greedy LP solution. Under the assumption of Observation 3, the spe ial ordered set (SOS) onstraints (20) are redundant and (18-22)redu es toa standard binary knapsa k LP relaxation:
Observation 4 If
p
i
b
i
−f
i
w
i
b
i
+s
i
≥
−f
i
s
i
∀i
, an optimal solution to the LP relaxation of problem CKS is given by indexingthe items in order that
(p
1
b
1
− f
1
)
(w
1
b
1
+ s
1
)
≥
(p
2
b
2
− f
2
)
(w
2
b
2
+ s
2
)
≥ . . . ≥
(p
n
b
n
− f
n
)
(w
n
b
n
+ s
n
)
.
(23) and settingx
i
= b
i
andy
i
= 1
fori < c,
x
c
=
W
−
P
i<c
(w
i
b
i
+ s
i
)
(w
c
+
s
b
c
c
)
andy
c
=
x
c
b
c
,
x
i
= 0
andy
i
= 0
fori > c ,
where
c
is the index in the sorted item order su h thatX
i<c
(w
i
b
i
+ s
i
) < W
butX
i≤c
(w
i
b
i
+ s
i
) ≥ W .
ThisobservationmerelytranslatesthegreedyLPsolutionof(18-22)inthe
(x, y)
variables (whenz
f
i
= 0 ∀i
).Now onsider the integer version of formulation(18-22) where
z
b
i
, z
f
i
∈ {0, 1} ∀i
. It is importanttonote that, althoughmodelCKS and formulation(18-22) have the same LP solution,theinteger version of(18-22)isnotequivalenttomodelCKS.Indeed, asolution where ase(ii)
of Observation 2 is optimal for some itemi
annot be represented as an integer solutionin thez
-formulation.The standard Bran h-and-Bound algorithm of Horowitz and Sahni for the 0-1 knap-sa k problem[9℄isa spe ializeddepth-rst-sear h bran h-and-bound wherevariablesare xed in an order that is greedy for both primal and dual bounding pro edure. Hen e, the rst leaf node to be explored when plunging depth into the tree orresponds to a greedy primal solution while ba ktra king leads to exploring progressively more distant neighborsof thisgreedy solution. Thedual boundsneednot bere omputedafterxing a variable toone: theirvalue dierfrom thatof the parent node onlyfor the bran hwhere we part fromthe greedy ordering, i.e., when avariableis xed to zero.
The extension to model CKS is not trivial. Indeed, the pro edure requires that the same greedy approa h solves both LP and IP problems. We have su h greedy approa h for the
z
-formulation but not for the(x, y)
-formulation. As mentioned above, both for-mulation are not equivalent in IP term. This di ulty an be over ome by impli itly dealing with both thez
-formulation (for dual de isions) and the(x, y)
-formulation (for primalde isions). Toillustratehow, weexpli itlyprovideabran h-and-bound pro edure under Assumption 1 whi h simpliesthe problem.We use the greedy ordering (23) that was dened for the
z
variables. But, the xing ofz
variables has a dierent interpretation for dual and primal bounds. The primal so-lution(x, y)
asso iated with a dual solutionz
is obtained by rounding-up the fra tional setup in luded inz
(whi h yields a setup solutiony
˜
) and by settingx
to the value of the optimal solutionof CKP(y
˜
)dened in Observation 1. This ensures that the solution we build obeys the hara terization of Observation 2. The so alled forward moves are sequen es of bran hes where az
i
variable is xed to 1. Forward moves are interspersed withxing-to-zerobran heswhereaz
i
variableissettozerowhi hweinterpretasxing the asso iatedx
i
to zero for the primal bound. Primal and dual bounds are evaluated afterea h xing-to-zero bran hing.The bran h-and-bound sear h is organized as follows: Items are onsidered in the order (23). For ea hitem
i
, three ases are onsidered:(a) z
i
= 1
(whi h,for the primal bound, orresponds to settingx
i
= b
i
andy
i
= 1
),(b) y
i
= 1
, andx
is free,(c) z
i
= 0
. However, Observation 2tells usthat ase(b)
needs only be onsideredif the knapsa k is lled atfull apa ity. Hen e, we an managewitha binary tree whereonly twobran hes are dened forea h item: the rst bran h tobeexplored orresponds toaggregated ase(a)
or(b)
, while the se ond bran h orresponds to ase(c)
. When ase(a)
is feasiblegiven the residual apa ity, the rst bran h is interpreted as ase
(a)
as it dominates ase(b)
. But when bran hing on ase(a)
is infeasible due to la k of apa ity, all the previousleftbran hes areinterpretedas ase(b)
. Inthe lattersituation,wehaverea hedCKP
(y)
issolveda ordingtoObservation1. Anothertypeofleafnode( alledBtype)arises when there are nomore items to onsider. In the latter ase,as the bran h
z
n
= 1
has been explored, the bran hz
n
= 0
does not need to be explored as it is dominated. This algorithmispresented inTable 1(inapseudo-language wherewe makeuse of some C++ notations). In our notations,IN C
is the value of the in umbent solution,Z
is the value of the urrent partial solution,U
is the urrent dual bound,C
is the urrent residual apa ity andv
is the return value of the routine solvingCKP
(y)
. The greedy heuristi for the primal problem used in this bran h-and-bound pro edure an be used independently. It is given in Table 2.Table 1: Bran h-and-Bound algorithmfor CKS under Assumption 1
Initialization: Sort items a ording to (23).
Let
IN C
= Z = 0
;C
= W
;x
= y = 0
;i
= 1
. Compute UB: LetU
= Z
;K
= C
;l
= i
;while
(l ≤ n)
and(K ≥ w
l
b
l
+ s
l
)
, do{U
+= (p
l
b
l
− f
l
)
;K−= (w
l
b
l
+ s
l
)
;l
= l + 1
. } If(l ≤ n)
,U
+= (p
l
b
l
− f
l
)
K
(w
l
b
l
+s
l
)
.Test Pruning: if
(U ≤ INC)
,goto Ba ktra king. Forward Move: While(i ≤ n)
and(w
i
b
i
+ s
i
≤ C)
, do{Z
+= (p
i
b
i
− f
i
)
;C−= (w
i
b
i
+ s
i
)
;x
i
= b
i
;y
i
= 1
;i
= i + 1
.}Type A Leaf Node: If
(i ≤ n)
/*and(w
i
b
i
+ s
i
> C
)
*/,do { If(s
i
< C)
, {lety
i
= 1; v = CKP (y)
;˜
x
=
argmax{CKP (y)}
;if(v > INC)
,IN C
= v
, re ord(˜
x, y)
;}Let
x
i
= y
i
= 0
;i
= i + 1
; /*Zero Setting */and go toCompute UB. } Type B LeafNode: Else/*(i = n + 1)
*/,do {If
(Z > INC)
, {IN C
= Z
;re ord(x, y)
;} Leti
= i − 1
;If
(y
i
== 1)
, {Z
−= (p
i
b
i
− f
i
)
;C+= (w
i
b
i
+ s
i
)
;x
i
= y
i
= 0
.}} Ba ktra king: Do(i = i − 1)
while(y
i
== 0)
and(i ≥ 1)
.If
(i == 0)
, STOP.Z
−= (p
i
b
i
− f
i
)
;C+= (w
i
b
i
+ s
i
)
;x
i
= y
i
= 0
;i
= i + 1
/* Zero Setting*/.Step A: Sort items a ording to(23). Let
C
= W
;x
= y = 0
; in umbent = 0;i
= 1
. Step B: While(C > w
i
b
i
+ s
i
)
and(i ≤ n)
, do {x
i
= b
i
;y
i
= 1
;C−= (w
i
b
i
+ s
i
)
;i
++
.} Step C: If(i > n)
, { re ordsolution(x, y)
; update the in umbent;and STOP.}Step D: Let
y
i
= 1
; solveCKP
(y)
a ording toObservation 1 and update the in umbent. Step E: Lety
i
= 0
;i
= i + 1
; and goto Step B.1.3 Dynami programming re ursion for the CKS problem
Here, we assume integer data:
s
i
,w
i
, andW
∈ IN
. To solve problem CKS, one an implementadynami programmingre ursionthat omputesthebest solutionofthe form des ribed inObservation 2. Letthe item indexing be su h thatp
1
w
1
≥
p
2
w
2
≥ . . . ≥
p
n
w
n
.
LetV
k
(C)
be the best value that an be a umulated using items
1
up tok
at levelx
k
∈ {0, b
k
}
and using a apa ityC
. SettingV
0
(C) = 0
for all
0 ≤ C ≤ W
, the valuesV
k
(C)
an be omputed re ursively:V
k
(C) = max{V
k−1
(C)
|
{z
}
x
k
=y
k
=0
, V
k−1
(C − w
k
b
k
− s
k
) + p
k
b
k
− f
k
|
{z
}
x
k
=b
k
, y
k
=1
}
for all
0 ≤ C ≤ W
andk
= 1, . . . , n
. This requiresO(nW )
operations. LetU
k
(C)
be the best valuethat an be a umulatedusing items
n
down tok
atlevelx
k
= 0
but withy
k
∈ {0, 1}
and using a apa ityC
. SettingU
n+1
(C) = 0
for all
0 ≤ C ≤ W
, the valuesU
k
(C)
an be omputed re ursively:U
k
(C) = max{U
k+1
(C)
|
{z
}
y
k
=0
, U
k+1
(C − s
k
) − f
k
|
{z
}
x
k
=0, y
k
=1
}
forall
0 ≤ C ≤ W
andk
= n, . . . , 1
. Thisrequires anotherO(nW )
operations. Then,the optimalsolution value for CKS an be obtained asmax{V
n
(W ), U
1
(W ),
max
1≤k≤n
{
C
1
,C
2
:W −b
k
w
max
k
<C
1
+C
2
+s
k
<W
{ V
k−1
(C
1
)+(W −C
1
−C
2
−s
k
)
p
k
w
k
−f
k
+U
k+1
(C
2
)}} } .
These latter omputations requireanother
O(nW
2
)
operations. The asso iated
(x, y)
so-lution iseasy to obtain.Under Assumption 1,
U
k
(C) = 0
for all
k, C
and theabove maximizationinC
2
isnot needed. Then, the omplexity isO(n W )
. When the upper boundsb
i
are not tight, i.e.b
i
≥
W
w
−s
i
i
forall
i
, noitemsk
an betaken atlevelx
k
= b
k
, hen eV
k
(C) = 0
for all
k, C
and the above maximization inC
1
is not needed. Then, the omplexity is alsoO
(n W )
. When Assumption 1 holds and items are unbounded, solving the problem requiresO(n)
(without sorting the items, one just needs to enumerate on whi h should be the riti al item).For the general ase where some
f
i
may be negative, another dynami programming re ursion an be dened whose omplexity isO(n
2
W
)
and doesnot require tosort items beforehand: Let
T
k,i
(C)
be the best value that an be a umulated with items
1
up tok
, withx
k
∈ {0, b
k
}
wheny
k
= 1
, while not usingi
(y
i
= 0
) and using a apa ityC
∈ {0, . . . , W }
:T
k,i
(C) = max{T
k−1,i
(C)
|
{z
}
x
k
=y
k
=0
, T
k−1,i
(C − s
k
) − f
k
|
{z
}
x
k
=0,y
k
=1
, T
k−1,i
(C − w
k
b
k
− s
k
) + p
k
b
k
− f
k
|
{z
}
x
k
=b
k
, y
k
=1
}
(24) ifk
6= i
,orT
k,i
(C) = T
k−1,i
(C)
if
k
= i
. Then,theoptimalsolutionvalue anbeobtained asmax
1≤i≤n
max
C
{T
n,i
(C)
|
{z
}
x
i
=y
i
=0
, T
n,i
(C) + min{
(W − C − s
i
)
+
w
i
, b
i
}p
i
− f
i
δ(W − C − s
i
>
0)
|
{z
}
0≤x
i
≤b
i
, y
i
=δ(W −C−s
i
>0)
,
(25)T
n,i
(C) − f
i
δ(W − C − s
i
≥ 0)
|
{z
}
x
i
=0,y
i
=δ(W −C−s
i
≥0)
} .
(26)where
δ(∗) = 1
if(∗) = true
and(∗)
+
= max{0, ∗}
. Some omputations an besaved by observing that
T
k,i
(C) = T
k,i+1
(C)
for
k < i
, but this remark does not hange the worst ase omplexity.2 The multiple- lass binary knapsa k with setups
Model MBKS is dened by setting item bounds
u
ij
to 1 and restri tingx
i j
to be binary,i.e., the modeltakes the form:max{
n
X
i=1
(
n
i
X
j=1
p
i j
x
i j
−
n
X
i=1
f
i
y
i
) :
n
X
i=1
((
n
i
X
j=1
m
i j
w
i
x
i j
)+s
i
y
i
) ≤ W, a
i
y
i
≤
n
i
X
j=1
m
i j
x
i j
≤ b
i
y
i
∀i,
x
ij
≤ y
i
∀i, j , x
ij
∈ {0, 1} ∀i, j , y
i
∈ {0, 1} ∀i .}
(27)Here, Assumption 2isrestri tive: indeed,if
a
i
>
0
there isaknapsa k sub-problemtobe solved to de ide whi h items(i, j)
within lassi
should be sele ted to satisfy this lower bound. Alsonote that we annotassumepositiveprotp
i j
. An item(i, j)
with negative protp
ij
<
0
might be worth sele tingto satisfy the lowerbounda
i
. However, ifa
i
= 0
, one an makenon restri tiveassumptions:Assumption 6 (without loss of generality) Under Assumption 2,
p
ij
≥ 0
for allj
. Otherwise,x
ij
= 0
inany optimalsolution. Similarly,Assumption 4takesaweakerform: Assumption 7 (withoutlossofgenerality)UnderAssumption2,f
i
<
max{
P
j
p
ij
x
ij
:
P
j
m
ij
x
ij
≤ b
i
, x
ij
∈ {0, 1} ∀j}
.Otherwise, if the set-up ost is larger than the maximum prot that an be generated with the lass
i
items, it is optimal to setx
ij
= 0 ∀j
andy
i
= 0
. Finally, eliminating rational lassweightsw
i
asinAssumption5isfeasible(by settingm
′
ij
= m
ij
w
i
,a
′
i
= a
i
w
i
,b
′
i
= b
i
w
i
and multiplying by a onstant su iently large to take this number integer);but it isnot re ommended asit introdu es large numbers in knapsa k onstraints(3).
MBKS an be reformulated as a multiple hoi e knapsa k, in the line of the work of Chajakis and Guignard [2℄. Sin e we assumed that all items have a weight that is a multiple of the lass weight, the apa ity onsumption of a lass
i
, i.e.,w
i
(
P
j
m
ij
x
ij
)
, is the same for all solutions(x
ij
)
j=1,···,n
i
that yield the same total multipli ityM
i
:=
P
j
m
ij
x
ij
. As a result, the optimization within ea h lass an be done independently of the global optimization of the use of the knapsa k apa ityW
. Thus, for ea h lass, one an theoreti ally enumerate all pairs(M
i
:=
P
j
m
ij
x
ij
, P
i
:=
P
j
p
ij
x
ij
)
that an be a hieved by0
-1
solutionsx
ij
. Note that one only needs to onsider undominated pairs(M
i
, P
i
)
: a pair(M
i
, P
i
)
is dominated if another lassi
solutiona hieves aprot at least as large with a smallermultipli ity ora greaterprot for the same multipli ity. To ompute all undominatedpairs, one needs to solve an all- apa ities knapsa k problem for ea h lassi
(a dynami programis well suited for this), i.e. for ea hM
= a
i
, . . . , b
i
, we ompute:P
i
(M) = max{
X
j
p
ij
x
ij
:
X
j
m
ij
x
ij
= M, x
ij
∈ {0, 1} ∀j}
(28)Then, the multiple hoi e knapsa k reformulation of MBKS isgiven by:
max{
X
i
b
i
X
M
=a
i
(P
i
(M) − f
i
)λ
i
M
:
X
i
b
i
X
M=a
i
(M w
i
+ s
i
) λ
i
M
≤ W,
b
i
X
M
=a
i
λ
i
M
≤ 1 ∀i, λ
i
M
∈ {0, 1}∀i, M}
(29)Thisreformulationinvolvesapseudo-polynomialnumberofvariables. AsforCKS,weuse this multi- hoi e knapsa k reformulation approa hto ben hmark our numeri alresults.
2.1 Chara terizations of optimal solutions
Inanalyzingthe stru tureofoptimalsolutions,rstnotethatanoptimalsolutionmay have
y
i
= 1
while thex
ij
's are set to the minimum value that allows to satisfy the lass lower bounda
i
. However, this isnot the ase whena
i
= 0
andf
i
≥ 0
.Observation 5 Under Assumptions1 and 2, there existsan optimalsolution where
y
i
=
0
whenP
j
x
ij
= 0
.The hara terisation of LPsolution toMBKSalsorelies onade omposition peritem lass:
Observation 6 Consider solutions to the LP relaxation of MBKS. Their proje tion in the subspa e
(x
i
=
P
j
m
ij
x
ij
, y
i
)
asso iated with lassi
are onvex ombinations of the followingextreme points:(i)
x
i
= 0 (
i.e.x
ij
= 0 ∀j)
andy
i
= 0 ,
(ii)
x
i
=
P
j
m
ij
x
ij
= a
i
andy
i
= 1 ,
(iii) x
i
=
P
j
m
ij
x
ij
= b
i
andy
i
= 1 .
If theprotper unit of knapsa k apa ityof extremesolution
(ii)
is lessthanthatof(iii)
, i.e., ifP
i
LP
(a
i
) − f
i
w
i
a
i
+ s
i
≤
P
LP
i
(b
i
) − f
i
w
i
b
i
+ s
i
(30) whereP
LP
i
(M)
is the solution to the LP relaxation of (28), then one only needs to on-sider solutions that are onvex ombination of ases(i)
and(iii)
. The reverse ase, i.e.P
LP
i
(a
i
)−f
i
w
i
a
i
+s
i
>
P
LP
i
(b
i
)−f
i
w
i
b
i
+s
i
, an only arise if
a
i
>
0
orf
i
<
0
.This observation results fromthe analysis of extreme solutions for the single lass knap-sa kproblemsdeneby onstraints(3). Figure1illustratesboththe asewherethe slope
P
i
LP
(a
i
)−f
i
w
i
a
i
+s
i
>
P
i
LP
(b
i
)−f
i
w
i
b
i
+s
i
and vi eversa.
PSfrag repla ements
P
LP
i
(a
i
)−f
i
w
i
a
i
+s
i
P
LP
i
(b
i
)−f
i
w
i
b
i
+s
i
a
i
b
i
x
i
0
PSfrag repla ementsP
LP
i
(a
i
)−f
i
w
i
a
i
+s
i
P
LP
i
(b
i
)−f
i
w
i
b
i
+s
i
a
i
b
i
x
i
0
(a)
(b)
Figure1: Ratio of lass
i
prot perunit of knapsa k apa ity onsumptionSimilarly to what we did for model CKS, we an derive from Observation 6 a
z
-re-formulation of the LP relaxation of MBKS. In the ontinuous relaxationof MBKS, item(i, j)
an yielda prot perunit equal toeither
p
ij
m
a
ij
i
− f
i
w
i
a
i
+ s
i
orp
ij
m
b
i
ij
− f
i
w
i
b
i
+ s
i
eort of targeting extreme solution
(ii)
or(iii)
of Observation 6 or their ombination. Case(ii)
an be split in two sub- ases, eithera
i
>
0
orf
i
<
0
. LetI
a
= {i : a
i
>
0}
andI
f
= {i : a
i
= 0
andf
i
<
0}
. Thus,I
a
∩ I
f
= ∅
. Fori
∈ I
f
, the extreme solution
(ii)
takes the form(x
i
= 0, y
i
= 1)
. Hen e, we introdu e variablez
f
i
∈ [0, 1]
su h thatz
i
f
= 1
represents solution(x
i
= 0, y
i
= 1)
. Similarly, fori
∈ I
a
, we dene a variable
z
a
ij
for ea h item
(i, j)
of lassi
, su h asz
a
ij
= 1
if item(i, j)
ontributes infull to targeting extreme solution(ii)
. Symmetri ally,variablesz
b
ij
are dened fori
∈ I = {1, . . . , n}
and asso iatedwithextremesolutions(iii)
. Withthesenotations,theLPrelaxationofMBKS an be reformulatedasmax
X
i∈I
a
n
i
X
j=1
(p
ij
−
f
i
a
i
m
ij
) z
i j
a
+
X
i∈I
n
i
X
j=1
(p
ij
−
f
i
b
i
m
ij
) z
i j
b
−
X
i∈I
f
f
i
z
f
i
(31) s.t.X
i∈I
a
n
i
X
j=1
(w
i
+
s
i
a
i
) m
i j
z
a
i j
+
X
i∈I
n
i
X
j=1
(w
i
+
s
i
b
i
) m
i j
z
i j
b
+
X
i∈I
f
s
i
z
f
i
≤ W
(32)n
i
X
j=1
[
m
i j
a
i
z
i j
a
+
m
i j
b
i
z
b
i j
] ≤ 1
∀i ∈ I
a
(33)n
i
X
j=1
m
i j
b
i
z
i j
b
+ z
f
i
≤ 1
∀i ∈ I
f
(34)z
i j
a
+ z
b
i j
≤ 1
∀i ∈ I
a
, j
z
a
i j
∈ [0, 1] ∀i ∈ I
a
, j
z
b
i j
∈ [0, 1] ∀i ∈ I, j
z
f
i
∈ [0, 1] ∀i ∈ I
f
(35)A solution
z
translates intoa solutionfor the LP relaxationof MBKS as follows:x
ij
= z
ij
a
+ z
b
ij
andy
i
=
X
j
(
m
i j
a
i
z
i j
a
+
m
i j
b
i
z
i j
b
) + z
f
i
(36)Constraints (33-34) are required to enfor e
y
i
∈ [0, 1]
. Observe that onstraints (3) are built in the denition of the hange of variables. Indeed, if we repla ex
andy
by their expression inz
in(3), inthe asea
i
>
0
, we obtain:a
i
X
j
(z
a
ij
m
ij
a
i
+ z
b
ij
m
ij
b
i
) ≤
X
j
m
ij
(z
a
ij
+ z
b
ij
) ≤ b
i
X
j
(z
a
ij
m
ij
a
i
+ z
b
ij
m
ij
b
i
)
whi h is always satised be ause
a
i
b
i
≤ 1
in the left-hand-side and
b
i
a
i
≥ 1
in the right-hand-side. In the ase
a
i
= 0
, (3) is triviallyveried. Hen e, we have shown thatProposition 2 TheLP relaxationof MBKS is equivalent tothe ontinuousrelaxationof binary knapsa k problem with lass bounds and SOS onstraints (31-35).
On one hand, it is known that the LP relaxation of binary knapsa k problem with SOS onstraints admits a greedy solution [6℄. On the other hand, [15℄ shows that the LP
edure. But, solving problem (31-35) requires dealing with both SOS onstraints and lass bounds. We have not found a greedy pro edure to solve this ase involving both omplexities. Instead, we develop a greedy LP solution for the spe ial ase where SOS onstraints are redundant, a result that extends that of referen e [15℄ to the ase with setups.
We make the simplifying assumption that all lass
i
items target a lling up tob
i
be ause this orresponds to abetter ratio:Assumption 8 (restri tive)
p
ij
m
a
ij
i
− f
i
w
i
a
i
+ s
i
≤
p
ij
b
i
m
ij
− f
i
w
i
b
i
+ s
i
∀(i, j) .
This assumption orresponds to the ase illustrated by part (b) of Figure 1. Note that Assumption 1 implies the above sin e, when
f
i
≥ 0
, eithera
i
>
0
and(p
ij
−
f
i
a
i
m
ij
) ≤
(p
ij
−
f
b
i
i
m
ij
)
while(w
i
+
s
i
a
i
) ≥ (w
i
+
s
i
b
i
)
, or
a
i
= 0
andp
ij
≥ 0
as stated in Assumption 6. Hen e, Assumption 8 an be understoodas alittleless restri tive than Assumption 1.Observation 7 Under Assumption 8, problem (31-35) admits a solution where all vari-ables
z
a
ij
andz
f
i
have value zero.Indeed,if Assumption8holdsand
z
a
ij
>
0
, one anmodifythesolutionby settingz
a
ij
′
= 0
andz
b
ij
′
= z
b
ij
+
(w
i
+
ai
si
) m
ij
(w
i
+
si
bi
) m
ij
z
a
ij
. This solution modi ation is feasible with regardtoknap-sa k onstraint (32) by onstru tion but alsowith regard to onstraint (33) as it an be easily he ked. Moreover, the prot value of the modied solution is not less than the original. Similarly, if
z
f
i
>
0
, de reasing its value allows to in rease somez
b
ij
value ofbetter prot ratio.
Then, we an give a greedy LP solutionto MBKS:
Proposition 3 IfAssumption8holds,anoptimalsolutiontotheLPrelaxationofMBKS is given by the following pro edure. Sort the items
(i, j)
in non-in reasing order of their ratio:(p
ij
−
f
b
i
i
m
ij
)
(w
i
+
s
b
i
i
) m
ij
(37) Letm
=
P
i
n
i
andk
= 1, . . . , m
be the item indi es in that ordering.K
i
is the set of items
k
that belong to lassi
:For
i
∈ {1, . . . , n}
, let the riti al itemfor lassi
bec
i
∈ K
i
, be su h thatX
k∈K
i
, k<c
i
m
k
≤ b
i
butX
k∈K
i
, k≤c
i
m
k
> b
i
.
(38) LetK
i
(l) = {k ∈ K
i
: k < c
i
andk < l
}
,I
b
(l) = {i : c
i
< l
}
, andW
(l) =
X
i
X
k∈K
i
(l)
(w
i
+
s
i
b
i
) m
k
+
X
i∈I
b
(l)
(w
i
+
s
i
b
i
) (b
i
−
X
k∈K
i
(l)
m
k
) .
(39)Then, let the global riti alitem,
c
∈ {1, . . . , m}
, be the highestindex item su h thatW
(c) ≤ W
butW
(c) + (w
i
c
+
s
i
c
b
i
c
) m
c
> W
(40)where
i
c
refers to the lass ontaining the global riti alitem (i.e.c
∈ K
i
c
) and setx
k
= 1
fork
∈ K
i
(c)
andi
= 1, . . . , n,
(41)x
c
i
=
1
m
c
i
(b
i
−
X
k∈K
i
(c)
m
k
)
fori
∈ I
b
(c),
(42)x
c
=
1
(w
i
c
+
s
ic
b
ic
) m
c
(W − W (c))
ifc
∈ K
i
c
(43)x
k
= 0
otherwise (44)y
i
= 1
fori
∈ I
b
(c)
(45)y
i
c
=
P
k∈K
ic
(c)
m
k
+ m
c
x
c
b
i
c
fori
: c ∈ K
i
(46)y
i
= 0
otherwise. (47)Proof: Observation 7 implies that in the LP formulation (31-35) we only keep the
z
b
ij
variables. The simplied formulation is that of a ontinuous multiple lass knapsa k problemthat admits agreedy solutionas proved in [15℄. Converting the greedy solution
z
intothe originalvariablesx
andy
providesthe desired result.2.2 Bran h-and-Bound
The greedy pro edure that allows to solve (31-35) under Assumption 8 an be the basisforaspe ializedbran h-and-boundalgorithmforMBKSthatgeneralizesthe depth-rst-sear halgorithmof Horowitz and Sahni. However, we are onfronted with the same di ulty as for modelCKS: the greedy pro edureis dened forthe
z
-formulationwhose IP ounterpart is not equivalent to model MBKS. To over ome it, we bran h onz
vari-ables but make orre tions tothe primalsolutions tomake them feasible for MBKS.To simplify the presentation, we make Assumptions 1 and 2 that imply Assumption 8. Then, the integerversion of the