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. Mihel (1), N. Perrot (2) and F. Vanderbek (3)
(1) ISEL-LMAH,UniversitéduHavre,mihelsuniv-lehavre.fr
(2)Frane-Téléom,divisionR&D, nany.perrotorange-ftgroup.om
(1)InstitutdeMathématiquesdeBordeaux,UniversitéBordeaux1,fvmath.u-bordeaux1.fr
November 27, 2008
Abstrat
Knapsak problems with setups nd their appliation in many onrete indus-
trialandnanialproblems. Moreover,they alsoariseassubproblemsinaDantzig-
Wolfe deomposition approah to more omplex ombinatorial optimization prob-
lems,wheretheyneedtobesolvedrepeatedlyandthereforeeiently. Here,weon-
siderthemultiple-lassintegerknapsakproblemwithsetups. Itemsarepartitioned
into lasses whose use implies a setup ost and assoiated apaity onsumption.
Item weights are assumed to be a multiple of their lass weight. The total weight
of seleted items and setups is bounded. The objetive is to maximize the dier-
enebetween theprotsofseleteditemsandthexedostsinurredforsetting-up
lasses. Aspeial aseis thebounded integer knapsakproblemwith setups where
eahlassholdsasingleitemandits ontinuousversionwherea frationofan item
an be seleted while inurring a full setup. The paper shows theextent to whih
lassial resultsfor the knapsak probleman be generalized to these variants with
setups. Inpartiular, an extension of thebranh-and-bound algorithm of Horowitz
andSahniis developed for problemswithpositivesetuposts. Ourdiret approah
isompared experimentallywiththe approah proposedintheliterature onsisting
inonverting the problem into a multiple hoie knapsak withpseudo-polynomial
size.
Keywords: Knapsak problem, xed ost, setup, variable upper bound, branh-and-
bound.
The Multiple-lass Integer Knapsak problem with Setups (MIKS) is dened as fol-
lows. The knapsak has apaity
W
. There aren
item lasses, indexed byi = 1, . . . , n
,with assoiated setup ost,
f
i∈ IR
, and setup apaity onsumption,s
i∈ IR
+. Eahlass is made of itsown items
(i, j)
forj = 1, . . . , n
i∈ IN
with assoiated protp
ij∈ IR
and upper bound
u
ij∈ IN
. The apaity onsumption of item(i, j)
is assumed to be amultiple of a lass weight,
w
i∈ IR
+, i.e.w
ij= m
ijw
i for some multipliitym
ij∈ IN
(assuming
w
ij≤ W
). Moreover, there are lower and upper bounds,a
i≤ b
i∈ IN
, onthe total multipliity of items that may be seleted within eah lass. The objetive is
to maximize the sum of the prots assoiated with seleted items minus the xed osts
inurred for setting-up lasses.
Thus, model MIKStakesthe form:
max
X
ni=1 ni
X
j=1
p
i jx
i j−
X
ni=1
f
iy
i (1)[
MIKS]
s.t.X
ni=1
((
ni
X
j=1
m
i jw
ix
i j) + s
iy
i) ≤ W
(2)a
iy
i≤
ni
X
j=1
m
i jx
i j≤ b
iy
i fori = 1, . . . n
(3)x
i j≤ u
i jy
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 madeunderrestritive assumptions that simplify the haraterization of extreme solutions of the ontinuousrelaxation. In our branh-and-bound algorithms, we shall assume that xed osts are
non-negative:
Assumption 1 (restritive)
f
i≥ 0
for alli
,and that there are no lass lower bounds:
Assumption 2 (restritive)
a
i= 0
for alli
.ModelMIKS hasseveral interesting speial ases. In abinarymodel, denoted MBKS,
x
i j∈ {0 , 1} ∀ij
. When eah lass holds a single item, i.e.n
i= 1 ∀i
, MIKS gives rise tothe integer knapsak problemwith setups (IKS):
max
X
ni=1
p
ix
i−
X
ni=1
f
iy
i (7)[
IKS]
s.t.X
ni=1
( w
ix
i+ s
iy
i) ≤ W
(8)a
iy
i≤ x
i≤ b
iy
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 knapsakproblemwithsetups denoted CKS.Observethat, when
a
i= w
i= 0
andb
i= 1 ∀i
, alltheabove models boil down toa standard binary knapsak problem (f.i.,for IKS, as
w
i= 0
,it is optimal to set
x
i= b
i ifp
i≥ 0
). Hene, these models are at least as hard as thestandard binary knapsak problem.
ModelCKSarises as asub-problemin apaitated multi-item lot sizing problemwhen
settingupthemahinefortheprodutionofanitemrequiressetuptimeandost: onethe
demand overing onstraints are dualized the problem deomposes into a CKS problem
for eah period. Then,
w
i,f
i ands
i are respetively the proessing time, the setup ost andthe setuptimeforitemi
,p
i isthedierenebetween thedual valueforoveringitemi
demand and itsprodution ost,W
is the mahine apaity of that period, and[a
i, b
i]
denes aninterval of validprodutionlevels for item
i
. A lower bounda
i on produtionmay arise due to a business rule to amortize setup or due to tehnial onstraints that
translateinto aminimum bathsize. Note that,for this appliation, xed ost naturally
satisfyAssumption 1. Goemans [4℄studiedthestruture ofthe CKS polyhedron, derived
faetdening inequalitiesand proposed a heuristiseparation proedure.
Model IKS is enountered as a sub-problem in solving the utting stok problem by
branh-and-prie [10℄. When using branhing onstraints that enfore integrality of the
numberofuttingpatterns thatinvolveagiven item
i
,the knapsaksubproblem mustbemodied to inlude a xed ost. Nonzero lower bounds,
a
i, may arise in the ourse of arounding heuristi when, in order to ahieve a feasible solution to the residual problem,
one must impose a minimum prodution level in remainingutting patterns. A speial
ase of model IKS was studied by Sural et al. [13℄: they assume
f
i= 0
andw
i= 1
forall
i
. Then, they show how to generalize the Dantzig's upper bound and they proposea primal heuristi. Both are used for setting up a depth-rst searh branh-and-bound
algorithm. Their motivations for studying this model were appliations in nane and
in mahine sheduling. The assumption
w
i= 1
is not restritive for IKS but assumingf
i= 0
is restritive. However, the Dantzig's upper bound an be generalized tothe asef
i6= 0
as shown inthis paper.Model MBKSalsoarisesasa sub-probleminabranh-and-prieapproahtothe ut-
ting stok problem. Most frationalsolutions an be ut-o by boundingthe number of
utting patterns that involves a spei binary variable of the knapsak subproblem in
its 0-1 form [14℄
1
. When a branhing onstraint is added that restrits the number of
1
Thepriing problem is normally aninteger knapsak problem:
max{ P
i
p
ix
i: P
i
w
ix
i≤ W, x
i≤ b
i, x
i∈ IN ∀i}
. Astandard0-1transformationonsistsinintroduingn
i= ⌊log
2b
i⌋+1
binaryitems(i, j)
foreahintegeritem
i
with multipliitym
i j= 2
j−1 forj = 1, . . . , n
i− 1
andm
i ni= b
i− P
ni−1 j=1m
i j.olumnsinvolvinga speibinary item
(i, j)
,the itemdual prieismodied inthe pri-ingproblem,leadingtoobjetiveoeients
p
i j6= m
ijp
i. Ifoneombinessuhbranhingwith that on the number of utting pattern involving a spei item
i
, then xed ostsare also nonzero, giving rise to modelMBKS. Observe that if the binary deomposition
of the priingproblem is not done apriori but dynamially asbranhing onstraints are
introduedonspei binaryitems(see [16℄ fordetails),thenmodelMIKSmust beused.
The speial 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 knapsak problem(this result relies on the assumption that item weights
are a multiple of their lass weight); exat algorithms are derived (branh-and-bound or
dynami programs) by adapting existing algorithmsfor the 0-1knapsak problem.
Variantsof modelMBKS are onsidered in the literature. Chajakis and Guignard[2℄
onsider a model where
m
ij= 1 ∀ij
, lass bound onstraints are replaed byP
nj=1ix
i j≥ y
i∀i
, and the item weights are not restrited to be a multiple of a lass weight (hene,the result of [15℄ onerning a polynomialgreedy solution of the LP relaxation does not
extend to the modelof [2℄). The appliation that motivated their study is the shedul-
ing of parallel unrelated mahines with setups where this knapsak problem arises as
a subproblem. They propose and test two approahes: either a dynami programming
solver or a two-stage approah. In the latter, the problem is transformed into a stan-
dard multiple hoie 0-1 knapsak problem and solved either by dynami programming
or branh-and-bound. The transformation onsists in dening a pseudo-item for eah
dominant feasible solutionswithin a lass. These dominant solutions are the states of a
dynamiprogramforsolvingthebinaryknapsakproblemdenedonasinglelass. There
is a pseudo-polynomial numberof them. They found that, for orrelated instanes with
small knapsak apaity (they assume integer data and onsider
W ≤ 500
), the diretdynami programming approah is the most eient. When the number of families or
the knapsak apaity inreases, the two-stageapproah using branh-and-bound for the
seond stage isthe most eient.
The variant of model MBKS that is onsidered by Jans and Degraeve [5℄ is simpler.
They also assume
m
ij= 1 ∀ij
andw
ij6= m
ijw
i, but their model hasb
i= 1 ∀i
. ThisHowever, this transformation introdues multiple 0-1 representation of a given integer solution. The
alternative0-1deompositionproposedin[15℄istoset
m
i ni= 2
ni. Then,oneneedstointrodueexpliitlassupperbounds:
P
nij=1
m
i jx
i j≤ b
i∀i
. Itguaranteesauniquerepresentationofeahintegersolution.Thisisessentialtoavoidtheenumerationofsymmetrisolutions. Anumerialomparisonofbranh-and-
boundapproahesbasedonthestandard0-1transformationversusthemultiplelassmodelispresented
in[15℄;itshowstheinreasebranh-and-boundtreesize thatmayresultfromignoring thissymmetry.
It takes the form
max{ X
i
( X
j
p
ijx
ij− f
iy
i) : X
i
( X
j
w
ijx
ij+ s
iy
i) ≤ W, X
j
x
ij≤ y
i∀i, x
ij, y
i∈ {0 , 1}}
where setting
x
ij= 1
amounts to produing itemi
so as to over demands from theurrent period
t
up tot + j − 1
. Moreover, their appliation assumes positive xed ostf
i≥ 0
. In this speial ase, feasible solutions verifyx
ij= x
ijy
i. Therefore, their modelredues to a standard multiple hoie knapsak problem
max{ X
ij
˜
p
ijz
ij: X
ij
˜
w
ijz
ij≤ W, X
j
z
ij≤ 1 ∀i, z
ij∈ {0, 1}} ;
where
z
ij= x
ijy
i,p ˜
ij= p
ij− f
i, andw ˜
ij= w
ij+ s
i. Jans and Degraeve [5℄ developedtheir own branh-and-bound algorithmfor it.
The present paper proposes ananalysis of models CKS and MBKS. Their extensions
tomodelsIKSandMIKSare alsodisussed. The aimistoshowthe extenttowhihlas-
sialapproahfortheknapsakproblem,suhasthedepth-rst-searhbranh-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 partiular, we show that under
assumptions slightly less restritive than Assumptions 1 and 2, the LP solutionto these
problemsan beobtainedinpolynomialtime byagreedyproedure. Thekeytothesere-
sults are reformulationas ontinuous knapsak problems with multiplehoie onstraints
[6℄orlassbounds[15℄. Theformulationare polynomialinsizewhilepreviouslyproposed
reformulations suh 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 branh-and-bound proedures. The other main ontribution of the paper is a
spei enumeration sheme for branh-and-bound for CKS and MBKS that exploit the
property of optimal solutions and the greedy ordering of the LP bound. The resulting
branh-and-bound algorithmsare tested and ompared to existing approahes.
Dynami programming reursion an also be derived for these knapsak models with
setups. They are straightforward extensionof resultsforthe standard knapsak problem.
We present them for the sake of establishing the omplexity of the various models. Of
ourse,theimprovementsofthe basitehniquesforknapsakproblems: lineartimeom-
putation of upper bound [1℄, improved variants of Dantzig's bounds, improved dynami
reursion (f.i. using bounds to eliminate intermediate states, exploiting the ore, or so-
alled balaned enumeration), more sophistiated branh-and-bound (f.i. making use of
dominanerules)andhybridmethods[12℄ouldalsobereviewed forthease ofproblems
tehniques toget apoint aross: todemonstrate thatknapsak problems withsetups are
not muh harder than standard knapsak problems.
1 The ontinuous knapsak problem with setups
In modelCKS, the item seletionvariables,
x
, are allowed to take ontinuous values.Hene, the formulationis:
max {
X
ni=1
(p
ix
i−
X
ni=1
f
iy
i) :
X
ni=1
(w
ix
i+ s
iy
i) ≤ W ,
a
iy
i≤ x
i≤ b
iy
i∀i , x
i≥ 0 ∀i , y
i∈ {0 , 1} ∀i .}
(12)Here, bounds
a
i andb
i are not neessarily integer, i.e.a
i andb
i∈ IR
+, ∀i
. Assumption2 an be made withoutlossof generality. Indeed, if
a
i> 0
forsomei
, one an transformthe problem asfollows: let
a
′i= 0
,b
′i= b
i− a
i,s
′i= s
i+ w
ia
i,f
i′= f
i− a
ip
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 haveAssumption 4 (without loss of generality)
f
i≤ 0
for alli
.Indeed, if
f
i≥ p
ib
i for somei
, it is optimal tosetx
i= y
i= 0
and onsider the problemthat remains on the other variables. While, if
0 < f
i< p
ib
i for somei
, then, in anyoptimal solution, either
x
i= y
i= 0
orx
i≥
pfii
, beause a solution where
0 < x
i<
pfii
an be improved by setting
x
i= y
i= 0
. Thus, fpii
an be interpreted as a lower bound,
a
i, whihan be eliminated asexplained above by re-settingb
′i= b
i−
fpii
,
s
′i= s
i+ w
i fpii
,
f
i′= f
i−
fpii
p
i= 0
. Finally,one an also assumeAssumption 5 (without loss of generality)
w
i= 1
for alli
.Otherwise, one an make a hange of variables
x
′i= w
ix
i and redene the assoiatedoeients:
p
′i=
wpii
,
b
′i= w
ib
i.UnderAssumption 5,problemCKSanbereformulatedasamultiplehoieknapsak
problem. When data are integer, i.e., when
a
i, b
i, s
i∈ IN ∀i
andW ∈ IN
, observe thatthe ontinuousvariables
x
takeintegervalue inany feasibleextremesolutions. Therefore,within eah lass, one an optimize the use level
x
by enumeration. Hene, the problem an be reformulatedas a multiplehoie knapsak problem:max{ X
i bi
X
x=ai
( p
ix − f
i) λ
ix: X
i bi
X
x=ai
( w
ix + s
i) λ
ix≤ W,
bi
X
x=ai
λ
ix≤ 1 ∀i, λ
ix∈ {0 , 1} ∀i, x} ,
(13)
where
λ
ix= 1
ix
i= x
. This formulation has pseudo-polynomial size but it leads to a possiblesolutionapproahusingasolverforthemultiplehoie knapsakproblem,whihwe shall use in numerialomparison toour algorithm.
In the rest ofthis setion,we makeAssumptions 2to4withoutlossof generality,but
we arry
w
i in the notation for the sake of extending the results to modelMBKS whereAssumption 5 is not made. Similarly,when Assumption 1 is made,
f
i= 0 ∀i
(as impliedby Assumption 4) but we keep
f
i in the formulation. Thus, our model is given by (12) wherea
i= 0
,p
i≥ 0
andf
i≤ 0
.1.1 Charaterizations of optimal solutions
Some properties of optimal solutions are used to develop bounding proedure or dy-
namiprograms. Toanalysethe strutureof extremesolutions,notethatif onexes
y
to˜
y ∈ {0 , 1}
n,the problem redues toaontinuous knapsak problemthatadmits agreedysolution.
Observation 1 (Dantzig, [3℄)
Let
I = {i : ˜ y
i= 1}
andW ˜ = W − P
i∈Is
i. The resulting problem in thex
variables is:[
CKP(y ˜
)] ≡ max{ X
i∈I
p
ix
i: X
i∈I
w
ix
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
suhthat
p
1w
1≥ p
2w
2≥ . . . ≥ p
|I|w
|I|.
Let
c
be the index for whihP
i<cb
iw
i< W ˜
butP
i≤cb
iw
i≥ W ˜
. Then, setx
i= b
i fori < c,
(15)x
c= W ˜ − P
i<cw
ib
iw
c,
(16)x
i= 0
otherwise. (17)This standard observation yieldstotheonlusion that
x
i∈ {0, b
i}
for alli
but one. Thesame observation was made in [13℄ for the ase
f
i= 0 ∀i
. Moreover, in that ase, [13℄adds that the item with
0 < x
i< b
i, if any, has the smallest ratio piwi
of non zero items.
Thispropertygeneralizestriviallytoourase. Letusexpliitlystatethisharaterization
of extreme solutionsto CKS foreasy referene.