Optimizing Schedules of Rail Train Circulations by Tabu Search Algorithm

This paper develops an integer programming model for the scheduling problem in train circulations on an intercity rail line. The model that aims to minimize the sum of interval time for any two consecutive tasks is proposed to characterize the train operation process. Two main constraints, namely, time-shift and equilibrium constraint, are considered to get the feasible and practical solution of train schedules. A heuristic procedure using tabu search algorithm is also designed to solve the model by introducing the penalty function and a neighborhood search method with the trip exchange and insert strategy. A computational experiment performed on test instances provided by twomajor stations on the Beijing–Tianjin Intercity Railway in China illustrates the proposed model and algorithm.


Introduction
Transit scheduling problem is a major area in operations research because of the complexity of problems that arise from various transit modes, such as airlines, railways, maritime, and urban transit.Vehicle scheduling and crew scheduling are two main problems that arise in this area.Generally, these two problems are considered separately, where the first is the vehicle scheduling problem and the second is the crew scheduling problem [1][2][3].
Recently, most scholars have focused on the two problems simultaneously.In [4], a single depot case with a homogeneous fleet of vehicles was considered and an exact approach was proposed to solve the simultaneous vehicle and crew scheduling problem in urban mass transit systems.An integrated approach to solve a vehicle scheduling problem and a crew scheduling problem on a single bus route was presented in [5].An integrated vehicle and crew scheduling problem was described using an integer linear programming formulation combining a multicommodity network flow model with a set partitioning/covering model in [6].An approach was presented to solve the bus crew scheduling problem that considers early, day, and late duty modes with time-shift and work intensity constraints in [7].The authors in [8] proposed an integrated vehicle-crew-roster model with days-off pattern, which aimed to simultaneously determine minimum cost vehicle and daily crew schedules.
In the field of rail transit, train and crew scheduling problems are key steps in the rail operational process.The train scheduling problem involves assigning trains to a set of trips generated by a train timetable.The crew scheduling problem involves assigning crews to trains that operate at a given schedule.The authors in [9] proposed a phase-regular scheduling method and applied a regular train-departing interval and the same train length for each period under the period-dependent demand conditions.In [10], a binary integer programming model incorporated with passenger loading and departure events was built to optimize the passenger train timetable in a heavily congested urban rail corridor.The authors in [11] established an optimization model based on maximum passenger satisfaction for train operations at the junction station in passenger dedicated lines.The authors in [12] described research in progress that would determine the minimum circulation of trains needed to execute a given timetable with given bounds on demand and capacities.
Train and crew scheduling is an NP hard problem.Generally, the difficulties stem from a large set of complex and conflicting restrictions that must be satisfied by any solution.Most of these restrictions are reflected in a sizable number of operational conditions that involve trips in daily train timetables, train numbers, train capacities, crew numbers, and certain constraints related to time-shift, equilibrium, and work intensity.The authors in [13] proposed an algorithm which was based on local optimality criteria in the event of a potential crossing conflict to solve the train scheduling problem.A model designed to optimize train schedules on single line rail corridors was described in [14].In [15], a multiobjective optimization model was developed for the passenger train-scheduling problem on a railroad network which included single and multiple tracks, as well as multiple platforms with different train capacities.To minimize shortages in capacity during rush hours, the authors in [16] described a model that could be used to find an optimal allocation of train types and subtypes for lines.
Meanwhile, various optimization models that relate to many aspects of train and crew schedules in railways are being studied extensively.The column generation approach is an effective algorithm for solving these problems.For example, the authors in [17] developed a column generation approach for a rail crew rescheduling problem.The authors in [18] presented a column generation approach based on the decomposition algorithm, which would achieve high-quality solutions at reasonable runtimes.
In recent years, a number of studies have paid more attention to developing a heuristic algorithm for the train scheduling problem.An algorithm that combined a compact assign and a matrix, as well as an operational time strategy was proposed in [19].The authors in [20] developed twosolution approaches based on a space-time network representation that would operate a predetermined set of train duties to satisfy the strict day-off requirement for crew in railways.On the premise of unfixed train used sections, the authors in [21] built an optimized train operation and maintenance planning model using an algorithm with a penalty function and a 3-opt neighborhood structure to solve the model.A particle swarm optimization algorithm with a local search heuristic was presented to solve the crew scheduling problem in [22].
For an overview of the above papers, most studies on constructing the train scheduling model have been paid to the factors associated with train numbers, train capacities, interval time of trains, and so on.Moreover, interval time often includes night waiting time, which allows a train to conduct the trip tasks for the following day when the shortest layover time is less than the interval time of two consecutive trips.In fact, most trains run on the intercity line with high frequency, which is highly similar to bus transit.The origin and destination stations are generally equipped with train bases.In this paper, the factor of night waiting time is neglected, and the train scheduling problem is merely based on the train timetables in one day.
This paper is organized as follows.In Section 2, the rail train scheduling problem and an optimization model that minimizes the total interval time cost are described.A tabu search algorithm is presented in Section 3. In Section 4, a numerical example is provided to illustrate the application of the model and algorithm.The last section draws conclusions and discusses future research directions.

Rail Train Scheduling Model
2.1.Problem Description.This paper considers train scheduling on a bidirectional intercity railway line with several stations.The location and number of trains available in each station are known.Every day, the trains are arranged from the designated stations to perform a set of trips.For each trip, the departure and arrival times and locations, which are determined by train timetables, are also known.Figure 1 shows a simple train timetable with three stations and 10 trips.
Train scheduling aims to assign a number of timetabled trips to a set of trains with the objective of minimizing total train operation costs and satisfying a range of constraints, including labor union agreements, government regulations, and company policy.For clarity, the following assumptions have to be considered.
(1) Any two consecutive trips arranged for a train should have compatible terminals.Deadhead trips are not considered in this paper.Thus, the arrival location of a trip should be similar to the departure location of the next trip (e.g., Trips 1 and 6).
(2) Any two consecutive trips arranged for a train should be compatible in time.A lower bound, called layover time, is present when a train arrives at a terminus.During this time, the trains wait for passengers to alight, board, turnaround, and so on.If the interval time of two trips cannot exceed the shortest layover time, the two trips for any train is voided.If we assume that the shortest layover time is 15 minutes, then we can say that Trips 4 and 5 cannot be compatible.
(3) The train scheduling problem is solved as a daily problem in which every train schedule is assumed to be obtained from a daily train timetable.For two consecutive trips, the departure time of one trip should not be earlier than the arrival time of the next trip (e.g., Trips 1 and 2).
(4) The number of required trains cannot exceed the prescribed maximum number of trains.another.For any trip task of a particular train, the departure station of the first trip and the arrival station of the last trip are not necessarily the same.

Objective Function.
The train is an important piece of equipment used in intercity railways, which is expensive to produce or purchase.To complete train timetables, the required number of trains should be as few as possible.Furthermore, the interval time of trains, a key factor in measuring their circulation efficiency, can be described as follows: a train runs in a section and reaches an intermediate station in one trip.It operates and waits at the station and then departs from the station for the following trip task.The interval time includes the operation time and waiting time at the station.When the train arrives and departs from the terminus, the interval time can be called the turn-back time.Therefore, the optimal objective of rail train scheduling is to determine the minimum number of trains required and ensure the minimum cost of interval time.As the sum of interval time and running time of trains is a multiple of the number of trains, and the running time of each train is a constant number, the objective of having the smallest number of trains is equivalent to the objective of having minimal cost in interval time.In this paper, the optimal objective is to minimize the total interval time, which can be formulated as follows: where  represents the number of trains required in a day,  represents the number of trips provided by a train timetable in a day and   is the interval time between trip  and trip .   is a binary 0-1 variable that indicates the status of trip  and trip  conducted by train .   has two values:    = 1 if trip  is the next trip after trip  conducted by train , and    = 0 otherwise.
The interval time of any two trips in train timetables is significantly influenced by factors related to the trip, such as origin station, destination station, and arrival and departure time at the two stations.For any two trips, if the destination station of the former trip is different from the origin station of the latter trip, or if the interval time is less than the shortest layover time  0 , then the two trips cannot be arranged using the same train.Obviously, the two trips cannot satisfy the time-shift constraint.In this paper, the interval time can be set to an infinite positive number .If the interval time of the two trips meets the time-shift constraint, then it can be calculated using the formula   −   .Therefore, interval time   between trips  and  can be expressed as follows: where   is the destination station of trip ,   is the origin station of trip ,   is the arrival time of trip  at destination station, and   is the departure time of trip  at origin station.

Constraints
(1) To ensure that each trip can be conducted using only one train, we formulate (2) The relationship between decision variable    and auxiliary variable    can be formulated using the following equation: (3) The two consecutive trips taken by the same train should satisfy the time-shift constraint, which means that the arrival time when the former trip ends at the destination station must be earlier than the departure time when the latter trip starts at the origin station.
The minimum difference should be not less than  0 , where () represents sign function, which is calculated using (6), (4) To ensure that the running mileage between different trains is equal, we have to make sure that the actual operation time between different trains does not vary significantly because of the constant speed of each train.The parameter   , which represents the total operation time of train , can be calculated using the following equation: Therefore, we can calculate the maximum and minimum operation times of trains, and the difference should not exceed the maximum value of the operation time between any two trains  1 , max (

Algorithm Design
The tabu search algorithm uses a neighborhood search procedure to iteratively move from one potential solution to an improved solution, until a stopping criterion is satisfied.Tabu search is a metaheuristic local search algorithm that can be used to solve combinatorial optimization problems.
The major advantages of this algorithm are its simplicity, speed, and flexibility, and the scheduling model for rail train circulations in this paper is a complex zero-one programming problem.Thus, the tabu search algorithm can be used easily.
The main parameters of the algorithm are designed as follows.

Expression of Solution.
The two-dimensional integer array encoding method can be used to solve the train scheduling problem.In this method, rows represent trains, and columns represent trips.The trips are numbered according to departure time in ascending order.For example, in the train operation data presented in Figure 2, the trip chains of each train can be expressed as follows: train 1: 1-6-7-8-9, train 2: 2-5-10, and train 3: 3-4-11-12.The expression of solution is shown in Figure 3.
Based on the values in the two-dimensional array, the decoding process is the inverse of the encoding process.For example, Figure 3  Other trains are decoded using the same method used in the former method.

Generation of Initial Solution.
The initial solution is the starting point of the algorithmic search.A superior initial solution enables the algorithm to arrive quickly at the optimal solution.In the process of generating the initial solution, the time-shift constraint should be satisfied.The procedure of the algorithm is as follows.
Step 5.If  > , then the algorithm ends and the results are obtained.Otherwise, go to Step 2.

Neighborhood Structure.
The neighborhood structure uses trips exchange and insert strategies between different trains.The trips exchange strategy can be described as follows: a single exchange point on both the trip chains of the two parents is selected.The trip number of that point is swapped between the two parent organisms.The resulting organisms are the children.For example, trip 7 of train 1 (1-6-7-8-9) is exchanged with trip 5 of train 2 (2-5-10), and new solutions can be obtained.The trip chain of train 1 becomes 1-6-5-8-9 and that of train 2 becomes 2-7-10, as shown in Figure 4.
The trips insert strategy can be described as follows: two consecutive trips from train 1 are inserted into the trip chain of train 2. The insert point depends on the departure time in the trips chain of train 2 in ascending order, and two new trip chains for the trains result.For example, if trip 5 of train 1 (1-5-7-8-10) is inserted into the trip chain of train 2 (2-6-9), then new solutions can be obtained.The trip chain of train 1 becomes 1-8-10 and the trip chain of train 2 becomes 2-5-7-6-9, as shown in Figure 5.The trips exchange or insert operation cannot be performed if the trip chain of any crew cannot satisfy the time-shift constraint using any operation.

Evaluation of Solution.
To search for better solutions in the algorithmic iterative process, we have to evaluate the solution.It must simultaneously calculate the value of the objective function and consider the constraints.Given that the initial solution satisfies the time-shift constraint and the new solution generated in the neighborhood search also satisfies the former constraint, we can consider only the equilibrium constraint as the only factor in the former steps that should be punished.In this study, the parameters in  can be considered as the punish factors and the value becomes a large positive number.If the solution can satisfy the equilibrium constraint, then the values of the fitness function and the objective function become equal.Otherwise, the value of the fitness function becomes significantly larger than that of the objective function, which means that the set of values for the decision variables cannot create a feasible solution.The fitness function can be formulated as follows: where  = ∑  =1 ∑  =1 ∑  =1   ⋅    represents the value of the objective function.

Other Parameters.
The record of the tabu table is the transform (exchange or insert) node, and tabu length has a fixed value.Regulation is selected based on the value of evaluation as the aspiration criterion.In other words, the solution of the objective can be free if it is better than any of the best candidate solutions currently known.The stopping criterion is based on the value of the fitness function.If the best value does not change after a given number of iterations, then the algorithm stops the calculation.

Numerical Example
The Beijing-Tianjin intercity rail line is a major railway system that serves passengers who travel between the cities of Beijing and Tianjin in China.The line starts from Beijing South Railway Station and ends at Tianjin Railway Station.It has a total length of 119.4 km and covers 74 trips in two directions every day.The main pieces of information about each trip, such as origin and destination stations as well as departure and arrival time, are presented in Table 1.
The shortest layover time for trains at switchback station is 15 minutes, and the maximum deviation value of any two trains is set to 90 minutes.The parameters for the tabu search algorithm are as follows: the tabu length is 6; the punish factor is 10,000; and the given number of iterations without improving the solution is 100.The optimal solution can be calculated using the VC++ program, as shown in Table 2.The objective value of the optimal solution is 5,099 minutes.
Table 2 indicates that the total number of trains is 15 in two directions.The maximum value of train operation time is no more than 360 minutes (nos.3 and 14).The minimum value of train operation time is 302 minutes (no.12).The deviation value of operation time between train nos. 3 and 12 is 58 minutes, which is less than the specified value of 90 minutes.Thus, the equilibrium constraint is satisfied.

Conclusions
In this paper, we present an optimized scheduling method of rail train circulations on a bidirectional intercity railway line.A binary integer programming model with the objective of minimizing the train fleet and the total interval times is presented to show the schedule process.To work out a practical schedule, the time-shift and equilibrium constraints are also considered.We have developed a tabu search algorithm to solve the proposed scheduling model.
Computational results with the trip data on Beijing-Tianjin have shown that the algorithm can produce highquality train scheduling solutions.Furthermore, this method can be widely applied to rail train circulations characterized by high-density trips and large-quantity trains.During the peak period of an intercity railway line, because of the unbalanced feature of trip numbers in both two directions, future research work may focus on considering the rail train circulations with deadhead strategy.

Figure 2 Figure 2 :
Figure 2 illustrates train schedules corresponding to the data from the train timetable in Figure 1.Three trains are arranged for 12 trips.Each row corresponds to the trip tasks of a train.For instance, the trip tasks of the first train (no. 1) are in a chain with C-A, A-C, C-B, B-C, and C-A.The columns correspond to the trips in a timetable.Notably, the number of columns that correspond to different trains differs from one
contains 3 trains and 12 trips.The numbers of trips conducted by train 2 are 2, 5, and 10.Thus the variables are

Table 1 :
Departure and arrival time of trips.: "DT" stands for departure time and "AT" stands for arrival time.Trains with odd numbers run from Tianjin Station to Beijing Station, and trains with even numbers run from Beijing Station to Tianjin Station. Notes

Table 2 :
The optimal results for train scheduling.