A Time-Space Network-Based Optimization Method for Scheduling Depot Drivers

: The driver scheduling problem at Chinese electric multiple-unit train depots becomes more and more difﬁcult in practice and is studied in very little research. This paper focuses on deﬁning, modeling, and solving the depot driver scheduling problem which can determine driver size and driver schedule simultaneously. To solve this problem, we ﬁrst construct a time-space network based on which we formulate the problem as a minimum-cost multi-commodity network ﬂow problem. We then develop a Lagrangian relaxation heuristic to solve this network ﬂow problem, where the upper bound heuristic is a two-phase method consisting of a greedy heuristic and a local search method. We conduct a computational study to test the effectiveness of our Lagrangian relaxation heuristic. The computational results also report the signiﬁcance of the ratio of driver size to task size in the depot.


Introduction
In the Chinese high-speed railway system, electric multiple-unit (EMU) trains need the maintenance to be executed at a specific level that is determined according to its accumulated running time or mileage reaches which are at a predefined threshold. Typically, there are five maintenance levels, in which the first-level maintenance (called operational maintenance) for an EMU train takes place when this EMU's accumulated running time reaches 48 h or its accumulated running mileage reaches 4000 km [1]. Since operational maintenance has the highest execution frequency, it becomes the main work for EMU train depots. During the first-level maintenance in a depot, an EMU train may be first cleaned at a cleaning track, then shunted to a repairing track for inspection tasks to be performed, and lastly returned to a storing track to wait for departure. Practically, because of the limited capacity of operation tracks, the task order mentioned above may be changed, and an EMU train may be stored at a storing track between different tasks.
Given a determined train shunting plan of the first-level maintenance, depot drivers are required to drive EMU trains from a storing track to a cleaning track, from a cleaning track to a repair track and, so on, according to a depot driver schedule. The depot driver scheduling problem aims to build a set of duties to cover driving tasks (including shunting and cleaning tasks), where many practical requirements should be satisfied, e.g., each duty can be picked up at most once by at most one driver, and the time between two adjacent tasks in duty must be longer than the walk time for a driver. A well-planned depot driver schedule is desired for the railway operator because it can reduce labor costs and improve the maintenance capacity of a depot. Moreover, with the increased use of EMU trains and the expansion of EMU depots, the scale of EMU maintenance work is expanding quickly, and it is difficult to obtain optimal or even feasible depot driver schedules manually, especially during important holidays, such as the Chinese Spring Festival.
In this paper, we design a time-space network for the considered depot driver scheduling problem with first-level maintenance. We then present a network flow optimization

Literature Review
In the literature, Heil et al. [2] present a comprehensive review of studies of railway crew scheduling problems in the past twenty years, they mention that few papers study the maintenance crews and depot shunting drivers scheduling. To the best of our knowledge, two works related to depot crew scheduling in the literature can be found. Wang et al. [3] study the depot shunting driver assignment problem with workload balance considerations, and Pour et al. [4] study the signaling maintenance crew scheduling problem in the Danish railway system.
The depot driver scheduling problem is one kind of crew scheduling problem (CSP) since depot shunting drivers can be regarded as crew. The CSP can be described as follows: "Given a set of tasks (trips, flights, etc.) with fixed starting and ending times and locations, and given a set of rules and criteria, find the minimum cost set of duties such that each task is included in a duty and all rules are satisfied". A lot of studies have been conducted on CSP in the past few years. Many researchers formulate the problem as a set partitioning problem or a set covering problem that can be solved by exact algorithms, see, e.g., Souza et al. and Gharaei et al. [5][6][7][8][9]. Some exact algorithms are usually developed based on a column generation technique, see, e.g., J .. utte et al., Nishi et al., and Liu et al. [10][11][12]. As the problem's scale is usually too large to be solved using the exact algorithm, researchers turn to developing a meta-heuristic to handle larger-scale crew scheduling problems. For example, Guillermo and Josś [13] develop a hybrid approach that combines tabu search and integer programming to solve a crew scheduling problem in railways. Elizondo et al. [14] put forward an evolutionary approach to deal with a CSP in underground passenger transport. Khmeleva et al. [15] presented a fuzzy-logic controlled genetic algorithm designed for the solution of the crew-scheduling problem in the rail-freight industry.
The crew planning problem is usually decomposed into two subproblems, including the crew scheduling problem and the crew rostering problem. In this respect, the crew scheduling problem forms anonymous duties covering all the trips for a defined period of time, and the crew rostering problem combines the duties into sequences which are subsequently assigned to individual crew members, see, e.g., Caprara et al. [16]. Many exact algorithms and meta-heuristics are developed to solve scheduling problems, see, e.g., Amjadian and Gharaei, Askari et al., and Taleizadeh et al. [17][18][19]. For example, Chew et al. [20] designed an approach based on tabu search to solve the driver scheduling problem in Singapore rapid transit. Practically, since the crew rostering problem is closely related to the crew scheduling problem, in some papers, both the crew scheduling problem and the crew rostering problem are taken into consideration, such as Amaya and Uribe, Zhou et al., and Bornd .. orfer et al. [21][22][23], who apply Lagrangian relaxation and Benders decomposition to solve the integrated problem of duty scheduling and rostering.
The characteristic of the depot driver scheduling problem is that the time interval between two consecutive tasks assigned to the same driver must be taken into consideration, while this time interval should be determined according to the practical working places rather than the types of these two consecutive tasks. A simple way to solve this problem is to give a sufficient long walking time between different tasks. However, this method may cause a lot of unnecessary waiting and walk for depot drivers which results in a waste of human resources. In the worst case, the depot driver schedule would be infeasible if a depot manager ignores the characteristics mentioned above. In this paper, the walking time between different tasks is particularly taken into consideration, and the drivers are allowed to return to the depot lounge several times if needed; thus, the decisions of waiting time and waiting places for each crew need to be determined. As we consider a long practical planning horizon, we also consider the determination of crew rostering and the maximum working time requirements for depot drivers. Our problem bears some similarities with the problem of Wang et al. [3] as both of these two problems focus on assigning driving tasks to depot drivers with given train shunting schedules. In Wang et al. [3], the objective is to minimize the walking distance and the fairness of the depot driver schedule, while the different required working time for different tasks and the waste of labor resources caused by waiting are not taken into consideration, and they do not allow the depot drivers to return to driver lounge more than once.
The contributions of this paper are as follows. First, we define an important practical depot driver scheduling problem for Chinese high-speed railways, which is studied in very little research. Second, we present an integrated optimization model for the considered problem which can determine driver size and driver schedule simultaneously and develop a network flow model-based Lagrangian relaxation heuristic. Our method is flexible in that it can be easy to modify arc costs or types to model and solve the problem that contains more practical constraints. Third, our computational results report the significance of the ratio of driver size to task size in the depot, which can help railway planners to estimate the driver size that is needed for these depots with different layouts and scales.
The rest of this paper is organized as follows. Section 3 gives a detailed description of the considered depot driver scheduling problem. Section 4 presents a time-space network and formulates a min-cost multi-commodity network flow model for the considered problem. Section 5 describes the development of a Lagrangian relaxation-based solution method. Computational experiments are conducted to test the solution method and to assess the benefits obtained by our solution approach, and the results are reported in Section 6. Lastly, some conclusions are made in Section 7.

Problem Description
The studied problem, hereinafter referred to as the depot driver scheduling problem, aims to simultaneously assign driving tasks to drivers and determine the drivers' detailed work schedules and walking routes while minimizing the operational cost. Some important characteristics of our problem are as follows: (i) our problem considers both the labor legislations (e.g., maximum working time requirement) and the depot regulations (e.g., the specified time window for depot drivers to sign in); (ii) a maintenance service may be canceled due to the limited driver scale, and a penalty is incurred when there is a cancellation; (iii) the maintenance services are predetermined and cannot be changed during planning horizon; and (iv) the planning horizon of each working day is discretized, and the time units are integers for which each time unit is 1 min. To be more precise, we offer the following definitions.

•
Task: A task represents an operation a driver may execute, such as signing in, signing out, and driving trains. Tasks can be divided into three categories: (i) driving tasks, which are indicated in the EMU train shunting schedule, such as, shunting an EMU from one track to another, and driving trains at cleaning tracks; (ii) shift tasks which include sign-in and sign-out operations; and (iii) walking and waiting tasks. Practically, the required time for driving tasks is fixed, while the timings for shift tasks is uncertain. Moreover, the numbers and the required time of walking and waiting tasks need to be determined when making solutions. • Shunting schedule: A shunting schedule determines the arrival and departure time of each train at each repairing track (optional), cleaning track, and shunting track it may traverse in the depot, such that certain operational requirements, such as track capacity, minimum headway constraints, and required maintenance procedures, etc., are taken into consideration. The shunting schedule is determined in the shunting schedule planning phase, which is used as input data for the problem studied in this paper. • Duty: A duty is a chain of tasks that can be assigned to at most one depot driver. A feasible duty must satisfy various labor laws and legislation.
In this paper, we study the depot driver scheduling problem of EMU trains' firstlevel maintenance in the depot, which aims at assigning a set of predetermined driving tasks to drivers such that certain labor laws and legislation (e.g., maximum working time constraint) and the depot regulations (e.g., the specific time window for depot drivers to sign in), should be satisfied. During the first-level maintenance, two maintenance processes, including the inspection process and the cleaning process must be performed. Other operations, such as shunting trains are auxiliary in the process. The order of these two maintenance processes is unfixed which should be determined in when making a train shunting schedule. Moreover, different processes should be executed on the corresponding tracks with specific equipment, that is, the inspection process should be executed on the inspection tracks that are equipped with fault inspection and correction equipment, while the cleaning process should be executed on the cleaning tracks that are equipped with train cleaning equipment (e.g., automatic train cleaner). It is obvious that without scheduling these driving tasks, our problem can be reduced to a set covering problem, which has been proven NP-hard. Figure 1 shows a typical layout of EMU train depot in China, which contains a driver lounge, a stabling yard, a cleaning area, a repairing shed, and several shunting tracks connecting different operation tracks. The stabling yard can be used to store trains and serve as the buffer between different maintenance operations or a temporary stop before the train departs from the depot. For an EMU train, there are driver cabs at both ends of this train, and it can move by itself in two directions without locomotives. A driver must be in the cab corresponding to the running direction to drive the train. When a train stays at an operating track, there are two positions of the track corresponding to the positions of the train's cabs for drivers to get on/off the train to start or end a driving task (which can be seen in Figure 1). For the sake of description convenience, we call the position of a track close to the entrance of the depot near working point (see, e.g., points numbered with odd numbers) and the other position which is far from the entrance of the depot far working point (see, e.g., points numbered with even numbers). Before introducing the input data, we first state the assumptions of our study.
• All trains considered in the paper are homogenous and can be moved bidirectionally on tracks. • All drivers considered in the paper are homogenous and able to drive all trains. • All repairing, cleaning, and stabling tracks are first-in-last-out tracks.

•
Drivers are smart, they would find the shortest path to reposition themselves between two points.  Given a chart of the depot shunting schedule, we can derive all the driving tasks with detailed information, such as the start and end time and the start and end working point. Take the EMU-1 in Figure 2 as an example, the train arrives at the depot and stops before the cleaning track C1 at time 30. Then, a driver in the depot takes over the train at once and starts to perform the cleaning task of the train at the near working point of track C1, i.e., working point 9. After finishing the cleaning task at time 65, the driver will get off the train at the far working point of track C1, i.e., working point 10. Another driver will get on the train at working point 9 at time 65 to shunt the train to track R4 to perform the repairing task. During the period of the shunting task, the driver has to switch the cab once, the time of switching cab has been included in the shunting task. After finishing the shunting task, the driver will get off the train at the far working point of track R4, i.e., working point 8. Finally, when the main driving tasks of EMU-1 have been finished, a driver will drive the train from the operating track R4 to operating track S1, to be specific, shunting the train from working point 7 at time 136 to working point 14 at time 148, then all the driving tasks for EMU-1 have been finished and the train will wait on the track S1 for departure. In a depot, there are usually several fixed hours for drivers to sign in at the driver lounge. After signing in, drivers will receive the working schedule, then in order to perform tasks in their duties, they have to walk to the working point corresponding to the tasks. If the driver arrives at the working point before the task begins, he will wait until the task begins. When the driver finishes the duty assigned to him, he will walk to the drivers' lounge and sign out.
Before introducing the input data, we first state the assumptions of our study.

•
All trains considered in the paper are homogenous and can be moved bidirectionally on tracks. • All drivers considered in the paper are homogenous and able to drive all trains. • All repairing, cleaning, and stabling tracks are first-in-last-out tracks.

•
Drivers are smart, they would find the shortest path to reposition themselves between two points.   Before introducing the input data, we first state the assumptions of our study.
• All trains considered in the paper are homogenous and can be moved bidirectionally on tracks. • All drivers considered in the paper are homogenous and able to drive all trains. • All repairing, cleaning, and stabling tracks are first-in-last-out tracks. • Drivers are smart, they would find the shortest path to reposition themselves between two points. Table 1 summarizes the input parameters of our problem, in which all time-related parameters are integer-valued. These parameters are described in detail as follows. The planning horizon [0,T] is discretized and the time units are expressed as integers (e.g., T = 960, if the planning horizon is 16 h and each time unit is 1 min).

Type of Data Notation Description
Depot data N set of working points in the depot, including the driver lounge n 0 , N = n 0 , n 1 , · · · , n |N| N o set of working points that could be used as origin points of driving tasks, walking distance between working point n i and n j Task data R set of driving tasks indicated in the shunting schedule o r origin working point of driving task r d r destination working point of driving task r p r start time of driving task r q r completion time of driving task r π r penalty for canceling driving task r Driver data K set of depot drivers, K = k 1 , k 2 , · · · , k |K| T sign set of time points for drivers to sign in, T sign = t 1 , t 2 , · · · , t |T sign | τ maximum allowed working time for drivers during the planning horizon v k average walking speed of driver k f k fixed cost for driver k if he/she is on-duty during the planning horizon α k unit cost for driver k when he/she is walking β k unit cost for driver k when he/she is waiting γ k unit cost for driver k to shunt trains in the depot δ k unit cost for driver k to drive trains at cleaning tracks

Depot Data
Let N be the set of nodes and E be the set of track segments in the depot, among which n 0 denoted the driver lounge and the other nodes n 0 , n 1 , · · · n |N| represent working points along tracks. Each track segment i → j ∈ E represents the segment from working point i to working point j, with no intermediate working point in between. In nodes set N some points may be the origin points of driving tasks, which are collected in node set N 0 . Note that a working point may be both an origin working point of a driving task and a destination working point of another driving task, e.g., in Figure 1, point 9 may be an origin working point of the driving task of driving a train at cleaning track C1, and point 9 may also be a destination working point of shunting task. Obviously, driver lounge n 0 is not in set N o . The distance between working point n i and n j is denoted by d ij .

Task Data
Let R be the set of considered driving tasks. For each driving task r ∈ R, the input data of each task r include: (i) the origin working point o r ∈ N\{n 0 }; (ii) the destination working point d r ∈ N\{n 0 }; (iii) the start time p r at its start working point o r ; (iv) the completion time q r at its destination working point d r ; and (v) a penalty π r that is incurred if driving task r is canceled.

Driver Data
Let K be the set of considered drivers. For each driver k ∈ K, the input data include: (i) the average walking speed v k ; (ii) the operating cost α k per unit time for driver k when he/she is walking; (iii) the operating cost β k per unit time for driver k when he/she is waiting; (iv) the operating cost γ k per unit time for driver k when he/she is executing shunting tasks; (v) the operating cost δ k per unit time for driver k when he/she is executing cleaning tasks, i.e., driving a train at a cleaning track; and (vi) the fixed cost f k for driver k if he/she is on duty, i.e., this driver works in the planning horizon, during the planning horizon. Considering the practical concern that the cleaning task is more difficult and fatiguing than the shunting task as the driver should control train speeds carefully, we require that γ k < δ k < β k < α k . Moreover, according to the depot regulation and labor legislations, drivers are required to sign in at the given time points in set T sign , and each driver can work at most τ time during the planning horizon.

Objective and Constraints
The considered problem is an integrated problem which simultaneously generates duties to cover driving tasks and assign these obtained duties to depot drivers, such that the total cost is minimized. The obtained solution for each on-duty driver indicates this driver's sign-in time, sign-out time, driving tasks, timings for having rests, and walking route, etc., in the depot. A feasible depot driver schedule must satisfy the following constraints: • Driving task assignment constraints: Each driving task r ∈ R can be executed by a driver at most once. • Sign-in constraints: If a driver k ∈ K is on-duty, he/she must sign in at the specific time points in T sign in the driver lounge and finally signs out in the driver lounge. • Walking time constraints: The time interval between executing two consecutive driving tasks for the same driver should be no less than the walking time for the driver to walk from the proceeding task's destination working point to the succeeding task's origin working point.

•
Maximum working time constraints: For each driver k ∈ K, the maximum duration of duty cannot exceed a fixed value τ.
The total cost of a solution is the sum of (i) total operating cost of executing (uncanceled) driving tasks, (ii) total cancellation cost of canceled driving tasks, (iii) total auxiliary cost for on-duty drivers to sign in, sign out, wait somewhere, and walk in the depot, and (iv) total fixed cost for on-duty drivers.

Time-Space Network Formulation
In this section we formulate the considered problem as a minimum-cost multi-commodity network flow problem with several restrictions, in which each commodity represents a depot driver, and the underlying network is an acyclic directed time-space network G = (V, A). In what follows, we first introduce the construction of our time-space network in Section 4.1. We then discuss the flow restrictions in Section 4.2. Lastly, we present the minimum-cost multi-commodity network flow model in Section 4.3.

Time-Space Network Construction
The set of all possible time instants in the planning horizon [0, T] is {0, 1, · · · , T}, which forms the "time" dimension of our network G. The "space" dimension of G covers all working points. Corresponding to each working point i ∈ N o and each time instant t are three vertices, including ρ t i , ρ t i andρ t i , while corresponding to each working point i ∈ N\N o and each time instant t are two vertices ρ t i and ρ t i . In these vertices, ρ t i represents that a crew is staying at working point i and time t, ρ t i represents a crew's departure for walking, andρ t i represents a crew's departure for executing driving tasks. Mathematically, the considered possible states that covered by "space" dimension is given by where vertices o and d are, respectively, the dummy source and sink for the muti-commodity flow.
The arc set A of G contains several types of arcs. The cost for driver k ∈ K to traverse arc u → v is denoted by ξ k (u, v). In what follows, we present a detailed description of different types of arcs considered in this paper.

•
Starting arcs: For working point i = n 0 , i.e., the driver lounge, and each time instant t ∈ T sign , there exists a starting arc o → ρ t i ∈ A sign . A driver traverses this arc represents that this driver signs in for the duty during the planning horizon, where a fixed cost of ξ k o, ρ t i = f k is incurred when driver k is on-duty. • Ending arcs: For working point i = n 0 , i.e., the driver lounge, and each time instant t = 0, 1, 2 · · · T, there exists an ending arc ρ t i → d . For each driver k ∈ K, ξ k ρ t i , d . This arc allows drivers to complete its operation at time t. • Transfer arcs: There are transfer arcs in network G which represents the situation where a driver has finished dwelling at a working point and is about to leave current working point. There are two types of transfer arcs depending on what the next operation the driver will do. The first type of transfer arc is for the situation where the driver will walk to leave current point. For each working point i ∈ N and The second type of transfer arc is for the situation where the driver will execute a driving task. For each working point i ∈ N o and time instant t = 0, 1, · · · T, there is a transfer arc ρ t i →ρ t i of this type if there exists one driving task r such that i = o r and t = p r . For each . This arc allows driver k to walk from working point i to working point j.

•
Waiting arcs: For each working point i ∈ N and time instant This arc allows a driver to wait at working point i when he/she is not working.

•
Driving arcs: For each pair of working points i ∈ N o and j ∈ N d , and time in- π r if task r is a driving task at a cleaning track. This arc allows driver k to shunt a train from one track to another or drive a train at a cleaning track. The cost coefficient includes not only the operating cost γ k (t − t) but also a cost reduction of π r since task r would not be canceled if task r is executed by driver k. • Dummy arcs: For the working point that related to the driver lounge, there is a dummy arc o → d . A driver k traverses the dummy arc means the driver has no work to do during the planning horizon, we have ξ k (o, d) = 0.

Constraints
A path from vertex o to vertex d in the time-space network G corresponds to a duty for depot drivers. A duty is feasible for depot driver k ∈ K if all cost coefficients of driver k along this path are finite. The objective of this problem is to find feasible paths for all depot drivers such that the total cost is minimized. The path should satisfy the constraints in Section 3.2. So, besides the standard network flow constraints such as flow conservation constraints and supply/demand constraints, our multi-commodity flow model also has the following constraints: • Driving task operation requirements: For each r ∈ R, the driving task r is executed at most once if it is uncanceled. Therefore, for each r ∈ R, we impose the constraint that the depot driver k s flow in the arc subset is at most one.
• Maximum duty time requirements: For each k ∈ K, the duty time cannot exceed the maximum allowed working time for drivers during the planning horizon if the driver is on duty. For each arc w → d ∈ A , we denote an arc subset as follows: in case of w = o, and For each k ∈ K, if driver k traverses arc w → d ∈ A , then this driver must traverse an arc in arc in C 2 w exactly once.

Time-Space Network Formulation
With the developed time-space network, we formulate the studied problem using a network flow model, where for each driver k ∈ K and u → v ∈ A , we use decision x k uv to indicate whether driver k traverses (x k uv = 1) arc u → v or not (x k uv = 0). The minimum cost multi-commodity network flow model for the considered problem is formulated as below: x k uv ∈ {0, 1} , for all k ∈ K, u → v ∈ A In the objective function (5), the constant term "∑ r∈R π r " is the total cancellation penalty of all driving tasks, and the term "∑ k∈K ∑ u→v∈A ξ k (u, v)x k uv " is the total cost of the solution less the cancellation penalties saved by successfully completing driving tasks. Then, objective function (5) represents the total cost of the solution. Constraints (6) are the supply constraints which require the outflow of each driver at vertex o to be 1. Constraints (7) are the demand constraints which require the inflow of each driver at vertex d to be 1. Constraints (8) are the flow conservation constraints for drivers at each vertex. Constraints (9) guarantee that each task is performed at most once. Constrains (10) required that the drivers must work no more than the specific time if he/she is on-duty. Constraints (11) are the binary constraints of the decision variables.

Lagrangian Relaxation Heuristic
Lagrangian relaxation provides an efficient mean to find optimality bounds for largescale integer linear programs that permits us to decompose problems to exploit their special structure. Lagrangian relaxation has been widely used to solve railway planning problems; for example, see Dauzère-Pérès et al. and Xu et al. [24,25].

Lagrangian Relaxation
We relax constraints (9) and constraints (10) of problem P by Lagrangian way, and bring them into the objective function with Lagrangian multipliers λ r ≥ 0 for each r ∈ R and µ k wd for each k ∈ K and w ∈ V d . We obtain the following relaxed problem, where λ is the vector of the λ r values, and µ is the vector of the µ k wd values.
∑ {u:u→v∈A} Furthermore, after removing the constant item " ∑ r∈R π r − ∑ r∈R λ r ", the Lagrangian relaxation problem can be decomposed into |K| independent problems. The subproblem corresponding to each k ∈ K is given as follows x k uv ∈ {0, 1} , for all u → v ∈ A Obviously, each subproblem P k (λ, µ) is a standard shortest path problem with arc length δ k uv = ξ k (u, v) + ∑ {u→v∈C 1 r :r∈R} λ r + ∑ {w∈V d :u=w,v=d} µ k wd − ∑ {w∈V d :u→v∈C 2 w } µ k wd .This shortest path problem can be solved easily with a standard dynamic programming algorithm. Given any vector λ of nonnegative λ r values and vector µ of nonnegative µ k wd values, a lower bound on the optimal objective value of problem P can be obtained by solving the relaxed problem P(λ, µ). To provide a tight lower bound, we would need to solve the following optimization problem max λ,µ P(λ, µ) which is referred to as the Lagrangian multiplier problem associated with original optimization P. If drivers are heterogenous, subproblems P k (λ, µ) can be solved in parallel for different k ∈ K when they are solved by a multi-core computer processor.

Upper Bound Heuristic
In this section we present an upper bound heuristic algorithm, which contains two phases. In the first phase, we use a greedy algorithm to solve the problem P which can be considered as a shortest path problem of resource constraints. We solve the shortest path problem considering the maximum schedule duration time for each k ∈ K with revised arc length δ k uv following the method used in Xu et al. [25]. For each k ∈ K, we first solve the shortest path problem without considering maximum schedule duration constraints using a dynamic programming whose computational complexity is O(n), where n is the number of arcs in the time-space network. If the obtained assignment scheme for driver k satisfies the maximum schedule duration constrain, we will set the cost of the tasks assigned to the driver to infinite for avoiding this task will be covered by another driver. In contrast, if the obtained assignment scheme for driver k violates the maximum schedule duration constrain, we temporarily block the tasks whose start time is less than the start time of the first task or whose start time is no less than the start time of the last task in the obtained assignment scheme. Then, we continue to solve the shortest path problem to get an assignment scheme for driver k. If the re-obtained assignment scheme satisfies the maximum duration constraint, we will release the tasks that are temporarily blocked and then block the tasks which are assigned to the driver permanently. Otherwise, we repeat the process above till find a feasible solution.
In the second phase, we try to use local search to improve the solution obtained in the first phase. The computational complexity of local search is obvious O(n log n), as there are exchange, swap, and insert operators, where n is the number of driver tasks. We then added a sentence. The operation that local changing a solution s to a neighbor s in neighborhood N(s) of solution s is called move operator. In this paper, we defined the following local search moves which are enlightened by Ma et al. [26]. It is worth noting that the specific move operator can be conducted only when the time permits.

•
Exchange operator: Given two drivers' duties, choose one task in each duty of the drivers, and exchange the task with the subsequent tasks of the two duties. The procedure of this move is illustrated in Figure 3. The original duty 1 contains task A, B, and C sequentially, and the original duty 2 contains task D, E, and F sequentially, see Figure 3a. When conducting the "exchange" move, we exchange the tasks after task A in duty 1 and the tasks after task D in duty 2. After the "exchange" operator, duty 1 will contain task A, E, and F sequentially; duty 2 will contain task D, B, and C sequentially, see Figure 3b. • Insert operator: Given two drivers' duties, choose one task and delete it in one of the duties; insert the task into an appropriate position in the other duty. The procedure of this move is shown in Figure 4. The original duty 1 contains task A, B, and C sequentially; the original duty 2 contains task D and E sequentially. When conducting the "insert" move, we delete task B in duty 1 and insert it into an appropriate position in duty 2 (such as between task D and task E in duty 2). After the "insert" operator, duty 1 will contain task A and C sequentially; duty 2 will contain task D, B, and E sequentially. • Swap operator: Given two drivers' duties, choose one task and delete it in one of the duties; insert the task into an appropriate position in the other duty. The procedure of this move is illustrated in Figure 5. The original duty 1 contains task A, B and C sequentially; the original duty 2 contains task D and E sequentially. When conduct the "swap" move, we delete task B in duty 1 and insert it into an appropriate position in duty 2 (such as between task D and task E in duty 2), delete task E in duty 2 and insert it into an appropriate position in duty 1 (such as between task A and task C in duty 1). After the "swap" operator, duty 1 will contain task A, E and C sequentially; duty 2 will contain task D, B and F sequentially. . When conducting the "exchange" move, we exchange the tasks after task A in duty 1 and the tasks after task D in duty 2. After the "exchange" operator, duty 1 will contain task A, E, and F sequentially; duty 2 will contain task D, B, and C sequentially, see Figure 3b. • Insert operator: Given two drivers' duties, choose one task and delete it in one of the duties; insert the task into an appropriate position in the other duty. The procedure of this move is shown in Figure 4. The original duty 1 contains task A, B, and C sequentially; the original duty 2 contains task D and E sequentially. When conducting the "insert" move, we delete task B in duty 1 and insert it into an appropriate position in duty 2 (such as between task D and task E in duty 2). After the "insert" operator, duty 1 will contain task A and C sequentially; duty 2 will contain task D, B, and E sequentially.  • Swap operator: Given two drivers' duties, choose one task and delete it in one of the duties; insert the task into an appropriate position in the other duty. The procedure of this move is illustrated in Figure 5. The original duty 1 contains task A, B and C sequentially; the original duty 2 contains task D and E sequentially. When conduct the "swap" move, we delete task B in duty 1 and insert it into an appropriate position . When conducting the "exchange" move, we exchange the tasks after task A in duty 1 and the tasks after task D in duty 2. After the "exchange" operator, duty 1 will contain task A, E, and F sequentially; duty 2 will contain task D, B, and C sequentially, see Figure 3b. • Insert operator: Given two drivers' duties, choose one task and delete it in one of the duties; insert the task into an appropriate position in the other duty. The procedure of this move is shown in Figure 4. The original duty 1 contains task A, B, and C sequentially; the original duty 2 contains task D and E sequentially. When conducting the "insert" move, we delete task B in duty 1 and insert it into an appropriate position in duty 2 (such as between task D and task E in duty 2). After the "insert" operator, duty 1 will contain task A and C sequentially; duty 2 will contain task D, B, and E sequentially.  • Swap operator: Given two drivers' duties, choose one task and delete it in one of the duties; insert the task into an appropriate position in the other duty. The procedure of this move is illustrated in Figure 5. The original duty 1 contains task A, B and C sequentially; the original duty 2 contains task D and E sequentially. When conduct the "swap" move, we delete task B in duty 1 and insert it into an appropriate position in duty 2 (such as between task D and task E in duty 2), delete task E in duty 2 and insert it into an appropriate position in duty 1 (such as between task A and task C in sequentially; the original duty 2 contains task D and E sequentially. When conduct the "swap" move, we delete task B in duty 1 and insert it into an appropriate position in duty 2 (such as between task D and task E in duty 2), delete task E in duty 2 and insert it into an appropriate position in duty 1 (such as between task A and task C in duty 1). After the "swap" operator, duty 1 will contain task A, E and C sequentially; duty 2 will contain task D, B and F sequentially. We adopt some ideas of the paper of Hoogeboom et al. [27] when we use above moves to generate new duties, it probably generates infeasible solutions. It is worth pointing out that Hoogeboom allows the violation of constraints to exist by adding a penalty to the infeasible solution to reach different areas of the solution space. In this paper, we do not allow infeasible solutions to exist. Thus, before performing a move operation, we will check the feasibility of the move. In the local search, we explore the three different neighborhoods which are in increasing order of complexity. If an improved solution is identified, the search will restart at the first neighbor of the new solution found. The local search We adopt some ideas of the paper of Hoogeboom et al. [27] when we use above moves to generate new duties, it probably generates infeasible solutions. It is worth pointing out that Hoogeboom allows the violation of constraints to exist by adding a penalty to the infeasible solution to reach different areas of the solution space. In this paper, we do not allow infeasible solutions to exist. Thus, before performing a move operation, we will check the feasibility of the move. In the local search, we explore the three different neighborhoods which are in increasing order of complexity. If an improved solution is identified, the search will restart at the first neighbor of the new solution found. The local search will finish if all neighbors are explored. The pseudocode for this local search is given in Algorithm 1. Because the local search method is time-consuming, we execute the second phase with a certain probability after obtaining solutions in the first phase. The overall framework of the upper bound heuristic algorithm is shown in the Algorithm 2.

Algorithm 2 Framework of the upper bound heuristic
Input: Driver set K, tasks set R, the probability of local search p L 1:use the greedy heuristic ub_greedy (K, R) to obtain solution s 2:randomly generate p from (0,1) 3:if p ≤ p L then 4: s ← local_search(s) Output: s

Subgradient Optimization Procedure
In this section, we present a subgradient optimization procedure which is used to search the near-optimal value of λ r and µ k wd . In the iteration of the subgradient procedure, the value "∑ k∈K ∑ u→v∈C 1 r x k uv − 1" for each r ∈ R and the value "x k wd − ∑ u→v∈C 2 w x k uv " for each k ∈ K and w ∈ V d form a subgradient vector η = η 1 , · · · , η |R| , η |R|+1 , · · · , η |R|+|V d | of the relaxed solution.Let η l (respectively λ l and µ l ) denote the η (respectively λ and µ) vector in the lth iteration of the procedure let η l m be the mth component of η l for m = 1, 2, · · · , |R| + |V d |, let λ l m be the mth component of Lagrangian multiplier vector µ l for m = 1, 2, · · · , |V d |. In the initial iteration, the components in η are all initialized as 0, and the Lagrangian multipliers are all set to 0. In the following iterations (l > 1), we update each multiplier according to the following formulas, e.g., see Xu et al. [25].
The procedure of each iteration of the subgradient optimization is described as follows: (i) obtain a relaxed solution of problem P by solving |K| shortest path problems P k (λ, µ); (ii) obtain a feasible solution of problem P using the upper bound heuristic presented in Section 4.2; (iii) identify constraints that violated by current relaxed solution; (iv) update the subgradient vector; and (v) update the Lagrangian multipliers. Because part (ii) is time-consuming, we may skip this part in some iterations to save computation time. This subgradient optimization procedure is terminated when one of the following situations occurs: (i) the gap between the upper bound and lower bound is below a prespecified threshold; (ii) the computational time reaches a prespecified limit; or (iii) the number of iterations reaches a prespecified limit. See Section 5 for more details regarding parameter settings.

Computational Study
In this section, we conduct computational experiments to test the method we presented in this paper. In Section 5.1, we introduce the generation method of test instances and the parameter setting. In Section 5.2, we conduct a computational study to evaluate our model and method. All the test instances are compiled with C# Language using Visual Studio 2019 and run on a personal computer with a 3.70 GHz Intel Core i9-10900k processor and 32 GB of internal memory.

Generation of Test Instances
We adopt two different sizes of depot networks to design instances to test the effectiveness of the proposed method in this paper. Specifically, the first depot network, namely Network 1, is originated from the network of Shanghai South Depot in China, see Figure 1. Network 1's track layout is of parallel-arrangement type. It has 4 repairing tracks, 2 cleaning tracks, and 9 storage tracks with 31 nodes (including a node that represents the driver lounge). Considering the development of high-speed railway and the expansion of the depots, we extend the current network of Shanghai South Depot. The extended depot network, called Network 2, has 8 repairing tracks, 4 cleaning tracks, and 18 storage tracks as well as 61 nodes (including a node that represents the driver lounge); for more details, see Figure A1.
In our computational study, the input parameters are estimated based on the characteristics of Shanghai South Depot in China. We first test a set of instances with the same task size while different driver sizes in Network 2 to determine a proper ratio of task size to driver size. We here consider one task size of |R| = 160 and five driver sizes of |K| = 8, 10, 12, 14, 16. For each combination of task size and driver size, we randomly generate 5 instances, which gives 25 test instances. After determining such ratio, we then consider three task sizes with |R| = 40, 80, 120 for Network 1, and three task sizes with |R| = 160, 200, 240 for Network 2. Since there are four driving tasks, including three shunting tasks and one cleaning task for each EMU train that is performed a level-one maintenance. We then need to consider EMU train shunting schedules with three train sizes of 10, 20 and 30 for Network 1, and three train sizes of 40, 50 and 60 for Network 2. For each task size, we generate 5 instances by randomly generating 5 EMU train shunting schedules, which gives another 30 instances. For each test instance with these two networks, we set the length of the planning horizon to T = 960 min, e.g., from 16:00 of one day to 08:00 of the next day, which contains two crew shifts. We consider two sign-in time windows for drivers, including [0, 60] and [480, 540], i.e., T sign = {0, 1, · · · , 60, 480, 481, · · · , 540 }. The maximum allowed working time τ for each driver is set to 480 min.
For each test instance, we generate train shunting and cleaning tasks as follows. Firstly, for each considered EMU train ι the arrival time a ι at the depot is randomly generated from a discrete uniform distribution between 20 and T − 180, the departure time from the depot is randomly generated from a discrete uniform distribution between a ι + 180 and T − 20. Here, the time of 20 min is the minimum required walking time for drivers and the time of 180 min is the minimum required in-depot time for EMU trains. Secondly, the time for shunting EMU train ι in the depot is randomly selected from the set {4,5,6}, where the probability of each value being selected is 1/3. The time forcleaning EMU train ι in the depot is randomly selected from the set {20,21,· · · ,30}, where the probability of each value being selected is 1/11. The time for repairing EMU train ι is randomly generated from a discrete uniform distribution between 80 and 100. Thirdly, with these parameters mentioned above, we generate a train shunting schedule by using a greedy first-in-firstserved method. Finally, we can obtain task data on the basis of the generated train shunting schedule, see Section 2.
For each driver k ∈ K, let c denote the unit cost for driver k to shunt trains in the depot, i.e., γ k = c, we set unit cleaning cost δ k = (1.1)c, unit walking cost α k = (1.3)c, unit waiting cost β k = (1.2)c and the fixed attendance cost α k = (10.0)c. Specifically, we set the unit waiting cost in driver lounge as 0.3 times the unit waiting cost outside the driver lounge because drivers can get a better rest in the lounge, and we encourage drivers to go back to the lounge and wait. Moreover, the penalty of canceling driving task r is set equal to (1.2)·[60·max(α, β) + c r ·t r ], where α = max α 1 , · · · , α |K| , β = max β 1 , · · · , β |K| , c r = max γ 1 , · · · , γ |K| , if task r is a shunting task and c r = max β 1 , · · · , β |K| if task r is a cleaning task, as well as t r is the duration of task r. For simplicity, the monetary unit is scaled by setting c = 1.
In our implementation of the Lagrangian relaxation heuristic, we set the parameter θ to 2.0 which will be reduced by 5% if the best lower bound identified shows no improvement for 15 consecutive iterations. If the optimality gap is less than 1.00%, the subgradient optimization procedure is terminated. The prespecified CPU time is set to two hours, and the prespecified maximum iterations is set to 1000. In addition, to save CPU time, for the first 200 iterations of the subgradient optimization procedure, we execute the upper bound heuristic and update UB at each iteration. After 200 iterations, we execute the upper bound heuristic with probability 0.1 at each iteration. Moreover, since local search method is also time-consuming, we execute local search method with probability 0.1 when the upper bound heuristic is executed. Table 2 summarizes the results of the first part of the computational study. The "UD" column reports the number of drivers that do not work during the planning horizon. The column "UT" reports the number of tasks that are not covered by drivers. The column "Gap" reports the optimality gap between the lower boundand the upper bound, which is defined as:

Computational Results
where the UB is the objective value of the corresponding solution method, and LB is obtained by the Lagrangian relaxation heuristic. The "Time (s)" column reports the CPU time (in seconds) used in each test instance. From Table 2, we can see that the number of drivers has an important impact on the optimality gap. From the results of instances with 8 drivers we can see that the optimality gap is approximately proportional to the number of tasks not performed, i.e., the more tasks not performed, the higher the optimality gap. From the computational results of instances with 8, 10, and 12 drivers, we can see that as the number of drivers increases, the optimality gap fails rapidly. From the computational results of instances with 12, 14, and 16 drivers, we can obtain a managerial insight that driver size of 12 seems large enough for 160 tasks, since we cannot reduce the optimality gap by using more drivers. Therefore, we set the ratio of the number of drivers to the number of driving tasks as 3:40 for the instances tested in the second part of our computational study. From Table 2, we can also see that the CPU time for each test instance tend to be larger as the driver size increases. Table 3 summarizes the results of the second part of the computational study. In order to evaluate the improvement of the local search to solutions, we conduct two kinds of upper bound heuristics. One only uses the greedy algorithm to obtain feasible solutions, while the other one further uses the local search method to improve the solutions obtained by the greedy algorithm in the first phase. In Table 3, "NL" denotes the local search is not used in the upper bound heuristic and "LS" denotes the upper bound heuristic used local search. Table 3 shows that our approach is efficient tools that can help railway operators to obtain high-quality schedules for depot drivers. That is, the proposed approaches can not only relieve managers' pressure of scheduling drivers, but also reduce the driver-related cost as much as possible. From Table 3, it can also be observed that local search method can improve the initial solution obtained by greedy heuristic algorithm, especially for those instances with large depot network scale and intensive driving tasks. It shows that the optimality gap improvements obtained by the local search method tend to be larger as the task size and driver size increase with the underlying Network 2. In contrast, for those instances with small depot network and less driving task, the optimality gap improvements are very little, in which most gap improvements are less than 0.5% for the instances with the underlying Network 1. It is probably because the solution space is small for the small-scale instances and the greedy heuristic can obtain a good enough or even the best solution.
From UD and UT columns of Table 3, we can observe that the ratio of task size to driver size is not fixed. Particularly, the ratio of task size to driver size for the small-scale instances is bigger than that for large-scale instances. This coincides with our practice experience. That is, for the small-scale instances where the driving tasks are less, the time duration between two tasks is long, which results in more driver idle time. For the large-scale instances where the driving tasks are intensive, drivers can perform more tasks on average. This result can help railways operators to determine the number of drivers when build or extend EMU train depots. Specifically, from the managerial perspective, drivers could be paid more in a busy depot where there are more driving tasks.
Moreover, we should mention that although the local search can improve the initial solution, it takes a lot of time. Even though we run local search with a probability of 0.1, the upper bound heuristic is still time consuming. Especially, the bigger the instance, the more time local search takes. For the instances with the largest scale, e.g., instances 26-30, the computation time of the algorithm with local search is twice that of the algorithm without local search.

Conclusions
In this paper, we studied a practical depot driver scheduling problem in the railway system that has been noticed by a few researchers. We formulate the problem as a minimum-cost multi-commodity network flow model with integer flow restrictions in a time-space network. We developed a Lagrangian relaxation heuristic for the proposed network flow model and designed an upper bound heuristic with a local search method. We conducted a computational study with a practical underlying railway depot in China. The computational results demonstrate the effectiveness of our solution method. The obtained results also show that our approach can help railway operators to find the preferred ratio of the number of drivers to the number of driving tasks, and drivers could be paid more in a busy depot.
It is worth mentioning that our research has several limitations. For example, though the local search method can improve the initial solutions obtained by the greedy heuristic, the CPU time it requires is long. Hence, one interesting future research topic would be to design a fast and effective heuristic algorithm to solve the problem. Similarly, if the task size is huge, the scale of the constructed time-space would be larger and the feasible path for a driver would be long, which needs more CPU memory, and the computational burden becomes heavy. Therefore, developing mathematical techniques to reduce the network size is also an interesting future research topic. Moreover, in this paper, we do not consider the workload balance of drivers and take the shunting schedule as known input data, so the problem of driver scheduling with the equity consideration and the integrated optimization to depot driver scheduling would also be one of the future research interests. In addition, railway depot operations are vulnerable to unexpected disruptions. Once a disruption occurs, we need to use efficient methods to reschedule drivers in the depot. So, another interesting future research direction is to develop efficient driver rescheduling methods for railway operators.