1 Introduction

The United Nations have estimated that, in 2018, 55% of the world’s population resided in urban areas and that, by 2030, this percentage will reach 60%, with one in every three people living in cities with at least half a million inhabitants (United Nations 2018). One of the keys to maintain a good quality of life in these areas is the reduction of fossil fuel engines on city roads, since they increase pollution and represent a stress factor due to traffic congestion. Having a good and reliable public transport system in place is thus necessary to encourage a shift from private mobility, and urban rail transit plays an important role, serving millions of passengers every day. For example, in 2017, more than 53.7 billion passengers worldwide have used metro systems, with cities like Beijing, New York and New Delhi, in the central places of the top 10 busiest metro systems, for an average of 1.8 billion passengers in that year (UITP 2018).

It is thus very important to produce good plans of operations for urban rail transit. The planning process often follows a hierarchical decision-making approach (Bussieck et al. 1997), with three different decision levels: (i) strategic, where decisions regarding infrastructure expansion or modification are taken, as well as line planning ones, where routes, frequencies and stop patterns are designed (Schöbel 2012; ii) tactical, where the use of the fixed infrastructure is planned in terms of services provided (Caimi et al. 2017; Harrod 2012; Kroon et al. 2009); (iii) operational, where, on a daily basis, adjustments to the plans concocted at tactical levels are taken when required (Samà et al. 2017).

Looking at the tactical level, the aim is to provide a comprehensive good plan of operations where all aspects of daily train services are considered. Providing such a plan is a quite complex and difficult task, and often the overall process is decomposed in a series of problems, such as: train timetabling, where departure and arrival times at each station of a certain network for each required train service are provided (Cacchiani and Toth 2012); rolling stock assignment and circulation, where it is decided which rolling stock serves which train service, how they move from/to the depot and how they circulate when used by different train services (Alfieri et al. 2006; Peeters and Kroon 2008); crew scheduling, which determines engine drivers and other company staff arrangements (Caprara et al. 1997); passenger assignment, which match in-vehicle passengers and number of seats available in a specific rolling stocks (Binder et al. 2017); maintenance scheduling, where plans for regular maintenance both on the infrastructure and on the rolling stocks are crafted to minimize disservice (Gaudry et al. 2016; Giacco et al. 2014); and so on.

The outcome of a stage provides inputs or constraints to the subsequent ones. The output is often of good or optimal quality at each stage, but it is rarely globally optimized for the overall planning process (Schöbel 2017). For example, train timetabling and rolling stock scheduling are usually studied separately, one after the other. However, during the process of rolling stock assignment and circulation, with departure and arrival times at stations provided by the train timetabling, it may be impossible to cover some services as they are with a specific rolling stock. It thus requires to either adjust the schedule or cancel some services. In short, the separation between these two stages leads to a re-optimization procedure, which may increase the computational effort. Furthermore, several stakeholders may be involved in the decision process, with different objectives that may not always align. For example, infrastructure managers are usually interested in minimizing their costs and maximizing their profit, while different customers prioritize their own comfort. In order to mitigate the gap between solutions for different aspect of the same problem and improve the quality of the overall solution, integrating approaches have been studied.

In the literature, there is no generally recognized objective functions for train timetabling. Various indicators are considered as valid, among which several linked to passengers satisfaction (Sun et al. 2014; Barrena et al. 2014a). To generate a timetable that maximizes the passengers’ satisfaction, it is vital to satisfy their travel demand. Since in practice travel demand is not uniformly distributed, but varies with a level of heterogeneity both from a temporal and a spatial point of view, it should be considered in terms of where it happens, when, and with which volume. Detailed travel demand data are also a significant foundation in operation analysis and timetable validation, besides its importance for timetable generation. Nowadays, such data are easier to acquire and analyze, thanks to the wide spreading of smart card-based automated fare collection systems (AFC), which mark passengers in terms of their origin-destination stations and their permanence time in the system (Zhao et al. 2007). Passengers data can be used to bridge the gap between the demand and supply in urban rail transit schedule generation. From each passenger’s specific perspective, to complete his/her trip, each one has to compete with the others for the limited supplied space (specifically the train capacity), especially during peak hours. It is critical to analyze which passengers can board on a specific train and which have to wait. For example, if a passenger boards on a train at his/her original station, then another at a subsequent one may not be able to due to train capacity limitation. Briefly, each passenger’s choice of boarding trains performs an interference on others’. However, as a result of the large volume of passengers in a urban rail transit network, modeling each passenger’s behavior is a consuming process, even when in possession of all required data. In fact, passengers’ specific choices of boarding certain trains are not considered in the majority of existing studies on demand-oriented train timetabling, which generally prefer a minor level of details for a more general overview of the demand during the planning phase. Aggregating passengers according to the same value of time/stations is a typical solution to handle such a big amount of data: some works aggregated passengers that enter the system from the same origin station (Sun et al. 2014), some consider also the passengers destination (Zhu et al. 2017) together with their arrival time at origin (Wang et al. 2018; Li et al. 2019) or the time window in which they travel in the system (Niu and Zhou 2013; Mo et al. 2019), while others disregard their origin-destination, bundling passengers passing in the same section between two stations at a certain time (Yue et al. 2017).

Looking instead at rolling stocks, they represent one of the most significant components of operating costs: their purchase, power consumption and life-cycle maintenance are involved as main goals during rolling stock scheduling (Peeters and Kroon 2008; Canca et al. 2014; Alfieri et al. 2006). Several types of rolling stocks exist that can be used on the same infrastructures, but their related cost varies, as well as their associated capacity. Thus, on the one hand, rolling stock optimization could be enriched with passenger demand data. Taking the typically high demand during peak hours as an example, if there are multiple rolling stock types characterized by different capacities, the timetable could be optimized not only by lessening train headway and reducing running time, increasing the frequency of services, but also by using large-capacity rolling stock. However, the same choice may result in wasted capacity at other times. Since rolling stocks have usually pre-fixed compositions in urban rail transit system (Wang et al. 2017b), we consider neither composition changes, nor coupling and decoupling. With a given fleet composed of different rolling stock types, the critical decisions on how many rolling stocks are necessary, of which type and how best to use them should be carefully determined. On the other hand, rolling stock constraints could be also included during the design of the timetable, not just in terms of which rolling stock to assign to which service, but also regarding their circulation in the network. Such integration in rail planning is highly meaningful in practice, since it gives the precise movements of rolling stock in the network and their relation to the different train services each covers.

Generally speaking, in order to integrated more aspects in the definition of a timetable, an aggregated level of detail is often reserved for the train movements (Cadarso and Marin 2012), passenger demand (Sun et al. 2014; Wang et al. 2018, 2017b), rolling stock loading capacity (Barrena et al. 2014a; Mo et al. 2020) or their specific allocation (Liu et al. 2020) and circulation (Wang et al. 2017a). This allows to obtain a more extended plan, engulfing larger portion of time, but risks to produce plans that are not actually employable in reality, without a post-processing adjustment. Validations of these plans are thus required, where all the different aspects are assumed at a higher level of detail to prove the validity of the general overview on more specific time horizons, reduce the inconsistency that may incur during operation.

The aim of this paper is to analyze how the integration of aspects regarding rolling stock and passenger assignment during the train timetabling process may result in terms of solution quality. We show how generating an integrated schedule allows to find a good feasible solution rather than an infeasible one as sequential approach risk to do, without the necessity for redundant re-optimization phases and adjustments. Furthermore, a microscopic level of detail is used to consider passengers and train movement, taking full advantage of AFC provided data. Hence, we present an integrated optimization of train service timetabling and rolling stock scheduling on a bidirectional urban rail transit line, in which time-varying origin-destination-dependent passenger demand and heterogeneous rolling stock types are taken into consideration. Specifically, the departure time of every train service at every station, assignment for each group of passengers, the heterogeneous rolling stock assignment and rolling stock circulation plan are optimized synchronously. Firstly, a multi-objective mixed-integer linear programming (MILP) model is proposed, which aims to minimize operating costs and waiting time for passengers. As a result of the problem complexity, a heuristic method is presented to return a good-quality solution.

The rest of this paper is organized as follows. In Sect. 2, we review related literature on train timetabling, rolling stock scheduling and passenger assignment. In Sect. 3, the detailed description and main assumptions of the problem we investigate are provided. In Sect. 4 the optimization model for the integrated train timetabling is formulated, while Sect. 5 designs the algorithms to solve the proposed model. In Sect. 6, numerical experiments are conducted on Chongqing Rail Transit Line 2. Finally, conclusions and further studies are provided in Sect. 7.

2 Literature review

The timetabling problem for railways was first proposed by Amit and Goldfarb (1971). Since then, several works have been dedicated to study the timetabling problem in the literature, with several variants proposed. For example, some works study the cyclic timetable, while others concentrate on the non-cyclic one. Since periodic event scheduling problem (PESP) was first proposed by Serafini and Ukovich (1989), various studies investigate the optimization of cyclic timetable using PESP as foundation (Liebchen 2008; Kroon et al. 2008; Zhang et al. 2019). The cyclic timetable has the advantage of being easily memorized by passengers, but since it is operated in the same way for peak and non-peak hours, it may result in higher operating costs (Cacchiani and Toth 2012). To improve these costs and obtain a schedule more in line with train operators desire, the non-cyclic version of the timetabling problem has begun to become more popular in the literature (Brännlund et al. 1998).

Another main feature that differentiates studies on timetabling regards the objective function to be optimized. It is common to optimize objective functions related to operators’ expectations such as minimizing the deviation or maximizing the profit compared to an ideal timetable (Caprara et al. 2002) or the deviation from a desired frequency (Bampas et al. 2006; Wang et al. 2017b). Furthermore, with respect to infrastructure capacity and operating costs, objective functions related to the minimization of energy consumption (Gupta et al. 2016) have also been considered.

Additionally, the objective function can be used to look at passengers during the timetabling design. In this case, they usually relate to the minimization of their total travel time (Sun et al. 2014; Wang et al. 2015; Zhang et al. 2018), total (Niu et al. 2015; Barrena et al. 2014a) or average waiting time (Barrena et al. 2014b), number of passenger waiting (Niu and Zhou 2013) or stranded at station (Liu et al. 2020).

In practice, passengers can be often characterized by four attributes relating to their trip in the urban rail transit system: stations of origin and destination and the related arrival times, collected by AFC systems (Zhao et al. 2007). However, due to the high number of passengers in public transport system and the related computation complexity of modeling each passenger’s behavior, in the literature passengers data are often aggregated. Generally speaking, this aggregation can be: (i) Origin-Destination (OD) based, where not just the origin but also the destination station of each passenger is known, together with their arrival time in the system. Such representation of passengers allows for a very detailed representation of passenger demand in the model, which could require a high computational effort (Mo et al. 2020; ii) Rate based, where the demand is defined by the passenger arrival rate at each origin station, computed as the total number of arrived passengers in a certain time period. In this case, the destination stations are not specified, which means that all passengers arriving at the same origin station are undifferentiated and their route in the network cannot be addressed (Niu and Zhou 2013; Wang et al. 2015); (iii) Section-based, in which the passenger travel demand is described as travel volume between two consecutive station, i.e., a section, in a certain time horizon, but data regarding the actual origin and destination of passengers are disregarded (Wang et al. 2018; Yue et al. 2017).

Even though passengers can be aggregated by the same value of attributes, which attributes to selected relate to model assumptions and the objective function used. If the objective functions involve passenger waiting time or travel time, the arrival time stamp at origin station is inevitable (Li et al. 2019). Instead, if the objective relates to punctuality at destination, the passengers are to be grouped by their arrival time at destination (Hamdouch and Lawphongpanich 2008; Zhu et al. 2017). Moreover, the precise calculation on passenger waiting time requires each passenger’s origin, destination, and the arrival time at his/her departure station, i.e., the time-dependent OD-based data. As a result of the complexity of modeling each passenger’s behavior, researchers generally discretize time and aggregate demand by grouping together passengers entering the system in the same time interval. As for the discrete time unit, a smaller value contributes to a more precise representation of demand, but also to a higher complexity of the mathematical model. Yet, there is no generally recognized length of the time unit for passenger aggregation or for timetable optimization: some use 1 min as a time interval length (Sun et al. 2014; Binder et al. 2017), some use 30 s (Mo et al. 2020), and others 15 (Yue et al. 2017; Mo et al. 2019). To decide passenger’s choice of boarding or not a train, either user equilibrium or system equilibrium has been used in the literature (Binder et al. 2017). For a detailed discussion regarding this, we refer the interested reader to (Tong and Wong 1999; Binder et al. 2017). As we aim to generate a train timetable and rolling stock schedule that mediates between passengers and operators point of view, the collaboration among passengers is assumed implicitly in this study.

Regarding the models and methods for train timetabling driven by the demand, Niu and Zhou (2013) formulate a mixed integer nonlinear program (MINLP) for regular train timetable on an over-saturated urban transit line, with time-dependent origin-destination passenger demand. This work is extended in Niu et al. (2015), with a predefined stop pattern on a non-saturated rail line with flexible train running and dwelling times. Barrena et al. (2014a) proposed three formulations for demand-driven train timetabling, aimed to minimize total passenger waiting time. In Barrena et al. (2014b) instead, cumulative passenger demand is used, and the proposed nonlinear programming model for minimizing average passenger waiting time is handled by an adaptive large neighborhood search meta-heuristic. Wang et al. (2015) studies the effectiveness of event-driven model for the timetabling problem, considering train departure and arrival events together with timed passenger arrival rates. Sun et al. (2014) proposed three models to design a demand-sensitive urban rail regular timetable, indicating that considering carriage capacity is more advantageous and shorter time unit could result in better solutions; however, the computation time and the accuracy of passenger demand become crucial factors for application. In Zhang et al. (2018), the MINLP model is formulated to generate an irregular timetable with cumulative OD-independent passenger demand and a predefined alighting ratio at stations, and a simulated annealing controlled adaptive large neighborhood search algorithm is proposed. Li et al. (2019) consider the trade-off of efficiency and fairness in irregular timetables and propose a MIP model to minimize total passenger waiting time for the cumulative passenger demand and a simulated annealing-based adaptive large neighborhood search meta-heuristic. These approaches have limited comprehensiveness and applicability since the section running time and dwelling time are considered as predefined constant in the model. Furthermore, they regard carriage capacity as always available. In addition, the passengers’ specific choice of boarding trains and their waiting time cannot be calculated accurately while considering rate-based or time-independent passenger demand.

Table 1 Comparison of relevant publications in terms of model and methods

Other works instead focus on the link between the timetabling and the rolling stock scheduling problems. Some use the timetable as input and then compute which rolling stock should be assigned to each service, together with how these rolling stocks circulate in the network (Alfieri et al. 2006; Peeters and Kroon 2008). To improve the quality of the timetable and minimize the risk of infeasibility when passing from one problem to the other, a number of authors have studied ways to integrate the two. Cadarso and Marin (2012) include rolling stock constraint in their rapid transit network timetabling problem, considering also shunting operations. Wang et al. (2017a) propose a two-stage model where a sequential quadratic programming algorithm and CPLEX are adopted to handle the combined timetabling and rolling stocks circulation problems, while Wang et al. (2017b) focus on producing a regular timetable which includes train schedule and circulation plans. Liu et al. (2020) present a MILP model for train timetabling in which train connection is also considered, with objective minimizing train service in connection, awaiting passenger number and the amplitude of passenger flow control actions. Zhu et al. (2017) instead propose a bi-level model where the OD-based passenger demand and carriage capacity are jointly considered. Yue et al. (2017) studies several network layouts which may include multiple depots and propose a bi-level model for train timetabling and rolling stock scheduling. Mo et al. (2020) integrate energy-efficient train timetabling with rolling stocks circulation in off-peak hours with two depots at both ends of the line and aimed to maximize the regenerative energy utilization and train service connections. These studies clearly indicate the practical role of integrating the two problems while considering different rail line layouts. However, often homogeneous rolling stocks are considered, while the benefits of heterogeneous types are neglected. As an exception, Mo et al. (2019) formulate a nonlinear integer programming model for train timetabling with various type of rolling stocks, aiming to minimize the total energy cost and passenger waiting time in situation of not-over-saturation. However, the bidirectional traffic is tackled separately, thus not taking into account the rolling stock circulation.

To summarize, Table 1 presents the most relevant works listed above, to highlight which aspect of train timetabling, rolling stock circulation, heterogeneous rolling stock assignment and passenger demand have been integrated and how, in terms of type of integration, infrastructure layout, travel demand consideration, train capacity incorporation, fixed or flexible running and dwelling times. With respect to the achievements and gaps in the literature, we propose an innovative mathematical model that optimizes train timetabling and circulation of heterogeneous rolling stock synchronously, and aims to improve passengers’ satisfaction and decrease operating costs, where the assignment of time-based OD-dependent passengers is jointly considered.

3 Problem description and assumption

Urban rail transit networks are usually comprised of several lines, each consisting of two parallel tracks dedicated to opposite travel directions. A line traverses several stations, each possessing two platforms, one for each direction. The two physical end stations in a line are defined as terminal stations. At the beginning of daily operations, rolling stocks are stored in a depot located nearby one of the stations on the line. A depot is physically connected to its line by coming in/going out track segments. Trains travel from one terminal station to the other, stopping at intermediate stations to allow for passengers boarding and alighting. When reaching a terminal station, a train can performed a turnaround maneuver using tracks connecting the two platforms of the station in order to change its running direction. The time required by a train to travel from one station to the subsequent one is called running time, while the one dedicated to a turnaround maneuver is referred to as turnaround time. Also, we define dwell time as the waiting time a train performs at a station platform to allow for the boarding and alighting of passengers. Furthermore, to abide safety regulations, a separation among trains needs to be ensured, which is translated in a headway time between the use of a track resource by two subsequent trains.

A train timetable describes how a train should run in the network during its daily schedule. Since the depot can be connected to any station on the line, we define a full-length train service as the round trip a train performs from the station to which the depot is connected back to it, performing stops on both directions throughout all the other stations of the line. Each service needs to be described in terms of its departure time from each stop, i.e., the time at which the service leaves a station, its running, turnaround and dwell times, together with the headway it requires to maintain with the other trains, all chosen in a range between a minimum and a maximum value. The minimum running and turnaround times required to travel between two consecutive station platforms depend on the maximum speed that can be reach in that specific track section. Moreover, the maximum running and turnaround times together with the minimum and maximum dwell times are linked to the minimal desired service quality.

A train service is performed by a physical rolling stock. More than one type of rolling stock may be used on a single line, each characterized by a certain capacity and operating cost. Obviously, a train service needs only one rolling stock to conduct its operations and can be served by only one type of rolling stocks. A rolling stock instead can and should be assigned to more than one train service, but all the train services served by the same rolling stock cannot travel on the line at the same time. Each service thus needs to be linked to a specific rolling stock, which can either wait for the start of the service in the depot or can be inherited by a previously concluded train service.

Passengers are allowed to board and alight when a train is in service, specifically when it stops at a station platform, but not before it departs from or after it goes back to the depot. Each passenger can board a service at his/her origin station in order to then reach a certain destination station, but only if the capacity of the service allows for it. The time a passenger has to wait at a station platform before is able to board on a service is defined as passenger waiting time.

To achieve a safe and accessible service, a timetable needs to be carefully crafted in such a way that all traffic regulations are satisfied while obtaining a suitable quality of service for passengers. Often the train timetabling, rolling stock assignment and circulation and the passenger assignment are problems that are tackled separately, frequently in cascade. However, the solution for one of these problems may be infeasible for the others, requiring the whole solution process to start anew. Furthermore, their objectives may be opposite and difficult to consider simultaneously. To generate a good schedule on urban rail line with high satisfaction for both operators and passengers, costs and profits of passengers and operators should be taken into consideration. On the one hand, minimizing total waiting time for passengers needs high service frequencies, which requires as much train services as possible to simultaneously travel on the line, and thus more rolling stocks. On the other, operators try to minimize their operating costs by using as few rolling stocks as possible, preferring the types of rolling stocks requiring less operating costs and minimizing the number of times they entry/exit to/from the depot. More train service connections mean less rolling stocks involved since they keep circulating on the line.

Our aim is to consider these problems integrated and obtain a suitable trade-off solution. We want to provide a reliable timetable in which the operating costs, expressed as cost required to use a certain type of rolling stock for a service, and passenger dissatisfaction, expressed as their waiting time at a platform before being able to board on a service, are minimized. We also consider the following assumptions for the problem under study:

  • Assumption 1 Discrete time instants are used to characterize temporal features. Passengers arrive at their origin stations at the end of every time instant. The origin and destination-based passenger demand is presented by a time-variant matrix;

  • Assumption 2 The stop pattern of all train services is fixed. Due to high volume and density of passengers travel demand, the urban rail transit line is normally served by stop-by-stop train services. Therefore, we assume all train services stop at every station, i.e., the skip-stop pattern is not considered in this paper;

  • Assumption 3 In our problem, we consider the general case in which the depot is not necessarily connected with a terminal station. In our work, the depot can be connected to any station, including an intermediate one. All rolling stock is stored in the depot when not in service, and the depot is of sufficient capacity to accommodate multiple rolling stocks at the same time. Thus, if a rolling stock goes back to depot, all passengers on that rolling stock should have to get off the train. For passengers it is too inconvenient to interrupt their journey, so passengers groups are not allowed to board a train directed back to the depot when their destination is a subsequent station;

  • Assumption 4 The stations do not have sidetracks, i.e., branches on the tracks to allow for train overtaking. For each operating direction, only one track exists in a section between two adjacent stations. Therefore, overtaking between train services is not permitted, tracks between stations can accommodate only one train at a time and no more than one services can dwell at a station platform at the same time.

Table 2 Set, parameters and indices for model formulation
Table 3 Variables for model formulation

4 Model development

In this section, we present the mathematical formulation for the researched problem. Firstly we introduce the notations in Table 2 and variables in Table 3 that areused throughout this section, then the mathematical model with objective and constraints is presented, and model complexity is analyzed at last in Table 4.

4.1 Model objective

We consider as objective function the minimization of the costs for passengers as well as operators in the timetable. We combine operating costs and passengers dissatisfaction with the quality of service; thus, the objective consists of three parts:

$$\begin{aligned} \begin{aligned} \min Q&= \omega _1 \sum _{t\in T} \sum _{o \in S} \sum _{d \in S} \sum _{i \in I} B_{tod}W_{todi} \\&\quad +\, \omega _2 \sum _{i \in I} \sum _{j \in J} \sum _{n=1}^{N_j} x_{ijn}F_j \\&\quad -\, \omega _3 \sum _{i \in I} \sum _{i' \in I} \theta _{ii'}P \end{aligned} \end{aligned}$$
(1)

The first part is linked to the passengers dissatisfaction and refers to the passenger assignment problem. Specifically, it consider the minimization of the total waiting time for all passengers. The second part refers instead to the rolling stock assignment and regards the minimization of the operating costs of performing a certain service using a specific type of rolling stock, which includes, e.g., the energy cost and the salary for staffs. The third part still regards the operating costs from the rolling stock circulation point of view. Specifically, it rewards keeping a rolling stock circulating and not having it going back to the depot to (maybe) re-enter the network at a later time.

We adopt the linear weighted-sum method to handle the multiple elements in the objective functions (Marler and Arora 2004). The three objectives could have different orders of magnitude according to problem scale and fixed parameters or being of different nature, making their pure sum of limited meaning. Therefore, three factors \(\omega _1\), \(\omega _2\), \(\omega _3\) are used to balance the different part of the objective function and transform all of them in costs. The choice of these three values has an impact on the formulation itself and on the meaning of the objective. With different requirements of operator’s preference or practical operations, these factors can be set as different values. For example, if operators prefer cost-minimize rather than passenger waiting time, larger \(\omega _2\) and \(\omega _3\) can be set.

4.2 Model constraints

We now present the constraints in the mathematical model. They can be divided into four groups referring to the four different aspects considered in the integrated problem. The first group deals with the safety and operating requirements of the train timetabling. The second and third groups consist of constraints regarding the rolling stock assignment and their circulation. Lastly, the fourth group relates to passenger assignment, where passengers’ choice and waiting time constraints are presented .

4.2.1 Train timetabling

We consider a bidirectional urban rail transit line, with \(S_{tot}\) stations. Since each station has two platforms, we have \(2S_{tot}\) physical station platforms on the line where trains stop. All possible stop operations belong to set S. For convenience, the platform connected with the depot is considered as two stop operations, with \(s = 1\) depicting the start of a new train service, either by exiting the depot or connecting to a previously run train service, and \(s=2S_{tot}+1\) representing the end of a train service, either by going back to the depot or connecting to a train that will start a new service. Thus the number of stop operations is \(2S_{tot}+1\) for a bidirectional rail line, regardless of the depot physical collocation on the line. Figure 1 shows an example of an bidirectional urban rail line layout with a depot connected to an intermediate station, referred to as \(S_D\).

Fig. 1
figure 1

Example of urban rail line layout

We describe the movements of each service \(i \in I\) on the line using their departure time \(D_{is}\) at each stop \(s \in S\). A minimum running time, due to physical and safety limitations, has to pass before the departure of a service from a stop s and the arrival to the subsequent \(s+1\). Furthermore, a minimum dwell time is required between the arrival of a train at a platform and its departure, adequate for passengers boarding and alighting. At the same time, excessive dwell time should be avoided due to service frequency requirements, as well as abundant running time, which is predefined by the urban rail line condition and required quality of service. Thus, the departure times at two adjacent stops of a single train service can vary within a predefined time window, expressed by constraints (2) and (3).

$$\begin{aligned}&D_{is} \ge D_{i,s-1} + w_{\min }^s+ r_{\min }^{s-1} \qquad \forall s \in S \setminus \{1\}, \forall i \in I \end{aligned}$$
(2)
$$\begin{aligned}&D_{is} \le D_{i,s-1} + w_{\max }^s+ r_{\max }^{s-1} \qquad \forall s \in S \setminus \{1\}, \forall i \in I \end{aligned}$$
(3)

Constraints (4) and (5) express the time window that has to intercourse between two consecutive trains travelling on the same track resource. For operation safety, two consecutive train services have to keep a necessary safety distance, i.e., a the minimum headway has to be maintained. Still, to guarantee the service frequency of urban rail transit, the headway between two train services should not exceed a predefined maximum value.

$$\begin{aligned}&D_{is} \ge D_{i-1,s} + H_{\min } \qquad \forall s \in S, \forall i \in I \setminus \{1\} \end{aligned}$$
(4)
$$\begin{aligned}&D_{is} \le D_{i-1,s} + H_{\max } \qquad \forall s \in S, \forall i \in I \setminus \{1\} \end{aligned}$$
(5)

As stated in Assumption 1, the continuous time is discretized into time instants. We consider the timetabling problem limited to a specific time horizon \([0, T_m]\), so that the departure and arrival times of every train at every stop should be in the time horizon under study, as shown in constraint (6).

$$\begin{aligned} 0 \le D_{is} \le T_m \qquad \forall s \in S, \forall i \in I \end{aligned}$$
(6)

4.2.2 Rolling stock assignment

Obviously, a train service needs one and only one rolling stock to conduct its operations. Constraint (7) indicates how, to each service i, one rolling stock, chosen among the \(N_j\) of each type j, can be used.

$$\begin{aligned} \sum _{j \in J} \sum _{n=1}^{N_j} x_{ijn} = 1 \qquad \forall i \in I \end{aligned}$$
(7)

In daily operations, one rolling stock could serve more than one train services. Obviously a rolling stock cannot serve two services at the same time. If a rolling stock serves two different services, a time interval between two tasks is mandatory. Since we consider the general case in which the depot can be connected to any station, \(t_{\min }^l = 0\).

$$\begin{aligned} D_{i'1} - D_{i,2S_{tot}+1} \ge t_{\min }^l \qquad \forall x_{ijn} + x_{i'jn} = 2, \forall i<i' \end{aligned}$$
(8)

With big-M, the above conditional constraint can be reformulated into constraint (9). In the constraint, we set \(M_1 = T_m\), i.e., the maximum time instant in the time horizon under study. If \(x_{ijn} + x_{i'jn} =2\), the constraint is the same as constraint (8); if \(x_{ijn} + x_{i'jn} = 1\) or \(x_{ijn} + x_{i'jn} =0\), the constraint is always satisfied, whatever the values of variables \(D_{i'1}\) and \(D_{i,2S_{tot}+1}\) are.

$$\begin{aligned} \begin{aligned}&D_{i'1} - D_{i,2S_{tot}+1} \ge t_{\min }^l - { M_1}(2-x_{ijn} - x_{i'jn}) \\&\qquad \forall i<i', \forall j \in J, \forall n\in N_j \end{aligned} \end{aligned}$$
(9)

4.2.3 Rolling stock circulation

When a rolling stock is assigned to a train service, it either goes out from the depot or is inherited by a previous service that has reached its last stop. Likewise, when a service reaches its last stop, the assigned rolling stock either goes back to the depot or begins a new service. We define a train service connection when two services are continuous without their rolling stock having to be stored back in the depot in the interim. In order to model the train circulation, we consider variable \(\theta _{ii'}\), with \(i, i' \in I\) and \(i<i'\), indicating if train service \(i'\) inherits (1) or not (0) the rolling stock of i. If it does, stop \(s=2S_{tot+1}\) performed by service i, i.e., the end of service i, coincides with stop \(s=1\) of service \(i'\), i.e., the beginning of service \(i'\). Thus, their departure times have to be the same, as modeled by constraint (10).

$$\begin{aligned} D_{i'1} = D_{i,2S_{tot}+1} \qquad \forall \theta _{ii'} = 1, \forall i,i' \in I \end{aligned}$$
(10)

The above conditional constraints can be represented with big-M as follows, where \(M_1 = T_\mathrm{m}\), given the ranges in constraint (6).

$$\begin{aligned}&D_{i',1} \ge D_{i,2S_{tot}+1} - { M_1}(1 - \theta _{ii'}) \qquad \forall i,i' \in I \end{aligned}$$
(11)
$$\begin{aligned}&D_{i',1} \le D_{i,2S_{tot}+1} + { M_1}(1 - \theta _{ii'}) \qquad \forall i,i' \in I \end{aligned}$$
(12)

We have to mention that, even if constraint (10) is similar to constraint (8), they represent different aspects of the integrated problem. Constraint (8) states that a single rolling stock can be used by multiple services during daily operation, as long as those services are not in the network at the same time. The two services using the same rolling stock could be connected, but they could also be far in time, requiring the rolling stock to go back to the depot for a certain amount of time. Instead, constraint (10) defines a service connection between two services that use a rolling stock one immediately after the other, without it having to go back to the depot.

For every service, there could be no more than one subsequent train connection. In a similar fashion, a service can be connected at most to one former service. These two conditions are depicted in constraints (13) and (14)

$$\begin{aligned}&\sum _{i' \in I : i < i'} \theta _{ii'} \le 1 \qquad \forall i \in I \end{aligned}$$
(13)
$$\begin{aligned}&\sum _{i \in I : i < i'} \theta _{ii'} \le 1 \qquad \forall i' \in I \end{aligned}$$
(14)

Constraint (15) links the rolling stock assignment to the rolling stock circulation, i.e., constraint (8) to constraint (10). Specifically, if two train services are connected, this means that they need to use the exact same rolling stock.

$$\begin{aligned} x_{i'jn} = x_{ijn} \qquad \forall \theta _{ii'} = 1 \end{aligned}$$
(15)

Although constraint (15) is a conditional one, all variables involved in it are binary, which allow us to change it into constraints (16) and (17). When \(\theta _{ii'}=1\), constraints (16) and (17) are equivalent to constraint (15); instead, when \(\theta _{ii'}=0\), \(x_{i'jn} - x_{ijn} \le M_2\) and \(x_{i'jn} - x_{ijn} \ge - M_2\) must be satisfied. Thus, we set \(M_2=2\).

$$\begin{aligned}&x_{i'jn} \le x_{ijn} + { M_2}*(1-\theta _{ii'}) \nonumber \\&\qquad \forall i,i' \in I, i<i', \forall j \in J, \forall n\in N_j \end{aligned}$$
(16)
$$\begin{aligned}&x_{i'jn} \ge x_{ijn} - { M_2}*(1-\theta _{ii'}) \nonumber \\&\qquad \forall i,i' \in I, i<i', \forall j \in J, \forall n\in N_j \end{aligned}$$
(17)

4.2.4 Passenger assignment

We consider passengers divided into groups. Each group of \(B_{tod}\) passengers arrives at the end of a time instant t at their origin stop o and heads to a destination stop d. Passengers belonging to the same tod group are not allowed to be separated. It means that every single passenger in a group should board on the same train service i and get off at same time. We create for every group of passengers a binary variable \(y_{todi}\), which indicates if (1) or not (0) a group of passengers travels using a certain train service i. Constraint (18) indicates how each group of passengers can travel using a single service, and all groups of passengers needs to be carried from their origin to their destination.

$$\begin{aligned} \sum _{i \in I} y_{todi} = 1 \qquad \forall o,d \in S \; \forall t \in T : B_{tod} > 0 \end{aligned}$$
(18)

However, passengers may not always be able to board a certain train. Indeed, it is impossible for passengers to board on a train service which departs before their arrival. Constraint (19) forces the passengers to not board a certain train if it departs from their origin before their arrival time.

$$\begin{aligned} y_{todi} = 0 \qquad \forall D_{io}<t \end{aligned}$$
(19)

The previous conditional constraint can be translated as the following big-M constraint. Given that the possible range value of \( D_{is}\) is \([0,T_\mathrm{m}]\), we use \(M_1 = T_\mathrm{m}\) in constraint (20).

$$\begin{aligned} \begin{aligned}&D_{io} \ge t + { M_1}(y_{todi}-1) \\&\qquad \forall o,d \in S, \forall i \in I, \forall t \in T : B_{tod} > 0 \end{aligned} \end{aligned}$$
(20)

As stated in Assumption 3, in this work we consider the general case in which the depot can be connected to any station, including an intermediate one. This means that we can end up with non-direct trains, i.e., trains that interrupt their service without reaching the terminus. While we still allow passengers to board those trains to maximize capacity and not have empty runs on the line, groups still exist that need to travel through the station connected with the depot, i.e., groups of passengers that have origin stop index larger than their destination one (\(o>d\)). If the rolling stock serving a train service goes back to depot, interrupting its services, passengers belonging to these special groups would have to get off that train and wait for a new one to continue their journey. Since this is a line, such transfers do not and should not occur. Constraint (21) is thus used to avoid special groups of passengers selecting non-direct trains.

$$\begin{aligned} y_{todi} \le \sum _{i'\in I : i < i'} \theta _{ii'} \qquad \forall i \in I, \; \forall B_{tod} : o > d \end{aligned}$$
(21)

The available capacity of train service i is determined by the physical rolling stock type j which serves i. We introduce variable \(q_{is}\) to monitor at each station the number of passengers on board of the train. Constraint (22) indicates how the occupancy of a train service i at a stop s cannot exceed the capacity of the rolling stock type used for that service.

$$\begin{aligned} q_{is} \le \sum _{j \in J} \sum _{n=1}^{N_j} x_{ijn}C_j \qquad \forall i \in I, \forall s \in S \end{aligned}$$
(22)

We thus need to track at each stop s, for each service i, its occupancy. Constraint (23) shows the occupancy of service i at stop 1, i.e., the station linked to the depot, while constraint (24) the one for all other stops. In a cumulative way, the occupancy of service i at stop s derives from the occupancy at the previous station \(s-1\), i.e., \(q_{i,s-1}\). When \(s=1\), the rolling stock used for service i comes either from the depot or from a service connection. In the first case, the service is empty when it stops at \(s=1\), so the only passengers on service i at this point will be the one actually boarding here. In the second case instead, there are still passengers on board of i, specifically the ones with \(o > d\), thus the ones that have remained on board the previously connected service at stop \(2S_{tot}+1\), to be added to the one boarding in \(s=1\).

Let us now instead consider what happens when \(s \in S \setminus \{1\}\). As said, the occupancy in s derives from the one at \(s-1\). A certain number of passengers on board at \(s-1\) will get off in s. We distinguish two cases: (i) passengers that have origin index \(o < s\), i.e., that have boarded i and for which no specific consideration needs to be done; (ii) passengers that have origin index \(o > s\), i.e., that have actually boarded a previously connected service \(i'\) and now need to get off, for which data regarding the rolling stock circulation need to be considered. Once passengers alight in s, other groups can board i to start their journey.

$$\begin{aligned} q_{i1}= & {} \sum _{t \in T} \sum _{d \in S} y_{t1di} + \sum _{i' \in I : i < i'} \theta _{i'i}q_{i',2S_{tot}+1} \nonumber \\&\quad \forall i \in I \end{aligned}$$
(23)
$$\begin{aligned} q_{is}= & {} q_{i,s-1} + \sum _{t \in T} \sum _{d \in S} B_{tsd}y_{tsdi} - \sum _{t \in T} \sum _{o \in S : o<s} B_{tos}y_{tosi} \nonumber \\&\quad - \sum _{t \in T} \sum _{o \in S : o>s} \sum _{i' \in I} B_{tos}y_{tosi'} \theta _{i'i}\nonumber \\&\qquad \forall i,i' \in I, \forall s \in S \setminus \{1\} \end{aligned}$$
(24)

Constraints (23) and (24) are nonlinear. We introduce a non-negative auxiliary variable \(q'_{i'is}\) as stated in constraint (25), and we substitute constraint (23) with constraints (26) and (27), and constraint (24) with (28), (29) and (30). Having introduced big-M constraints and considering constraint (22), we define \(M_3 = \max _{j \in J} \{ C_j\}\).

$$\begin{aligned}&q'_{i'is} \ge 0 \qquad \forall s \in S, \forall i',i \in I, i'<i \end{aligned}$$
(25)
$$\begin{aligned}&q'_{i'i1} \ge q_{i',2S_{tot}+1} - { M_3}(1-\theta _{i'i}) \qquad \forall i',i \in I,i'<i \end{aligned}$$
(26)
$$\begin{aligned}&q_{i1} \ge \sum _{t \in T} \sum _{d \in S} y_{t1di} + q'_{i'i1}\qquad \forall i',i \in I ,i'<i \end{aligned}$$
(27)
$$\begin{aligned}&q'_{i'is} \le { M_3}\theta _{i'i} \qquad \forall i',i \in I, i'<i \forall s \in S \setminus \{1\} \end{aligned}$$
(28)
$$\begin{aligned}&q'_{i'is} \le \sum _{t \in T} \sum _{o\in S : o>s} B_{tos}y_{tosi'} \nonumber \\&\qquad \forall i',i \in I, \forall s \in S \setminus \{1\} \end{aligned}$$
(29)
$$\begin{aligned}&q_{is} \ge q_{i,s-1} + \sum _{t \in T} \sum _{d \in S} B_{tsd}y_{tsdi} \nonumber \\&\quad - \sum _{t \in T} \sum _{o\in S : o<s} B_{tos}y_{tosi} - q'_{i'is} \nonumber \\&\qquad \forall i',i \in I, \forall s \in S \setminus \{1\} \end{aligned}$$
(30)

In the objective function we are interested in penalizing the total waiting time of passengers. With the given assumption on passengers arrivals, passenger waiting time is defined as the difference between the time instant t in which the group tod arrives at their origin stop o and the departure time of the train service i the group boards, computed as in constraint (31).

$$\begin{aligned} W_{todi} = D_{io} - t \qquad \forall y_{todi} = 1 \end{aligned}$$
(31)

The above conditional constraint can be transformed into a big-M constraint, as follows.

$$\begin{aligned} \begin{aligned}&W_{todi} \ge D_{io} - t - { M_1}(1-y_{todi}) \\&\qquad \forall i \in I, \forall o,d \in S, \forall t \in T : B_{tod} > 0 \end{aligned} \end{aligned}$$
(32)

4.3 Model complexity

Here, we analyze the model complexity. In the proposed MILP model for the integrated problems, there are two types of variables: binary, which includes train service connections \(\theta _{ii'}\), heterogeneous rolling stock utilization \(x_{ijn}\) and passengers’ boarding choice \(y_{todi}\); integer or continuous, regarding train service departure times at every stop \(D_{is}\), passenger waiting time \(W_{tod}\) and train service occupancy \(q_{is}\). It is easy to imagine that such a model would be very large. In the following discussion, the total number of variables and critical constraints will be studied.

As illustrated in Table 4, the model complexity in terms of its variables is highly dependent on the number of train services |I|, the number of physical stations \(S_{tot}\), the number of rolling stocks \(\sum _{j \in J} N_j\) and the number of passenger groups |B|. For example, with 10 physical stations, 10 train services, 15 rolling stocks and 1000 groups of passengers, the total number of variables and constraints can be counted directly: 10,195 binary decision variables would be included in the model, of which 10,000 would denote passengers’ service boarding choice. Meanwhile there would be 10,200 integer variables, of which 10,000 for passenger waiting time. Not only large amount of variables increase the complexity when computing, but also the NP-hardness of train timetabling problem makes solving it difficult (Caprara et al. 2002).

Table 4 Number of variables

To decrease the model complexity and the size of the problem as much as possible, two possible strategies can be here applied: the first is to define specific range for some of the integer variables, and the second is lessen the number of variables by erasing a certain number based on implicit information.

Regarding the first strategy, we define a specific time window for each departure time variable \(D_{is}\). In our problem definition, the running time in sections, the dwelling time at stations and the headway time between two consecutive services are flexible but limited by a minimum and a maximum value. We use these values, as well as the maximum time horizon in the instance, to specify a time window \([DL_{is}, DU_{is}]\) for each variable \(D_{is}\). In Fig. 2, these time windows are depicted in bold green lines, found using the extreme value of train running, dwelling and headway time, depicted as gray dashed lines.

Fig. 2
figure 2

Time windows of train services

Regarding the second strategy, we focus on the binary variables. Specifically, we remind that each service has to be performed by a specific rolling stock. But a rolling stock can and should serve more than one service with no-overlap on services at any time instant. When two services are served by the same rolling stock, a connection exists if the rolling stock continues travelling on the line as a subsequent service without going back-in/out-of the depot. As a result of \(D_{is} \in [DL_{is}, DU_{is}]\), it is easy to understand that a service connection could happen, i.e., \(\theta _{ii'} = 1\), only when the time window at the final stop of a service i overlaps with the one at the first stop of a service \(i'\), i.e., \([DL_{i,2S_{tot}+1}, DU_{i,2S_{tot}+1}] \bigcup [DL_{i'1}, DU_{i'1}]~\ne ~\emptyset \). If this is not true, i.e., \([DL_{i,2S_{tot}+1}, DU_{i,2S_{tot}+1}] \bigcup [DL_{i'1}, DU_{i'1}] = \emptyset \), the only possible value variable \(\theta _{ii'}\) can take is 0, which means we can erase it, reducing the number of variables considered and constraints that strictly depend on it, without any loss of information.

For example, in Fig. 2, the departure time of train service 1, 4, 9 and 12 is defined, as said, in specific time windows, shown as bold green lines with a lower bound and an upper bound in gray dashed lines. Intuitively there is an overlap between the time window at the last station of service 1 and the one at the first station of service 9; thus, it is possible to schedule a connection, as shown by the orange dotted curve line between service 1 and service 9 if, for example, they were to be scheduled as depicted by the black solid lines in the figure. Services 1 and 9 can be served by the same rolling stock. Instead, let us consider services 1 and 4, for which no-overlap exists in their two time windows. In this case, the connection will never happen, i.e., \(\theta _{1,4}=0\). The same can be said for services 1 and 12, i.e., \(\theta _{1,12}=0\). With this implicit information, \(\theta _{1,4}\) and \(\theta _{1,12}\) can be excluded from the formulation without any loss.

Furthermore, let us consider a tod passengers group: these passengers arrive at origin stop o at time t and are directed to destination stop d. The trains they can board should depart no earlier than their arrival, i.e., \(D_{io} \ge t\), as declared by constraint (19); thus, we can define the reachable train services for a tod passenger group as the set \(RES_{tod}\). When creating the time window for train departure time \(D_{is}\) we have defined an upper limit \(DU_{is}\). Since the train cannot depart after \(DU_{is}\) from stop s, the passengers that can board on service i have to arrive before \(DU_{is}\). Therefore, if \(t > DU_{io}\), train service i is not reachable by passengers with origin stop o, i.e., \(y_{todi} = 0\) in any case, so there is no need to create this variable, as well as the related \(W_{todi}\). The number of variables on passengers’ choice \(y_{todi}\) and on passenger waiting time \(W_{todi}\) can thus decrease.

Looking at the minimum and maximum value of running, dwell and headway times, we can also speculate on the number of rolling stock in utilization, defining a range [RSLRSU], with RSL indicating the minimum number of rolling stock that have to be used to perform the required service, and RSU the maximum feasible one.

5 Solution approach

Based on implicit information from the model and the instance to be solved, the number of variables and constraints can be decreased, as shown in Sect. 4.3. Specifically, we define ranges for some variables as well as exclude the always-0 ones and the related constraints. Still, solving the integrated problem remains a difficult task due to the NP-hardness of the train timetabling problem. Thus, we propose an iterated programming approach (IPA) where, in each step, we concentrate the solving process on a specific area, i.e., neighborhood, of the searching space: certain variables and constraints are fixed based on the best incumbent solution, limiting the number of decisions to be taken.

figure a
figure b
figure c

The idea stems from the analysis of the links among the four aspects of problem and the six categories of decision variables defined in the model. Variables \(y_{todi}\) and \(W_{todi}\) related to passengers’ choice and waiting time are numerous and highly dependent on train timetable, service connections and rolling stock assignment. Thus we consider departure time \(D_{is}\), rolling stock utilization \(x_{ijn}\) and service connection \(\theta _{ii'}\) as primary decision variables, while passengers’ choice \(y_{todi}\), waiting time \(W_{todi}\) and service occupancy \(q_{is}\) as secondary ones.

Algorithm 3 describes in details the iterative programming approach developed. It can be divided into two main stages: the first one, called Rolling Stock Circulation Stage (lines 1–32), concentrate on diving toward an initial good quality solution prioritizing the search on rolling stock circulation decisions; the second stage, called Complete Model Stage (lines 33–44), enlarges back the focus to the overall model, to increase diversification and escape local minima. In each stage, several solving steps are taken sequentially. Each step is solved using ILOG CPLEX, with parameters regarding the relaxed induced neighborhood search (Danna et al. 2005) and sometimes emphasizing the search toward feasible solutions. Between two adjacent steps or before the Complete Model Stage, the solution of the previous one is always set as warm start, which provides hints to speed up the search. As input we consider: the mathematical model (MODEL) in its simplified form; the maximum iteration number \(f^\mathrm{stop}\) and the total allocated computation time \(C^\mathrm{stop}\) to be used as stopping criteria; the computation time limit for each step \(c^\mathrm{stop}\), since it may vary for different ones.

In the Rolling Stock Circulation Stage, the algorithm may start from a train timetable to validate; otherwise, we guide a random search to build a feasible one. The range of possible rolling stock in utilization [RSL, RSU] is used for integrating the given train timetable with the rolling stock assignment and/or to generate a feasible initial solution for the overall model. We select the upper integer average value in the range as initial number of rolling stocks circulating in the network, i.e., \(\hbox {iter}_\mathrm{stock} \leftarrow \Big \lceil {\frac{\hbox {RSL}+\hbox {RSU}}{2}}\Big \rceil \) (line 1). With this number we generate a basic scheme of train service connections by connecting each train i with train \(i+\hbox {iter}_\mathrm{stock}\), if it exists (lines 5–7). Then, the number of rolling stocks is applied to the existing timetable; otherwise, if no initial feasible timetable to validate is provided, a regular one is obtained by: (i) fixing the departure time of the last train with a subsequent connection, chosen randomly in the range \([DL_{is}, DU_{is}]\) in such a way that the latest groups of passengers can still board the train; (ii) fixing the others at regular intervals using as reference the last train (line 8). After having so fixed variables \(\theta _{ii'}\) and \(D_{is}\), we solve the rest of the model (i.e., MODEL\(_\mathrm{stock}\)) using CPLEX to find the best values for the passengers choice and rolling stock selection (line 9).

From this moment on, we aim to improve the incumbent solution. We use two steps (lines 10 and 12) to focus the search for a good-quality solution by fixing a subsets of variables \(D_{is}\). The idea is to solve reduced models (i.e., MODEL\(_{red}\), lines 11 and 13) that would rapidly bring down the value of the objective function, regardless of the risk of ending up in a local minimum, by focusing on decreasing the passengers waiting time. On the one hand, Neighborhood1 aims to change the train departures to benefit all waiting boarding passengers without having to delay passengers boarding on time. On the other hand, Neighborhood2, aims to level the waiting time to a median value for all passengers, by trying to reduce the waiting time for the top 15% passengers groups, at the expenses of the passengers on time but not of the one that are already suffering delays.

Specifically, Neighborhood1 analyzes the waiting time \(W_{todi}\) of each group of passengers in the incumbent solution. We first compute for each train i at each stop s the average waiting time for the passengers boarding that train at that station due to the chosen \(D_{is}\) in the solution, i.e., \({\overline{w}}_{is} = \frac{\sum _t \sum _d B_{tsd}W_{tsdi}}{\sum _t \sum _d B_{tsd}}\). Then, for all train services i dwelling at stop s for which passengers do not wait, i.e., for all \({\overline{w}}_{is} = 0\), we set \(D_{is}\) to the same value of the incumbent solution (line 10). Having fixed some variable \(D_{is}\) in the model, we search for a new incumbent solution by solving a reduced problem with CPLEX (line 11). The reduced searching space allows for the quick computation of an improved, more advantageous solution, in which the train departures are changed to benefit waiting boarding passengers without having to delay passengers boarding on time, i.e., by recomputing only the \(D_{is}\) associated with \({\overline{w}}_{is}>0\).

Similarly, Neighborhood2 computes \({\overline{w}}_{is}\). Then, it includes the strictly positive \({\overline{w}}_{is}\) in a sorted list, i.e., \(Rank_{{\overline{w}}}\). After that, for all train services i stopping in s for which \({\overline{w}}_{is}\) belongs to the smallest 85% in \(Rank_{{\overline{w}}}\), we set \(D_{is}\) to the same value of the incumbent solution (line 12). Again, having fixed some variable \(D_{is}\) in the model, we search for a new incumbent solution by solving a reduced problem with CPLEX (line 13). The aim in this case is to reduce the peak-waiting times, which would be the ones that add more delay to the total value of the objective function.

In the Rolling Stock Circulation Stage, both in Neighborhood1 and Neighborhood2, we keep fixed the train service connections \(\theta _{ii'}\). We evaluate different number of rolling stocks, until we see no improvement in the objective function value or the computation time expires.

In the Complete Model Stage we keep improving the overall solution by repeating three steps until either the overall computation time has expired or we have reached the maximum number of iteration allocated for this stage. In the three steps we first explore the search space nearby the incumbent solution with Neighborhood1 (lines 34–35), then Neighborhood2 (lines 36–37), this time without prefixing the train service connections, and then we enlarge the search to the overall solution space of the complete mathematical model (i.e., MODEL, line 38).

6 Numerical experiments

To demonstrate the efficiency of the proposed integrated optimization model, we conduct a set of numerical experiments on the Chongqing Rail Transit Line 2, illustrated in Fig. 3. This line is a bidirectional urban rail line covering a length of 30 km with 25 physical stations in service. The operation from Jiaochangkou to Yudong is defined as the downstream direction, while the reverse is defined as upstream one. There are two depots on this line, i.e., Dayan Depot and Baijusi Depot, located, respectively, near the Zoo and the Baijusi stations. Two types of train services (i.e., full length from Jiaochangkou to Yudong and short-turning services from Jiaochangkou to Tiantangbao) and two types of rolling stocks are utilized on this line. Due to the scale and complexity of the real problem, we adopted in the case study a 18.57-km length rail line formed by first 19 stations, which is traversed by both full-length and short-turning services during daily operations (i.e., from Jiaochangkou to Tiantangbao stations). The depot linked with Zoo station with go-out and go-in tracks, i.e., Dayan Depot, is the only depot for the hypothesized shortened line. In the following experiments, all services are considered as full-length services on the shortened line from Jiaochangkou station to Tiantangbao station, whose stations are shown in bold in Fig. 3. Furthermore, the passengers flow data are collected by AFC on a day in September 2018. In this AFC system, each passenger is marked with his/her origin and destination stations, as well as by the entry time in the system.

Fig. 3
figure 3

Chongqing rail transit line 2

Table 5 The static of instances regarding to model
Table 6 Computation result

In our model, we use a time discretization of 15 s, as adopted in related literature (Yue et al. 2017; Mo et al. 2019). Thus, passengers data are counted every 15 s for each OD pair. The minimum and maximum headways are 3 min and 30 s and 12 min, respectively, i.e., 14 and 48 time instants. Since the passengers data were collected in 2018, we also use rolling stocks data of that time. Two types of rolling stocks with different carriage capacities and operation costs can be used. Due to the crowdedness during peak hours, we adopt maximum capacity, respectively, as 882 and 1342 persons for low-capacity and high-capacity rolling stock, accounting both for seated and standing passengers. Available numbers of rolling stocks are, respectively, 27 for low-capacity and 22 for high-capacity ones. As for the operating costs, the China Association of Metros reported in 2018 a monetary operating costs of 23.8 CNY per rolling stock per kilometer, which includes 47.6% labor costs and 52.4% other costs (e.g., energy cost, maintenance cost). Since the high-capacity rolling stocks used in our experiments are the typical ones used in Chinese urban rail transit systems, we compute the cost of one full-length service performed by a high-capacity rolling stock as 23.8 * 18.57 = 441.966 CNY. Instead, as the low-capacity rolling stocks weight less and require less energy compared with high-capacity ones but still require the same amount of labor, we computed its cost as follows: we set the same labor costs as for the high-capacity rolling stock, while we reduced the other costs proportionally to the capacity reduction, which resulted in a total cost factor of 0.8. Thus, the cost of one full-length service performed by a low-capacity rolling stock is 23.8 * 18.57 * 0.8 = 353.5728 CNY. Regarding the objective functions, the weights \(\omega _1\), \(\omega _2\), \(\omega _3\) of the different objectives are set equal to 1, as we consider all three objective equally important in our study. Without loss of generality, the weights can be set as any values preferred by operators or company shareholders.

In the experiments, we consider three instances to verify the effectiveness of the MILP model and the iterated programming approach proposed. As mentioned before, \(S_{tot} = 19\) in our instances, so we have \(|S|=39\) as well as the parameters |I| and \(|B_{tod}|\) shown in Table 5. The total number of variables for each instance in the original definition of the model is shown in column 6 of the table, while, in column 7, we show the reduced number of variables, computed as described in Sect. 4.3.

All computational experiments have been run on Windows laptop 64-bit, with 1.60–2.30 GHz Intel(R) Core(TM) CPU i5-4200U and 8GB RAM, using IBM ILOG CPLEX 12.9. The iterative programming approach instead has been implemented in Java and compiled with JDK 14. Since we do not consider an initial timetable to validate in our computational results, we run each instance 10 times, starting from the randomly generated regular timetable to account for this randomness. The computational time limits allocated to the Neighborhood 1 and Neighborhood 2 solving steps and to the overall model step in the second stage are set at 300 s.

Table 6 presents a comparison between the model solved by CPLEX and by using the IPA proposed in Sect. 5. For both CPLEX and IPA, a maximum computation time of 3 h has been set. Since 10 runs for each instance have been conducted with the iterative programming approach, we present for comparison three values for the objective function: the best value/the average value/the worst value of all 10 runs. The last column of the table shows the improvement achieved by IPA, compared to the objective value found by CPLEX. We compute the improvement as the absolute difference of the best value found by IPA and the one given by CPLEX in 3h, divided by the latter one.

For instance A, the smallest, we can see how the quality of the solution found by the iterative programming approach is better than the one found by CPLEX in the same amount of time, even in the worst case. Here, even if slight, an improvement still exists, indicating the effectiveness of the solving approach even when its evolution tends to stuck on local minima. As problem scale grows in instance B and C, the effectiveness of the solution approach with respect to CPLEX increases, as highlighted by the best improvement on the objective value achieved by IPA, shown in percentage in the last column of the table.

To better analyze the behavior of IPA and the comparative quality of the solutions found, we extended the running time allocated to CPLEX to 24 h, while keeping 3 h as time limit for IPA. Figures 4, 5 and 6 show the evolution of the iterative programming approach, computed as averages on all 10 runs of each instance, and of CPLEX when solving, respectively, instances A, B and C. In the three figures, time is presented on the x-axis, expressed in seconds. Two different scales are used since two different time limits are considered for CPLEX and IPA. The bottom x-axis shows in red the 3 h for the iterative programming approach, while the upper one shows in yellow the 24 h used for CPLEX. The two colors also indicate the related evolution curve of each solving approach. On the yellow curves, we highlight with a diamond the value found by CPLEX at 3 h, i.e., the ending time for the red curve. On the y-axis instead we show the objective function value. The values on the y-axis have been limited to zoom more on the behavior of the iterative approach.

In particularly, the iterative programming approach allows to find a first solution more quickly and with a much better value than the benchmark given by CPLEX, which instead requires, respectively, 29, 1763 and 4209 s to find the first solution for instances A, B and C. Benefitting from a better initial solution, IPA can spare time to further improve the objective, while CPLEX keeps searching for the initial feasible solution, fact made evident in instance C, which takes more than an hour to find a first solution against 1 min for IPA. In instance A, the difference between the final value found by IPA and the one found by CPLEX is relatively small, but to reach that similar value CPLEX requires almost all 24 h, having been stuck for several hours on a local minimum. While allowing for smaller improvement, IPA is able to jump to, even if sometimes slightly, better quality solutions, allowing for a better investment of the overall computation time.

Fig. 4
figure 4

Comparison of CPLEX and iterative programming approach on instance A

Fig. 5
figure 5

Comparison of CPLEX and iterative programming approach on instance B

Fig. 6
figure 6

Comparison of CPLEX and iterative programming approach on instance C

From the evolution of the iterative programming approach on the three instances, we see that, while the initial slopes of the curves are due to the first stage of the solution process (i.e., the Rolling Stock Circulation Stage), which takes an average of 478, 1740 and 3226 s for instances A, B and C, the Complete Model Stage allows to escape local minima at the end of the first, as it is particularly evident from Fig. 5.

Regarding the final solutions in instances B and C, its quality in CPLEX is worse than the one provided by IPA in 3 h. Especially for instance C, the largest instance in our experiments, the final objective values provided by CPLEX and IPA are of a different order of magnitude.

7 Conclusions

The planning process in urban rail transportation is usually split into several stages, where the outcome of a stage provides inputs or constraints for the subsequent ones. While each stage could generate an optimal outcome, global insights on the quality for the overall solution are more difficult to obtain. Furthermore, a solution from one stage may not lead to a feasible solution in the subsequent one without some initial adjustments. From an operator’s point of view, obtaining a timetable without repeated re-optimization could not only improve efficiency but also reduce computational efforts.

In this paper, we investigated the integration at tactical level of train timetabling, train service connection, assignment of different rolling stocks and passenger’s choice of boarding, with consideration of time-based origin-destination dependent passenger demand and heterogeneous types of rolling stock. To meet dynamic passenger demand, train running time in sections and dwelling time at stations are considered as flexible in a predefined range which contributes to the generation of a non-cyclic non-regular timetable.

A MILP model is proposed for the integrated problem with multi-objectives of minimizing total passenger waiting time and operating cost, with constraint requirements on train operations, train service connection, utilization of different rolling stocks, process of passenger boarding/alighting and depot which can be located anywhere on the line. It is worth mentioning that the model input of time-based OD-dependent passenger demand contributes to the accuracy on calculating passenger waiting time and train occupancy, which also affects the utilization of rolling stocks in terms of capacity of accommodating passengers. Naturally, the integrated problem is difficult to solve by a commercial optimization solver due to the problem scale and NP-hardness of train timetabling. An iterative programming approach is thus proposed. A comparison on solution effectiveness and efficiency between the proposed iterative programming approach and the benchmark CPLEX is conducted on the Chongqing Rail Transit Line 2. The results show that the proposed iterative programming approach is able to better invest the allocated computation time as well as produce better quality solutions. These advantages become more and more evident as instance grows.

The work shows an interesting exploration of integration in train timetabling and heterogeneous rolling stock scheduling with passengers’ satisfaction related to waiting times at platforms. It investigates how to trim down re-optimization while generating a reinforced schedule, contributing to the reduction of redundant procedures and the associate computational costs for operators and stockholders in urban rail transit systems.

This study, without loss of generality, can easily be extended to other types of lines in urban rail transit systems or be used to judge the quality of the operational timetable with the actual passenger data collected by AFC. Still, a great computation complexity characterizes the integrated model. Regarding the solving procedure, additional diversification techniques can be proposed for IPA, as well as different algorithms to solve the problem. Furthermore, a rolling horizon approach could be implemented to show how the solving procedure could extend the timetable to larger time horizon, as well as analyze how the importance of the different elements considered in the objective function may affect the overall solution process. Furthermore, as passenger demand is not independent from train schedules, the changes on the timetable would also lead to passenger demand changes. The passenger demand not only shows the dynamic on dimension of time and space, but also the volume in different days. Considering the passengers’ reaction to timetable shifts or randomness in passenger demand could be of interest.