Title: A Column Generation Algorithm for the Log Truck Scheduling Problem.

Size: px
Start display at page:

Download "Title: A Column Generation Algorithm for the Log Truck Scheduling Problem."

Transcription

1 Title: A Column Generation Algorithm for the Log Truck Scheduling Problem. Authors: Myrna Palmgren Department of Optimization Linkoping University S Linkoping, Sweden mypal@mai.liu.se Mikael Rönnqvist Department of Optimization Linkoping University S Linkoping, Sweden miron@mai.liu.se Peter Värbrand Department of Science and Technology (ITN) Linköping University SE Norrköping, Sweden petva@itn.liu.se Abstract: The log truck scheduling problem is one of the most complex routing problems where both pickup and delivery operations are included. It consists in finding one feasible route for each vehicle in order to satisfy the demands of the customers and in such a way that the total transport cost is minimised. We use a mathematical formulation of the log truck scheduling problem that is a generalised set partitioning problem. We then apply a column generation algorithm for solving the LP relaxed model and a branch and price algorithm for obtaining integer solutions. Numerical results from Swedish forestry companies are presented. 1

2 Introduction The wood flow planning in Swedish forestry is a complex process. Therefore, it is treated on several levels: strategic, tactical and operative level. While the strategic level treats the problem within a time horizon of one year, the operative planning is a short term one that consists of the daily transportation of logs. This in turn is done in two steps, primary transportation which involves moving the harvested logs from the actual felling point to piles situated close to the roads and secondary transportation where logs are transported from the road to their final destination. Most of this latter transportation is done by logging trucks and it corresponds to about a third of the total transport work (tonnes/km) in Sweden. We concentrate on the secondary transportation problem which is a variant of the Pickup and Delivery problem with time windows or the PDPTW. The PDPTW is a generalisation of the familiar vehicle routing problem with time windows (VRPTW) which in turn is a generalisation of the well-known travelling salesman problem (TSP). The PDPTW is defined as follows, given a number of customers with a specific demand, the problem is to find a set of routes, one for each vehicle in order to satisfy the demand. Each demand consists of a pick-up operation at an origin node and a delivery operation at a destination node. The pick-up and delivery operations have to be done on time and therefore a time window is associated with each pick-up and delivery node. The pick-up operation must of course precede the delivery. The PDPTW arises in a number of applications like the dial a ride problem or the transportation of disabled persons. 2

3 Savelsbergh and Sol (1995), distinguish between the single vehicle PDPTW and the multiple vehicle case. The first problem is a constrained TSPTW while the latter one is a constrained VRPTW. A number of variations in the objective function is possible, depending on whether it is people or goods that are to be transported. The PDPTW in its two cases (the single vehicle and the multiple vehicle cases) is formulated using three types of variables. In Dumas, Desrosiers and Soumis (1991) the PDPTW is formulated as a set covering problem, where each column represents an admissible route. Figure 1. An illustration of the components involved in daily transportation planning. The secondary transportation problem or what we call the log truck scheduling problem (LTSP) is described in Figure1. Starting in the forest, harvesters fell the trees and forwarders carry out the log extraction operation that has been explained earlier. Since the logs are of different types or assortments (depending on for example the species and the quality) the forwarder would then have to group and pile those logs of the same 3

4 assortment at different points close to the roadside. The forwarders are also equipped with computers that can measure the quantities moved during the day. This information is then given to the transport centre. The transport centre also receives data from the customers, reporting the daily or weekly demands and the quantities that have already been delivered. The transport manager's job is to assign the truck drivers different jobs in order to satisfy the demands of the customers. The trucks drive to harvesting points and load the assortments required and drive them to the customer. The LTSP differs from the PDPTW in two aspects:! In the PDPTW, each node should be visited exactly once while in the LTSP the nodes can be visited a number of times by the same vehicles or by different ones. The reason for this is that the quantities available at the harvesting points could exceed the truck capacity.! In the LTSP there is an additional decision to make at each node which is to decide how much to pick up or deliver at that specific node. The variant of the pick-up and delivery problem where the quantities picked-up are not decided in advance is not so common in the literature. However, the problem is of great interest in countries with important forestry industry such as Chile, New Zealand, Sweden and Finland. Since 1990 a computerised system (ASICAM) has been in use in several forestry firms in Chile. A description of this system is given in Weintraub et al. (1996). The simulation process produces a complete working schedule for one whole day 4

5 and it takes about three minutes to solve problems involving about 200 trucks, 40 supplies and 15 demands. Rönnqvist and Ryan (1995) describe a real time despatching approach at one of the major forestry companies in New Zealand. Here, the entire daily schedule is not required and instead the objective is to generate one trip at a time for each truck that is available. The truck drivers call the transport centre once their delivery has been completed and ask for a new task or trip. The solution method in the despatching context must thus find solutions quickly. Their model is based on a generalised set partitioning model. The combination of both heuristics and exact methods has been applied successfully in Finland. A system called EPO has been in use at a large Finnish company, Enso-Gutzeit since 1993, (Linnainmaa, Savola and Jokinen, 1995). EPO is a system that deals with all stages from strategic planning to operative one. The input data is collected on-line directly from the forests and the main output is a weekly schedule for each truck. The solution approach combines both heuristics and optimisation and consists of three phases: 1. Determine which supply is reserved for each factory 2. Produce possible schedules for the trucks 3. A postprocessing phase that is done in part manually In order to formulate the LTSP let us consider a number of vehicles with different home bases and a given capacity, a number of supply points each with a specific supply and 5

6 finally, a number of customers, each with a given demand. A supply point is defined by the product or wood assortment available, the quantity of that assortment and the time interval within which it can be picked up. Similarly, a demand point is characterised by an assortment, a quantity and a time window for the delivery operation. The LTSP consists in finding a set of minimal cost routes, one for each vehicle in order to satisfy the demands of the customers. It is a scheduling problem since it produces a set of schedules for the vehicles in advance. If the routes are decided in real time it is a dispatching problem. Each route or schedule produced must satisfy a number of constraints such as time windows that assure that the truck visits the supply points or customers within their opening hours. Naturally, each route must originate and end at the home base of the truck driver. Furthermore, the capacity of the truck should not be exceeded and different assortments or products should not be mixed within the same block of the truck. Precedence constraints guarantee that a supply node or pickup node is visited before the customer or the delivery node. General coupling constraints make sure that the correct assortment is delivered to each customer. The cost of a route depends on the travel distance and on the load of the truck. In this paper we present an approach to solve the LTSP based on column generation. We present a generalised set-partitioning model that acts as the master problem in a Dantzig- Wolfe decomposition. Then, we generate a priori a set of feasible routes that are potential columns or variables in the restricted master. This set of feasible routes is used indirectly 6

7 to solve the LP relaxed master. We choose to apply a branch and price procedure to obtain integer solutions. The branching strategy used is constraint branching. The remainder of this paper is organised as follows: in the following section the mathematical model is presented, then the solution method is described. Here we focus on the interpretation of constraint branching for the log truck scheduling problem and the heuristic used to design the set of feasible columns. Finally we present some numerical results from two different case studies and discuss important issues that are of interest for further research. Mathematical model Like the vehicle routing problem, the log truck scheduling problem can be modelled in several ways. One common and natural solution approach for set partitioning models is column generation. In our case it is natural for two reasons: 1. The columns represent a whole day s route for one truck 2. The number of columns is huge even for small problems and in practice it is impossible to enumerate all feasible routes. We start by presenting the basic model where each column represents one feasible route for a truck. The variables used are the binary variables x ij taking the value 1 if truck i uses route j, and 0 otherwise. The following notations are used: 7

8 n : number of trucks m i : number of feasible routes for each truck i n s : number of supply points n d : number of demand points d p : demand at point p s k : supply at point k a ijk : quantity picked up at supply point k by truck i using route j. b ijp : quantity delivered at demand point p by truck i using route j. c ij : cost of route j used by truck i The problem can be formulated as follows: [P] min c ij x ij n m i i = 1 j = 1 subject to m i x ij j = 1 =1 i = 1,2,, n (1) n m i i= 1 j = 1 a ijk x ij sk k = 1, 2,, n s (2) n m i i= 1 j = 1 b ijp x ij d p p = 1, 2,, n d (3) { 0,1} x i, j (4) ij 8

9 The objective is to minimise the total cost of transportation: here the c ij coefficients correspond directly to the cost of the route j. The cost of each route depends on several factors such as the load of the truck, the condition of the roads and the speed of the truck. Three sets of constraints must be met. Constraint (1) forces the model to choose one route for each truck. Each truck is permitted to stay at the home base during the whole day, therefore a column with cost zero representing this is added to the set of feasible routes. The second set of constraints (2) insures that the total quantity picked up does not exceed the supply. Finally constraint (3) guarantees that the demand is satisfied. Each column in model [P] corresponds to a feasible route for one truck. The example shown in Figure 2 illustrates the relation between one real route and its corresponding column. The truck in the example starts with a pick-up of 40 tonnes at supply point 1, and drives to the customer where it is totally emptied. The truck drives back to the same supply point for another trip. After delivering 40 more tonnes to the demand point, it visits supply point 3 and picks up 30 tonnes there. Since the truck is not fully loaded after that visit, it continues to supply point 2 where it picks up an additional 10 tonnes. Finally, the truck delivers the last load and travels back home. It is clear that the information in the column involves the sum of the amounts picked-up or delivered along the whole route. Therefore, we need to save all data concerning the exact schedules to be able to access the real route for each truck. 9

10 Supply 1 Demand 1 Supply 3 1 Truck Demand 1 Supply 2 80 Supply 1 10 Supply 2 30 Supply 3 Figure 2. Example of the relation between a route and a column. Solution approach The columns needed in model [P] can be obtained in different ways. One way is to enumerate the whole set of feasible columns and construct the complete problem by adding all columns. This is not practical due to the large number of feasible columns. Solving a subproblem according to the Dantzig-Wolfe scheme is another way of generating columns, see e.g. Lasdon (1970). Another equivalent possibility is to enumerate the whole set of feasible columns and to price them and add the ones with negative reduced cost. Finally, a subset of all feasible columns can be enumerated. If the number of columns in the subset is still very large, a pricing procedure can be applied in order to select the best columns and add them to the restricted problem however this approach does not guarantee a global optimal solution. 10

11 We have chosen to generate a large number of columns within a heuristic algorithm and to store them in a pool of columns. By pricing all columns in that pool, new columns with negative reduced costs are chosen and added to the problem. This means that we consider a restricted version of the model [P] since only a subset of the columns is included in it. This version is treated as the restricted master in a column generation procedure. Then, we aim to solve the restricted master by using a solution approach that consists of two phases 1. The first phase where the linear relaxation of the problem is solved. 2. The second phase where integer solutions are obtained by applying a branch and bound scheme. Solving the linear relaxation The first step in this phase is to relax the integrality constraints in the model [P], constraint (4). Then the restricted master is solved with some initial columns. The next step is to price each column in the pool. This means that the reduced cost of each column is computed by using the dual solution of the LP master. The column with the most negative reduced cost is chosen and added to the LP relaxation of the problem as an entering variable. Then the LP is resolved and this procedure continues until no more columns with negative reduced costs or entering variables are found. Figure 3 illustrates the idea of the pricing procedure. 11

12 New columns Dual prices Master Problem Figure 3. An illustration of the pricing procedure. Obtaining integer solutions The result obtained by solving the restricted master is usually fractional since the master problem is a continuous relaxation of an integer problem. Therefore, it is necessary to find integer solutions that solve the original problem. Branch and bound is a classical technique and is the most common way of solving integer problems. The idea behind the branch and bound procedure is to partition the set of feasible solutions into smaller sets and search for integer solutions in the subsets instead of in the original set. Each time such a partition is done, a range of fractional values is excluded from the set of possible solutions. In this paper, we apply a branch and price technique that allows new columns to enter the problem within the B&B tree. For more details about branch and price see for example Barnhart et al (1998). Briefly, branch and price consists of a branching stage and a pricing stage. Each time a branching is applied new constraints are added to the problem and the modified problem is called the subproblem. The role of the pricing stage is to price the potential columns and return the column with the least reduced cost, if this reduced cost is negative the column is added to the problem or subproblem. 12

13 Several issues have to be defined before running a branch and price procedure, the most essential being the branching strategy and the order in which the subproblems are to be inspected and solved. There are several branching strategies for dividing the set of feasible solutions. For example Kohl (1995) describes five different branching strategies for the VRPTW. The most classical branching strategy when the LP relaxation is considered is the variable branching. The idea is to choose a fractional variable x ij that in our case is supposed to be binary and to fix it to be zero on one side of the branch and 1 on the other side. If there are a number of variables with a fractional value, the variable with the largest value for example, can be chosen to branch on. One disadvantage of this branching strategy is that in problems containing binary variables and convexity constraints like [P], this strategy can lead to an unbalanced tree; this means that the tree does not grow proportionally. Instead of choosing one single fractional variable and imposing the values 0 or 1 in the branches, constraint branching forces the sum of some variables to be 0 or 1. This branching strategy was suggested by Ryan and Foster 1981, and the authors motivation for the strategy is precisely the unbalanced tree effect that has been described previously. By forcing the sum of a group of variables to be 0 or 1, the tree tends to become more balanced. Ryan and Foster apply this strategy to the classical set-partitioning problem where the constraints are of the form P j a ij x j = 1. Their theory is based on the fact that any sum of variables covering a pair of constraints satisfies the following inequality: 13

14 0 J j x j 1 where J is the set of indexes connected to variables covering a certain pair of constraints. The set J of variable indexes differs with the pair of constraints considered. In order to choose which set of variables and which sum j J x j to branch on this sum is computed for all pairs of constraints and the sum that is closest to 1 for example can be chosen to branch on. Since the convexity constraints in the log truck scheduling problem do not have any variables in common, (they belong to different trucks) we choose to apply this branching strategy on all pairs of constraints containing exactly one convexity constraint. Now that the variables belong to the same convexity constraint their sum is less or equal to 1 and the constraint branching strategy can be used. In practice, a pair of constraints means that a vehicle/ location pair is chosen to branch on, (location in our problem is either a pick-up point or a delivery one). For example if the constraints pair corresponds to vehicle k and pick-up point l, imposing the sum of the variables covering these constraints to 1 is equivalent to forcing the vehicle k to visit the pick-up point l. In contrast to variable branching, both branches here lead to serious changes in the problem since the 0-branch forbids the vehicle k to visit the location l. There is an interesting interpretation of constraint branching in general and specifically in the case of the log truck scheduling problem. Since the sum of the variables is between 0 and 1, it can be viewed as the probability of a truck visiting a specific location. When we 14

15 seek the constraint pair for which the sum of the variables is closest to 1, we then seek the truck-location pair with the highest probability that is strictly less than 1. Designing feasible routes Our strategy is to enumerate a subset of the feasible routes and to limit the number of routes in this subset as much as it is possible without losing the ones with good quality. Instead of enumerating all possible routes by visiting all supply points and all the possible combinations of demand points, we restrict the number of demand points that could be reached from each supply point. This means we only allow the truck to visit a small number of customers after a visit to a certain supply point. Therefore we start by solving the classical transportation problem that gives us a possible flow between the supply and demand points. Then this flow solution is used to decide demand points that could be reached from each supply point. In that way we make sure that the demands of the customers can be satisfied at the same time as the number of routes is limited. In a similar way, we limit the number of supply points that can be reached from the demand points. The heuristic that is described in Palmgren (2001) is a version of cluster first route second methods. The rules that have been implemented for enumerating all possible routes within these limits or clusters are as follows 1. Trucks are only allowed to pick up the same assortment during a trip. 2. Trucks continue the pick-ups operation until they are totally loaded. 3. The delivery is made to only one customer. Thus we consider the truck empty after a visit to a customer. 15

16 4. The amount loaded at a certain point is decided by the capacity available of the truck and the quantity remaining at the supply point. The algorithm proceeds in the following way: it starts at the driver s home base and visits any one of the supply points to load the truck. The quantity that the truck picks up depends on the amount available at the supply and the free capacity of the truck. Since the same truck can visit one supply point several times during the route, the supply available at that point has to be updated after each visit. The algorithm always loads the truck to the maximum. This means that the quantity loaded at the supply point i is equal to the minimum function of the remaining supply at the point i and the truck s free capacity load(i) = min( free capacity, residual supply(i)). After loading at the harvesting point there are two alternatives, either the truck is fully loaded or it is not. If it is fully loaded the next step is to find a customer that is included in the list for the supply point and to deliver the load to that customer. Since the clusters are constructed in a way such that all supply points and demand points that are included in the same cluster agree on the assortment type, there is no need to take that issue into account while designing the trips. If the truck is not fully loaded, the algorithm seeks other supplies (that are not empty) in the same cluster in order to fill the truck. This step is repeated until the truck is full, then a customer is visited for unloading. With this approach we make sure to cover all supply and demand points. 16

17 Numerical results The solution approach described earlier has been tested on two case studies from two Swedish companies SÖDRA and SYDVED. The first case is taken from SYDVED that coordinates large forestry areas, buys wood from independent forestry owners, sells it to saw and pulp mills and is in charge of all the log transportation from different origins to customers. Since SYDVED controls a large forestry area the company leaders have simplified their work by dividing the area into a number of smaller districts where the transportation planning is done independently. The data used in the first case are obtained from one of those districts. The geographical location of the company is characterised by a large number of supply points that are scattered around the area and in this specific case study the number of supplies is 266 while the number of demands is only 15. The total supply is several times larger than the total demand but the supply points differ a lot by their available quantities, some independent lot owners wants to sell 3 tonnes of logs while larger supplies can offer up to 800 tonnes. There are 4 assortments demanded ant the total quantity is 3239 tonnes. 28 trucks are available for the transportation. The working days are divided into two shifts, each consisting of 8 hours work. The start and the end nodes of the shifts are in this case at the home base, which means that the drivers meet at one location to change shifts. 17

18 In the second case study that is taken from SÖDRA, 6 trucks are used to transport wood chips from 16 supply points to 13 demand points. The total quantity available and required is 1482 tonnes. Moreover, all trucks have the same capacity, namely 38 tonnes. This means that the total number of trucks-loads (or trips required) is equal to 39 and the number of wood chips assortments is 5. The solution approach described in this paper was applied on the first case and the number of feasible routes generated was 2.57 millions. CPLEX was used to solve the LP relaxed restricted masters and the branch and price procedure was interrupted after that a certain number of columns were added to the restricted master. Then branch and bound was applied for 4 hours before interruption. In all tests made the branch and bound tree was never totally searched. SYDVED had used the 28 trucks in order to satisfy the total demand. This number could be reduced to 19 trucks in the solution. For a complete result description, see Palmgren In order to test the quality of the clusters suggested in the algorithm, we designed other clusters and solved the problem using the new sets of columns. In this test the clusters are designed according to simple rules. These are: each supply point is connected to the two closest demand points requiring the correct assortment and each demand point is connected to the two closest supply points and a number of randomly chosen ones. Table 1 shows that the LP solution improved with the number of the columns in the pool. Table 1: Testing the quality of the routes 18

19 Number of columns in the pool LP solution B&P and MIP solver Feasible? No No No No This improvement was though not enough to get a feasible integer solution, not even for the case where the number of columns generated exceeded 3 millions. These results can also be compared to Table 2 where a feasible integer solution was found without having to generate more than columns. The columns in this test are generated according to the heuristic described earlier. The clusters do not change from one test to another. In order to modify the number of columns in the pool we changed the number of supply points visited after leaving a demand point. Table 2 shows that the LP solution does not improve much with the number of columns in the pool. The integer solutions presented in Table 2 are not optimal. We first register the integer solution found after running the branch and price procedure that was interrupted when 2000 columns were added to the LP master. Then, CPLEX MIP solver was used to solve the resulting restricted master. This is stopped after 4 hours. We tried to use CPLEX MIP solver without running branch and price first but in that case no integer feasible solution was found. 19

20 Table 2: Testing the effect of the number of routes generated Number of columns in the pool LP solution Branch and price solution B&P and MIP solver # of nodes in branch and price Feasible? No Yes Yes Yes Yes The number of routes generated in this case is 2.9 millions. The results obtained are compared to the actual routes. In order to make this comparison possible we computed the total driven distances for each truck. Each route consists of loaded trips unloaded ones and trips originating or terminating at the home base. It is important to note that the actual routes are in this case well structured and carefully planned. In fact, the whole set of data for case 2 is constructed using the actual routes as a basis. This was done by observing and registering the trips made and the locations visited and then including only these locations in the data. The results are shown in Table 3 below. Table 3: Results of the second case. 20

21 Total driven distance Actual routes Scheduling solution Difference between the two solutions 7984 km 7314 km -670 km -8.4% Loaded distance 4456 km 4157 km -299 km -6.7 % Unloaded distance 2599 km 2452 km -147 km -5.6 % Home journeys 929 km 705 km -224 km -24 % Loaded percentage 63.2 % 62.9 % -0.3 % Total loaded percentage 55.8 % 56.8 % +1 % Conclusions The heuristic proposed for designing the set of feasible routes is based on the solution of the classical transportation problem. The enumeration procedure loops over all supply points and constructs each route trip by trip until the end of day is reached. The results presented show that using the transportation problem as a basis for the set of clusters led to good quality routes and feasible integer solutions. The branch and price procedure was necessary to obtain feasible integer solutions. It was impossible to add all generated columns to the restricted master at once, at the same time, the columns added during the first phase were not enough to generate a feasible integer solution. In many cases B&P was able to return a feasible integer solution within 2 hours running time. Our solution approach succeeded in both case studies, even though the second case was tough since we did not have so much freedom of choice. This is due to the way case 2 21

22 was constructed and that the possible destinations that could be visited from each supply point were given. The heuristic for choosing the set of columns has some disadvantages; when the problem is balanced, as it is in case 2, the number of feasible columns needed to produce an integer feasible solution increases. If this number exceeds several millions, the memory allocated for the problem becomes very large. Moreover, the pricing procedure becomes more time consuming. Here, the role of a column-generating subproblem is important. The heuristic gives a set of start columns and exact column generation helps to improve the integer solution without requiring so much memory space. Therefore, the algorithm becomes complete once a column generator is added to it. We are currently working on an algorithm for solving the subproblem of the LTSP, which is a constrained shortest path problem. Our approach is based on the K shortest paths algorithm that is discussed in Palmgren (2001). References Barnhart, C., Johnson, E.L., Nemhauser, G.L., Savelsbergh, M.W.P., Vance, P.H., Branch-And-Price: Column Generation for Solving Huge Integer Programs. Operations Research, Vol. 46, No. 3, May-June Dumas, Y., Desrosiers, J., Soumis, F.,1991. The pickup and delivery problem with time windows, European Journal of Operational Research 54,

23 Kohl, N., Exact Methods for Time Constrained Routing and Related Scheduling Problems. PhD thesis, Department of Mathematical Modelling, Technical University of Denmark. Lasdon, L.S., Optimization Theory for Large Systems. Macmillan series in Operations Research. Linnainmaa, S., Savola, J., Jokinen, O., EPO: A knowledge based system for wood procurement management. Paper presented at the 7 th Annual Conference on Artificial Intelligence, Montreal. Palmgren, M., Optimisation Methods for Log Truck Scheduling, Theses No. 880, Linköpings Universitet. Ryan, D.M., Foster, B.A., An Integer Programming Approach to Scheduling. Computer Scheduling of Public Transport, pp North_holland, Amsterdam. Rönnqvist, M., Ryan, D., Solving Truck Despatch Problems in Real Time. Proceedings of the 31th Annual Conference of the Operational Research Society of New Zealand, August 31-September 1, Wellington, New Zealand, Savelsbergh, M.W.P., Sol, M., The General Pickup and Delivery Problem. Available on the web. 23

24 Weintraub, A.,Epstein, R., Morales, R., Seron, J., Traverso, P., A Truck Scheduling System Improves Efficiency in the Forest Industries. Interfaces 26: 4 July-August,