Skip to main content

Exploring trade-offs in public bus electrification under stochastic conditions


In this article, we address the question of electric bus planning and operation under stochastic travel time and energy consumption. Uncertainties in the environment may cause disruptions to the planning and operation of electric buses, and a transportation planner must anticipate such conditions and be able to respond appropriately. One of the preconditions for planning robust strategies is understanding the existence and impact of multiple trade-off scenarios, which is the basis for this study. We model the travel time delays and trip energy consumption using estimated probability density functions and use a stochastic, mixed-integer formulation with chance constraints to evaluate several trade-off scenarios for electric bus fleets under uncertainty. The results show the existence of trade-off scenarios that lead to varying degrees of impacts related to network and environment. Careful fleet planning, dispatch, and charge control enable us to make the balance between these trade-offs and achieve better operational performances under uncertainty.


Road transportation is a significant \({\text{CO}}_2\) emission contributor that threatens our planet. According to International Energy Agency (IEA), about 11% of the global \({\text{CO}}_2\) emissions from existing energy infrastructure originate from the transportation sector. Roughly two-thirds of that is due to road transportation (IEA 2020).

In recent years, there has been growing momentum for the electrification of the transport sector as a potential solution for reducing greenhouse gas (GHG) emissions. Besides being climate-friendly, electrification can also reduce air pollution and noise, making electrification an attractive choice for many transportation companies. In June 2023, the Swiss public accepted “the Climate and innovation act” that, among other things, sets a 100% GHG reduction target for the transportation sector by 2050 (Shields 2022). Electrification and renewable energy integration is the prime strategy to achieve this policy target.

This article focuses on public buses that constitute a significant part of Europe’s public transportation network, covering most urban and rural areas. Efficient planning and management of electric bus fleets, with a comprehensive understanding of the associated trade-offs, is crucial for the success of bus electrification, despite the clear environmental benefits it offers. Especially under stochastic conditions where the travel time and energy consumption of trips cannot be accurately predicted, a public transportation planner must anticipate the trade-off scenarios that may emerge from various contingency situations and plan for them in advance.

This article presents a mixed-integer optimization method to solve the electric bus planning and scheduling problem with constraints related to charging and feasible time windows. We model the average speed of each trip and the energy consumption as a stochastic function that represents the effects of unpredictable road traffic. Compared to a baseline scenario, various levels of unpredictability in the environment can cause operational contingencies with varying magnitudes that transportation planners could address by choosing trade-off options. We focus our study on a subset of these trade-off options and analyze what economic and environmental consequences that may arise.

The rest of the article contains a chapter investigating the state-of-the-art techniques related to electric bus planning and scheduling, the proposed mathematical formulation of the problem, the case study description, and the results and the conclusion.


Electric bus planning and scheduling problem belong to the broad class of optimization problems known as the Vehicle Scheduling Problem (VSP). We can further subdivide VSPs based on the number of depots (single or multiple depot VSPs) and whether the buses are homogeneous or heterogeneous. A single depot problem is a typical case for small transportation companies, and it can be solved within a polynomial time (Bunte and Kliewer 2009). Multiple depot VSP, on the other hand, is NP-hard (Bunte and Kliewer 2009; Gkiotsalitis et al. 2021). Homogeneous VSP refers to a scenario where all vehicles have the same characteristics, such as type and capacity (Baldacci et al. 2008). In contrast, heterogeneous VSP involves vehicles with different characteristics.

Some of the earliest work on solving the VSP using minimum cost flow, linear assignment, and quasi-assignment methods can be found in Daduna and Pinto Paixão (1995), Freling et al. (2001), Orloff (1976), Paixão and Branco (1987). Several variants of VSP emerged over time, e.g., Capacitated VSP (Borčinová 2017), Time-window VSP (Ilin et al. 2018), and VSP with stochastic travel demands (Lei et al. 2011), all of which tighten the original VSP model with additional constraints related to the vehicle capacities, feasible time-windows, and variable uncertainties.

Forming a VSP with electric buses requires additional constraints for the maximum driving range, battery charging, discharging, and recharging time-window constraints. In transportation modeling literature, the driving range constraints are often described as either the maximum driving distance (Li 2014) or the maximum driving time (Wang and Shen 2007) after one charging event. Using travel distance to determine the driving range is a rough proxy since energy consumption is a function of several variables, such as the distance and travel speed, passenger loading, terrain gradient, weather conditions, and the current battery life. An optimization model that considers the driving speed and passenger loading is presented in Li et al. (2019). To reduce the number of variables and improve the computational time, the authors avoid continuously tracking the battery’s state of charge. Since energy consumption is not tracked explicitly, the batteries may run out in some extreme situations, even with satisfying model constraints. However, under strict assumptions, the authors solve the electric VSP problem with time constraints within a finite time. A modeling strategy presented in Rinaldi et al. (2018) assigns a binary decision variable to indicate whether or not a bus has sufficient energy to perform a trip at a given time step. Since the authors keep track of the state of charge (SOC) at each time step, the resulting mixed-integer model becomes exponentially large as the number of trips or buses increases.

The variability of traffic conditions in the real world can be significant, prompting scientists to investigate techniques for incorporating stochasticities in travel time and energy consumption into electric bus scheduling models. Tang et al. (2019) introduced a method that addresses uncertain trip durations by using a tuneable buffer distance parameter to extend the electric bus’ operational range. The stochastic network flow methodology proposed by Shen et al. (2023) formulates the problem as a directed graph, wherein the nodes consist of trip and depot nodes. Each trip node is associated with a specific start time, a stochastic trip duration, and a stochastic energy consumption described by a probability density function (PDF). In the robust optimization approach presented in Jiang et al. (2021), the stochastic nature of travel time is modeled as a cardinality-constrained uncertainty set. The optimization problem seeks a robust solution, feasible even under the worst-case uncertainty conditions.

Despite the current work in the literature on the various formulations and solution methods for the electric bus planning and scheduling problem, there is a lack of studies on evaluating different trade-off scenarios under stochastic conditions. This article is an attempt to address the research gap mentioned above.

Mathematical formulation

The transportation (quasi-assignment) model, elaborated in Bunte and Kliewer (2009) and (Daduna and Pinto Paixão 1995), serves as the foundation for our mathematical formulation. The key idea is to model the problem as a series of decisions or events that can be mathematically represented as a directed decision graph. The following subsections provide a comprehensive description of the mathematical formulation of the optimization problem. Appendix 1: Table 5 provides a complete guide to the nomenclature used in the following subsections. Figure 1 shows the structure of the resulting decision graph for the case of only two trips.

Graph generation and compatibility constraints

Let us define the following sets:

  • \(N=\{n_0,n_1,...,n_k \}\) is the set of nodes. Each node represents a scheduled trip from a starting station \(n^s_{k}\) at time \(t^s_{k}\) to a destination \(n^d_{k}\) with a planned travel time \(t_{k}\), travel distance \(s_k\) and planned energy consumption \(e_{k}\),

  • \(D=D_s \cup D_d\) where \(D_s\) and \(D_d\) are the sets of start and end depot indices,Footnote 1

  • \(C=\{c_0,c_1,...,c_k \}\) is the set of nodes corresponding to charging events at each \(n_i\in N\). In other words, visiting \(c_i\) indicates the charging event at the destination of trip \(n_i\). It also implies \(|C|=|N|\), if charging infrastructure is available at each node. If charging occurs only at the depot, \(C=\varnothing\),

  • \(W=\{w_0,w_1,...,w_k \}\) is the set of nodes corresponding to depot charging events. In other words, visiting \(w_i\) indicates that a bus dead-head to the depot and recharges batteries after completing the trip \(n_i\in N\). It also implies that \(|W|=|N|\),

  • \(B=\{``elec'', ``fuel''\}\) is the set of heterogeneous bus types in the problem.

Let us say that \(G=(V, A)\) is a directed graph where \(V=N\cup C\cup D\cup W\) represents the set of nodes. \(A=\{(i,j): i,j\in V,i\ne j\}\) represents the set of arcs in the network where each arc (ij) denotes the servicing of trip j after a trip i. We define a binary decision variable \(x_{i,j}^b\) that takes the value one if a bus of type b reaches node \(j \in N\) after serving the trip denoted by \(i \in N\). In other words, \(x_{i,j}^b\) takes the value one if the arc (ij) in the graph is served by a bus of type b.

Fig. 1
figure 1

The mathematical form of the problem with two trips (blue nodes). Each trip (blue node) has a corresponding charging event (light-blue node) and a go-to depot and charge event (grey node). The red arrows indicate a feasible solution to the problem

The resulting graph can be quite large. For example, given |N| trips, |B| bus types, and \(|D_d|\) number of candidate vehicles, the resulting graph has \(3|N|+|D_d|+1\) nodes and \((3|N|+|D_d|+1)^2|B|\) arcs. However, we can eliminate many of these arcs due to incompatibility, thus reducing the size of the graph significantly.

For each pair of nodes \(i,j\in V\), i and j are compatible (denoted by \(i\sim j\)) if an arc can exist between the nodes i and j. Using the above definition, we specify the compatibility constraints of the problem as follows.

  1. 1.

    \(i\not \sim i\), \(\forall i \in V\),

  2. 2.

    \(i\sim j\), \(\forall j \in C\cup W, i \in N \Leftrightarrow\) i is the corresponding trip node of j,

  3. 3.

    \(i\not \sim j\), \(\forall i \in C\cup W, j \in N\) if j is the corresponding trip node of i,

  4. 4.

    if \(i \in D_s\), \(i\sim j \Leftrightarrow j\in N\),

  5. 5.

    if \(j \in D_d\), \(i\not \sim j, \forall i\in W\cup D_s\),

  6. 6.

    if \(i \in D_d\), \(i\not \sim j, \forall j \in V \setminus D_d\),

  7. 7.

    if \(j \in D_s\), \(i\not \sim j, \forall k \in V \setminus D_s\),

  8. 8.

    \(i\sim j \Leftrightarrow t^s_{i}+T_{i,j}\le t^s_{j}\), where \(T_{i,j}\) is the sum of the trip time and the relocation time from \(n^d_{i}\) to \(n^s_{j}\).

The last of the compatibility constraints above is called the time-window constraint.

Stochastic travel time and energy consumption

Our proposed strategy is to model the difference between the actual and planned trip time duration as a random variable with some known probability distribution that we can estimate using real-world measurements. For convenience, let us refer to the difference between the actual and planned trip time duration as “residual trip duration.”

The data set we use to approximate the best-fit distribution contains 1065 observations of residual trip durations for two public bus lines in Ticino, Switzerland. Residual trip duration can be negative, in which case the actual trip duration is less than planned. Since, by definition, residual trip duration is the difference between the actual and planned duration of the same trip, we can convince ourselves that each observation is independent, which is a requirement for the next step.

The limited size of the data set induces prediction uncertainty. Therefore, we estimate the upper and lower confidence bounds for the cumulative distribution function (CDF) by evaluating the 95% Kolmogorov–Smirnov (KS) confidence interval. Unlike parametric methods, this approach does not rely on assumptions about the underlying distribution, which makes it ideal for characterizing the uncertainty of a probability density curve estimated using only a few observations. For an interested reader, the mathematical basis for non-parametric confidence band estimation using KS-statistic is available at (Owen 1995).

During the optimization process, we sample residual trip durations from the probability distribution corresponding to the upper confidence bound (let us identify them as KS-Max distribution), which, in terms of residual trip durations, represent worse conditions and would allow us to observe trade-off scenarios better. Figure 2 graphically represents the upper and lower confidence bounds and how the uncertainty modeling impacts the PDF of the data distribution. We estimate the best-fit probability distribution for the data set using 10,000 sampled observations from the KS-Max distribution (Fig. 3).

Fig. 2
figure 2

Uncertainty modeling of the residual trip duration data set. a The effect of uncertainty on the PDF. b The estimated upper and lower confidence bounds of the CDF

Fig. 3
figure 3

Fitted log-normal distribution of the residual trip durations. Distribution fitting carried out using distfit (Taskesen 2023). The red dotted lines indicate the confidence intervals

The planned energy consumption \(e_k\) is determined by the method presented in Hjelkrem et al. (2021). First, we discretize the route of each trip and define the energy consumption for traveling each discrete trip segment. Then, the total energy consumption of the journey is the sum of the energy consumption for all trip segments. Equation (1a) describes the calculation of the energy consumption of a single trip, which is the energy consumption related to the motion and auxiliary uses.Footnote 2 Note that \(\mathcal {K}\) is the set of discrete segments, mg is the weight of the bus (including passenger weight), \(A_f\) is the frontal area of the bus, \(\alpha _k\) is the inclination of the road segment \(k \in \mathcal {K}\), \(C_{r}\) is the rolling resistance of the tires, \(C_d\) is the drag coefficient, \(\rho\) is the air density, \(\eta\) is the overall efficiency of the bus allowing for all complexities, and \(s_k\) is the length of the trip segment k.

Equation (1b) refers to the calculation of auxiliary energy consumption for the trip segment \(k \in \mathcal {K}\) where \(C_p\) is the specific heat capacity of air, \(Q_v\) and \(Q_d\) are the air exchange rates of the bus through ventilation and door opening/ closing. \(H_d\) is a step function that defines whether the door is open. The value of the step function is set to one at the end of each trip segment if the bus is at an intermediate stop. \(\Delta \theta\) is the temperature difference between the interior and exterior of the bus, and \(\tau _k\) is the travel time of the trip segment k. For convenience, we assume continuous power consumption of 500 W for ventilation when the bus is en route. If the bus is in use, we assume 700 W constant power consumption for lighting and undefined sources, the time integral of which is given by \(e_{other}\). We recommend the reader refer to (Hjelkrem et al. 2021) for a complete explanation of the energy consumption modeling approach.

We assume constant travel speed within a trip segment which changes at the start of the next trip segment. This approximation excludes the effect of acceleration, but it is widely used in the scientific literature to model time-varying traffic conditions (Xiao and Konak 2016).

$$\begin{aligned} e&=\sum _{k \in \mathcal {K}}\frac{s_k}{\eta }\biggl (mg \sin \alpha _k+mgC_{r}\cos \alpha _k+\frac{1}{2} \rho v_k^{2}A_fC_{d}\biggr ) + e_{hvac} + e_{other}, \end{aligned}$$
$$\begin{aligned} e_{hvac}&=\sum _{k \in \mathcal {K}}\rho C_p\biggl (Q_v + Q_dH_d \biggr )\Delta \theta \tau _k + e_{ventilation}. \end{aligned}$$

Unlike the residual trip durations, we do not have measured data to estimate a stochastic distribution for energy consumption. However, from Eq. (1a), we can write the stochastic energy consumption as a function of two other stochastic variables, i.e., velocity and passenger capacity. Another important random variable in the energy equation is the temperature. While it is possible to represent the temperature at each time step as a random variable in our method, for simplicity, we adhere to a deterministic temperature profile representing (on average) the coldest day of the year.

Assuming we possess knowledge or a reasonable approximation of a random variable’s minimum, maximum, and likely outcomes, we may represent its distribution using a triangular distribution. In contrast to other common alternatives, such as the uniform and normal distributions, the triangular distribution can capture asymmetry and skewness in outcomes (Fairchild et al. 2016).

We estimate the triangular distributions for velocity and passenger capacity by utilizing the data outlined in Table 1, and subsequently, using Eqs. (1a) and (1b), calculate the energy consumption for 1020 trips over 6 days with randomly sampled velocities and passenger capacities. We also have the planned energy consumption for each trip, enabling us to set up a stochastic distribution for the difference between actual and planned energy consumption \(\Delta e\). Figure 4 show the estimated best-fit distributions for \(\Delta e\) in both travel directions.

Table 1 Minimum, likely, and maximum passenger capacity, and velocity values
Fig. 4
figure 4

The estimated distributions of \(\Delta e\), the difference between actual and planned energy consumption in the two travel directions. Distribution fitting carried out using distfit (Taskesen 2023) The red dotted lines indicate the confidence intervals

Now we can write the actual trip time \(t_k^{*}\) and actual energy consumption \(e_k^{*}\) of a trip k as follows (Eqs. 2a, 2b). \(\Delta t_k\) is sampled from the estimated log-normal distribution, whereas \(\Delta e_k\) is sampled from one of the estimated normal distributions depending on the direction of the trip.

$$\begin{aligned} e_k^{*}&= e_k-\Delta e_k. \end{aligned}$$
$$\begin{aligned} t_k^{*}&=t_k+\Delta t_k. \end{aligned}$$

Finally, we model the stochastic time-window and battery charge/ discharge dynamics (for electric buses) as follows.

\(\gamma _{i}\) is a decision variable that denotes the actual departure time of the trip i that cannot be less than the planned departure time (Eq. 3a). \(\Gamma _{i,j}\) is the sum of \(t^*_i\), the actual duration of trip i and the relocation time from \(n^d_{i}\) to \(n^s_{j}\). As such, Eq. (3b) ensures a sufficient time-window between the starting times of two consecutive trips. \(E_{i,j}\) (Eq. 3c) is the planned energy consumption associated with the electric bus for the duration \(\Gamma _{i,j}\). It is equal to the sum of \(e_i\), the actual energy consumption of the trip i, and the energy consumption during relocation. \(soc_i\) is a decision variable that keeps track of the SOC at node i where \(soc_i=1.0\) for \(i\in D_s\). \(c_{bat}\) is the battery capacity in kWh.Footnote 3

The Eq. (3d) describes the charging dynamics of a bus entering the charging node \(c_i\). \(\Delta soc_{i}\) is the SOC change corresponding to the charging event. We can write a similar equation for depot charging as well. Then it is straightforward to calculate the charging duration \(\zeta _{i}\), \(i\in C\cup W\), assuming constant charging power during a charging event. If \(p_i^c \in [0, p^c_{max}]\) and \(p_j^d \in [0, p^d_{max}]\) are the charging powers at nodes \(i \in C\) and \(j \in W\). Then the charging time is given by Eq. (3f).

$$\begin{aligned} \gamma _{i}&\ge t^s_{i}; { \forall i\in N}, \end{aligned}$$
$$\begin{aligned} \bigl (\gamma _{i}+\Gamma _{i,j}-\gamma _{j}\bigr )\sum _{b\in B}x_{i,j}^b&\le 0; { \forall i,j\in N}, \end{aligned}$$
$$\begin{aligned} \biggl (soc_i+\frac{E_{i,j}-\Delta e_i}{c_{bat}}\biggr )x_{i,j}^{elec}&=soc_j x_{i,j}^{elec}; { \forall i,j\in N\cup D}, \end{aligned}$$
$$\begin{aligned} soc_{i}+x_{i,j}^{elec}\Delta soc_{i}&=soc_{j} { \forall i\in N, j\in C, } \end{aligned}$$
$$\begin{aligned} soc_{i}&\ge soc_{min}{ \forall i\in V}, \end{aligned}$$
$$\begin{aligned} \zeta _{i}p_i^c&=c_{bat}\Delta soc_{i}; { \forall i\in C\cup W.} \end{aligned}$$

A time-window constraint with charging time applies for every arc that starts at a trip node and ends at another trip node while passing through a charging or depot charging node. The constraint ensures the existence of a sufficient time-window between the two trips, given the respective trip time, relocation time(s), and charging time.

Flow constraints, total delay, and fleet size

The mathematical form of the problem also includes flow constraints and a delay time constraint. The flow constraints ensure that each trip node is visited exactly once (Eq. 4a) and there is a continuity of flow from the starting depot until one of the destination depot nodes (Eqs. 4b, 4c).

$$\begin{aligned} \sum _{\begin{array}{c} i\in D_s\cup C \cup W\\ b\in B \end{array}}x_{i,j}^b&=1; \forall j\in N, \end{aligned}$$
$$\begin{aligned} \sum _{\begin{array}{c} i\in D_s\cup C\cup W \end{array}}x_{i,j}^b&=\sum _{\begin{array}{c} p\in V \end{array}}x_{j,p}^b; \forall j\in V\setminus D, \forall b\in B, \end{aligned}$$
$$\begin{aligned} \sum _{\begin{array}{c} i\in D_s, j\in N\\ b\in B \end{array}}x_{i,j}^b&=\sum _{\begin{array}{c} i\in N\cup C, j\in D_d\\ b\in B \end{array}}x_{i,j}^b. \end{aligned}$$

The only source of trip delays in our mathematical form is the residual trip durations sampled from the estimated stochastic distribution, a proxy for uncertain conditions such as road traffic and an input parameter to the optimization model. We have also defined the decision variable \(\gamma _{i}, i \in N\), the actual departure time of trip i that enables us to manage the uncertainty of the environment by strategically planning the bus fleet. Consequently, the total time delay, \(\kappa\), is the sum of delays at the start of each trip with respect to the scheduled departure time (Eq. 5a).

$$\begin{aligned} \kappa&=\sum _{i\in N}\bigl (\gamma _{i} - t^s_{i}\bigr ). \end{aligned}$$

We define the variables \(\lambda\) and \(\lambda _e\) as the number of buses and electric buses, respectively. We use these two variables to optimize for the minimum fleet size later. The number of buses equals the number of arcs emanating from the starting depot (Eq. 6a). The number of electric buses equals the number of arcs emanating from the starting depot where the bus type is “elec” (Eq. 6b).

$$\begin{aligned} \lambda&=\sum _{\begin{array}{c} i\in D_s, j \in N \\ b \in B \end{array}}x_{i,j}^b, \end{aligned}$$
$$\begin{aligned} \lambda _e&=\sum _{\begin{array}{c} i\in D_s, j \in N \end{array}}x_{i,j}^{elec}. \end{aligned}$$

Chance constraints

Chance constraints only apply to the fleet size and mixed fleet trade-off scenarios (refer to subsection “Scenario definitions and objective functions”). Chance constraints enable us to specify constraints that must be satisfied with a certain probability. With uncertain trip durations, it is reasonable to expect some trips to experience delays. Typically, public transportation companies can tolerate a certain amount of delays, provided it does not significantly tarnish the company’s image. For example, assume we can accept delays exceeding five minutes 90% of the time. In that case, we can represent it as a chance constraint. The binary decision variable \(\chi _i\) in Eqs. (7a) and (7b) is set to one if the delay is less than or equal to five minutes and zero otherwise. M is sufficiently large value and \(\mid N \mid\) is the number of trips.

$$\begin{aligned} \gamma _i - t_i^s - 5&\le (1 - \chi _i)M; \forall i\in N, \end{aligned}$$
$$\begin{aligned} \sum _{i\in N} \chi _i&\ge 0.9 \mid N \mid . \end{aligned}$$

Scenario definitions and objective functions

We define the following scenarios to evaluate the trade-offs of electric bus planning under uncertainty.

  • Baseline scenario: There is no uncertainty in travel time or energy consumption, meaning the electric buses operate precisely per the given schedule. We use the baseline scenario for comparison purposes and to set up partial solutions for optimizing scenarios under uncertainty.

  • Battery size trade-off: This scenario aims to evaluate the influence of stochastic energy consumption on the minimum battery size. Travel times are deterministic as in the baseline case, but the energy consumption in this scenario is stochastically modeled. The partial solutions of the variables \(x_{i,j}^b\), \(\lambda\), and \(\lambda _e\) are defined based on the solution of the baseline scenario.

  • Fleet size trade-off: This scenario aims to evaluate the influence of stochastic travel time and energy consumption on the minimum fleet size. Therefore, travel duration and energy consumption are incorporated into the model in their stochastic form. Moreover, we set the value of \(c_{bat}\) based on the solution of the baseline scenario.

  • Mixed fleet trade-off: The third trade-off scenario focuses on mixed bus fleets where electric and diesel buses may co-exist. Time and energy uncertainties are present in this scenario, and the battery size (for electric buses) and the fleet size are defined from the partial solution of the baseline scenario.

The baseline scenario defines the best case for electric bus planning and operation with the smallest electric bus fleet, minimum battery capacity, and no deviations from the planned schedules. The objective function for the baseline scenario is written as a weighted sum (Eq. 8a) where \(r_1\), \(r_2\), and \(r_3\) are the costs (weights) associated with each component objective.

Each stochastic optimization problem minimizes the expected value of the objective function over 20 scenario trajectories. Battery size trade-off scenario is set up by loading a partial solution of the baseline solution; therefore, the variables in the partial solution should not appear in the objective function (Eq. 8b). \(r_4\) is the cost associated with the total delay time. Recall that we define \(\kappa\) as the sum of delays at the start of the trips. That means even though there are stochastic delays during travel time, a transportation planner may minimize the delay at the beginning of the next trip by optimally dispatching the available vehicle. Similarly, Eqs. (8c) and (8d) depict the respective objective functions for fleet size trade-off and mixed fleet trade-off scenarios.

Each scenario objective is formulated as a minimization objective.

$$\begin{aligned} \mathcal {O}_{base}&=r_1 c_{bat} + r_2 \bigl (\lambda - \lambda _e\bigr ) + r_3 \lambda , \end{aligned}$$
$$\begin{aligned} \mathcal {O}_{to1}&= \mathbb {E} [r_1 c_{bat} + r_4 \kappa ], \end{aligned}$$
$$\begin{aligned} \mathcal {O}_{to2}&= \mathbb {E} [r_2 \bigl (\lambda - \lambda _e\bigr ) + r_3 y + r_4 \kappa ], \end{aligned}$$
$$\begin{aligned} \mathcal {O}_{to3}&= \mathbb {E} [r_4 \kappa - r_5 \lambda _e]. \end{aligned}$$

Overnight charging

The optimal overnight charging schedule is a charging schedule for each bus that minimizes the total charging cost during the overnight charging period (Eq. 9a). The total cost constitutes a demand cost that depends on the peak demand and an energy cost that depends on the electrical energy consumed during the charging period.

Let \(\mathcal {T}\) be the set of time steps belonging to the charging duration and \(\mathcal {P}\) be the set of indices corresponding to each electric bus. The constraint (9b) states that the sum of charging power over the charging horizon should be equal to the energy required to recuperate the batteries of each bus to their total capacity. \(p_t^i\) is a decision variable that denotes the charging power of bus i at time t, and \(\psi ^i\) is the energy required to recuperate the bus i. We calculate \(\psi ^i\) using the solution for soc at destination depot nodes in the optimization model presented earlier. \(y_t\) is the total charging power at time t that is upper bounded by \(\Phi\) (Constraints 9c and 9d).

$$\begin{aligned} \text {Minimize } c_1 + c_2,&\end{aligned}$$
$$\begin{aligned} \text {s.t. } \sum _{t} p_t^i&= \psi ^i; { \forall i\in \mathcal {P}}, \end{aligned}$$
$$\begin{aligned} \sum _{i} p_t^i&= y_t; { \forall t\in \mathcal {T}}, \end{aligned}$$
$$\begin{aligned} \sum _{i} p_t^i&\le \Phi ; { \forall t\in \mathcal {T}}, \end{aligned}$$
$$\begin{aligned} -u&\ge p_t^i - p_{t+1}^i; { \forall t\in \mathcal {T}, \forall i\in \mathcal {P}}, \end{aligned}$$
$$\begin{aligned} u&\le p_t^i - p_{t+1}^i; { \forall t\in \mathcal {T}, \forall i\in \mathcal {P}}, \end{aligned}$$
$$\begin{aligned} c_1&= \omega _1\Phi , \end{aligned}$$
$$\begin{aligned} c_2&= \omega _2\sum _t y_t. \end{aligned}$$

Constraints (9e) and (9f) limit extreme charging power fluctuations that could reduce the battery lifetime. We assume the maximum ramp rate u to be 20 kWh/min per time step in both directions. Lastly, the constraints (9g) and 9h calculate the demand cost and energy cost during the charging period where \(\omega _1,\omega _2\) are the demand price (CHF/kW) and energy price (CHF/kWh), respectively.

Economic assessment

The purpose of economic assessment is to assess and compare electric and diesel buses in terms of costs and energy consumption. The economic parameters used in the cost calculations are presented in Appendix 2: Table 6 in the appendix. Currently, public transport companies in Switzerland are exempted from paying a carbon tax. However, we include a carbon tax component in the operating cost calculation, given that there is a continuing effort from the Swiss government to introduce a new \(\text{CO}_2\) law.

Due to the different effective lifetimes of buses, batteries, and charging station infrastructure, we use the annualization approach in the investment cost analysis. The operating costs are also evaluated for one year period.

Case study

The case study presented in this article is based on a public bus line in Ticino, Switzerland, with 170 trips per weekday and 146 trips on the weekend, each spanning over 13 km. The trips takes place back and forth between two terminal stations, and the average planned travel times in the two directions are 39 and 46 min, respectively. The first bus leaves the depot at 04:27 in the morning (05:27 on the weekend), and the last bus is scheduled to return at 01:02 (also on weekends). Table 2 gives parameters specific to the bus type. The other input parameters used in the model, especially for energy calculations, are summarized in Table 3.

Table 2 Bus related parameters
Table 3 Other parameters used in the optimization model

A preliminary assessment confirms that the bus lines under our investigation do not require fast-charging pantographs at a terminal station for the feasible operation of electric buses. In other words, an overnight charging strategy is sufficient to meet the charging needs of electric buses on this bus line. We use this information to reduce the size of the problem by setting \(C = \varnothing\). The optimization horizon is one day at a one-minute time resolution. The problem constraints and objective functions form a Mixed Integer Non-linear Problem (MINLP) that we model and solve using the Python-Gurobi (Gurobi Optimizer version 9.5.2 under academic licensing) interface. The solver finds a solution with a 1% optimality gap for the base scenario in about 720s. The battery size, fleet size, and mixed-fleet stochastic models take much longer solution times (1300, 26,900, and 43,000s, respectively) due to the number of scenarios.Footnote 4 The minimum memory requirement for running the stochastic optimization models is 128 GB.

We extrapolate the simulation results from one weekday and weekend day for the economic cost calculations, assuming it represents each weekday and weekend day of the year.


Table 4 provides an overview of the key results for each scenario. The baseline conditions result in a minimum fleet of nine electric buses, each with a 610 kWh battery.Footnote 5

Table 4 Scenario results

As demonstrated by the battery size trade-off scenario, the buses require a larger battery size to accommodate the energy consumption uncertainties for the same fleet size. Uncertainties related to energy consumption result in approximately a 9.7% increase in battery size. On the other hand, given the same battery size, accommodating the energy consumption and travel time uncertainties requires at least one additional bus in the fleet. The mixed-fleet scenario allows the transportation planner to find an acceptable trade-off between the fleet and battery sizes but at the cost of increasing \(\text{CO}_2\) emissions.

The peak charging power demand under the battery size trade-off scenario is the highest among all scenarios investigated. Three crucial factors affect the potential for peak demand management during overnight charging. Firstly, if the buses require more charging due to higher energy consumption during the day, buses may need to charge for longer, leading to charging overlaps and higher peak demands. Secondly, if the duration between the first and the last bus returning to the depot at the end of the day is short, there is a higher chance that their charging can overlap. The final ingredient that describes the variance of the charging power profile is the fleet composition.

In the battery size trade-off scenarios, the average duration between the first and the last bus returning to the depot at the end of the day is 80.25 min. In comparison, the average duration between the first and the last bus arriving at the depot in the fleet-size trade-off scenario is 143.90 min (minimum: 99, maximum: 248), which is quite substantial and provides an extra time window for the buses returning early to charge and ramp up to maximum charging power. It also means these buses can ramp down  the charging demand later to keep the peak demand under control. In the mixed-fleet scenario, fewer buses require charging, naturally leading to lower charging peaks.

The grey area between the confidence intervals in Fig. 5 shows the variance of the total charging power that occurs mainly due to the uncertain return times of electric buses. The cause of this uncertainty in the fleet-size trade-off scenario is the trip delays and the number of electric buses. Observe that, on average, the fleet size trade-off scenario results in a lower charging peak, despite having a larger fleet size. A larger fleet size impacts the total charging energy demand primarily because the buses perform more dead-head trips from and to the depot. On the other hand, a larger fleet offers additional flexibility for charge scheduling. For instance, as seen in the case study, some buses can return to the depot earlier and begin charging, reducing the  charging time overlap with other buses and reducing the peak electricity demand. The mixed-fleet scenario induces high variance in the return times of the electric buses, which also contributes to the variance of peak charging power .

Fig. 5
figure 5

Total overnight charging power of the buses for each scenario. a Baseline, b Battery size trade-off, c Fleet size trade-off, d Mixed fleet. The red line shows the average charging power, and the dotted lines indicate the 95% confidence intervals

Uncertainties in travel time influence the total travel distance of buses. This is primarily due to the adjustments made in dispatch schedules to minimize trip delays, leading to different sequences of trips undertaken by each bus. A vital planning insight from these observations is the importance of having flexibility over fleet dispatch. Traditionally, fleet dispatch schedules are fixed and often very hard to change. As a result, we may observe increased battery capacities and overnight charging profiles such as the one in Fig. 5b that incur high demand costs and higher investments and network infrastructure. Transitioning towards an electric bus fleet means that a transportation company has to rethink its existing dispatch schedules and update them to have more flexibility in dealing with environmental uncertainties, optimize operations, and reduce costs.

In each scenario, the initial SOC when buses leave the depot is 1.0, and during overnight charging, the batteries are fully recovered such that the strategy is repeatable. It is essential to highlight the relationship between this initialization and the minimum battery and fleet size. Some studies investigate electric bus scheduling problems with initial SOC set to values less than 1.0, for example, 0.5. Without feasible diurnal charging options such as pantographs, such initialization can lead to unrealistically high battery capacity requirements or oversized bus fleets. The strategy we present minimizes both the battery and fleet sizes while being repeatable over time.

Figure 6 shows the annualized investment cost and operation cost calculated for each scenario. The total investment annualized over the lifetime is much lower for the case of mixed-fleets. At the same time, operating a mixed-fleet is also more expensive compared to other scenarios. However, mixed fleets offer an economically attractive transition strategy for many transportation companies that wish to electrify their fleets. It is important to note that as bulk energy consumers, transportation companies may have the option to negotiate more favorable tariff conditions from their local electricity suppliers. Moreover, given the present geo-political conditions, fossil fuel prices can show higher volatility and may increase significantly in the future. Such conditions, if transpires, further the economic argument in favor of electrifying the bus fleets.

Fig. 6
figure 6

a Annualized investment cost and (b) operation cost for each scenario


In this article, we attempted to evaluate and understand the impact of environmental uncertainties on the planning and operation of an electric bus fleet. In particular, we examined several trade-off scenarios. Based on the results, we observe that stochasticities related to energy consumption and travel time significantly impact some of the planning and operational decisions a transportation planner should make.

Uncertainties of the world induce adversity, leading to larger battery capacity requirements in electric buses. In particular, in situations where an overnight charging strategy is used, the fleet size, composition, and travel delays can influence the extent of our ability to manage the charging peaks. However, larger electric and mixed bus fleets provide more demand-shifting flexibility at the expense of more investment costs or environmental damage. It is important to note that while the general reasoning is still valid, the magnitude of such trade-offs depends on the specific use case that needs to be examined by the planners and decision-makers case by case.

Mixed fleets can be an attractive solution for organizations that seek to shift from a diesel to an electric bus fleet. Nonetheless, mixed fleets require effective operational planning, owing to the significant variances in charging profiles and operating costs. In particular, whether to run an electric or a diesel bus at a given time is a question that has several dimensions, such as minimizing dead-heading, the return and recharge schedules of electric buses, and mitigating the potential risk of critical battery depletion under extreme conditions.

Does investing in electrification (including renewable energy integration) of public transportation lead to a positive net return? Public transportation in Switzerland has long been considered a service with many social benefits, and the Swiss government subsidizes up to 50% of public transport costs on average.Footnote 6 The sales of tickets, subscriptions, and advertising alone are insufficient to cover the costs of transportation companies. Therefore, traditional measures such as net present value and return on investment cannot accurately evaluate the value of the public bus electrification projects without properly quantifying the associated social benefits. In this article, we assumed that all evaluated scenarios lead to the same social benefits. We also showed that electrification could generate the same social benefits but at a lower operational cost, which leads to the recovery of the initial investment over a period of time. More research can be done in this direction to understand better and quantify the social benefits of electrified public transport and propose more suitable means and metrics to evaluate projects whose primary objective is to provide a service.

In conclusion, the uncertainties of the environment play an essential part in the optimal planning and operation of electrified bus fleets. By considering these uncertainties through proper modeling and optimization techniques, we can enable public transportation networks that are more responsive to changing conditions, more profitable, and more supportive of the broader goals of sustainable urban mobility.

Availability of data and materials

The data sets used to estimate the probability distributions of trip delays are obtained via personal communication and are not publicly available.


  1. For the single depot scenario, the set \(D_s\) comprises solely of one element. The cardinality of \(D_d\) is the maximum number of vehicles, which is predetermined to be sufficiently large for the model to be feasible.

  2. We consider energy consumptions related to heating/cooling and ventilation under auxiliary energy uses.

  3. We assume each electric bus to have the same battery capacity. Consequently, the trip assignment is symmetric, and we implement a symmetry elimination constraint to eliminate symmetric solutions.

  4. If a reader wishes to reproduce the model, we recommend running several experiments to identify tight bounds for the variables to improve the solution time.

  5. The weekend operation requires only seven buses with approximately 590 kWh battery capacity. However, the optimal size is determined considering the continuous feasible operation of the fleet on both weekdays and weekends.

  6. These subsidies include both buses and railways. Buses, especially those serving rural areas, may receive a significantly higher share of incentives from the government.


  • Baldacci R, Battarra M, Vigo D (2008) In: Golden B, Raghavan S, Wasil E (eds) Routing a heterogeneous fleet of vehicles. pp. 3–27. Springer, Boston

  • Borčinová Z (2017) Two models of the capacitated vehicle routing problem. Croatian Oper Res Rev 8(2):463–469

    Article  MathSciNet  MATH  Google Scholar 

  • Bunte S, Kliewer N (2009) An overview on vehicle scheduling models. Public Transport 1(4):299–317

    Article  Google Scholar 

  • Daduna JR, Pinto Paixão JM (1995) Vehicle scheduling for public mass transit—an overview. (May 2016): 76–90

  • Fairchild K, Misra L, Shi Y (2016) Using triangular distribution for business and finance simulations in excel. J Financ Educ 42:313–336

    Google Scholar 

  • Freling R, Wagelmans APM, Pinto Paixão JM (2001) Models and algorithms for single-depot vehicle scheduling. Transport Sci 35(2):165–180

    Article  MATH  Google Scholar 

  • Gkiotsalitis K, Iliopoulou C, Kepaptsoglou K (2021) An exact method for the multi-depot electric bus scheduling problem in time windows. SSRN Electron J

  • Hjelkrem OA, Lervåg KY, Babri S, Lu C, Södersten C-J (2021) A battery electric bus energy consumption model for strategic purposes: validation of a proposed model structure with data from bus fleets in China and Norway. Transport Res Part D Transport Environ 94:102804

    Article  Google Scholar 

  • IEA: Energy technology perspectives 2020. (2020)

  • Ilin V, Matijević L, Davidović T, Pardalos P (2018) Asymmetric capacitated vehicle routing problem with time window. In: Proceedings of the XLV Symposium on Operational Research (SYM-OP-IS 2018), pp. 16–18

  • Jiang M, Zhang Y, Zhang Y (2021) Optimal electric bus scheduling under travel time uncertainty: a robust model and solution method. J Adv Transport 2021:1–19

    Google Scholar 

  • Lei H, Laporte G, Guo B (2011) The capacitated vehicle routing problem with stochastic demands and time windows. Comput Oper Res 38(12):1775–1783

    Article  MathSciNet  MATH  Google Scholar 

  • Li Jing-Quan (2014) Transit bus scheduling with limited energy. Transport Sci 48(November):521–539

    Article  Google Scholar 

  • Li L, Lo HK, Xiao F (2019) Mixed bus fleet scheduling under range and refueling constraints. Transport Res Part C Emerg Technol 104(March):443–462

    Article  Google Scholar 

  • Orloff CS (1976) Route constrained fleet scheduling. Transport Sci 10(2):149–168

    Article  Google Scholar 

  • Owen AB (1995) Nonparametric likelihood confidence bands for a distribution function. J Am Statis Assoc 90(430):516–521

    Article  MathSciNet  MATH  Google Scholar 

  • Paixão JP, Branco IM (1987) A quasi?assignment algorithm for bus scheduling. Networks 17(3):249–269

    Article  MathSciNet  MATH  Google Scholar 

  • Rinaldi M, Parisi F, Laskaris G, D’Ariano A, Viti F (2018) Optimal dispatching of electric and hybrid buses subject to scheduling and charging constraints. IEEE Conference on Intelligent Transportation Systems, Proceedings, ITSC 2018-Novem, pp 41–46

  • Shen Y, Li Y, Chen C, Li J (2023) Electric vehicle scheduling based on stochastic trip time and energy consumption. Comput Indus Eng 177:109071

    Article  Google Scholar 

  • Shields M (2022) Climate and Innovation Act. [Web Page] Retrieved from the portal of the Swiss government on 2023.06.20 .

  • Tang X, Lin X, He F (2019) Robust scheduling strategies of electric buses under stochastic traffic conditions. Transport Res Part C Emerg Technol 105:163–182

    Article  Google Scholar 

  • Taskesen E (2023) distfit is a Python library for probability density fitting.

  • Wang H, Shen J (2007) Heuristic approaches for solving transit vehicle scheduling problem with route and fueling time constraints. Appl Math Comput 190(2):1237–1249

    MathSciNet  MATH  Google Scholar 

  • Xiao Y, Konak A (2016) The heterogeneous green vehicle routing and scheduling problem with time-varying traffic congestion. Transport Res Part E: Logis Transport Rev 88:146–166

    Article  Google Scholar 

Download references


We acknowledge the valuable contribution of Claudio Blotti of Ferrovie Autolinee Regionali Ticinesi SA (FART) and Ivano Realini of Autolinea Mendrisiense SA (AMSA) within the context of PVxTutt’Elettrico project. We also thank Davide Strepparava and Dyuman Bulloni for their technical support.

About this supplement

This article has been published as part of Energy Informatics Volume 6 Supplement 1, 2023: Proceedings of the 12th DACH+ Conference on Energy Informatics 2023. The full contents of the supplement are available online at


This publication is supported by the PVxTutt’Elettrico project funded by the Federal Office of Transport’s SETP 2050 program under the grant agreement 0780000887.

Author information

Authors and Affiliations



Conceptualization: CBH; Methodology: CBH, LN, VM, MB; Modeling, testing, and validation: CBH; Writing: CBH, MB; Review and Editing: CBH, LN, MB, VM.

Corresponding author

Correspondence to Charitha Buddhika Heendeniya.

Ethics declarations

Competing interests

The authors declare that they have no competing interests.

Additional information

Publisher’s Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.


Appendix 1

See Table 5.

Table 5 Nomenclature for sets, parameters, and variables

To maintain brevity, the scenario dimension of the stochastic variables is not explicitly stated; however, it is understood that each scenario-dependent variable incorporates an extra dimension to accommodate for different scenarios within the stochastic programming model.

Appendix 2

See Table 6

Table 6 Parameters used for the CAPEX and OPEX evaluation

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit

Reprints and Permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Heendeniya, C.B., Nespoli, L., Belliardi, M. et al. Exploring trade-offs in public bus electrification under stochastic conditions. Energy Inform 6 (Suppl 1), 35 (2023).

Download citation

  • Published:

  • DOI: