Integrating packing and distribution problems and optimization through mathematical programming

Article history: Received June 25, 2015 Received in revised format: October 12, 2015 Accepted October 22, 2015 Available online October 24 2015 This paper analyzes the integration of two combinatorial problems that frequently arise in production and distribution systems. One is the Bin Packing Problem (BPP) problem, which involves finding an ordering of some objects of different volumes to be packed into the minimal number of containers of the same or different size. An optimal solution to this NP-Hard problem can be approximated by means of meta-heuristic methods. On the other hand, we consider the Capacitated Vehicle Routing Problem with Time Windows (CVRPTW), which is a variant of the Travelling Salesman Problem (again a NP-Hard problem) with extra constraints. Here we model those two problems in a single framework and use an evolutionary meta-heuristics to solve them jointly. Furthermore, we use data from a real world company as a test-bed for the method introduced here. Growing Science Ltd. All rights reserved. 6 © 201


Introduction
This work studies a joint model integrating two classical combinatorial optimization problems: the Bin Packing Problem (BPP) (Ma et al., 2013) and the Capacitated Vehicle Routing Problem with Time Windows (CVRPTW) (Kok et al., 2010).These problems frequently arise in the operational planning of the distribution and transportation of goods (Mula et al., 2010).The usual way of addressing such problems is by applying mathematical programming methods.Since the decision variables are usually integer-valued the solutions space consists of orderings (subsets of natural numbers).But the complexity of finding solutions puts both BPP and CVRPTW in the NP-Hard class.This means that if a polynomial time algorithm for any of them could be found, it could help to solve in polynomial time any problem in the NP-complete class.This is why it is frequent to seek heuristic methods to find approximately optimal solutions.The combination of both problems involves, given a set of requests of several customers, vehicles and routes serving them in an efficient way.We have to determine what requests can be satisfied by the same vehicle in such a way as to use efficiently its capacity, reducing the costs of distribution.Before analyzing the joint problem we will briefly discuss each of the problems separately.

The Vehicle Routing Problem
Given a class of vehicles and two groups, one of customers and the other of depots, both distributed geographically, the Vehicle Routing Problem requires finding minimal cost routes starting and ending at the depots such the vehicles visit each customer at most once (Frutos & Tohmé, 2012;Escobaret al., 2014;Oyola & Løkketangen, 2014).The solution depends on several parameters, namely the size of the vehicle fleet, the degree of heterogeneity and capacity of the vehicles, the number of depots, the degree of randomness of the demand, the time windows of the service, etc.Each selection yields a different setting, of which the most basic one is the Traveling Salesman Problem (TSP), which provides a ground on which more complicated and practical instances can be stated (Theys et al., 2010).In the TSP a sole vehicle has to visit each customer on a single, minimal cost route.That is, the total distance covered by the vehicle should be minimal.The complexity of this problem stems from the fact that in a general and symmetric case with n customers the number of feasible routes is   . It is easy to see that this problem belongs to the NP-complete class.
TSP can be extended to the multiple TSP (m-TSP), m salesmen have to cover a determinate number of cities, such that each one is visited by only one of the agents.Each route is a round trip starting on a given base-city.The goal here is minimize the total distance covered by the different vehicles.In turn, the Vehicle Routing Problem (VRP) generalizes m-TSP adding a customer-specific demand; geographically distributed depots and a vehicle-specific capacity (Kallehauge et al., 2006) (Fig. 1).With the additional requirement that the total demand on a route cannot exceed the capacity of the corresponding vehicle we get the Capacitated Vehicle Routing Problem (CVRP) (Frutos & Tohmé, 2012;Kao et al., 2013;Sitek, 2014).In turn, CVRP with Time Windows (CVRPTW) is the CVRP with the added constraint that each customer has a time window for delivery (Bräysy, 2003).In the case of single depot, the CVRPTW requires to find m routes (one for each vehicle) such that: (i) each route starts and ends at the depot, (ii) each customer is visited by just one vehicle, (iii) the total demand on a route does not exceed the capacity of the vehicle serving it, (iv) the departure and arrival times at the depot fall inside a given time window, and (v) the total cost (distance plus the penalties for violating the time windows of the customers) are minimal.

The Bin Packing Problem
The Bin Packing Problem (BPP) is that of packing a set of objects in several containers such that the total weight or volume does not surpass the capacity of the container, minimizing the number and the cost of use of containers (Baumgartner et al., 2011;Bennell et al., 2013).Many real world packing problems can be modeled as instances of the BPP, like the determination of the optimal amount to load in trucks and other vehicles (Lodi et al., 2012).

The Combined Problem
If capacity is measured only on a single dimension, the problem of loading and distributing cargo in a fleet of vehicles would be represented by CVRPTW (Bräysy, 2003).But real world goods have several features each of which corresponds to a dimension of capacity, e.g.weight; surface of the floor of the container; volume of the container; fragility (which determines if it can be piled) etc. (Iori et al., 2007).So, the goal is, on one hand, to optimally pack a bunch of elements in a set of containers with given dimensions.On the other, the packing must be done such that each vehicle serves the customers on a route.Separate optimal solutions to the packing and routing problems can yield a joint sub-optimal solution.Thus, it is convenient to integrate the problems in a single framework as to capture the interdependences among the problems (Fig. 2)., where the class of nodes is , where  are two copies of the depot and  has a transportation cost ij c and a travel time ij t .The demand of customer i C  is a class i P of items with total weight i q , to be satisfied by a vehicle in a service time i s .Each item h  P has width h f and height h e , where ).Each vehicle may cover at most one route and cannot split the deliveries to any customer, thus being forced to visit each customer only once.Each vehicle has a rectangular load space of width k f and height k e .Items have a fixed orientation and have to be packed in parallel to the borders of the floor of the vehicles.Furthermore, they cannot be rotated.

The Variables and Constraints of the Problem
The binary variable ijk x has value 1 iff vehicle k K  goes through edge   z is 1 if items h and l are loaded together and 0 otherwise.To avoid superposition, L hl o will be 1 iff item l is laid on the left of h.On the other hand, U hl o will be 1 iff item l is below item h, to avoid vertical superposition.M are large constants.
Eq. ( 1) states the goal, namely the minimization of total cost.Eq. ( 2) is the per-vehicle capacity constraint.Eqs.(3-4) ensure that each customer is visited only once and the depot is used by all the vehicles.Flow conservation is ensured by Eqs.
(5-6), while Eq. ( 7) warrants the satisfaction of time constraints.Expressions (8,9) enforce the time windows whose violations are penalized in the objective function.Eqs.(10-13) specify the domains of some variables.Constraints (14,15), combined with Eq. ( 3) indicate that all items have to be loaded in vehicles and that all items i P corresponding to customer i must be consolidated in a single vehicle k.Eqs.(16-17) mandate that no items can be loaded as to exceed the perimeter constraints of the vehicles.In turn, constraints (18-21) ensure that no items can be superposed (instead of piled up) in vehicle k.Inequality (22) ensures that only vehicles in use can be loaded.Finally, Eqs.(23-26) impose conditions on the rest of the variables.

An Instance of the Problem and its Solution
To run the model on a real-world case we have chosen data from a fruit company in Rio Negro (Argentina) and its provision area in Buenos Aires.This company has a depot in the city (N1) and 3 refrigerated vehicles with the same load capacity, intended to cater its customers in 10 marketplaces across Buenos Aires.  1 specifies these markets (Ni, i = 1,…,11, where N1 is the depot) and their corresponding time windows are (ai,bi), i = 1,…,11.We also specify the servicing time si for each customer as well as its corresponding geographical position (Latitude: Xi, Longitude: Yi).Table 2 specifies the transport costs ij c while Table 3 the travel times ij t , for each pair of customers (i,j).As said, the fleet based on node N1 has m=3 refrigerated vehicles, each one with a capacity Qk=26.000Kg.The rectangular loading space has dimensions f k = 2.5 m and e k =13.5 m (i.e. a floor surface of 33.75 m 2 ).The demand of each customer i N | i 2,...,11  , consists of a number Pi of pallets of apples o pears.Each item i h P  is a pallet of width fh=1.2 m and length eh=1.0.The weight of the demand of customer i is the sum of the weights of all the requested pallets.The weight of an apple pallet is happle=994.70Kg while the corresponding to a pear one is hpear=1.136.80Kg.Each customer formulates its demand according to the stocks available in the depot.A failure in delivering the demanded pallets means that the customer marketplace will be left out of stock.The trucks are loaded under a LIFO (last in first out) policy and the optimization goal is to load the vehicles such that they are able to deliver all the demanded pallets to the customers on their corresponding routes.Fig. 3 shows the graph of the problem.It has 11 nodes and 110 edges.The problem is solved combining mathematical programming methods with a genetic algorithm (Goldberg, 1989).As it is well known, a genetic algorithm starts with a family of potential solutions and then by successive rounds of selection of the fittest on which mutation and crossover operators are applied it will tend to yield closer to the optimal outcomes.After some seasons of exploratory essays, we set the size of the population in 100, with 500 generations, and using as procedures ranking (for selection); 2-Point (for crossover) with probability 0.85 and 2-Swap (for mutation) with probability 0.01.The algorithm, programmed in MatLab, runs on an Intel Core 2 Duo processor 2,4 GHz.y RAM 4 Gb.Each run took less than 3 seg.We considered the demands reported on Table 4, and compared the outcomes under our procedure to the real-world actions taken by the company.In the real world, the company underused the vehicles: in average each truck was loaded only up to a 70% of its capacity.We have presented an integrated method solving jointly the Bin Packing Problem (BPP) and the Capacitated Vehicle Routing Problem with Time Windows (CVRPTW) in a loading and distribution setting.We have run it with real-world data of a fruit company serving several markets.The procedure, including a genetic algorithm, has been implemented in Matlab.The results have satisfied the technical and operational constraints of the problem, yielding significantly better outcomes than the current policies of the company.Further work involves the application to larger problems and the implementation of the procedure in a dedicated computer environment.

Fig. 1 .
Fig. 1.Solution to a VRP problem with three vehicles and a single depot

Fig. 2 .
Fig. 2. Joint BPP and CVRP setting A vehicle arriving before i a has to wait until the time window opens, while if delivering after i b is penalized by an amount L i c .For the deposit node we assume 0overall departure and arrival time of the vehicles.The fleet consists of m identical vehicles of capacity Q (indexed by   K 1,..., m  plane coordinates (x,y) of the lower left corner of item h.Finally, F k c is the cost of vehicle k.Then, expressions (1-26) represent the entire model:

Table 1
Customer nodes

Table 2
Transport costs (monetary units)