A tabu search approach for the livestock collection problem

A tabu search approach for the livestock collection problem

Computers & Operations Research 35 (2008) 3213 – 3229 www.elsevier.com/locate/cor A tabu search approach for the livestock collection problem Johan O...

714KB Sizes 8 Downloads 165 Views

Computers & Operations Research 35 (2008) 3213 – 3229 www.elsevier.com/locate/cor

A tabu search approach for the livestock collection problem Johan Oppen∗ , Arne LZkketangen Molde University College, 6402 Molde, Norway Available online 1 March 2007

Abstract We present a problem dealing with transportation of live animals to slaughterhouses. The problem is taken from the Norwegian meat industry, and may be viewed as a vehicle routing problem extended with inventory constraints to ensure a smooth production flow at the slaughterhouse. In addition, several constraints to ensure animal welfare have to be met. These include duration limits for how long animals can stay on the vehicle as well as rules for mixing different animal categories. In this paper, we show that this real-world problem can be solved heuristically, even if it is large both in size and complexity. A tabu search based solution method for the problem is presented, and results from computational testing are given, including comparisons with manual solutions from today’s planning system. 䉷 2007 Elsevier Ltd. All rights reserved. Keywords: Vehicle routing problem (VRP); Rich VRP; VRP with side constraints; VRP with inventory constraints; Livestock transportation; Tabu search

1. Introduction The project “Transportation of living animals—reduced transportation costs, good animal welfare and first-class meat quality” is a co-operation between the Norwegian Meat Research Center, Gilde Norsk KjZtt, Fatland and Molde University College. The Norwegian Meat Research Center is a center for competence and emergency control in the Norwegian meat industry. Gilde Norsk KjZtt and Fatland are Norwegian meat companies. They both run slaughterhouses, and they also cut and process the carcasses into finished meat products. The project, which was launched in 2003 and stipulated to last for five years, focuses on the collection of animals for slaughter. The main goal of the project is to develop a decision support system (DSS) to reduce transportation costs and at the same time secure good animal welfare and meat quality, as these are three main factors for the profitability of both farmers and the meat industry. Tomasgard and HZeg [1] describe an optimization model for production processes that are later in the value chain for meat products. It would be beneficial to integrate larger parts of the value chain in the same planning system to avoid suboptimization, but this paper concentrates on a part of the value chain where optimization-based planning systems are almost non-existing. The livestock collection problem (LCP) may informally be described as the problem of constructing the best possible set of routes for transportation of living animals from farmers to one slaughterhouse. Each route must be feasible according to constraints on duration, vehicle capacity, mix of animal types and visiting order of the customers. The whole solution as a set of routes must adapt to both the production plan, see Section 2.2.5, and the lairage capacity at the ∗ Corresponding author. Tel.: +47 71214240; fax: +47 71214100.

E-mail addresses: [email protected] (J. Oppen), [email protected] (A. LZkketangen). 0305-0548/$ - see front matter 䉷 2007 Elsevier Ltd. All rights reserved. doi:10.1016/j.cor.2007.02.021

3214

J. Oppen, A. Lkketangen / Computers & Operations Research 35 (2008) 3213 – 3229

slaughterhouse. Ability to get solutions for the livestock collection problem will be an important part of the DSS referred to above, and the contribution of this paper is to describe the problem and give a solution method. The rest of the paper is divided as follows. In Section 2 follows a closer description of the livestock collection problem. An overview of solution methods is given in Section 3, followed by a description of our tabu search (TS) approach in Section 4. In Section 5 we describe test instances and our computational results. Conclusions and suggestions for future work are given in Section 6. 2. Problem description The livestock collection problem may be viewed as a vehicle routing problem (VRP) extended with constraints regarding production and inventory. In this section we first present the basic VRP. We then give a more detailed presentation of the livestock collection problem, and discuss what known extensions to the VRP should be included in this setting. In the end we add constraints to model the connection between the routing part and the inventory and production part of the problem. 2.1. The vehicle routing problem The VRP deals with the allocation of transportation tasks to a fleet of vehicles, and the simultaneous routing for each vehicle. The VRP was first described by Dantzig and Ramser [2], and is a computationally hard optimization problem with high industrial relevance. The classical VRP is defined on a graph G = (N, A) where N = {0 . . . n} is a vertex set and A = {(i, j ) : i, j ∈ N } is an arc set. Vertex 0 is the depot; the other vertices are the customers. The travel cost between customer i and j is defined by cij 0 and di is the demand for customer i. The vehicles are usually identical, each with a capacity q. The goal is then to design a least cost set of routes, all starting and ending at the depot, where each customer is visited exactly once. The total demand of all customers on a route must be within the capacity q. This classical formulation is often referred to as the capacitated VRP or CVRP. If cij  = cj i for at least one pair of customers, e.g. due to a one-way road, we have an asymmetric VRP. 2.2. The livestock collection problem Our version of the livestock collection problem deals with transportation of live animals from farmers to slaughterhouses, and includes both a routing part and an inventory problem at the slaughterhouse. An exhaustive description of inventory problems can be found in [3]. Gribkovskaia et al. [4] have treated a simplified version of the livestock collection problem, and we are not aware of other research dealing with this kind of combination of a VRP and an inventory problem. There exists a large body of research where the VRP is combined with other logistic problems, such as location routing [5] and inventory routing [6]. While location routing combines vehicle routing with facility location, the location of the slaughterhouse is already decided in the LCP. Instead, the inventory part of the LCP adds a timing aspect to the problem, so that we have to consider both when the routes arrive at the slaughterhouse as well as what they bring into the inventory. In the inventory routing problem, on the other hand, one has to decide both what customers to serve, how much to bring to each of them and how to do the routing. In the LCP, we consider the orders as data, meaning that we know both where to go and what to collect. Several extra constraints must be added to the basic VRP model to have a problem formulation that corresponds well to the real-world problem. Toth and Vigo [7] describe a rich variety of extensions to the classical VRP, many of these are used in our modeling of the LCP. In the following we give a brief presentation of the necessary constraints, more details can be found in [8], which is a pure problem description with no focus on solutions. We illustrate our version of the LCP by giving a small example, this will then be used to explain important constraints and features of the problem as well as its solution. Fig. 1 shows where the slaughterhouse, three vehicle drivers and 19 customers (producers) are located. The slaughterhouse is shown as a solid square, the drivers’ homes as open squares and the customers are shown as circles. In this example, we assume a euclidean topology where it is possible to travel between any pair of locations by following a straight line. In the real world, we have to use road data to compute distances between locations. We use different colors to keep track of different animal types to be collected, see Section 2.2.1, as well as the health status of each farm, see Section 2.2.3. In addition to the data for the example given in Table 1, we also need estimates for vehicle speed, time needed to load and unload vehicles, etc.

J. Oppen, A. Lkketangen / Computers & Operations Research 35 (2008) 3213 – 3229

3215

Fig. 1. Locations.

A solution for an instance of the LCP consists of a set of planned routes describing how the collection of animals should be carried out. Time information from the route plan, together with the slaughter plan for the instance, will give information about the expected inventory levels for the different animal types during the time horizon. As an example of what a solution may look like, we show a plan for Tuesday for our example in Fig. 2. Similar plans exist for Sunday and Monday, and together these constitute a solution for our small example. In addition to the graphical view shown here, one also needs a more detailed written description of the solution. This typically includes tour information: when and from where should the tours start, when and in what order should the different orders be served and when should the vehicles return to the slaughterhouse. 2.2.1. Mixing rules Transportation of live animals requires that several rules to secure animal welfare are followed. Animal welfare affects meat quality and thus has both economical and ethical aspects. Animals are divided into types and categories, where the types by and large correspond to the different species. Bovine refers to cattle, while ovine is used for sheep and goats. Each type is divided into categories by size, gender, whether bovines have horns or not and whether sheep are sheared or not. Mixing of animals of different types in the same compartment in a vehicle is not allowed. Neither is it allowed to mix animals with and without horns or animals of substantially different size. These rules are supposed to protect animals from being stressed or injured during transport. In our example, we have only two types of animals, bovine and pigs. Customers with bovine for collection are shown as light blue circles, those who have pigs are shown in red. We consider all bovines to be young bulls without horns and all pigs to be slaughter hogs. We are then left with only one mixing rule in this particular case: we cannot have both bovine and pigs in the same compartment. Problems where different types of loads have to be kept in separate compartments during transport are often referred to as loading problems, see [9,10]. Most of the research in this area deals with problems where all compartments of the vehicle are accessible all the time, such as transport of petroleum products to gas stations. In the LCP, this is not the case, see Section 2.2.4. 2.2.2. Duration Another constraint that treats animal welfare is that no animal can be transported continuously for more than 8 h. This means that no tours can be planned to last longer than 8 h, measured from the time of the first loading to the time of unloading at the slaughterhouse. In our example, we may use customer 19 to illustrate this rule. The time required to load 60 pigs and go back to the slaughterhouse is estimated to be 7 h 25 min, which means that only one short stop on the way back to the slaughterhouse is possible within the time limit. A vehicle may thus have to return to the slaughterhouse with less than a full load, because there is no time to make additional stops to fill up the vehicle.

3216

J. Oppen, A. Lkketangen / Computers & Operations Research 35 (2008) 3213 – 3229

Table 1 Data for LCP example Slaughter plan Day

Bovine

Pigs

Sunday Monday Tuesday

0 0 45

0 220 110

Inventory capacities Bovine

Pigs

30

200

Vehicles Vehicle number

1 2 3

Configuration

Total capacity

Front section

Mid-section

Rear section

Bovine

Pigs

1 or 2 comp. 2 comp. 2 comp.

1 or 2 comp. 2 comp. 2 comp.

1 comp. 2 comp. 2 comp.

14 15 15

79 102 102

Orders Customer

Bovine

Pigs

Health status

Cust. 1 Cust. 2 Cust. 3 Cust. 4 Cust. 5 Cust. 6 Cust. 7 Cust. 8 Cust. 9 Cust. 10 Cust. 11 Cust. 12 Cust. 13 Cust. 14 Cust. 15 Cust. 16 Cust. 17 Cust. 18 Cust. 19

0 3 9 4 0 2 0 14 0 0 7 4 0 0 0 0 2 0 0

10 0 0 25 50 0 5 0 20 5 0 0 25 20 80 10 0 20 60

Normal Infected Normal Normal Normal Normal Normal Normal Normal Normal Normal Normal Breeding Normal Normal Normal Normal Normal Normal

2.2.3. Visiting order and health status When vehicles travel between farms to collect animals, one has to take precautions to avoid the spread of diseases. Pig herds with boars (males) used for breeding purposes need extra protection, so these may only be visited by empty and clean vehicles. This means they need to be visited as the first stop of the tour. Customer 13 in our example has a breeding herd of pigs, and must therefore be first on the tour. This is indicated by printing the customers name in light blue. Herds that are infected with some disease should be the last stop on the tour, the vehicle is then cleaned at the slaughterhouse before it is used again. Customer 2’s herd is infected with a disease, the name of the customer is printed in red, and this must be the last stop on the tour. A vehicle cannot visit more than one breeding herd or more than one infected herd per tour, see Section 4.2. These constraints may easily lead to longer tours and thereby extra costs.

J. Oppen, A. Lkketangen / Computers & Operations Research 35 (2008) 3213 – 3229

3217

16 Driver 2

12 Driver 3

9 Driver 1

11

Inventory levels

10 3

13

0

0

14

tuesday Fig. 2. Routes for Tuesday.

Sigurd et al. [11] describe and propose a solution method for a pickup-and-delivery problem with time windows and precedence constraints. The application is transportation of live pigs between farms in Denmark according to a number of veterinary restrictions. To avoid the spread of diseases, the vehicles must visit the farms in a non-decreasing order of health levels. A low health level corresponds to a healthy livestock. 2.2.4. Vehicle fleet The vehicle fleet is heterogeneous, as the vehicles differ both in size and how they can be divided into compartments. Almost all vehicles used for animal transport in Norway are divided horizontally into three sections by permanently positioned walls or gates. Most vehicles are outfitted to stack pigs and ovine in two tiers, while bovines in many cases need the full height of the vehicle. An “average” vehicle has a capacity of about 15 cows or bulls, 90 slaughter hogs or 150 lambs. This means that a compartment typically can take five cows or bulls, 16–18 pigs or 25 lambs. When only one animal type is transported at the time, which is normally desired for animal welfare reasons, it is relatively easy to calculate the legal load of the vehicle. Sometimes two or three animal types are transported by the same vehicle, and then the loading problem becomes more cumbersome, see Section 2.2.1. This situation typically occurs when it is difficult to compose full loads of only one animal type. Fig. 3 shows how a vehicle may be divided into sections and compartments. Vehicle 2 and 3 in our example have enough height to carry bovine in the lower compartment and pigs or ovine in the upper compartment at the same time, while vehicle 1 is lower and may only stack animals in two tiers if there are pigs or ovine in both compartments of a section. Vehicle 1 also has only one compartment (no lift) in the rear section. The upper compartment in a section must always be loaded before the lower, as the floor in the upper compartment is raised and lowered by a lift. When the upper compartment is used, the floor is first lowered. The animals are then brought into the compartment, and the floor is raised. The lower compartment can then be filled with other animals. Vehicle 2 and 3 in our example both have a larger capacity than vehicle 1, as can be seen in Table 1. It should also be noticed that these two vehicles may carry 51 slaughter hogs in addition to 15 bulls, as the upper compartments are always available. In order to fully utilize these vehicles capacity, one has to consider the sequence in which the animals are loaded. If bovines are loaded into a section, the upper compartment will be blocked and cannot be accessed until the bovines are unloaded. In other words, the sequence in which the orders of a tour are served may affect the actual capacity of the vehicle.

3218

J. Oppen, A. Lkketangen / Computers & Operations Research 35 (2008) 3213 – 3229

Fig. 3. A vehicle is divided into sections and compartments.

The smaller height of vehicle 1 makes it impossible to have both bovine and smaller animals in the same section of the vehicle. This makes the loading order less important for this vehicle, as bovine will not block any upper compartment in the same section. One should note, however, that putting one animal type into the lower compartment of a section blocks the section in front of the one that is being loaded. This also leads to situations where the loading order affects the vehicle capacity. The vehicles are used for up to four tours each day, the first tour each day usually starts from the driver’s home. 2.2.5. Today’s practice on registration and planning Animals for slaughter are reported to the slaughterhouse by the farmer; normally this has to be done by the week before wanted collection. The day of collection may or may not be fixed right away, this depends on several factors. Plans are usually made for one week at the time, then adjustments are made day by day if needed. The plans for animal collection and production must of course fit together, and several factors govern the construction of these plans for a given period of time. These factors include the number of animals registered for collection during the time horizon, production capacity at the slaughterhouse, vehicle capacities and demand for meat products. It is not necessarily the same factors that restrict different companies, as some may have capacity to collect and process all registered animals, while others utilize their full production capacity most of the time. If the amount of registered animals is large, a company may decide to postpone some of the collection to a later week. The geographical area from which the slaughterhouse collects animals is divided into smaller districts. In some districts one vehicle has a monopoly, while in others two or three vehicles operate. Some vehicles operate in two or three districts. This system thus often predetermines what vehicle will pick up what orders, it normally also excludes the possibility to construct routes where vehicles collect animals from districts different from their own. As our project focuses on the transportation part rather than on the production part of the slaughterhouses’ area of operation, we view the slaughter plan as an input. We also treat the set of animals to be collected during the time horizon as given, thus we do not include the selection of what to collect by the current plan and what to postpone, in the problem. For our small example, the plan is to slaughter all the bovines on Tuesday, while we are going to slaughter 220 pigs on Monday and 110 on Tuesday. All orders must be serviced during Sunday, Monday and Tuesday, but we are free to decide what day to collect from each farm. It is also important to realize that in the real world, unforeseen changes happen every day. In our setting, this means that new orders occur that have to be served on short notice, i.e. animals that for some reason need to be collected for slaughter right away. Because of urgent orders and the fact that there is some deviation between what is reported by the farmers and what is actually delivered, there is usually a difference between how the collection of animals is planned and what actually happens. 2.2.6. Inventory constraints When vehicles arrive at the slaughterhouse, the animals are unloaded into a lairage, where they are kept until they are slaughtered. The animals cannot have more than one overnight, and no slaughtering is done during the weekend. This means that no animals can be kept in lairage over the weekend. If an animal type is to be slaughtered the next

J. Oppen, A. Lkketangen / Computers & Operations Research 35 (2008) 3213 – 3229

3219

day, some animals are usually kept overnight to be able to start the production early next morning. This means some animal collection is done on Sundays, even if there is no slaughtering that day. No animals can be lairaged over the weekend, see Section 2.2.6, so less collection is needed on Fridays. The lairage has a certain capacity which cannot be exceeded, neither should the lairage run empty, as halting production is very costly. It is important to note that the inventory constraints are global, and not associated with single routes. In our example, we have a capacity of holding 30 bovines and 200 pigs in the inventory. Bovines will not be slaughtered on Monday, so we cannot collect any of them on Sunday. We will have to collect at least 15 bovines on Tuesday in order not to overfill the inventory from Monday to Tuesday. We can collect up to 200 pigs on Sunday, the rest may be brought in on Monday without exceeding the inventory capacity. We have not taken into account the possibility of running empty during the day, even if the longest tours arrive at the slaughterhouse in the afternoon. In practice, most tours collect animals quite close to the slaughterhouse, which provides a smooth supply of animals for the production process. 3. Solution methods The VRP has become one of the most widely studied problems in combinatorial optimization, and much effort has been put into developing both exact and heuristic methods to solve the VRP. The classical VRP is known to be strongly NP-hard. 3.1. Solution methods for the VRP 3.1.1. Exact methods An exact solution method is able to find the optimal solution of a problem and to prove the optimality of the obtained solution. Exact solution methods for the VRP include branch and bound and branch and cut [7]. These techniques are known to consistently solve benchmark instances with up to 50 customers in reasonable time. 3.1.2. Heuristic methods Heuristic solution methods cannot guarantee that an optimal, or even feasible, solution is found; neither can optimality easily be proved when an optimal solution is actually found. The reason for using heuristics is the assumption that a suitable heuristic should be able to find reasonably good solutions relatively quickly. This can be very useful in cases where exact methods perform poorly due to the size or structure of the problem. Bräysy et al [12,13] give an overview of heuristics for the VRP. This includes heuristics for rich models where many of the possible extensions are included, which is important in our setting. 3.2. Solution methods for the LCP Not much has been done to solve VRPs extended with inventory constraints for the depot. Gribkovskaia et al. [4] solved a simplified version of the livestock collection problem with eight orders using CPLEX, and found that adding the ninth order made the problem too hard for CPLEX to find a feasible solution in reasonable time. They formulated the problem as a mixed integer problem and used a simplification by dealing only with one animal category, a homogeneous vehicle fleet and no precedence constraints. 4. A TS-based heuristic for the LCP We propose a TS-based heuristic for the LCP, and our algorithm is based on a TS algorithm for VRPs with time windows described by Cordeau et al [14]. Their method has been extended and adjusted to deal with the constraints described in Section 2.2. TS is a local search based metaheuristic introduced by Fred Glover. The main ideas are to avoid recently visited parts of the solution space and to guide the search towards new and promising areas. Non-improving moves are allowed to escape from local optima, and attributes of recently performed moves are declared tabu or forbidden for a number of iterations to avoid cycling. TS does not rely very much on randomness, but tries to be “intelligent” in its way to perform

3220

J. Oppen, A. Lkketangen / Computers & Operations Research 35 (2008) 3213 – 3229

the search. TS has been successfully adapted and applied to numerous discrete optimization problems, VRP included. See Glover and Laguna [15] for more information about TS. 4.1. Time and inventory The time horizon for a problem instance is one or more days, usually six (one week, starting on Sunday). For each tour, we keep track of the time the vehicle leaves the driver’s home or the slaughterhouse, when the vehicle arrives and leaves each of the farms, when the vehicle arrives at the slaughterhouse and when the vehicle is ready for the next tour after unloading and cleaning. Time is measured in minutes, and for each tour the time from the first animals are loaded until they are unloaded at the slaughterhouse is computed. If this is more than 8 h, the duration constraint for the tour is violated. If the vehicle returns to the slaughterhouse at a later hour in the evening than some specified point in time representing the end of the working day, the end-of-day constraint for the tour is violated. The slaughter plan tells how many animals of each type are to be slaughtered each day. The inventory level from the previous day plus the animals received during the day must be sufficient to meet the slaughter plan for the day, and the inventory level must always be between a minimum safety level and the lairage capacity. 4.2. Moves A tour has a legal starting and ending location if it satisfies the following: the first tour of each day starts at the driver’s home, the following tours start at the slaughterhouse. All tours end at the slaughterhouse. Let S be the set of all solutions that satisfy the following constraints: every tour has a legal starting and ending location, every order belongs to exactly one tour and two tours that use the same vehicle are separated in time. In addition, no tour visits a breeding herd after having visited a non-breeding herd, and no tour visits a non-infected herd after an infected herd. This means that we allow for intermediate solutions that may violate some of the constraints explained in Section 2.2: • One or more tours in a solution may collect more animals than the vehicle’s capacity allows for. • One or more tours may violate precedence constraints by visiting more than one breeding or infected herd. • One or more tours may violate the 8-h rule because the time from the first loading until the arrival at the slaughterhouse exceeds 8 h. • One or more tours may arrive at the slaughterhouse after the working day has ended. These four types of constraint violations are controlled by penalties, see Section 4.3. Allowing for intermediate infeasible solutions during the search has been used successfully by Cordeau et al, see [14], and both [16,17] show that dynamically adjusted penalties work well to get a mix of feasible and infeasible solutions during the search. Let A(s) = {(i, j, k, l) : order i is visited by vehicle j on day k and tour number l} be an attribute set associated with each solution s ∈ S. The neighborhood N (s) of a solution s is defined by applying an operator that removes an attribute (i, j, k, l) from A(s) and replaces it with a different attribute (i, j  , k  , l  ), where j  = j  ∨ k  = k  ∨ l  = l  . This means a move consists of moving an order from its current tour to a different tour. The neighborhood size is |N | = n(m − 1), where n is equal to the number of orders and m is equal to the total number of tours for all vehicles. When an order is removed from a tour, the tour is reconnected by linking the predecessor and successor of the removed order. The insertion of an order into a tour is done so as to minimize the increase in the length of the tour, but without changing the order of the orders already in the tour. If the order to be inserted represents a breeding herd or an infected herd, it is inserted as the first or last order, respectively. We use three different variants of the move type explained above: Global moves are moves where the full neighborhood is explored. When such a move is evaluated, we look for the best overall move without considering the fact that moving an order from one day to another may lead to violation of inventory constraints. To be able to maintain a satisfactory balance between the amounts of animals that are collected each day, and thus control the inventory levels, we also need more restricted moves. Local moves are moves that allow orders to be moved only between tours on the same day.

J. Oppen, A. Lkketangen / Computers & Operations Research 35 (2008) 3213 – 3229

3221

Dedicated moves are used to repair violated inventory constraints. These moves allow only orders containing a certain animal type to be moved between tours on certain days. The neighborhood size will be significantly smaller for the two latter move variants than for the global. The use of the different variants are explained in Section 4.6. 4.3. Move evaluation For each solution s ∈ S, let c(s) be the total length of all tours in the solution, and let q(s) be the total violation of capacity constraints for the tours, measured as the total number of animals exceeding the vehicles’ capacities. Let r(s) be the total number of precedence constraint violations. Let t (s) be the total amount of duration violations, and let u(s) be the total amount of end-of-day violations. When moving from a solution s to another solution s  ∈ N (s), possible moves are evaluated using • • • • •

c(s  ), change in total length, q(s  ), change in capacity violations, r(s  ), change in number of precedence violations, t (s  ), change in duration violations, u(s  ), change in end-of-day violations.

In order to have terms of approximately equal magnitude, the five terms listed above are normalized by dividing each of them by a number that represents the largest change that normally occurs for that particular term in a move. These five numbers are represented by c , q , r , t and u , respectively. Solutions are then evaluated using a function f (s  ) = c(s  )/c + q(s  )/q + r(s  )/r + t (s  )/t + u(s  )/u , where , , ,  are positive parameters that are dynamically adjusted during the search. If f (s  ) 0, moving to the new solution s  is a non-improving move, if f (s  ) < 0 the move is improving. Because the move evaluation function includes changes in constraint violations, a move may be regarded as non-improving even if the total distance is reduced, and vice versa. We also tried to include an additional penalty term for inventory constraint violation in the move evaluation function. This strategy was chosen to treat the inventory constraint violations in the same way the standard VRP constraint violations are treated, see Section 4.6, which has shown to be a successful way of balancing the search between feasible and infeasible solutions. It turned out, however, that this led to huge difficulties in finding feasible solutions at all. It seemed very hard to get the different penalties to work together towards feasibility, instead they seemed to co-operate to increase infeasibility for all constraint types. We have not been able to establish if these problems are caused by the mere number of penalty terms or by the global nature of the inventory constraints. 4.4. Diversification In order to guide the search to new and possibly unvisited parts of the solution space, we use continuous diversification. If moving to a solution s  ∈ N (s) is found to be deteriorating, that is, f (s  ) > 0, this move is given a penalty p(s  ) = i /iter that is added to f (s  ). Here, i is the number of times order i has been moved during the search, iter is the number of iterations or moves performed so far and  is the diversification intensity. Setting  to zero corresponds to no diversification at all, while a larger value for  makes it more likely that an order that has been moved only a few times is chosen to be moved in favor of an order that has been moved more frequently. Note that this penalty is added to the move evaluation function only if f (s  ) > 0, which means that it comes into play only when the search is trying to escape from a local optimum. 4.5. Initial solution Two different approaches have been tried to construct an initial solution for the livestock collection problem. The first one failed due to problems with the inventory constraints. It seems to be important to find a starting solution where the amounts of collected animals for each day fit to the slaughter plan and the inventory capacities. We found it hard

3222

J. Oppen, A. Lkketangen / Computers & Operations Research 35 (2008) 3213 – 3229

to recover from a large amount of inventory constraint violations, and thus we pay more attention to this aspect in our current method for constructing an initial solution. This method consists of four steps: 1. 2. 3. 4.

clustering of orders, distribution of clusters throughout the days of the time horizon, assigning clusters to vehicles, route construction.

In the first step, orders are put together to make clusters that correspond approximately to truckloads. The orders should represent the same animal type to meet the desire for homogeneous loads, they should not be geographically too far apart and they should have a total number of animals that is close to the average vehicle capacity. Both the heterogeneous vehicle fleet and the diversity in order size make it difficult to construct clusters that make up perfect loads. In the second step, the clusters are assigned to days. Each day is assigned enough animals to cover the slaughter plan, and to provide animals for lairaging for the next day. The amount of animals in the lairage from one day to the next varies, but at least half of the lairage capacity is usually used. The slaughterhouse needs to have animals for 1 or 2 h of production in the lairage when the work starts in the morning, otherwise one may run out of animals to slaughter before the vehicles start to arrive with the first loads. Clusters are assigned to days in a random way, but for Sunday we pick clusters that are relatively close to the slaughterhouse. This is done to meet the drivers’ wish for relatively short tours on Sundays. When all clusters are assigned to days, they are assigned to the closest vehicle that has spare tours on that day. The number of tours each vehicle may have each day in the initial solution depends on the distance from the driver’s home to the slaughterhouse. The last step in creating the initial solution is that each vehicle creates its own routes to service the clusters that have been assigned to it. There are normally from one to five orders in each cluster. The initial solution may have tours that violate vehicle capacities, precedence constraints, duration constraints as well as end-of-day constraints. All these constraint violations are relatively easy to recover from. The initial solution does not violate the inventory constraints. 4.6. Tabu search The TS starts from the initial solution and moves, in each iteration, to the first encountered non-tabu neighbor that represents an improvement, that is, f (s  ) < 0. If no such neighbor is found, the move that minimizes f (s  ) is chosen. If f (s  ) > 0, a non-improving move is performed, and the diversification mechanism explained in Section 4.4 comes into play. The tours of the current solution are scanned sequentially to find the first order to move that leads to an improvement. In each iteration, the search starts from where the previously moved order was found, and all tours are scanned in a circular way. Because the first improving move is accepted, it may take several iterations to loop through all tours. If no improving move is found, which corresponds to being in a local optimum, then all neighbors of the current solutions are evaluated before a non-improving move is chosen. The three different move types referred to in Section 4.2 are used to overcome the problems encountered in keeping feasibility with respect to the inventory constraints, as described in Section 4.3. This is done in the following way. The first 100 moves are restricted to local moves, that is, orders are moved only to others tours on the same day. In this way, we do not affect the way the orders are distributed among the days. We then allow for 10 global moves, as we think it is too restrictive only to move orders within the same day. By allowing only a small number of global moves, we avoid losing control of the inventory balance. When these global moves are performed, we check the inventory situation throughout the time horizon. If there are any overflow or shortage situations, we perform dedicated moves until the inventory status is again feasible. A similar cycle is then repeated throughout the search: every 100 iterations, we allow for 10 global moves followed by the necessary number of dedicated moves to repair inventory constraint violations caused by the global moves. Typically, we need between zero and five dedicated moves to restore inventory feasibility. To prevent the search from going back to recently visited parts of the solution space, the attribute (i, j, k, l) that was removed from A(s) by the last move is declared tabu for tabu tenure iterations, where tabu tenure is the tabu length or

J. Oppen, A. Lkketangen / Computers & Operations Research 35 (2008) 3213 – 3229

3223

duration. During these iterations, it is not allowed to move order i back to vehicle j ’s tour l on day k. By the use of a simple aspiration criterion, a tabu move can still be chosen if this leads to a feasible solution that is the best found so far in the search. After each move, the values of the parameters , ,  and , see Section 4.3, are adjusted. If the current solution is feasible with respect to vehicle capacities, the value of  is decreased to make it less costly to violate vehicle capacity constraints. If the current solution does violate such constraints,  is increased to make it more costly. In the same way,  is decreased if the solution violates precedence constraints and increased otherwise,  is adjusted according to whether duration constraints are violated or not and  is decreased or increased according to the violation of the end-of-day constraints. The long-term memory is updated by incrementing i , where i is the order moved. If the current solution is feasible and has a total length less than times the length of the best feasible solution found so far during the search, the solution is considered good. Whenever a good solution is found, a 2-opt post-optimization procedure is applied to the tours of the solution. It would be a waste of time to apply the 2-opt procedure for all feasible solutions, but it is also important to apply it often enough to capture the solutions that become a new best solution after a 2-opt procedure is applied. When the 2-opt procedure is applied, one must also check that the tour remains feasible with respect to vehicle capacity after a change is made, as changing the visiting and loading sequence may have an influence on the actual vehicle capacity, see Section 2.2.4. This means we may have to omit some distance-reducing moves in the 2-opt and accept tours that are not 2-optimal. The search continues until a preset time limit is reached, or until a preset number of moves are performed. 5. Computational testing The TS algorithm described in Section 4 has been coded in C++ using Microsoft Visual Studio 2005, and the tests described here have been run on a Dell Precision PWS380 computer with a 3.6 GHz Pentium(R) D CPU with 3.62 GB of RAM. 5.1. Real-world test instances To test the performance of our algorithm, we have used data from week 7 in February and week 22 in May/June 2006 from the slaughterhouse Fatland Jæren at HommersAAk, Norway. For both instances, we have information about what farmers were visited during the week and how many animals of each category were collected from each farmer. In addition, we have information about available vehicles (home location and capacity), approximate slaughter plan and lairage capacities. We have information both about what was planned and what actually happened at Fatland Jæren during these particular weeks. This makes it to some extent possible to compare our solutions with the plans from the manual system that is used today. We have also used these data to get estimates on vehicle speed and time consumption for the different operations, and to find deviations between the amount of animals the farmers report and the amount they actually deliver. Some characteristics of the two instances are summarized in Table 2. In both cases, each order contains only animals of the same type, and no order is larger than the capacity of the smallest vehicle type used. This is the reason why there are more orders than farms, and this splitting is done in advance to avoid a situation where the algorithm has to split some of the orders. It is of course possible to pick up more than one order at the same location on the same tour if that is desirable. The data necessary to build the complete test instances were not available from Fatland’s information system, so a few days of manual registration work was needed. It is, however, of great importance to be able to test with real-world data, as a future system will have to solve real-world problems. Table 2 Real-world test instances Instance

Orders

Farms

Bovine

Pigs

Ovine

Total

Vehicles

Week 7 Week 22

162 196

144 184

288 281

1438 1328

176 288

1902 1897

8 8

3224

J. Oppen, A. Lkketangen / Computers & Operations Research 35 (2008) 3213 – 3229

Table 3 Random test instances Instance

Orders

Vehicles

Bovine

Pigs

Ovine

Total

n150_v7_std n150_v7_ov n150_v5_std n150_v5_bov n110_v5_std n110_v5_pig n110_v3_std n110_v3_ov

150 150 150 150 110 110 110 110

7 7 5 5 5 5 3 3

266 171 266 403 230 96 192 129

1388 649 1388 825 1261 1643 922 557

175 2219 175 84 49 34 175 1316

1829 3039 1829 1312 1540 1773 1289 2002

5.2. Random test instances In addition to the real-world instances described in Section 5.1, we have generated a set of eight random instances for the LCP. These instances are made in the following way: first, 12 orders and one vehicle are removed from the week 7 real-world instance. This new instance is named n150_v7_std, its name indicating the number of orders, the number of vehicles and a mix of animal types close to the real-world instance from which it was made. Another instance, n150_v7_ov, is then made by changing several of the orders containing bovine and pigs into orders containing ovine. Two other instances are made by removing two more vehicles, then the orders from n150_v7_std are kept or partly replaced with bovine orders to make up the instances n150_v5_std and n150_v5_bov, respectively. The last four instances all contain 110 orders, they have either five or three vehicles and the distribution of animal types varies. Whenever an order is changed, only the type and number of animals are changed, the location is not. Table 3 summarizes some of the characteristics of the random instances. In each case, the slaughter plan is changed to match the number of animals. 5.3. Finding search parameter values Like most heuristic solution methods, our TS method for solving the LCP includes several parameters whose values have to be determined. Finding the best combination of parameter values is impossible in practice, as this requires testing an enormous number of different combinations. In addition, some parameters are likely to be quite sensitive to instance-specific data, and thus finding one single best value for such a parameter may be impossible. In our view, what is needed is a set of robust parameter values. These values should give reasonably good performance for a wide range of problem instances, and they should be determined without too much effort. A few tests, as well as some experience in using TS to solve VRPs, have resulted in the following. Tabu tenure: The value for the tabu tenure is, in each iteration, chosen randomly from a set of integers. This strategy is found to give better results than using a fixed value for tabu tenure. We choose tabu tenure from the set of integers from 5 to 10, lower and upper bound included. Infeasibility weights: Initially, the infeasibility weights , ,  and  all have the value 10. After every iteration their values are increased or decreased, see Section 4.6. We have found multiplicative adjustment to be the best strategy, and we use the same adjustment policy for all four weights. A weight whose corresponding constraint is not violated in the current solution is divided by 1.5, while the weight for a violated constraint is multiplied by 1.01. This means that infeasibility weights are decreased faster than they are increased. Diversification intensity: Tests have shown that 0.001 serves as a good value for the diversification intensity parameter . It should be noticed that this parameter is multiplied only by the relative move frequency of an order and that no other factors are used. Other researchers, see e.g. [18,19], also use scaling factors like problem size in their penalties. For the LCP, however, we have not found such scaling factors to have any significant positive effect. When to apply 2-opt: We use 1.05 as the value for , which means that 2-opt is applied only on feasible solutions with a total length not exceeding 1.05 times the length of the best found feasible solution. Running time: Fig. 4 shows improvements found for the week 7 instance during 10 single 2-h runs of our algorithm. Each dot represents a new best solution found in each single run. As search time increases, fewer improvements are

J. Oppen, A. Lkketangen / Computers & Operations Research 35 (2008) 3213 – 3229

3225

6000

Objective

5500

5000

4500

4000

3500

0

20

40

60

80

100

120

Time in minutes

Fig. 4. Improvements found during the search.

Table 4 Results of robustness testing Setting Standard Tabu tenure (5–10) Divide (1.5) Multiply (1.01) Diversification (0.001)

Max. deviation

3–7 7–15 1.3 2.0 1.001 1.1 0.01 0.0001

1.0312 1.0232 1.0489 1.0198 1.0219 1.0766 1.0656 1.0535 1.0261

found. The steep descent phase is over in less than 10 min, but some improvements are found even during the second hour in almost every run. For our subsequent testing purposes we have chosen to run the algorithm for 1 h, as most of the improvements should then be captured. We use a different random seed in each run, each test is run 10 times and we report the best result found. The poorest result from the 10 runs is typically 3–5% above the best. In practice, the running time will depend very much on the time available. If a solution is needed in just a few minutes, one has to accept a solution that may be poorer than what may be achieved if the algorithm is allowed to run until the next day. 5.4. Robustness testing The random instances described in Section 5.2 have been used to test the robustness of our algorithm. All instances are first solved using the parameter settings found in Section 5.3, different values are then tried for tabu tenure, adjustment of infeasibility weights and diversification intensity. A summary of the results and the parameter values used are given in Table 4. The standard parameter values are given together with the name of the parameter in the leftmost column of the table. The middle column gives the values tried for each parameter, and in the rightmost column the results are given as the maximum deviation from the best result found for any of the eight instances. This means that e.g. changing the diversification intensity parameter to 0.01, using the standard values for the other parameters, gives solutions that deviate at most 5.35% from the best solution found.

3226

J. Oppen, A. Lkketangen / Computers & Operations Research 35 (2008) 3213 – 3229

Table 5 Test results Method

Manual TS Improvement(%)

Week 7

Week 22

Total distance

No. of tours

Total distance

No. of tours

4470 3931 12

46 (5 tr.) 42 9

4513 3573 21

40 (7 tr.) 38 16

The standard parameter settings give a maximum deviation of 1.0312, thus we always find solutions with total length within 3.12% of the best found when we use the parameter values from Section 5.3. Changing some of the parameter values may lead to small improvements, we found about 1% less deviation from the best results in three cases. The algorithm seems fairly robust with respect to both different instances and to changes in the parameter settings. 5.5. Test results Our TS algorithm has been run on the data sets from Fatland, and Table 5 gives a summary of the results from the TS as well as numbers extracted from the manual plans. The manually planned tours for the two weeks included the use of a trailer for five and seven of the tours, respectively. Our model does not include the use of trailers, but nevertheless suggests solutions with fewer tours and less total distance. In our view, our TS method produces promising results, even if our model is still incomplete. It should be noted that our method can guarantee plans that do not include any constraint violation, while today’s manual system in principle allows for the creation of route plans that violate rules. It is believed that in the future, it will be necessary to have a system for planning with which one can prove that no plans are made that violate rules for animal welfare. One important reason why we get quite good results is that we do not keep the geographical partitioning of today’s system, see Section 2.2.5, a partitioning we believe is an obstacle for the construction of better routes. In addition, the TS method chooses the pickup time without considering when the farmers want to be visited during the week. Time windows are needed in the model, but it is also clear that today’s practice of assigning day for pickup when the animals are registered reduces the set of feasible solutions quite much. It is probably not necessary to let the producers decide the time for pickup to the same extent as reflected in today’s practice. As long as manual planning is done, both geographical partitioning and assigning pickup day at once serve as necessary means to keep the planning process manageable. For an automated planning system, on the other hand, they will constrain the solution space and lead to poorer solutions than what would be possible without these restrictions. 5.6. The cost of additional constraints In our view, one of the advantages of an automated planning system is the ability to generate plans for possible scenarios to see the effect of situations that may occur. It may be valuable to know what the extra transportation costs in a given situation would be, in more extreme cases it may also be interesting simply to know if one can get feasible plans. To illustrate this, we have run our test instances with an extra constraint that allows for homogeneous loads only, meaning that only one animal type is allowed on each tour. The results from this test are shown in Table 6. Demanding only one animal type per tour leads to a rather large increase in total distance, while the number of tours is about the same. This corresponds well to the fact that it is easier to utilize the full capacity of the vehicles with only one animal type per tour, as the loading problem then more or less disappears. On the other hand, the distance increases because farmers who deliver more than one type of animals have to be visited more than once, and because remote orders with different animal types that are close together cannot be served on the same tour. In a different test, we have manipulated the instance from week 7 to imitate a situation where some of the visited farms are infected with a disease. As explained in Section 2.2.3, only one infected herd can be visited per tour, and it must be the last visit. If many infected herds have to be visited, this should lead to an increase in total distance traveled. In extreme cases many of the tours may visit only one farm. We have imitated two different types of situation, one

J. Oppen, A. Lkketangen / Computers & Operations Research 35 (2008) 3213 – 3229

3227

Table 6 Cost for homogeneous loads Method

Week 7

Base case Home loads

Week 22

Total distance

No. of tours

Total distance

No. of tours

3931 4530

42 41

3573 4502

38 40

Table 7 Cost for “infected” scenarios Base case

Random

Clustered

10%

20%

10%

20%

Dist.

Tours

Dist.

Tours

Dist.

Tours

Dist.

Tours

Dist.

Tours

3931

42

3929

42

4287

43

4969

42

5179

45

Fig. 5. Normal route pattern.

where the infected herds are spread randomly geographically, and another where all herds in one part of the collection area are infected. In both cases we have two scenarios, one where 10% of all orders are from infected herds and one where 20% of the orders are of this kind. Table 7 shows the results for this test. If the infected herds are spread randomly, increases in total distance are small. For the 10% random case, we actually get a marginally shorter solution than we did for the normal case. If the infected herds are clustered, we get quite large increases in distance. For the 20% clustered case, we also see that the number of tours needed increases significantly. These results show that the geographical distribution of the infected herds has a large influence on the increase in transportation costs. If all herds in an area are infected, this increase may be significant even if the number of herds is quite small. This effect can be seen in Figs. 5 and 6, which show parts of the suggested route pattern for a “normal” day and for a day with many visits to infected herds.

3228

J. Oppen, A. Lkketangen / Computers & Operations Research 35 (2008) 3213 – 3229

Fig. 6. Routes visiting infected herds.

All the infected herds in Fig. 6 are in the north, which corresponds to the top of the figure. It should be noted that it is not the same set of customers that is served in the two cases, the purpose is to show typical changes in the route pattern. When several infected herds are visited, many routes have to add a visit to serve an order in the infected area as the last stop. In a normal situation, many of these orders would have been served on the same tour, as can be seen in Fig. 5. 6. Conclusions and future work We have described the livestock collection problem, which is a rich VRP extended with production and inventory constraints. Both model complexity and the size of real-life problem instances are likely to make exact methods fail to find good solutions, and thus heuristic approaches are needed. We have described a TS based algorithm for the LCP. Computational testing and comparisons with plans from today’s manual system show that our method constructs good solutions that do not violate the different constraints in the model. Future work on this problem may include: Use of trailers: Some vehicles use a trailer on some tours, especially if the distances are long. It is not allowed to leave a trailer containing animals behind and pick it up later, and some farms are not accessible if the vehicle uses a trailer. A similar problem is treated by Semet, see [20], but it is then allowed to leave the trailer behind and pick it up later. The possibility to use trailers should be included in the model for the LCP. Time windows: In the livestock collection problem, there are two kinds of time windows, and they occur for two different reasons. The first type occurs because the farmer is not at home, ready to deliver animals, all the time. Therefore, he or she needs to be visited on certain days of the week or within certain time intervals during the day. The second type of time window is broader, typically two or three days, and occurs because the animals need to be slaughtered within a certain time interval in order to have the desired weight at the time of slaughter. Further investigations are needed to find the real needs of time windows for the farmers, as today’s practice seems to be too permissive in letting the farmers decide the time for collection. Myopic focus: When a plan is made for several days at the time, one will often be more concerned about getting a good plan for the first day or two, while one only needs to know that a feasible plan exists for the last days of the time horizon.

J. Oppen, A. Lkketangen / Computers & Operations Research 35 (2008) 3213 – 3229

3229

Replanning with minimal disturbance: Changes that occur during the planning horizon, see Section 2.2.5, are likely to necessitate replanning. It will then be advantageous to be able to create new plans that deviate as little as possible from the previous ones. Diversification: The long-term goal of the project is to make a decision support system (DSS). It would then be advantageous for the decision-maker to have several good, but different, solutions to choose from. The meaning of different then has to be defined more precisely, and a further investigation of how distance functions, see [21], may be used for this purpose would be interesting. Acknowledgments The work described here is part of the project “Transportation of living animals—reduced transportation costs, good animal welfare and first-class meat quality”, and is sponsored by the Norwegian Fund for Research Tax on Agriculture Products. We thank Terje Wester and Jarle Dalane of Fatland Jæren, ]ivind Bjurbeck, Halvor Hjelle and Erik Bergseng of Gilde, Stein W. Wallace of Molde University College and Inge Midtveit and Ole Alvseike of Norwegian Meat Research Center for their help with the problem description and data collection. References [1] Tomasgard A, HZeg E. A supply chain optimization model for the Norwegian meat co-operative. In: Ziemba WT, Wallace SW, editors. Applications of stochastic programming. MPS–SIAM series on optimization; 2005. [2] Dantzig GB, Ramser JH. The truck dispatching problem. Management Science 1959;6:80–91. [3] Zipkin PH. Foundations of inventory management. Boston: McGraw-Hill; 2000. [4] Gribkovskaia I, Gullberg BO, Hovden KJ, Wallace SW. Optimization model for a livestock collection problem. In: Proceedings of the 17th annual conference for Nordic researchers in logistics. 2005. p. 365–81. [5] Tuzun D, Burke LI. A two-phase tabu search approach to the location routing problem. European Journal of Operations Research 1999;116: 87–99. [6] Campbell AM, Savelsbergh MWP. A decomposition approach for the inventory routing problem. Transportation Science 2004;38:488–502. [7] In: Toth P, Vigo D, editors. The vehicle routing problem. Philadelphia, PA: Society for Industrial and Applied Mathematics; 2002. [8] Oppen J, LZkketangen A. The livestock collection problem. Working paper 2006:3, Molde University College, Molde, Norway, 2006. [9] Brown GG, Ellis CJ, Graves GW, Ronen D. Real-time, wide area dispatch of mobil tank trucks. Interfaces 1987;17:107–20. [10] Cole Smith J. A genetic algorithm approach to solving a multiple inventory loading problem. International Journal of Industrial Engineering 2003;10:45–54. [11] Sigurd M, Pisinger D, Sig M. Scheduling transportation of live animals to avoid the spread of diseases. Transportation Science 2004;38: 197–209. [12] Bräysy O, Gendreau M, Hasle G, LZkketangen A. A survey of heuristics for the vehicle routing problem, part I: basic problems and supply side extensions. Technical Report, Molde University College, Molde, Norway, 2003. [13] Bräysy O, Gendreau M, Hasle G, LZkketangen A. A survey of heuristics for the vehicle routing problem, part II: demand side extensions. Technical Report, Molde University College, Molde, Norway, 2003. [14] Cordeau J-F, Laporte G, Mercier A. A unified tabu search heuristic for vehicle routing problems with time windows. Journal of the Operations Research Society 2001;52:928–36. [15] Glover F, Laguna M. Tabu search. Dordrecht: Kluwer Academic Publishers; 1997. [16] Arntzen H, Hvattum LM, LZkketangen A. Adaptive memory search for multidemand multidimensional knapsack problems. Computers and Operations Research 2006;33:2508–25. [17] Hvattum LM, LZkketangen A, Glover F. Adaptive memory search for Boolean optimization problems. Discrete Applied Mathematics 2004;142:99–109. [18] Taillard E. Parallel iterative search methods for vehicle routing problems. Networks 1993;23:661–73. [19] Gendreau M, Hertz A, Laporte G. A Tabu search heuristic for the vehicle routing problem. Management Science 1994;40:1276–90. [20] Semet F. A two-phase algorithm for the partial accessibility constrained vehicle routing problem. Annals of Operations Research 1995;61: 45–65. [21] LZkketangen A, Woodruff DL. A distance function to support optimized selection decisions. Decision Support Systems 2005;39:345–54.