A Generalized Bin Packing Problem for parcel delivery in last-mile logistics

Abstract In this paper, we present a new problem arising at a tactical level of setting a last-mile parcel delivery service in a city by considering different Transportation Companies (TC), which differ in cost and service quality. The courier must decide which TCs to select for the service in order to minimize the total cost and maximize the total service quality. We show that the problem can be modeled as a new packing problem, the Generalized Bin Packing Problem with bin-dependent item profits (GBPPI), where the items are the parcels to deliver and the bins are the TCs. The aim of the GBPPI is to select the appropriate fleet from TCs and determine the optimal assignment of parcels to vehicles such that the overall net cost is minimized. This cost takes into account both transportation costs and service quality. We provide a Mixed Integer Programming formulation of the problem, which is the starting point for the development of efficient heuristics that can address the GBPPI for instances involving up to 1000 items. Extensive computational tests show the accuracy of the proposed methods. Finally, we present a last-mile logistics case study of an international courier which addresses this problem.

M A N U S C R I P T M A N U S C R I P T

Introduction
The transportation services market is estimated to be worth approximately 3 trillion euros worldwide with a gross value added (GVA) of 600 billion in the EU-28 at basic prices, corresponding approximately to 5% of the total GVA [16]. In the past decade, new challenges emerged thanks to an increased awareness of stakeholders and companies to a more general vision of the transportation sustainability taking into account economic, environmental and social aspects. In particular, last-mile delivery raised as one of the more complex, challenging, and innovating topic. In more detail, the explosion of e-commerce and the need of a global vision of the sustainability of the last-mile brought researchers and practitioners to define new A C C E P T E D M A N U S C R I P T business and operational models. These models must fulfill the increasing demand and the high standards in terms of quality of service required by e-commerce and traditional companies and flexibility asked by end users. In this paper we consider a crucial aspect in the management of last-mile logistics operations, i.e. the planning of the fleet used in a given urban area to deliver the parcels. More precisely, we address the tactical problem of setting a last-mile parcel delivery service in a city by considering different transportation companies, which differ in cost and service quality. We also show how this problem can be modeled as a packing problem, namely the Generalized Bin Packing Problem with bin-dependent item profits (GBPPI).
Packing problems deal with the assignment of items to bins. In the tactical problem presented here, the item model the parcels while the bins represent the vehicles of the TCs available for the deliveries.
The contribution of this paper is twofold. The first contribution refers to the packing problems literature.
In details, the introduction of the bin-dependent item profits provides a more flexible packing problem (GBPPI) that enables to tackle the majority of real-world performance indicators and to address problems with mixed objective functions. The mixed objective function consists of two terms with opposite signs: 1) the total cost of the bins used to be minimized; and 2) the total bin-dependent profit of the selected items to be maximized. Although the introduction of bin-dependent item profits might seem an irrelevant development of the original Generalized Bin Packing Problem (GBPP), we show that this modification in the problem setting revolutionizes the methodologies. It is known from the literature that small changes in the objective function do not alter problem complexity [43]. However, we show that this is not the case for the GBPPI. This unexpected behavior can be noticed in at least two circumstances. First, as we show in Section 5.3, if a commercial solver is used to address both the GBPP and the GBPPI, the percentage gap significantly increases with the same computational time on instances with the same number and typology of items and bins. Second, all the more so, classical heuristic approaches of packing problems, such as the Best Fit and Next Fit decreasing procedures, fail when the profit becomes bin-dependent. To overcome these issues, after providing an integer-programming we propose efficient methodologies which take bin dependency of profits into account.
The second contribution of the paper is to use the GBPPI to address a real case study arising in last-mile logistics which involves an international courier. Every day, the courier has to serve its customers. Even if the customers can both ask for pick-ups and deliveries, we can relax this scenario. In fact 85% of the operations of a courier are deliveries [40]. Therefore, we can just take into account the effects of deliveries.
In order to perform the service, the courier uses a set of transportation companies (TCs) which fulfill parcel deliveries using their own fleet. The courier must decide each day which TCs to select for the service in order to minimize the total cost and maximize the total service quality. That decision must be taken in a short time (approximately 10 minutes after all parcels to deliver become known) to ensure a prompt assignment of parcels to vehicles and, therefore, an efficient service. Minimizing the total cost and maximizing the total service quality are conflictual objectives. Existing models for last-mile logistics only partially consider conflictual objectives while addressing the selection of different TCs [38,39]. The introduction of bin-dependent item profits allows the use of the GBPPI in last-mile logistics [13,42].
The remainder of this paper is organized as follows: in Section 2, we introduce the problem and review important literature on packing problems on which the GBPPI is based. In Section 3, the GBPPI model is described, and in Section 4 heuristics for addressing the GBPPI are introduced. Instance sets and computational results are given in Section 5. In more detail, we compare the GBPPI with the classical GBPP, showing how the introduction of the bin dependency of the profits makes our problem much difficult to solve. Then, we show the accuracy and the effectiveness of our metaheuristics and finally we show how using the GBPPI to solve the problem faced by an international courier of choosing the mix of delivery options/sub-contractors can bring to a reduction of its operational costs, with a clear benefit for the company.
Conclusions are provided in Section 6.

Problem setting and literature review
The operations concerning the very last leg of the supply chain, the so-called last-mile logistics, have emerged as one of the most problematic ones to manage, optimize, actuate, and control. These operations, in fact, face significant fulfillment constraints, higher social, environmental and economic costs, and the complexity to maintain their economies of scale and expected service levels. In the recent years, following the enormous increase of the e-commerce and the relative growth of parcel deliveries (and returns) in our cities, last-mile challenges have become more and more complex, and many researchers have focused on finding solutions at various levels.
The most important innovations in this area generally share the vision of reducing as much as possible the negative externalities while maintaining the process sustainability in terms of costs and quality. For example, new collaborative business models exploiting crowd-tasking [46] or synchro-modality [15,19] have appeared, accompanied by a steadily increasing use of self-service technologies, such as parcel lockers, or greener solutions, such as electric vehicles and bicycles [45,41]. Moreover, it has also been shown that a more appropriate modeling of the customers' behavior and more adequate pricing schemes for the service time-constraints may help in de-stressing the so-called Attended Home Deliveries, in which the parcel must be delivered within a precise time window in order to find the customer at home [44,30].
While at an operational level the optimization of last-mile logistics reduces to deal with vehicle routing and scheduling problems (generally complicated by the presence of multiple depots, products, and distribution echelons or by hard loading constraints [47,7,29]), the tactical planning is instead fundamental to evaluate the options (e.g., the various transportation tenders) and allocate the right resources (vehicles, operators, products) to the right place (depots, facilities, distribution centers) for the day-by-day operations [2,23]. In the last decade, there have been interesting developments in the packing literature so that, in addition to their classical uses at the operational level, packing problems have gradually appeared as tools for modeling strategic and tactical decisions taken in the transportation and supply chain sectors [13,38].
This has led, for instance, to new problems, such as the Variable Size and Cost Bin Packing Problem [12], the Multi-handler Knapsack Problem under Uncertainty [39], and the Generalized Bin Packing Problem (GBPP) [4]. The problem studied in this paper is indeed a generalization of the GBPP and it is used to provide decision support at a tactical level for last-mile logistics.
Packing problems look for an optimal assignment of items to a set of bins able to accommodate them.
In the GBPPI, bins are characterized by their capacity and cost of use, and are classified by type, i. e., bins of the same bin type have the same capacity and cost. The items can be compulsory (i.e., mandatory to load) or non-compulsory, and are characterized by weight and profit. The item profits depend on the bin types. The aim of the GBPPI is to load compulsory items and profitable non-compulsory items into appropriate bins in order to minimize net cost. This is given by the difference between the total cost of the bins used and the total profit accruing from the loading of the items. As already discussed in Section 1, the GBPPI naturally arises in last-mile-logistics optimization, where a courier responsible for parcel delivery faces a tactical problem involving the following decisions: 1) select a number of TCs, 2) select a number of vehicles from the fleet of the chosen TCs, and 3) assign parcels to the chosen vehicles. In the GBPPI, the TCs are modeled by the bin types and vehicles by the bins. This implies that cost and capacity for bins of the same type represent the transportation cost and the maximum weight for each vehicle of the fleet of a particular TC. Moreover, each TC has a limited fleet with a maximum number of available vehicles. Parcels are represented by items. Therefore the weight of an item models the weight of a parcel, while its profit takes into account the economic value for the courier due to delivery and the gain due to the service quality of TCs. The courier knows service quality based on feedback from consignees. This feedback takes into account a number of factors including punctuality, integrity of parcels at the delivery, and courtesy.
Compulsory items represent priority parcels which have to be consigned in the current delivery, while noncompulsory items are those parcels which delivery can be procrastinated. Finally, the courier might cope with municipality traffic limitations on the maximum number of circulating vehicles.
The GBPPI is an evolution of bin packing problems which we briefly recall here. The oldest problem is the Bin Packing Problem (BPP), which consists of a set of items to be loaded into bins of equal size such that the number of bins used is minimum [32,10,9]. The Variable Sized Bin Packing Problem (VSBPP) is a generalization of the BPP, which was proposed in the 1980s by Friesen and Langston [18], and involves the introduction of bin types. Monaci [33] and Haouari and Serairi [21] studied exact algorithms, whereas heuristic approaches were adopted in [20,22,28]. A more interesting variant where there is no correlation between the volume and the cost of the bins is discussed in [12] for the deterministic form and in [13] for the stochastic one.
The Generalized Bin Packing Problem (GBPP) is a generalization of previous bin packing problems, involving the introduction of item profits as well as compulsory and non-compulsory items. Heuristics, and exact and approximate algorithms can be found in [4,6]. Online and stochastic variants were discussed in [5,36]. Finally, approximation issues were studied in [3].
The analysis of the literature shows how all problems studied have costs and profits associated to just one of the two sets: usually costs to bins and profits to items. Actually, to the best of our knowledge, no study considers a dependency of the profits from both items and bins. This feature prevents the use of classical heuristics, namely the Best Fit and Next Fit Decreasing heuristics, to address the GBPPI.

The GBPPI model
In this section, we propose a model for the GBPPI. We define the following: • I: set of items • σ : J −→ T : indicator function, where given bin j ∈ J , reveals its type t ∈ T , i.e., σ(j) = t iff bin j ∈ J belongs to type t ∈ T • p it : profit generated by item i ∈ I when accommodated into a bin of type t ∈ T • w i : volume of item i ∈ I • C t : cost of a bin of type t ∈ T • W t : capacity of a bin of type t ∈ T • L t : minimum number of bins to be used of type t ∈ T • U t : maximum number of bins to be used of type t ∈ T • U ≤ t∈T U t : maximum number of bins to be used An optimal solution of an instance of GBPPI must satisfy the following requirements: • The overall cost given by the difference between the cost of the bins used and the profits incurred by the loaded items is minimized.
• All compulsory items must be accommodated into some bins.
• The sum of the volumes of the items loaded into a bin cannot exceed the capacity of that bin.
In order to provide a model for the GBPPI, we need to introduce the following binary variables: A model for the GBPPI can then be formulated as follows: The objective function (3) ensures that the solution minimizes the total net cost, given by the cost due to the bin used minus the profit obtained from the loading of the items into the bins. Constraints (4) are the so-called capacity constraints that ensure that the sum of the volumes of the items loaded into a bin does not exceed the bin capacity. Constraints (5) ensure that all compulsory items are loaded, whereas constraints (6) state that non-compulsory items may or may not be accommodated. Constraints (7)-(9) are bin usage constraints. Finally, constraints (10)-(11) force the variables involved to be binary.
We point out that the presence of bin usage constraints (7)-(9) and a limited number m of bins might lead to infeasible solutions. As shown in [4], in order to ensure that the problem is feasible, a dummy bin with a large capacity and high cost is added to the problem.

A C C E P T E D M A N U S C R I P T
Model (3)-(11) inherits all the variables and constraints from the model for the GBPP described in [4] except for the objective function. Although the change in the objective function due to the introduction of bin-dependent item profits might seem trivial at first glance, in 5.3 we present a detailed comparison between the GBPP and the GBPPI and show that the latter is harder to solve. Moreover, as we show in Section 4, the introduction of bin-dependent item profits implies a relevant generalization of the constructive heuristics used to tackle both problems.

Heuristics
In this section, we present efficient heuristics for addressing the GBPPI. As mentioned in the introduction and will be shown in 5. • one constructive heuristic named Best profitable (BP) • one constructive heuristic named Best Assignment (BA), • one metaheuristic named Greedy Adaptive Search Procedure (GASP) [17], • a parallel matheuristic named Model-Based Matheuristic (MBM).
These heuristics provide a flexible trade-off between quality of solution and computational time, in light of the imposed maximum computational time of 10 minutes.

The constructive heuristics
The proposed constructive heuristics are a variant of Best Fit Decreasing (BFD) introduced by Johnson et al. [27] to address BPP. As already discussed, this generalization is necessary to address GBPPI and problems with a mixed objective function. Our constructive heuristics are called Best profitable (BP) and Best Assignment (BA), and operate with a list of available bins SBL and one of sorted items SIL.
The major variant implemented in order to address the GBPPI is the broadening of the definition of the best bin. Let S ⊆ J be the set of bins used in a solution of a bin packing problem, and let W res (b) be the residual volume of bin b ∈ S. In previous versions of the bin-packing problem, the best bin for an item was defined as the one that can accommodate the item such that the residual space is minimized. In GBPPI, instead of considering the minimum residual space, we compute a figure of merit consisting of a weighted sum that takes into account both item profit and bin volume. Again, this choice is motivated by the fact that in the GBPPI, we need to consider two factors. In classical bin packing problems the aim is to minimize residual space in order to reduce the number of bins used or the cost of bin usage. The adoption of this approach in the GBPPI does not always guarantee effective outcomes because item profits in such cases rely heavily on bins. Our weighted figure of merit, defined as α · p i σ(j) − (1 − α) · W res (j), simultaneously addresses these two loading policies. The term p i σ(j) maximizes item profit, whereas the term W res (j) minimizes residual space. α ∈ [0, 1] is a coefficient that is varied during the execution of GASP (cf. Section 4.2), and allows both loading policies to be spanned.
A further generalization is that this definition of the best bin is applied to a subset of N |SIL| items, rather than a single item. When we consider item i in list SIL, we take into account the sublist For each item, we compute the best bin; at the end of this process, we select the best item i * ∈ SIL and the best bin b that maximizes the aforementioned figure of merit.
Our computational experience confirmed that this "medium-term" memory improves the performance of the heuristics. The behavioral difference between BP and BA heuristics can be observed when we cannot load item i ∈ SIL into any of the already bins used in S. In this case, we try to select a new bin where to accommodate item i. The BP heuristic considers item i with the remaining succeeding items in SIL, and selects the bin that minimizes the difference between bin cost and the sum of profits from items that can be loaded into that bin. If this difference is positive and item i is non-compulsory, then item i is discarded because it is not convenient to open a new bin. Similarly, the BA heuristic selects the bin that maximizes profit for item i. Both heuristics perform a post-optimization procedure consisting of two parts. In the first part, for each bin b ∈ S contributing to the solution, we try to perform, if possible, the best swap with a bin b ∈ J \ S that has not been used. Clearly, the swap is possible if the items loaded into bin b can also be accommodated into bin b , and the difference between the cost of bin b and the sum of the profits of the items loaded in it is greater than the difference between the cost of bin b and the sum of the profits of the same items loaded into bin b . Furthermore, in the second part of the post-optimization procedure, we remove bins from the solution that are not profitable and do not contain compulsory items. It is clear that the solutions provided by the BP and BA heuristics depend on the two parameters α and N . As we show in Section 4.2, the values of these parameters are varied using the GASP procedure, which employs BP and BA as sub-heuristics. In contrast to classical bin packing heuristics such as the Best Fit Decreasing, we wish to point out that the ordering of items for the BP and BA is something outside the algorithmic 9 A C C E P T E D M A N U S C R I P T framework. In fact, in Section 4.2 we show that GASP will be responsible to sort the items before using any constructive heuristics. Otherwise, if the BP and BA are used as stand-alone heuristics, many sortings of items are possible due to the presence of multiple and bin-dependent attributes. This behavior can also be observed in GBPP, where Baldi et al. [4] studied different sortings for constructive heuristics. According to their study and to the knapsack-problem heuristics [32], the best performance on average can be obtained sorting the items by non-increasing profit over weight ratios and then by non-increasing weight.

The GASP
Greedy Adaptive Search Procedure (GASP) algorithms consist of a multi-start procedure to find a good initial solution and of a loop where, at each iteration, a new solution is generated by means of a simpler heuristic. In our GASP for GBPPI, we employ the Best profitable and Best Assignment heuristics, which were already described in Subsection 4.1.
Moreover, we try to improve the solution performing a steepest descent local search where the neighborhood consists of "1 to 1 swaps". We perform the swaps each time an improving solution is found. A swap consists in unloading one item, say i 1 , to create sufficient room to accommodate an unloaded item i 2 . The swap is only performed if it is possible and profitable.
At each iteration of the main loop, we try to generate a different and improved solution by varying the order of the items in the list SIL. This is performed by associating a score with each item. A score update procedure randomly assigns a different score value to each item.
Finally, a long-term reinitialization procedure is executed each time a solution does not improve in consecutive iterations. Its purpose is to explore a different area of the feasible set by changing parameters α and N of the constructive heuristics. The proposed method incorporates some ideas from [35]. The pseudo-code of our GASP is proposed in Algorithm 1.
The algorithm presented in this section satisfies the terminology of the term GASP, namely Greedy Adaptive Search Procedure. It is a greedy algorithm because it is based on the BP and BA procedures that can be classified as greedy algorithms. It is also an adaptive-search algorithm because the long-term reinitialization procedure is helpful to explore new regions of the solution space.
The GASP metaheuristic can be easily parallelized. Let P be the set of available threads in a parallel computation. It is enough to execute one GASP metaheuristic for each thread p ∈ P and with a different seed for the random-number generator. Let BP (p) be the final best solution provided by the GASP executed by thread p ∈ P, then the overall best solution BS will be store the resulting solution as CS 10: if CS < BS then 11: BS := CS 12: perform "1 to 1" swaps 13: numConsecutive := 0 14: else 15: numConsecutive := numConsecutive + 1 16: end if 17: score update procedure 18: if numConsecutive = M AXCON SECU T IV E then 19: long-term reinitialization procedure

Multi-start initialization
The purpose of our multi-start initialization procedure is twofold: to feed the main loop of GASP with a good initial solution, and automatically calibrate the parameters used by the constructive heuristics.
As already discussed when introducing the constructive heuristics, in contrast to the classical bin packing problem the concept of best bin does not merely depend on the residual volume. The introduction of bindependent item profits makes it impossible to define the best bin just in terms of residual volume. In fact, the following factors should be taken into account: 1) the residual volume itself, 2) the item profit, and 3) the bin type. The multi-start initialization is an auto-calibrating procedure where the Best profitable heuristcs is executed a number of times, each time varying the parameter N within a given range. The value of N providing the best solution is used in the following part of the heuristic.

Score update
Item scores are randomly extracted from a discrete uniform distribution. The motivation for this choice is that working with integer values rather than real values implies a faster resolution of the sorting procedure.
We prefer to distribute the item scores in a range proportional to the number of items, and then use integer scores rather than concentrating the scores with real values within a smaller range.

The Model-Based Matheuristic
We present here a parallel matheuristic for the GBPPI, where a set of computer threads P run simultaneously. It consists of a loop, where at each iteration each thread solves a subproblem using model (3)- (11).
The resolution of subproblems with model (3)-(11) allows us to take into account two targets at the same time, namely the minimization of the cost and the maximization of the profits. Thus, this matheuristic is suitable to address problems with a similar structure.
In each subproblem, a small set of bins is randomly selected from the incumbent solution and the set of available bins. Then, we solve model (3)-(11) using these bins, the items loaded into the bins in the incumbent solution, and the items that have not been loaded in the incumbent solution. In order to further improve the given solution, we merge couples of partial solutions that do not have any bins and items in common. The best solution is updated if the new solution is an improvement over the incumbent one. This process continues until an overall time limit is reached.
According to the taxonomy of parallel methods proposed by Crainic and Toulouse [8], this approach can be classified as 1C/RS/MPSS, where the following hold: • 1C: One Control, i.e., one master thread controls all the remaining threads.
• RS: Rigid Synchronization, i.e., at each iteration, we wait for all threads to complete their computations.

A C C E P T E D M A N U S C R I P T
• MPSS: Multiple points same strategy, i.e., each thread solves a different subproblem, but using the same strategy.
We chose to use this kind of parallelism because it can easily be implemented in our matheuristic. As we show in the next section, although the matheuristic can be exploited without parallel computation, this approach is strongly recommended when GBPPI is employed as a subproblem of a larger problem, and significantly improves the performance of the matheuristic. The main steps of the MBM matheuristic are shown in Algorithm 2. The initial solution can be any feasible solution. However, for better results it is important to start with a good solution. In our computational tests we used the solution found by the GASP as initial solution of the MBM.

Computational results
In this section we analyze different computational aspects of the GBPPI. First, we compare the GBPPI with the classical GBPP, showing how the introduction of the bin dependency of the profits makes our problem much difficult to solve. Then, we show the accuracy and the effectiveness of our metaheuristics.
Finally, we show how using the GBPPI to solve the problem faced by an international courier of choosing the mix of delivery options/sub-contractors can bring to a reduction of the operational costs, with a clear benefit for the company.

13
A C C E P T E D M A N U S C R I P T

Test environment
We extended the original instances for the GBPP [4] by introducing bin dependency in the item profits.  Ten instances were generated for each combination of features in Table 1, for a total of 300 instances. For each instance, the minimum and the maximum number of available bins for bin type t ∈ T is respectively set to The aforementioned 300 basic instances are then used to generate four classes of instances, numbered from 0 to 3, differing for the presence of compulsory items and the profit of the not compulsory ones. Class 0 considers the special case in which all the items as compulsory, and thus the items have no profit associated to them. In classes 1 and 2 all the items are non compulsory and an item profit p i of item i ∈ I is given by respectively, where U denotes uniform distribution.

A C C E P T E D M A N U S C R I P T
Given the item profit (for the instances of classes from 1 to 3), the bin-dependant profit p i t is generated as Like in [39], ϑ can either be extracted from a uniform distribution U(0, 1) or from a Gumbel distribution G(0, 1). Values in (12) ensure that profit values approximate realistic settings. C min and C max are the extremes of the uniform distribution and of the truncated Gumbel distribution. This is done to avoid unrealistic values. For the sake of brevity, we refer to instances of GBPPI with item profits extracted from a Gumbel distribution according to (12) as Gumbel instances, and instances of GBPPI with item profits extracted from a uniform distribution according to (12) as uniform instances. GBPPI instances are also available on line [34]. y j ≤ y j+1 ∀j ∈ J : σ(j) = σ(j + 1).

Calibration
We

Comparison between the GBPP and the GBPPI
We compare here the classical version of the GBPP versus the new GBPPI. It is important to design a heuristic that is accurate and fast at the same time, in order to be able to exploit the benefits of the GBPPI in a city logistics setting, as discussed in Section 1.
To make the comparison, we selected 30 instances of the GBPP along with the corresponding Gumbel and uniform instances of the GBPPI, as explained in the text. Thus, the number of instances in this instance set is 90. The number of items range from 25 to 500. We solved each instance with the solver, eight threads and a time limit of six hours. Furthermore, we monitored the percentage gap provided by the solver after one minute, 10 minutes, one hour, and six hours of computation. The results of these initial tests are summarized in Table 2, where we show the gaps in mean percentage between test instances, grouped by the number of items and type of instances. In particular, C denotes the original instances of GBPP, G stands for the Gumbel instances of GBPPI, and U represents the uniform instances of GBPPI.  From Table 2, we can see that the gaps provided by the solver for the GBPPI instances (both Gumbel and uniform) are clearly higher than those of the original GBPP. For example, the gap in mean percentage of the 500-item-GBPP instances is 0.43%, whereas the gap in mean percentage of the corresponding GBPPI

A C C E P T E D M A N U S C R I P T
instances is 2.50% for the Gumbel instances and 2.72% for the uniform instances. This suggests that the introduction of the dependence of item profits on bins involves greater computational effort.
It is worth remarking on the trend in gaps with respect to the range of the minutes. This interval is crucial in city-logistics settings, where decisions need to be made quickly [37]. It was not possible to report the percentage gaps for the 500-item instances after one minute of computation because the solver was unable to determine an initial solution (i.e., the percentage gap was arbitrarily large). The percentage gaps provided by the solver after 10 minutes for the GBPPI instances were acceptable for the 25-item instances only. As the number of items increased to 50, the gaps increased to 2.12% for Gumbel instances and to 1.60% for uniform instances. The percentage gaps tended to increase as the number of items increased.
This trend became considerably more evident for the 500-item instances, with the GBPP instances having a mean percentage gap of 1.43 and the GBPPI having gaps of 38.19% and 20.57%, respectively, for the Gumbel and uniform instances. These gaps were clearly prohibitive. Moreover, for some instances the solver was unable to find an initial solution after 10 minutes of computation. All these considerations indicate that the solver alone is not appropriate to address GBPPI in a city-logistics environment where decisions are made quickly and the number of items is greater than 500.
In Table 3, we list the percentage gaps between the algorithms proposed in this paper and the percentage gap of the best (minimum) between the Best profitable (BP) and Best Assignment (BA) constructive heuristic with respect to the solver the best solution found by the solver with a time limit of 1 hour. The The best constructive heuristic was compared to the solver with one thread only because the execution of BP and the BA heuristic does not require parallelism. The computational time of the constructive heuristic was practically zero, but this immediate execution was paid for in terms of the highest percentage gaps.
In fact, the overall is quite high, with a mean gap greater than 12%. This remarks again the difficulty given by the introduction of the bin dependency of the items' profits. In fact both the BP and BA extends quite known concepts in the packing literature that normally gives gaps less than 1% [12,4]. Actually, as already noticed in multi-dimensional packing problems [38,11], the presence of multiple ordering options deteriorates the performances of traditional concepts. This, in conjunction with a profit scheme linking the sets of bins and items, make the best and next fit concepts to have bad performances. Table 3   is the Best Fit Decreasing (BFD) [6]. We used the instances presented in this section to compare the BP and BA with the BFD. As already discussed in Section 4.1, the main innovations for the new constructive methods are the introduction of a memory for the candidate items to be accommodated and a mixed figure of merit for selecting the best bin. In Table 4  These results show that while the BFD is still useful for the GBPP, it has to be replaces with better constructive heuristics when addressing the GBPPI because, as already discussed, the introduction of bindependent item problems does not change the solution set but strongly modifies the nature of the problem.

A C C E P T E D M
A N U S C R I P T

Computational results of the heuristic methods
In Table 5, we list the percentage gaps between the algorithms proposed in this paper and the best solution found by the solver in one hour. The results are reported according to the type of instance (Gumbel and uniform), the number of items (from 25 to 200), and the number of threads (one and eight). We also wanted to estimate the benefits of a parallel computation in comparison with a single-thread approach. The columns in Table 5    In column 3 we report the results of the constructive heuristics. Although this value was high, the Best profitable and Best Assignment heuristics found their utility in the execution of GASP and MBM, which yielded much lower percentage gaps. Moreover, from Table 5  when the number of threads increased from 1 to 8. Table 6 presents the average computational times of the last best solution found by the MBM. The columns in Table 6 indicate the following: col. 1) represents the type of distribution for the item profits, col. 2) shows the number of items, cols. 3) and 4) list the average computational times needed to find the best solution for the MBM with one and eight threads, respectively.  The analysis of Table 6 reveals that the average time tended to increase in line with instance size.

DISTRIBUTION
Moreover, the overall average time was approximately one minute.
Finally, we compared the MBM with the branch-and-price by Baldi et al. [6] on the same instances as the classical GBPP. We computed the percentage gaps of the MBM with respect to the branch-and-price results. The results are presented in Table 7 according to the number of items. In particular, columns 2, 4, 6, and 8 indicate the percentage gaps of the branch-and-price with respect to its best lower bound computed at the root node (cf. [6] for further details). Columns 3, 5, 7, and 9 present the percentage gaps of the MBM with respect to the best objective function provided by the branch-and-price. The instances in Class 3 were defined for 500 items only. The overall percentage gap of the MBM compared to the branch-and-price was approximately 0.22%. Nevertheless, we observed that for 34 instances, better results were found than those 20 A C C E P T E D M A N U S C R I P T provided by the branch-and-price in Baldi et al. [6], and within a considerably smaller computational time.
The time limit of the branch-and-price was one hour, while that of the MBM was two minutes. Moreover, for a third of the instances of GBPP, the Model-Based Matheuristic could find the same results generated by the branch-and-price.  1 The instances in Class 3 were defined for 500 items only.

Smart City case study
As described in Section 1, the case study refers to the planning of parcel deliveries of an international courier. In this case study, we compare our MBM solutions with those of the courier based on its business policy. We analyzed 30 instances (i.e., 30 competitive tenders) with 1,000 daily parcel deliveries (i.e., the items), 10 TCs (i.e., the bin types), and up to 100 trucks (i.e., the bins) per TC, available in an urban distribution area.
In Table 8, we present the percentage gaps of our MBM compared to the business policy and the solver (this time with a time limit of two hours) over the 30 competitive tenders. Our MBM always finds better results than those provided by the business policy and the solver.
A more interesting outcome results from the analysis of the instances from an economic and managerial point of view. The size of each instance is representative of the daily parcels of a parcel delivery company in a medium-sized city. If we compare the solution with one based on expert opinion (tactical decisions based on expert opinion and day-to-day decisions optimized by means of specific optimization tools), the assignments given by GBPPI achieve a constant reduction of the overall cost by between 3 and 4%. In terms of the economic impact of costs, this amounts to 120,000-180,000 euros for a medium-sized city (the interval depends on different scenarios of annual numbers of parcels). Moreover, this economic impact will A C C E P T E D M A N U S C R I P T

INSTANCE COURIER GAP SOLVER GAP INSTANCE COURIER GAP SOLVER GAP
Instance

A C C E P T E D M A N U S C R I P T
increase in the near future, due to the increase in B2C flows resulting from e-commerce, mass customization, and decentralized production [25,26].

Conclusions
In this paper, we introduced a new packing problem named Generalized Bin Packing Problem with bin-dependent item profits (GBPPI). We have shown that GBPPI can be applied at both tactical and operational levels. At the tactical level, GBPPI models cross-country and multi-modal transportation settings. At an operational level, GBPPI describes the problem of a courier selecting the appropriate number and type of vehicles from a set of available transportation companies. We have also demonstrated that the introduction of bin-dependent item profits is not trivial in terms of problem resolution. We presented a number of heuristics to efficiently address the problem within limited computational time. We have also presented extensive computational results and a case study of a well-known international courier operating in northern Italy.