Lodi, A., & Monaci, M. (2003) - Integer Linear Programming Models For 2-Staged Two-Dimensional Knapsack Problems.
Lodi, A., & Monaci, M. (2003) - Integer Linear Programming Models For 2-Staged Two-Dimensional Knapsack Problems.
Abstract. We are given a unique rectangular piece of stock material S, with height H and width W , and a list
of m rectangular shapes to be cut from S. Each shape’s type i (i = 1, . . . , m) is characterized by a height h̄i ,
a width w̄i , a profit p̄i , and an upper bound ubi indicating the maximum number of items of type i which can
be cut. We refer to the Two-Dimensional Knapsack (TDK) as the problem of determining a cutting pattern of
S maximizing the sum of the profits of the cut items. In particular, we consider the classical variant of TDK in
which the maximum number of cuts allowed to obtain each item is fixed to 2, and we refer to this problem as
2-staged TDK (2TDK). For the 2TDK problem we present two new Integer Linear Programming models, we
discuss their properties, and we compare them with other formulations in terms of the LP bound they provide.
Finally, both models are computationally tested within a standard branch-and-bound framework on a large
set of instances from the literature by reinforcing them with the addition of linear inequalities to eliminate
symmetries.
1. Introduction
The problem of cutting a given set of small rectangles (items) from large identical rect-
angular pieces of stock material has been regarded as a prototypical problem in the field
of Cutting & Packing (see Dyckhoff, Scheithauer, and Terno [2] for an annotated bibli-
ography) ever since the seminal work of Gilmore and Gomory [7]. In [7] these authors
discussed a large variety of multi-dimensional cutting problems, starting from the def-
inition of the Two-Dimensional Cutting Stock Problem in which the objective function
is to minimize the number of large rectangles used. In an earlier work, Gilmore and
Gomory [6] proposed a column generation approach to solve the One-Dimensional ver-
sion of the above problem, which calls for cutting a set of one-dimensional items from
the minimum number of identical bars of material. In [7] this approach is extended to
solve the two-dimensional version of the problem, and each slave problem is as follows:
a profit is associated to each item, and a unique large rectangle has to be cut so as to
obtain a subset of the items whose sum of the profits is a maximum. This latter problem
is referred in [7] as the Cutting Knapsack Problem to emphasize that a unique stock
rectangle and a set of profits are considered.
7
8
5 6 5
4
3
6
4
7
1
2
1 2 3
(a) (b)
Fig. 1. Examples of non-guillotine cutting (a), and guillotine cutting (b) patterns
In this paper we refer to the former problem as Two-Dimensional Cutting Stock (or
Two-Dimensional Bin Packing1 , see Lodi, Martello and Monaci [14] for a recent survey),
and to the latter as Two-Dimensional Knapsack (TDK).
More formally, in TDK we are given a unique rectangular stock of material S, with
height H and width W , and a list of m rectangular shapes to be cut from S. Each shape’s
type i (i = 1, . . . , m) is characterized by a height h̄i , a width w̄i , a profit p̄i , and an
upper bound ubi indicating the maximum number of items of type i which can be cut.
The problem calls for the determination of a cutting pattern of S maximizing the sum of
the profits of the cut items (see, Figure 1(a)).
TDK can be found in the literature in many variants deriving from additional re-
quirements or extensions. One of the most common of these variants is determined by
the requirement of producing cutting patterns of guillotine type, i.e., in which each item
must be cut with a sequence of edge to edge cuts parallel to the edges of S (see Figure
1(b)). A special case of this class of problems is the so called d-staged Two-Dimensional
Knapsack, in which the maximum number of guillotine cuts allowed to obtain each item
is fixed to d. This latter class of problems was introduced by Gilmore and Gomory [7],
and has received considerable attention due to relevant real-world applications.
In this paper we consider the case of d-staged cutting with d = 2 (see Figure 2(a)),
and we denote it as 2-staged Two-Dimensional Knapsack (2TDK). Note that, if a third
stage of cutting is allowed only to separate an item from a waste area, we call this
the non-exact case of 2TDK or 2TDK with trimming (see, Gilmore and Gomory [7],
and again Figure 2(a)). Otherwise, we have the exact case of 2TDK, or 2TDK without
trimming (see, Figure 2(b)).
It will be shown in Section 3.1 that the restriction introduced makes the column
generation approach of Gilmore and Gomory suitable for 2TDK. Indeed, in this case the
slave problem is a One-Dimensional Knapsack. These problems have been addressed
1 The name Cutting Stock is used when multiple copies of each item have to be cut off, while Bin Packing
is the version in which each item is considered somehow separately.
Integer linear programming models for 2-staged two-dimensional Knapsack problems 259
in the literature by several authors, and both exact and heuristic algorithms have been
proposed for some different variants. In particular, the following problems may occur:
Extensive studies on 2TDK problems have been performed by Hifi [9]. In particu-
lar, Hifi and Zissimopoulos [12], Morabito and Garcia [19], and Hifi [10] adapted and
extended the approaches proposed by Gilmore and Gomory [7] (i.e., dynamic program-
ming and the already mentioned column generation) to solve many of the variants of
2TDK. Hifi and Roucairol [11] proposed both exact and heuristic algorithms for the
specific case FC-2TDK.
The case in which d = 3 has been recently faced by Vanderbeck [21] by using
nested decomposition within the classical column generation formulation. The general
TDK has been considered by Fekete and Schepers [3, 4] who proposed an elegant graph
theory formulation, and a bounding technique based on the definition of “dual-feasible”
functions. Both the formulation and the bounding technique can be applied to multi-di-
mensional cutting problems in general.
In this paper we propose two Integer Linear Programming (ILP) models for 2TDK
involving a polynomial number of variables and constraints, which can be easily adapted
to all the variants of 2TDK described by the cases above. In the next section the models
are introduced, discussed and compared by considering, for simplicity, the Fixed Con-
strained version of the problem. In Section 3 the quality of the continuous relaxations
of these models are compared with the classical column generation formulation by Gil-
more and Gomory, and with bounds obtained by exploiting appropriate dual-feasible
8 8 9
9
4 5 6 4 5 6 7
7
1 2 1 2 3
3
(a) (b)
Fig. 2. Examples of 2-staged patterns: non-exact (a) and exact (b) cases
260 A. Lodi, M. Monaci
functions. In Section 4 the models are computationally tested on instances from the lit-
erature by using the branch-and-bound framework provided by Cplex 6.5.3 enriched by
specific linear inequalities aimed at avoiding symmetries and by a simple problem-ori-
ented branching rule. In Section 5 the extensions to the other cases are presented along
with additional computational results on each of them.
In the following we assume that all input data are positive integers.
Many of the classical heuristic results on Two-Dimensional Packing Problems are ob-
tained by considering the restriction of packing (cutting) the items into shelves, i.e., rows
forming levels. More precisely, a shelf is a slice of the stock rectangle with width W ,
and height coincident with the height of the tallest item cut off from it. In addition, each
item cut off from the shelf has its bottom edge on a line, the basis of the shelf, and the
top of the shelf determines the basis of a following shelf (see, e.g., the slice containing
items 4, 5, 6, 7 in Figure 2(a)).
The following simple observation holds.
Recently Lodi, Martello and Vigo [15] and Lodi [13] introduced new models for Two-
Dimensional Packing problems in which the restriction of packing into shelves is ex-
plicitly considered. In the light of the previous observation, some of the results and the
terminology introduced in [13] can be used for 2TDK. In particular, it is also true for
2TDK that for any optimal solution there exists an equivalent solution in which the first
(leftmost) item cut in each shelf is the tallest item of the shelf (see again Figure 2(a)).
This allows us to consider only solutions which satisfy this condition, and this first item
is said to initialize the shelf.
2.1. Model 1
For the first model we consider each item to be distinct, i.e., for each shape’s type i
(i = 1, . . . , m), we
define ubi identical items j such that hj = h̄i , wj = w̄i , and
pj = p̄i . Let n = m i=1 ubi indicate the overall number of items, and consider the items
ordered in such a way that h1 ≥ h2 ≥ . . . ≥ hn . The model assumes that n potential
shelves may be initialized: shelf k, if used, must be initialized by item k (k = 1, . . . , n).
Then, the possible cutting of the n items from the potential shelves is described by the
following binary variables:
1 if item j is cut from shelf k
xj k = (k = 1, . . . , n; j = k, . . . , n) (1)
0 otherwise
Integer linear programming models for 2-staged two-dimensional Knapsack problems 261
2.2. Model 2
In the second model the decomposition of the sets of shapes into single items is done
only in terms of shelves, i.e., we consider the items with the same shape’s type together,
whereas we separate them with respect to the initialization of the shelves. Hence, we
need to define a mapping between shape’s types i (i = 1, . . . , m), and potential shelves
k (k= 1, . . . , n). In fact, any item
of type i may be cut from shelves in the range
[1, is=1 ubs ], and we define αi = is=1 ubs (i = 1, . . . , m) with α0 = 0. On the
other hand, any shelf k can be used to obtain items whose type is in the range [βk , m],
with βk = min{r : 1 ≤ r ≤ m, αr ≥ k} (k = 1, . . . , n). Thus, βk (k = 1, . . . , n)
denotes the shape’s type of the item that must initialize shelf k. By assuming again
h̄1 ≥ h̄2 ≥ . . . ≥ h̄m , we have two separate sets of variables. The first set is composed
of the following integer (non-binary) variables:
number of items of type i cut from shelf k if i = βk
xik = (7)
number of additional items of type i cut from shelf k if i = βk
where i = 1, . . . , m; k ∈ [1, αi ], and the term “additional” indicates that the item of
type i initializing shelf k is separately considered (if the shelf corresponds to this type
of items).
The second set involves the following binary variables:
1 if shelf k is used
qk = (k = 1, . . . , n) (8)
0 otherwise
262 A. Lodi, M. Monaci
“additional” parts (x parts) in the same shelf or in the following shelves of that type (if
any). Hence, the profit of the item is possibly taken into account completely (see the
objective function (9)), while the height of the corresponding shelf is only partially paid
(see constraint (12)). This is not the case for the LP relaxation of M1, since if an item
initializes a shelf it cannot be packed as “additional” neither in it nor in the following
shelves.
The following example shows the above drawback and the effectiveness of inequal-
ities (13) in overcoming it.
Example 1. 1 We are given the simple instance: H = W = 10, m = 2, h̄1 = 10,
w̄1 = 1, p̄1 = 1000, ub1 = 3, h̄2 = w̄2 = 1, p̄2 = 1, ub2 = 100.
The LP relaxation of M1 gives an upper bound UM I = 3007, whereas, without inequali-
I I
ties (13), UM = 3070 corresponding to the solution q1 = 0.3, x11 = 2.7, plus 7 shelves
full of items of shape’s type 2. This solution could be forbidden by using an obvious
strengthening of (14): 0 ≤ xik ≤ ubi − 1 if βi = k, which corresponds, in this case,
to x11 ≤ 2. However, this could be not enough: an equivalent solution is q1 = 0.2,
x11 = 1.8, q2 = 0.1, x12 = 0.9 plus 7 shelves full of items of shape’s type 2. By impos-
ing the three inequalities (13) (which dominate by the lifting operation the strengthening
above) x11 + x12 + x13 ≤ 2, x12 + x13 ≤ 1, x13 ≤ 0, we obtain UM I I = 3007.
and this solution has exactly the same value. Constraints (10)–(12) and (14)–(15) are triv-
ially satisfied since they perfectly match corresponding constraints of M1. It remains to
show that also constraints (13) are satisfied and this involves just the case, in the algorithm
above, in which we are considering a shelf k packing additional items of shape’s type
i = βk (the else case). First, observe that by construction xik I I ≤ ub − (k − α
i i−1 ) since
no variable xjI k with j < k is defined (for M1). This shows that at most ubi − (k − αi−1 )
additional items of type i are “available” (from M1c ) for shelves k, k + 1, . . . , αi and the
264 A. Lodi, M. Monaci
I I ≤ ub − (k − α
αi I I
inequality xik i i−1 ) above can be lifted as s=k xis ≤ ubi − (k − αi−1 )
which coincides with inequality (13) for the pair (i, k).
M2 → M1. Given a feasible solution M2c , a corresponding solution M1c is built as
follows:
for k := 1 to n
I := q ;
xkk k
for i := βk to m zi := xikII
for j := k + 1 to n
xjI k := min{1, zβj }
zβj := zβj − xjI k
where zi (i = 1, . . . , m) is, by construction, the number of “additional” items of shape’s
type i cut from the current shelf (the one defined by the outer loop). The solution ob-
tained with the algorithm above has the same value of the original M2c and is feasible
for the continuous relaxation of M1 since inequalities (13) guarantee that, given a shelf
k such that i = βk (k = 1, . . . , n), no item j of shape’s type i can be cut off from k if
j < k.
A final remark concerns the geometric bound, i.e., the most obvious upper bound
for general Two-Dimensional Knapsack problems obtained by solving the continuous
relaxation of the 0-1 Knapsack Problem in which the capacity of the knapsack is W · H ,
and to each item j (j = 1, . . . , n) corresponds an item of KP01 whose profit is pj
and whose weight is wj · hj . Not surprisingly, by denoting the value of this continuous
relaxation bound as Ug , and the value of the continuous relaxation of the models as UM ,
the following simple result can be proved with algebraic arguments (see Monaci [18]):
Proposition 1. For any instance of FC-2TDK, UM ≤ Ug .
We conclude Section 2 by briefly discussing the size of M1 and M2 above. It is im-
mediate that M1 involves n(n + 1)/2 binary variables and 2n constraints, whereas M2
involves 2n + m + 1 constraints (note that i one inequality (13) for each of the n
we have
potential shelves), n binary variables, and m i=1 s=1 ubs integer variables. This means
that the number of integer variables of M2 depends on the structure of the instance, and,
in particular, belongs to the range [n, n(n + 1)/2], where the lower bound of n variables
corresponds to the case in which all the items are identical (m = 1), whereas the upper
bound is given by the case in which all items are different (m = n).
3. Upper bounds
In this section we consider other upper bound procedures for 2TDK and we computa-
tionally compare them, in Section 3.3, with the bound provided by the LP relaxation of
the models.
A classical upper bound for FC-2TDK can be derived from the column generation ap-
proach proposed by Gilmore and Gomory [6]. Let S := {1, . . . , N S} be the set of all
Integer linear programming models for 2-staged two-dimensional Knapsack problems 265
ris ris
where (0 ≤ ≤ ubi , i = 1, . . . , m) denotes the number of items with shape’s type
i which are cut from shelf s. Let As and Ps be the height and the profit of shelf s, i.e.,
formally:
m
As := max{h̄i : ris > 0, i = 1, . . . , m} and Ps := p̄i ris
i=1
Thus, the LP relaxation of the column generation formulation for 2TDK (the so-
called master problem) is as follows:
UCG := max Ps ys (17)
s∈S
subject to ris ys ≤ ubi (i = 1, . . . , m) (18)
s∈S
As ys ≤ H (19)
s∈S
ys ≥ 0 (s ∈ S) (20)
Since the number N S of variables (columns) is in general huge, only a subset of them is
considered, thus “restricted” LP relaxations are iteratively solved until no variable with
negative reduced cost exists, i.e.
m
Ps ≤ ρAs + πi ris (∀s ∈ S) (21)
i=1
where πi (i = 1, . . . , m) and ρ are the dual variables associated with constraints (18) and
(19), respectively. Columns with negative reduced cost, violating condition (21), can be
detected by solving the so-called slave problem, i.e., the following Bounded Knapsack
Problem (BKP):
m
Z(BKP ) := max (p̄i − πi )ri (22)
i=1
m
subject to w̄i ri ≤ W (23)
i=1
0 ≤ ri ≤ ubi integer (i = 1, . . . , m) (24)
If there exists a feasible shelf s such that Z(BKP ) > ρAs , then s is added to the formu-
lation (17)–(20), otherwise UCG represents the value of the upper bound of the column
generation formulation.
266 A. Lodi, M. Monaci
Since we are just interested at the quality of the bound, we implemented the above
column generation approach by using Cplex for solving both the master problem and the
slave problem. For the description of an efficient implementation of column generation
techniques for cutting and packing, the reader is referred to Vanderbeck [20, 21].
Finally, it is easy to see that the presented technique can be adapted to all the variants
of 2TDK by modifying the slave problem, i.e., the way the columns are generated.
Recently, Fekete and Schepers [4] proposed a general bounding technique for cutting
and packing problems by using the concept of dual-feasible functions (see also Lueker
[16]), and exploited it for solving multi-dimensional knapsack problems.
Roughly speaking, a dual-feasible function u is a function mapping a given instance
I of the problem into a new instance I such that any feasible solution for I is also feasi-
ble for I : hence, any bound for I is also valid for I . Fekete and Schepers [4] proposed a
set of mapping functions which can be used to produce different I , thus different valid
bounds: after this mapping, they simply compute the geometric bound (see Section 2.3)
on I .
It is known that any function u described above is a feasible solution of the dual of
the column generation formulation of the problem (see the previous section). This fact
implies the name “dual-feasible” function, and the dominance of UCG with respect to
the bounds which can be obtained from any function u.
We used the three dual-feasible functions proposed in [4] to produce modified in-
stances of FC-2TDK. However, since the bound given by the LP relaxation of M1 and
M2 dominates the geometric bound (recall Proposition 1), we applied the LP relaxation
of our models as bounding procedure on the modified instances. The results were not
satisfying since we were not able to improve the bound given by M1 (and M2) on the
original instances. This behavior seems to be due to the structure of the instances (see
Section 3.3) in which there is a large number of “small” items, i.e., items whose height
(resp. width) is small with respect to the height (resp. width) of the stock unit. The dual-
feasible functions in [4] are known to be effective in case of “large” items. However,
better results could be in principle obtained by using specific dual-feasible functions
taking into account the 2-stage constraint.
Since no improvement has been obtained, detailed computational results using
dual-feasible functions have been omitted in the next section.
We compared the column generation bound and the bound given by the Models de-
scribed in Section 2 by considering the set of 38 FC-2TDK instances2 proposed by Hifi
and Roucairol [11] and composed of 14 weighted instances and 24 unweighted ones.
The results are given, separately for weighted and unweighted instances, in Table 1. We
need to note that the literature of 2TDK distinguishes two cases: (i) the case in which
2 Available at ftp://panoramix.univ-paris1.fr/pub/CERMSEM/hifi/2Dcutting/.
Integer linear programming models for 2-staged two-dimensional Knapsack problems 267
the first cut is horizontal, i.e., the case we referred to in the entire paper, and (ii) the
case in which the first cut is vertical. In the latter case, we can simply extend the ter-
minology of shelf patterns by referring to “shelves” also as “columns” forming levels
(see the discussion at the beginning of Section 2). From an operational viewpoint, this
case can be easily handled by swapping the dimensions of both the stock piece and the
items.
In particular, for each instance of the discussed sets, Table 1 indicates the identifier
(ID), the number of shape’s types (m), and the number of items (n). Moreover we report,
for both horizontal and vertical patterns (cases (i) and (ii), respectively), the optimal so-
lution value (Opt), the ratio between the bound produced by the continuous relaxation
268 A. Lodi, M. Monaci
of the models (UM ) and the optimal solution value, and the ratio between the bound
produced by the column generation (UCG ) and the optimal solution value3 .
The computational results show that the bound produced by the column generation
is better than the one produced by the LP relaxations of our models on almost all the
instances. This fact is not surprising since it follows from a general result by Geoffrion
[5]. Specifically, the average percentage gap of UM for the weighted instances is 11.5%
(12.8% resp.) for the horizontal (vertical resp.) pattern with respect to 3.8% (4.0% resp.)
of UCG . For the unweighted instances, instead, these gaps are 5.8% (6.5% resp.) with
respect to 2.8% (2.1% resp.).
These results show a quite large difference between UM and UCG , mainly in the
weighted case. However, as will be shown in Section 4.2, these initial gaps of M1 and
M2 are efficiently closed within a branch-and-bound framework. Moreover, we have to
point out that the computation of UCG requires the solution of a set of (N P -hard) BKPs
whose solution requires pseudo-polynomial time.
4. Computational experiments
We tested models M1 and M2 on the instances introduced in Section 3.3 by using the
standard branch-and-bound (without specific tuning of the parameters) of the commer-
cial ILP solver Cplex version 6.5.3. The code runs on a Digital Alpha 533 MHz.
We performed two sets of computational experiments: the first is aimed at improv-
ing the performance of the models within the branch-and-bound framework, whereas
the second compares the models with the existing literature. In Section 4.1 we propose
linear inequalities aimed at removing symmetric solutions from the search space, and
their effectiveness is computationally shown. Moreover, a simple improvement to the
standard branching rule of Cplex 6.5.3 is presented and tested in the same section.
In the second set of experiments (see Section 4.2) we compare the results obtained
by M1 and M2 (plus the effective linear inequalities and the branching rule) with those
of the best exact algorithm in the literature by Hifi and Roucairol [11].
Symmetries are one of the main problems when dealing with exact methods for cutting
problems. This is true in general for ILP models (e.g., Hadjiconstantinou and Christo-
fides [8]) when they are not based on the column generation framework (see, instead,
Vanderbeck [20]), and also for branch-and-bound methods exploiting combinatorial
bounds (e.g., Martello and Vigo [17]), the only exception being the graph theory mod-
eling approach of Fekete and Schepers [3].
In our models some of these symmetries are avoided by the assumptions discussed
at the beginning of Section 2: we do not explicitly distinguish the position of an item in
a shelf (neither the position of a shelf in the rectangular stock piece), and the fact that n
3 Both bounds are rounded down to the closest integer before computing their ratio with respect to the
optimal value.
Integer linear programming models for 2-staged two-dimensional Knapsack problems 269
potential shelves are considered (each of them with a prefixed height) allows to further
restrict the search space.
In addition, some other symmetries can be avoided in both models by using two sets
of linear inequalities which are presented hereafter for M1, and then adapted to M2.
The first set of inequalities is aimed at removing from the search space the equivalent
solutions in which a shelf k is used instead of a shelf , both corresponding to items with
the same shape’s type, and such that k > . We call these inequalities Ordering Inequal-
ities (OIs). They are stated in the following Theorem where the notations introduced for
M2 (see Section 2.2) are used.
Theorem 2. For any shape’s type i (i = 1, . . . , m), linear inequalities
xtt ≥ xt+1,t+1 (t ∈ [αi−1 + 1, αi − 1]) (25)
are valid for formulation M1.
Proof. Suppose that in an optimal solution of 2TDK one of the inequalities (25), say
xkk ≥ xk+1,k+1 , is violated. This implies that item k has been cut off from one of the
shelves 1, . . . , k − 1, say s, whereas item k + 1 initializes its shelf. However, since k
and k + 1 are identical, it is always possible to “swap” shelves k and k + 1 by: (i) cutting
item k + 1 from s, (ii) initializing shelf k with its corresponding item, and (iii) obtaining
from shelf k the items which were cut from shelf k + 1. Hence, we obtain an equivalent
optimal solution such that inequality xkk ≥ xk+1,k+1 is satisfied.
The second set of inequalities concerns the number of additional items of a given
shape’s type, say i, which can be cut from shelves, say and k, such that (by using the
β-notation introduced for M2) β = βk = i. In particular, we want to remove from
the search space those solutions in which the number of these items cut from shelf k is
greater than the number of those cut from shelf if k > . We refer to these inequalities
as Extended Ordering Inequalities (EOIs).
Theorem 3. For any shape’s type i (i = 1, . . . , m), linear inequalities
αi
αi
xst ≥ xs,t+1 (t ∈ [αi−1 + 1, αi − 1]) (26)
s=t+1 s=t+2
Both Ordering Inequalities and Extended Ordering Inequalities can be added to the
ILP models in the construction phase (O(n) + O(n) inequalities in both cases), and their
effectiveness is computationally tested by solving to optimality the same set of instances
introduced in Section 3.3. Table 2 reports computational results comparing M1 and M2
in their basic version and with the addition of OIs and EOIs. The results are given
separately for weighted and unweighted instances, and, for each model both in basic
and strengthened versions, the average computing time (in seconds) and the number of
unsolved instances within the time limit of 1,800 seconds are reported. Recalling that
each of the instances is solved twice (first cut either horizontal or vertical), the entries
of the table consider 28 and 48 different runs for the weighted and unweighted cases,
respectively.
The results in Table 2 show that the addition of linear inequalities in order to avoid
symmetries in the models is very effective by allowing the solution of the entire set of
instances. Moreover, since we considered as solution time for the unsolved instances
the time limit, the average computing times are an optimistic estimate, thus the already
relevant speed up shown by the table could be even higher. From now on, we consider
the version of M1 and M2 with the addition of OIs and EOIs.
We conclude the section by briefly mentioning the standard branching strategy im-
plemented by Cplex 6.5.3 and by proposing a simple problem-oriented improvement. In
order to show that the proposed models are effective for a general-purpose ILP solver, we
did not tune Cplex, so that, for example, we leave Cplex automatically choose up/down
branch direction and backtracking tolerance. A simple and quite effective improvement
can be, however, achieved by defining a priority order for the variables to branch on.
Specifically, we assign a higher priority to the variables corresponding to the initializa-
tion of a shelf (xkk in M1 and qk in M2). For each of these variables, the priority value
is set to the value of the profit of the corresponding item, thus giving larger priority to
items with larger profit.
Table 3 reports the results of this simple branching rule (“improved”) compared with
the automatic variable selection (“default”) implemented by Cplex 6.5.3. The table is
organized as Table 2 where columns indicating the number of unsolved instances are
replaced by columns indicating the average number of branch-and-bound nodes.
The results in Table 3 suggest that the proposed ordering is quite effective in the se-
lection of the branching variable, by effecting in an overall reduction of both computing
times and number of branch-and-bound nodes.
5. Models’ extensions
In the previous sections we discussed the Fixed Constrained version of 2TDK, and in
particular the non-exact case. An immediate extension to the exact case is possible for
both models: in M1 (resp. M2) it is enough to set xj k = 0 if hk = hj (resp. h̄k = h̄βj ),
or more efficiently not to define those variables.
In the following sections we consider the extensions needed by the models in order
to address the most common variants of 2TDK discussed in Section 1. Both M1 and
M2 are considered with the addition of the symmetry-breaking inequalities and with the
simple branching rule discussed in Section 4.1.
Note that, without loss of generality, we address in the following sections only the
case in which the first cut is horizontal.
Both models can be easily extended to the case in which ubi = +∞ (i = 1, . . . , m), i.e.,
no upper bound on the number of items of each shape’s type is defined. This case, called
4 The Digital Alpha 533 MHz has 16.1 SpecInt95 value while the UltraSparc10 250 MHz has 10.4 SpecInt95
value. This indicates that the Digital Alpha is about 3 times faster.
272 A. Lodi, M. Monaci
unconstrained in Section 1, has been considered in the literature, e.g., [9], and can be
addressed by simply observing that such an upper bound always exists due to “shape”
reasoning. Due to the limited size of the stock piece, the simplest way of computing such
a bound is to consider for each shape’s type i (i = 1, . . . , m), ubi = (H W )/(h̄i w̄i ),
i.e., the geometric upper bound computed as area of the rectangular stock divided by
the area of the shape’s type. A slight improvement can be obtained by considering
ubi = H /h̄i · W/w̄i . This leads to a mapping of an unconstrained instance to a
constrained one, thus immediately allowing our models to be used without any change.
The drawback of this mapping for our models is obvious: since the bound we com-
pute is not tight, the size of the models grows up very quickly both in terms of number of
variables and constraints. This fact dramatically decreases the effectiveness of M1 while
Integer linear programming models for 2-staged two-dimensional Knapsack problems 273
M2 is still usable in practice since the items of the same type are considered together
at least as x variables. We computationally checked this behavior by considering the
classes of instances5 discussed by Hifi [10], and some results are reported in Table 5.
We considered as an example a single instance for each class reported in [10], and
we tested both M1 and M2 as discussed in Section 4 for a given time limit of 1,800
seconds on a Digital Alpha 533 MHz6 .
In Table 5 we report, for each instance, its identifier (ID), the number of shape’s type
(m), and the number of items after the mapping (n). In addition, we report the optimal
solution value (Opt), and the ratio between the upper bound of the continuous relax-
ation (UM ) and Opt. Then, for each model, the number of variables and constraints (nv
and nc respectively), and the computing time (t.M1 and t.M2 respectively) are reported.
Finally, in round brackets, we report the percentage gap between lower and upper bound
where the instance is not solved to optimality within the time limit (directly reported by
Cplex). Table 5 does not report results for the instances of the class LW and LU which
are unsolvable for our model: the smallest weighted instance of this class, LW1, involves
after the mapping 102748 items (so as the corresponding unweighted one LU1), thus
the size of both models becomes intractable.
These results show that both models remain able to solve in a reasonable amount
of computing time a large set of unconstrained instances of 2TDK, thus showing the
flexibility of the proposed framework. In particular, M2 greatly benefits from the fact of
considering items of the same shape’s type partially together.
However, it is important to point out that for pure unconstrained 2TDK, i.e., FU-
2TDK, ILP models are far from being the state of the art technique. Indeed, FU-2TDK
is solvable by computing the optimal solution of a set of m + 1 disjoint unconstrained
knapsack problems: one for each shape’s type, m, and one for cutting the shelves from the
5 Available at ftp://panoramix.univ-paris1.fr/pub/CERMSEM/hifi/2Dcutting/.
6 In Table 5 and in the other ones of Section 5 the first set of instances refers to the weighted case, and the
second set to the unweighted one.
274 A. Lodi, M. Monaci
stock unit. Moreover, as already proposed by Gilmore and Gomory [7], these knapsack
problems can be solved in a single step by dynamic programming. Effective implemen-
tations (also for FU-3TDK) of this framework have been proposed by Hifi [10] obtaining
results which are around 2 orders of magnitude better than those in Table 5.
The second variant of 2TDK we consider is the one in which the items can be rotated
by 90◦ , called rotation in Section 1. The basic idea for extending both models to this
case is to introduce for each possible item, say j , a “companion” item, say j , for which
the height and weight values are swapped, and then add to the formulation suitable
constraints avoiding that j and j are both inserted.
More formally, since in M1 each item is considered separately, for each item j
(j = 1, . . . , n) the companion item j + n is considered such that hj +n = wj and
wj +n = hj , and the 2n items are sorted by non-increasing height values. A straight-
forward way of imposing the constraints on the packing of the companion items is to
replace constraints (3) by
j θj
xj k + xθj ,k ≤ 1 (j = 1, . . . , 2n; j < θj ) (29)
k=1 k=1
where θj (j = 1, . . . , 2n) indicates the companion of item j after the sorting and re-
numbering phase.
However, it is not possible to use these constraints in combination with the OIs. Con-
sider, for example, two identical items j and j + 1, and their companions (after sorting)
θj and θj +1 , and suppose that in the optimal solution two shelves must be initialized
with height hj and wj . The associated OIs force the opening of shelves j (j being the
first item of height hj ) and θj (θj being the first item of rotated height wj ), whereas this
is forbidden by a corresponding constraint (29) since j and θj are the same item.
A simple way of overcoming this problem is to relax in a surrogate fashion con-
straints (29) in the following way. Let T = {1, . . . , m} be the set of the shape’s types,
and let γj ∈ T (j = 1, . . . , 2n) indicate the shape’s type to which items j and θj belong.
We obtain the following m surrogate constraints
j
xj k ≤ ubt ∀t ∈T (30)
j ∈J | γj =t k=1
αi
αi
( xik + qk ) ≤ ubt ∀t ∈T (31)
i∈I | δi =t k=1 k=αi−1 +1
Integer linear programming models for 2-staged two-dimensional Knapsack problems 275
where I = {1, . . . , 2m} is the set of the shape’s types either in the original orientation
or rotated, and δi ∈ T (i ∈ I ) indicates the original shape’s type corresponding to the
new shape type i. Constraints (31) replace constraints (10).
Obviously, the mapping discussed in Section 2.2 and denoted by arrays α and β has
to be updated, and again we need to replace n with 2n.
Both M1 and M2 were tested on a small set of the instances used in sections 3.3 and
4 in which the rotation version of the problem is solved. The results are reported in Table
6 in which for each instance we indicate the identifier (ID), the number of shape’s types
(m), and the number of items to be cut off (n). Note that in order to solve R-2TDK the
instance is almost doubled in size. In addition, for each instance we report the optimal
solution value (Opt), the ratio between the upper bound produced by the continuous
relaxations of the models (UM ) and the optimal solution value, and the computing times
of M1 (t.M1) and M2 (t.M2). In round brackets, we report the percentage gap between
lower and upper bound where the instance is not solved to optimality within the time
limit of 1.800 CPU seconds.
Table 6 proves that the extension of M1 and M2 are still suitable for the solution
of the rotation version of 2TDK. However, the computing times required for instances
solved by allowing the items to be rotated are in general much higher than those given in
Table 4. Concerning the behavior of the models, as discussed in Section 4.2, M1 is more
effective than M2 when the ratio n/m is small, for example instance Hchl2 (n/m < 2.2).
Moreover, M1 turns out to be very effective for the overall set of instances in Table 6,
and greatly benefits of the new simple branching rule discussed in Section 4.17 .
7 See, Monaci [18] for a comparison of the performance of M1 and M2 with and without the branching
rule.
276 A. Lodi, M. Monaci
The last variant of 2TDK we consider is the one in which also a lower bound on the
number of items of each type is specified, i.e., one is required to cut off at least lbi
items of type i (i = 1, . . . , m). This variant, which is denoted by double-Constrained
(dC-2TDK), has been recently addressed by Cung and Hifi [1] for the more general
guillotine TDK problem, and has several practical applications.
Note that finding a feasible solution of dC-2TDK is already NP-complete, since
it corresponds to the recognition version of the Two-Dimensional Shelf Bin Packing,
which is in turn a generalization of the classical One-Dimensional Bin Packing (see,
[15]).
Both M1 and M2 can be easily extended to consider this variant. In particular, for
M1 we can simply write, for each i = 1, . . . , m, the first lbi constraints of type (3) as
equalities. For M2, instead, we need to add, for each i = 1, . . . , m, a new constraint of
the following form:
αi
αi
xik + qk ≥ lbi (32)
k=1 k=αi−1 +1
which assures that at least lbi items of type i are cut off.
We tested our models on the instances used by Cung and Hifi [1] (kindly provided
by the authors), and the results are shown in Table 7. This table contains the same infor-
mation as the previous ones with an additional
column indicating the overall number of
items which must be cut off (L), i.e. L = m i=1 lbi .
Again, Table 7 shows that the addition of the lower bounding constraint is suitably
taken into account by the extensions of M1 and M2, and in fact, the computing times
to solve this more constrained variant are considerably smaller than the corresponding
ones in Table 4.
6. Conclusions
Acknowledgements. We are grateful to Silvano Martello and Daniele Vigo for introducing us to the wide
domain of Cutting & Packing. Thanks are also due to Adam N. Letchford and Alberto Caprara who read a
preliminary version of the paper, and to the anonymous referees whose tight remarks consistently improved
the paper. We acknowledge the support given to this project by the Consiglio Nazionale delle Ricerche (CNR),
Italy.
References
[1] V.-D. Cung and M. Hifi. Handling lower bound constraints in 2D guillotine cutting. Talk presented at
ISMP 2000, Atlanta, 2000.
[2] H. Dyckhoff, G. Scheithauer, and J. Terno. Cutting and Packing (C&P). In M. Dell’Amico, F. Maffioli,
and S. Martello, editors, Annotated Bibliographies in Combinatorial Optimization, pages 393–413. John
Wiley & Sons, Chichester, 1997.
[3] S.P. Fekete and J. Schepers. On more-dimensional packing I: Modeling. Technical Report ZPR97-288,
Mathematisches Institut, Universität zu Köln, 1997.
[4] S.P. Fekete and J. Schepers. On more-dimensional packing II: Bounds. Technical Report ZPR97-289,
Mathematisches Institut, Universität zu Köln, 1997.
[5] A.M. Geoffrion. Lagrangean relaxation for integer programming. Mathematical Programming Study,
2:82–114, 1974.
[6] P. C. Gilmore and R. E. Gomory. A linear programming approach to the cutting stock problem. Opera-
tions Research, 9:849–859, 1961.
[7] P. C. Gilmore and R. E. Gomory. Multistage cutting problems of two and more dimensions. Operations
Research, 13:94–119, 1965.
[8] E. Hadjiconstantinou and N. Christofides. An exact algorithm for the orthogonal, 2-D cutting problems
using guillotine cuts. European Journal of Operational Research, 83:21–38, 1995.
[9] M. Hifi. Contribution à la résolution de quelques problèmes difficiles de l’optimization combinatoire.
Habilitation thesis, PRiSM, Universitè de Versailles St-Quentin en Yvelines, 1999.
[10] M. Hifi. Exact algorithms for large-scale unconstrained two and three staged cutting problems. Combi-
natorial Optimization and Applications, 18:63–88, 2001.
[11] M. Hifi and C. Roucairol. Approximate and exact algorithm for constrained (un)weighted two-dimen-
sional two-staged cutting stock problems. Journal of Combinatorial Optimization, 5:465–494, 2001.
[12] M. Hifi and V. Zissimopoulos. A recursive exact algorithm for weighted two-dimensional cutting prob-
lems. European Journal of Operational Research, 91:553–564, 1996.
[13] A. Lodi. Algorithms for Two-Dimensional Bin Packing and Assignment Problems. PhD thesis, University
of Bologna, Italy, 2000.
278 A. Lodi, M. Monaci: Integer linear programming models for 2-staged two-dimensional
[14] A. Lodi, S. Martello, and M. Monaci. Two-dimensional packing problems: a survey. European Journal
of Operational Research, 141:241–252, 2002.
[15] A. Lodi, S. Martello, and D. Vigo. Models and bounds for two-dimensional shelf packing problems.
Journal of Combinatorial Optimization, 2002 (to appear).
[16] G. S. Lueker. Bin packing with items uniformly distributed over intervals [a,b]. In Proc. 24th Annual
Symp. Found. Comp. Sci., pages 289–297, 1983.
[17] S. Martello and D. Vigo. Exact solution of the two-dimensional finite bin packing problem. Management
Science, 44:388–399, 1998.
[18] M. Monaci. Algorithms for Packing and Scheduling Problems. PhD thesis, University of Bologna, Italy,
2002.
[19] R. Morabito and V. Garcia. The cutting stock problem in hardboard industry: a case study. Computer
and Operations Research, 25:469–485, 1998.
[20] F. Vanderbeck. Computational study of a column generation algorithm for bin packing and cutting stock
problems. Mathematical Programming, 86:565–594, 1999.
[21] F. Vanderbeck. A nested decomposition approach to a 3-stage 2-dimensional cutting stock problem.
Management Science, 47:864–879, 2001.