A hybrid algorithm for the multi-depot vehicle scheduling problem arising in public transportation

Article history: Received December 18 2018 Received in Revised Format January 26 2019 Accepted February 3 2019 Available online February 4 2019 In this article, a hybrid algorithm is proposed to solve the Vehicle Scheduling Problem with Multiple Depots. The proposed methodology uses a genetic algorithm, initialized with three specialized constructive procedures. The solution generated by this first approach is then refined by means of a Set Partitioning (SP) model, whose variables (columns) correspond to the current itineraries of the final population. The SP approach possibly improves the incumbent solution which is then provided as an initial point to a well-known MDVSP model. Both the SP and MDVSP models are solved with the help of a mixed integer programming (MIP) solver. The algorithm is tested in benchmark instances consisting of 2, 3 and 5 depots, and a service load ranging from 100 to 500. The results obtained showed that the proposed algorithm was capable of finding the optimal solution in most cases when considering a time limit of 500 seconds. The methodology is also applied to solve a real-life instance that arises in the transportation system in Colombia (2 depots and 719 services), resulting in a decrease of the required fleet size and a balanced allocation of services, thus reducing deadhead trips. © 2019 by the authors; licensee Growing Science, Canada


Introduction
From a technical point of view, the Operational Planning of public transportation systems includes scheduling of work shifts for bus drivers, scheduling of preventive maintenance work, scheduling of the services, as well as personnel allocation for each shift.Recently, this task has involved the control in real time of the operational system fleet with the incorporation of Communication and Information Technologies.Each one of the aforementioned problems represents a challenge when they are faced by the companies.All of these problems have already been studied widely in the specialized literature, and due to their computational complexity (they are classified as NP-hard), they are usually approached independently.This work deals with the Multiple Depot Vehicle Scheduling Problem (MDVSP), in which a set of vehicles must perform a set of trips with a given frequency at specific moments during the day.When examining the vehicle scheduling literature, we identified several works in the context of public transportation system.It was verified that applying optimization approaches contributed to the development of an efficient transportation system, capable of meeting the mobility needs required in cities Ibarra-Rojas et al. (2015).
The creation of itineraries for each vehicle is one of the most complex tasks in transportation planning and is known to be NP-hard.Despite its difficulty, this has been a problem of great interest given that the cost represented by the vehicles, either by their acquisition or by use, is one of the highest in the budget of operation of public transportation systems (Ceder, 2007).The reality of public transportation companies highlights the importance of efficiently solving the MDVSP, thus motivating the study of new alternatives that fit the particular environment of each company dedicated to the operation of public transportation services.However, regardless of the particularities of each scenario, the objective is likely to be framed in the total fulfillment of itineraries and reduction of costs related to system operation.Each itinerary or route is a description of the trips that must be done in specific times and areas, satisfying a frequency according to the conditions of the service and the needs of the mass transportation service determined by tactical planning.Therefore, the combination of route and departure times is denoted as service and a group of services in the same area is defined as timetable.The public transportation system routes are defined by their strategic planning and usually do not have substantial changes in the short and medium terms.
Each route must be served within a given frequency, at a defined average speed.This must be defined in the strategic planning of the transportation system, since all these route requirements are defined from the design of the service network itself and are designed precisely to meet the requirements identified during the strategic planning.In this work, we propose a matheuristic algorithm to solve an Operational Planning problem of a Public Transportation System that can be modeled as a MDVSP.The algorithm was first tested by benchmark instances consisting of 2, 3 and 5 depots, and a service load ranging from 100 to 500.The results obtained show that the proposed algorithm was capable of finding the optimal solution in most cases when considering a time limit of 500 seconds.We then applied the methodology to solve a real-life scenario of a Colombian public transportation system involving 2 depots and 719 services, and the results obtained imply in a decrease of the required fleet size and a balanced allocation of services, thus reducing deadhead trips.
The remainder of the paper is organized as follows.Section 2 presents a literature on the MDVSP, Section 3 formally describes the problem.Section 4 includes the proposed methodology.Section 5 contains the results of the computational experiments.Section 6 presents the concluding remarks.

Literature Review
In this section we review the recent MDVSP literature, briefly describing the corresponding solution approaches.Huisman et al. (2004) proposed a dynamic model to solve the VSP.The approach addressed by the authors consists of solving a set of optimization problems in a sequential manner, taking into account different scenarios in future travel times.During the first phase, trips are assigned to the different depots (clustering), solving the static problem.Next, in the second stage, a simple VSP is solved dynamically.The proposed methodology was evaluated in a bus operator company in the Netherlands.The data set consists of 1,104 trips and four depots.Gintner et al. (2005), considered the MDVSP with multiple types of vehicles.The authors proposed a two-phase method that provides near-optimal solutions.The mathematical formulation of the problem is based on a space-time network and a vehicle is allowed to start from one depot and return to a different one, aiming at minimizing deadhead and stop times.In practical cases, the number of trips is over a thousand, which is the reason the authors combined the model of a space-time network with a heuristic approach, in order to solve large problems and add new practical considerations.Hadjar et al. (2006) proposed a Branch-and-Bound algorithm to solve the MDVSP, which combines Column Generation (CG), Fixed Variables and Cutting Planes.The authors studied two mathematical formulations that are based on CG schemes to solve the Lagrange relaxation of the Linear Programming problem.The algorithm was tested on randomly generated cases as well as benchmark instances.In addition, they also applied their algorithm on a set of real world instances that were derived from data belonging to the Montreal Transport Society (MTS).The MTS operates a network that includes seven depots, 665 bus lines with 380 completion points and 17,037 trips.
In the study conducted by Wang and Shen (2007), a new version of the problem -denoted as VSP with Route and Fueling Time Constraints (VSPRFTC) -was presented in which they consider electric buses.This implies taking into account two new constraints: the duration of the route and the time of vehicle recharging.The authors propose a new mathematical formulation and use of the ant colony algorithm as a solution method.Laurent and Hao (2009) proposed an iterated local search (ILS) algorithm to solve the MDVSP.The authors developed a new neighborhood operator called block movement (Block Moves).The methodology uses a so-called auction algorithm to generate the initial vehicle scheduling.It then integrates a Two-Step Perturbation mechanism as a diversification procedure.The developed approach was tested on a set of 30 benchmark MDVSP instances.Hassold and Ceder (2014) presented a methodology based on a minimum cost network flow model, where the authors dealt with the heterogeneous fleet VSP (MVT-VSP) to solve a real case in New Zealand and the results showed an improvement of 15%, in terms of the cost of the vehicle fleet.
By means of a heuristic framework that makes use of a space-time network, the work presented by Guedes and Borenstein (2015) addressed the heterogeneous fleet MDVSP using truncated column generation and reduction of the state space.The results obtained were promising and constitute a feasible alternative to efficiently solve the problem.Shui et al. (2015) put forward a cloning algorithm and two heuristics of travel time readjustments.The approach obtained small CPU times and the ability to solve large instances such as the operation of buses in Nanjing, China.Recently, Wen et al. (2016), solved the VSP involving electric buses denoted as Electric VSP (E-VSP), whose main constraint lies in the buses driving ranges associated with battery recharging, which can be fully or partially recharged.The mathematical formulation proposed for the E-VSP involves, in the first step, minimizing the number of vehicles needed to carry out all scheduled trips (Timetable) and, secondly, minimizing the traveled distance, which is equivalent to minimizing deadhead trips.The problem was formulated as a mixed integer programming problem and was solved using an Adaptive Large Neighborhood Search (ALNS) heuristic.The solution methodology was capable of finding good quality solutions for large size problems and near-optimal solutions in small cases.Schöbel (2017) presented an integrated approach in the context of planning process of public transportation system.The author argues that, instead of optimizing each stage of transportation systems, it would be more beneficial to consider the entire process in an integrated fashion.To this end, a model that jointly covers route planning, Timetables and VSP was proposed as well as an iterative heuristic algorithm.The results obtained were promising and the author listed a series of challenges for future studies regarding the integrated point of view of optimizing public transportation system planning.

Problem description and formulation
In the context of public transportation, the MDVSP can be represented through a set , , … , of trip timetables that must be performed in a time horizon τ.Each trip is characterized by the time and place of origin, as well as the destination.Let , , … , be the set of depots and the number of vehicles located at depot .

A pair of trips
, is compatible, if trip can be executed immediately after trip by the same vehicle.This is possible if the time of trip completion plus the time of empty travel (deadhead) from to (added with a sufficient safety margin), is less than the start time of trip .The objective of MDVSP is thus to connect a subset of trips to be performed by a vehicle, starting and ending at the same depot in such a way that the sum of the total travel costs is minimized.The formulation proposed by Mesquita and Paixão (1992) can be considered a suitable alternative in our case, mainly because it contains a polynomial number of variables and constraints.Let , be a directed graph where a set of vertices 1,2, … , is partitioned into 1,2, … , , which corresponds to trips , , … , , and a set 1, 2, … , , which refers to depots , , … , .Set contains the arcs , representing the feasible trip pairs , and all the arcs leaving and arriving the depots , 1 , 1, , for 1,2, … , and 1,2, … , .A cost is associated to each arc, which estimates the fuel consumption necessary for the deadhead trip from to , and other penalties that the transportation company intends to apply.The costs associated to the arcs from or to a depot are denoted as: , 0, 1,2, … , and , ∞, , 1,2, … , , .In the particular case in which transportation companies seek to simultaneously minimize the size of the fleet and the costs of deadhead trips, then , , represents the cost of the deadhead trip from depot to the starting point of the trip (from the place of completion of trip to depot , plus half the cost incurred by the use of the vehicle belonging to depot .The MDVSP aims at finding the set of least-cost circuits in such a way that: (i) Each vertex ∈ is covered exactly once by a circuit, (ii) Each circuit contains exactly one vertex of set and (iii) The number of circuits that covers vertex 1 must never exceed 1,2, … , .

Definition of decision variables
The decision variables of the mathematical model proposed by Mesquita and Paixão (1992) subject to , The meaning of the constraints is described as follows:  Constraints (2) ensure that, for each 1,2, … , ; when finishing trip , the bus must return to a depot or must start another trip ∈ . Constraints (3) assign, for each 1,2, … , , a bus to a trip , either from the depot or from another trip. Constraints (4) enforce that, for 1,2, … , the capacity of a depot must not be violated. Constraints (5) impose, for each pair and , the assignment between trip and depot , as long as trip is the first trip of an itinerary done by a vehicle that starts its service from depot . Constraints (6) ensure that, for each pair and , the assignment between trip and depot , as long as trip is the last trip of an itinerary done by a vehicle that returns to depot . Constraints (7) establish that for each pair , ∈ , if a trip is connected directly with trip and trip is assigned to depot , then, trip is assigned to depot . Constraints (8) guarantee that each trip ∈ is assigned exactly to one depot. Constraints ( 9) and ( 10) define the domain of the decision variables. Constraint ( 11) impose an upper bound on the maximum number of vehicles that is obtained by a simple constructive procedure as described in Section 4.2.

Proposed methodology
This section describes the proposed hybrid algorithm that combines (i) a GA procedure; (ii) a SP approach; and (iii) a MIP formulation.The GA metaheuristic is based on the methodology presented by Chu and Beasley (1998), whose initial pool of itineraries is built using different constructive procedures.The best combination of the itineraries generated while executing the GA is then obtained by the SP approach which in turn possibly returns an improved solution.Such solution is then provided as a starting point to a MIP solver which aims at finding an even better solution using the formulation proposed by Mesquita and Paixão (1992).The algorithm will be referred to as GA+SP+MIP and its basic description can be seen in Fig. 1.The three constructive algorithms implemented to generate initial solutions are described as follows.

Clustered Concurrent Scheduler (CCS)
In this procedure, we apply the traditional Concurrent Scheduler method (Dell'Amico et al., 1993) adding a first clustering stage, that is, the algorithm starts by determining from which depot each of the trips should be attended.To this end, each trip is assigned in a heuristic fashion taking into account the lowest value , , as shown in Fig. 2. The next step is to sort the trips assigned to each depot in ascending order with respect to the start time.
Each itinerary is then generated by only allowing feasible assignments.When the first infeasibility occurs, the itinerary is completed and assigned to a vehicle of the corresponding depot.The procedure is repeated until there are no trips to be assigned to each of the clusters (Figure 3).

Fig. 3. Construction of itineraries for each depot's fleet
In case the least-cost arc that connects a given depot to service runs out of vehicles, the procedure attempts to reassign such service to the next depot also using the least-cost arc criterion, as shown in Fig. 4. The algorithm terminates when all trips have been assigned.The method is based on the construction of a general sequence with all trips , that is, only the nodes of set are taken into account.The first trip in the sequence corresponds to the one with smaller start time.
The following trips in the sequence are assigned according to the feasible nearest neighbor criterion.In addition, the terminal node must have at least degree 2 (Jungnickel, 2007).When there are no more feasible assignments or the minimum degree requirement is not met, the procedure sets the subsequence as an itinerary.The construction of the general sequence continues with the unassigned trips, taking as a junction trip the one which has the highest degree of feasible departure.The previous procedure is repeated until all trips are assigned to the general sequence, as illustrated in Figure 5. Finally, the subsequences become supernodes (Figure 6) and the Generalized Assignment Problem (GAP) is solved in order to relate it to the set of depots, and to have a complete MDVSP solution.
Fig. 6.Supernodes corresponding to travel itineraries (GAP) Fig. 7 shows the GAP solution and the corresponding node decoding.

Division of Attention Sequence (DAS)
This algorithm corresponds to an adaptation of the sequence division approach proposed by Prins (2004) and extended by Liuet al. (2009) for vehicle routing problems.The method starts with a sequence of all trips sorted in ascending order according to their start time (Fig. 8).

Fig. 8. Ascending ordered sequence (or any combination of criteria) and its corresponding subgraph
From this sequence, we obtain a subgraph of the original problem and through its exhaustive exploration one can build a digraph or auxiliary graph with all possible feasible itineraries and sub-itineraries (Fig. 9).

Fig. 9. Subgraph (or auxiliary graph) after removing infeasibilities
Because the problem involves multiple depots, each itinerary is repeated as many times as the number of depots.The minimum path between the trip that starts earlier in the sequence and the last one in the digraph, as shown in Fig. 10, yields a MDVSP solution.In this paper, a minimum flow-based mathematical formulation is employed to determine the shortest path.
Fig. 10.Digraph with all feasible routes and subroutes for each one of the depots.
We now compare the performance of the constructive procedures with the optimal solutions of the benchmark instances by Fischetti et al. (1999).Each figure provides the results for the alternatives of 2 (Fig. 11), 3 (Fig. 12) and 5 depots (Fig. 13).It is important to mention that during the execution of the tests, it was observed that the constructive procedures did not appear to dominate each other for the distinct alternatives.In fact, they are complementary to obtain good quality results when considering the different cases of the existing benchmark instances.

Genetic Algorithm (GA)
After building several initial solutions with the constructive procedures, a population-based metaheuristic could be an interesting strategy to benefit from the generated schedules.Once the initial population is created (Fig. 14), one applies a procedure that seeks to quickly obtain an UB from the fleet required to meet the services.This procedure simply consists in sorting all the services in ascending order according to their start time, and constructing itineraries consecutively with this sequence.In our case, we chose to implement a Chu-Beasley-based Genetic Algorithm as a population-based metaheuristic.An elitist acceptance criterion is used, and when it is possible to update the population, only the worst solution is modified.
The coding of the solutions that represent the population is composed of two vectors.The first corresponds to the order in which the services are added to the itineraries, and the second indicates the vehicles to which the services of the first vector are assigned, as proposed in Park (2001).The criterion adopted for assigning trips to itineraries is improved using a trip insertion operator to each of the itineraries under construction.
Coding the solutions in vectors facilitates the application of recombinations.In this work, the five forms of recombination presented in Leung et al. (2001) are used.

Set Partitioning (SP)
After the GA terminates, a SP-based procedure is applied as an attempt to further improve the incumbent solution.In this phase, a solution is built from the best itineraries of the final population obtained by the GA.The strategy consists of partitioning each solution (each one is a set of itineraries) and performing the optimal reconstruction of a solution for the MDVSP.In Subramanian et al. (2013) a compact model of SP is proposed, oriented to vehicle routing problems with a homogeneous fleet.In this work, such model is applied to the MDVSP as described next.Let be the set of all possible itineraries assigned to the different depots and ⊆ the set of itineraries that contains the trip or service.Define as the binary variable associated with the itinerary ∈ with associated cost .Moreover, let ⊆ be the set of itineraries assigned to depot ∈ and let be the number of buses or available vehicles at depot .The formulation can be written as follows: Objective function ( 12) minimizes the sum of the costs of choosing the best combination of itineraries.Constraints (13) guarantee that service is served exactly by one itinerary .Constraints ( 14) ensure that the selected itineraries do not exceed the maximum number of vehicles available at each depot.Enumerating all elements of set would result in a prohibitively large number of itineraries.Therefore, we decided to limit the size of by only considering the set of solutions associated with the final population obtained by the GA procedure.We will thus obtain a compact model that will contain about thousands of itineraries for the largest cases.As a result, the model can be easily solved with the wellknown MIP solver CPLEX® Version 12.7.

Initial primal bound and MIP-based solution
The best solution found during the SP procedure is provided as an initial primal solution to the the MIP model proposed by Mesquita and Paixão (1992), which in turn is the last step of our methodology.It was observed that providing an initial solution substantially helped improving the efficiency of the model.However, as it still may be hard to determine the optimal solution, especially for large-size instances, a time limit was imposed to avoid prohibitively long runs.

Computational Results
The proposed algorithm was implemented in C ++ ® running Ubuntu Linux 16.04.03 of 64-bits LTS operating system and CPLEX® 12.7 as a MIP solver.The experiments were performed on an Intel® Core ™ i5-4570 CPU of 3.20 GHz × 4, and 8 GB of RAM.A time limit of 500 seconds was imposed to the MIP model presented by Mesquita and Paixão (1992).In order to evaluate the performance of the developed approach, we made use of the benchmark instances introduced by Fischetti et al. (1999).These test cases are composed of 10 instances for each set.The sets combine 100, 200, 300, 400 and 500 services with 2 depots.For 3 and 5 depots they handle a maximum of 400 and 300 services, respectively.
In Tables 1, 2 and 3, the 10 instances of each benchmark set are grouped and the corresponding averages are presented for each set (OPT, optimal value of the objective function).Also, we compare the average number of vehicles (NV) as well as the CPU times in seconds (T (s)) and the Gaps found by the different stages of the proposed methodology.In addition to achieving optimality in most of the test cases, the proposed algorithm also finds the optimal number of vehicles required in all instances, thus showing the efficiency of our approach for the benchmark instances considered.We therefore believe that the algorithm can be extended to a real life instance in the context of mass public transportation.

Application in a Real Case
The results for the real world scenario obtained by both the constructive procedures and the GA+SP+MIP algorithm are shown in Table 4 and Fig   As illustrated in Table 4, by only applying the constructive procedures, we were capable of obtaning a reduction of one vehicle on the fleet necessary to meet all services on a business day.In later stages, a decrease in the number of vehicles was not achieved, given that the demand is very high.However, the GA+SP+MIP algorithm decreases deadhead trips, finding a uniform distribution on the allocation of services to buses.In Fig. 15 and Fig. 16, where the vehicle scheduling is presented using 35 vehicles; the x-axis represents the time of the day, the y-axis contains each schedule, and the numbers in the lines correspond to the "ids" of the trips or services assigned to the vehicles.Each service has a starting time and a completion time, which are the points between the ids.The deadhead trips or idle times for the vehicles are highlighted in green, showing how the methodology achieves a more balanced solution (with cost 16208, Fig. 16) when compared with the initial solution in Fig. 15 (with cost 20240). .Algorithm (GA+SP+MIP) impact in the resulting assignment Therefore, it is possible to conclude that the minimum number of vehicles were used and that the deadhead trips were reduced significantly.

Fig. 5 .
Fig. 5. Sequence generated connecting routes using the nearest neighbor criterion

Fig. 15 .
Fig. 15.Initial solutionFig.16.Algorithm (GA+SP+MIP) impact in the resulting assignment Therefore, it is possible to conclude that the minimum number of vehicles were used and that the deadhead trips were reduced significantly.

Table 1
Consolidated (average) of instances groups with 2 depots

Table 2
Aggregate results for the benchmark instances with 3 depots

Table 3
Aggregate results for the benchmark instances with 5 depots

Table 4
Comparative table constructives real case, business day