Minimum Cost Flow-Based Integrated Model for Electric Vehicle and Crew Scheduling

Vehicle and crew scheduling is vital in public transit planning. Conventionally, the issues are handled sequentially as the vehicle scheduling problem (VSP) and crew scheduling problem (CSP). However, integrating these planning steps ofers additional fexibility, resulting in improved efciency compared with sequential planning. Given the ever-growing market share of electric buses, this paper introduces a new model for integrated electric VSP and CSP, called EVCSPM. Tis model employs the minimum cost fow formulations for electric VSP, set partitioning for CSP, and linking constraints. Due to the nonlinear integer property of EVCSPM, we propose a method that hybrids a matching-based heuristic and integer linear programming solver, GUROBI. Te numerical results demonstrate the efciency of our methodology, and the integrated model outperforms the sequential model in real-life scenarios.


Introduction
Developing public transit is the fundamental way to achieve sustainable urban development [1], which has been a widely discussed topic since the 1960s.Specifcally, vehicle and crew scheduling are two major planning problems in public transport scheduling [2].Tese problems aim at minimizing the operational costs associated with the feet size and crew size required to ensure timely trips and compliance with labor crew regulations for efcient vehicle blocks and crew shifts [3].Typically, these problems are approached separately, with the vehicle scheduling problem being addressed frst, followed by the crew scheduling problem [4].
Ball et al. [5] contend that scheduling vehicles independently of the crew is not ideal for urban transportation, as crew cost typically outweighs vehicle operating cost.It is well established that integrating planning steps reveals more options and increases the solution space, leading to greater efciency gains [6].Furthermore, public transport operators face challenges transitioning from conventional diesel to electric vehicles (EVs) powered by batteries [7].In recent years, the market share of EVs has experienced a signifcant increase [8][9][10].On the 27th of January 2022, the Ministry of Transport issued the "14th Five-year Development Plan for Green Transportation," which includes a goal of reaching 72% of EVs in urban public transport and making fully EVs the mainstream option in the bus market by 2025 [11].Hence, we address the electric VSP (EVSP) and CSP simultaneously.Te combination of these two problems is called the electric vehicle and crew scheduling problem (EVCSP).
Resource-constrained VSPs, including EVSP, are known to be NP-hard [12].In addition, the single-based CSP is also NP-hard due to complex constraints arising from wage agreements and internal regulations [13].Te EVCSP falls into the category of NP-hard problems.It is considerably more challenging than the isolated problem [14], and it takes more time to solve optimally, particularly for real-world and large-size applications [15].
Only a few papers tackle the integrated vehicle and crew scheduling problem (VCSP) [4], and several discussions concern the electric version (EVCSP).Existing literature on VCSP (including EVCSP) models and algorithms is summarized in Table 1.To our knowledge, all models proposed in the literature fall into one of two classes [55]: (i) partial integrations and (ii) complete integrations that require decisions to be taken simultaneously.
Some early papers deal with partial integration [33]: (1) schedule vehicles using a heuristic approach in CSP, (2) include crew considerations in VSP, and (3) change vehicle schedules in CSP.Most of the procedures fall under the frst category and are based on a heuristic procedure proposed by Ball and Bodin [5].Te solution procedure is decomposed into three components, emphasizing the CSP: a piece construction component, a piece improvement component, and a shift generation component.Similar heuristic approaches in the frst category are proposed by Tosini and Vercellis [23]; Falkner and Ryan [21]; and Patrikalakis and Xerocostas [22].All these approaches use a similar set covering formulations as in Ball et al. [5].Afterward, the approach that solves CSP incorporates side constraints for the vehicles that appear [4].Scott [18] frst proposed approaches for the second category by heuristically determining vehicle schedules that account for crew costs using the linear programming dual of the HASTUS CSP model.Te third category has far fewer fruits than the frst two, with Gintner et al. [26] proposing a time-space network formulation for CSP that allows vehicles to have more autonomy during the crew scheduling phase, ultimately leading to selecting the most consistent vehicle schedule that aligns with the objectives of CSP.We refer to Freling et al. [28] for an overview of these papers.
Te state-of-the-art complete integration models for VCSP fall into three main categories [50]: (1) network-fowbased formulation, (2) constraint-based model, and (3) maximum covering model.Te earliest and most successful category is the network-fow-based formulation.Tese models mainly comprise time-space/multicommodity/ quasi-assignment [2,4,38] network fow formulations for VSP, a set partitioning/covering for CSP, and additional linking constraints to ensure the compatibility of vehicle and crew schedules [14].Freling [29] introduces the frst integrated VCSP model using quasi-assignment-based formulations, while Huisman [27] provides the initial general formulations for VCSP by extending the single-depot model of Freling [29] to the multidepot case.Te second category of models can refer to Laurent and Hao [53] who present an integrated model based on constraint satisfaction that is intuitive and natural [3].Prata et al. [56][57][58] propose the maximal covering model under the third category, which generates potential blocks, shifts directly over the timetabled trips, and then covers all trips with available resources (vehicles and crews).For an overview of complete integration, we can refer to Steinzen et al. [42].
To the best of our knowledge, only two papers address the issue of EVCSP: Perumal et al. [7] and Sistig and Sauer [34].Perumal et al. [7] modify the mathematical model proposed by Friberg and Haase [20] to explain VCSP as a set partitioning problem by adding additional constraints that link vehicle and crew schedules.Tey incorporate the crucial constraints of EVs, including limited driving range and lengthy recharging times [60,61], into the VCSP, thereby increasing operational complexity.Teir research suggests resolving EVCSP using a branch-and-price heuristics method coupled with an adaptive large neighborhood search (ALNS).However, the model referred to by Perumal et al. [7] is partially integrated and only considers a constant driving range for EVs.Yet, the actual driving range can be infuenced by various factors such as air density, driving speed, air conditioning usage, and complex road surfaces [11].Ten, Sistig and Sauer [34] avoid this faw, and the integrated model they refer to is initially proposed by Freling [29].Tis paper aims at an innovative, low-complexity model for the integrated issue and advocates for energy consumption and recharging strategies that are more practical to include in the scheduling process.
Te minimum cost fow (MCF) is a common type of network fow that can be extended in various ways [62].Tis paper presents a complete integration model for EVCSP, which is based on the MCF.Specifcally, the model involves MCF formulations for EVSP, set partitioning for CSP, and linking constraints that guarantee compatibility of EV and crew schedules.Te outcomes of MCF can be useful for addressing various network-related issues, including maximum fow, assignment, shortest path, transshipment, and transportation problems [63].Successful integration requires a practical design of the key MCF components.
Furthermore, it is imperative to customize EVs' energy consumption and charging strategy for accurate modeling.In practice, EVs spend signifcant time at multiple intermediate stops, waiting at red lights, and navigating through trafc jams.Tus, we divide the EV operation into prevailing driving and standstill.Fontana [64] demonstrates that the energy consumption of an EV is modeled using engineering principles and supported by analytics.We utilize the mentioned model to calculate the EV energy consumption of prevailing driving and standstill states.Typically, EV charging strategies include battery swaps, slow recharge, and fast recharge [60,61].Te current mainstream strategy in bus operation enterprises is to perform slow recharge at night and fast recharge during daily operations [11].
Te contributions of this research are fvefold: (a) A novel EVCSP model based on MCF is proposed with an integrated design for nodes, directed arcs, cost, and constraints; (b) the exact minimum feet size for VCSP is derived, and furthermore, the lower bound of both feet and crew sizes for EVCSP is discussed since minimizing feet and crew sizes are the primary task; (c) time compatibility and energy compatibility of any two spells or trips are defned for arc generation; (d) an approach hybrids a matching-based heuristic method, and integer linear programming (ILP) solver is derived for our integrated model; and (e) a series of numerical examples are provided to illustrate the performance of the model and the approach developed.
Te remainder of the paper is structured as follows.Section 2 elaborates on the concepts related to EVCSP.Section 3 suggests an integrated design for the problem 2 Journal of Advanced Transportation

Electric Vehicle and Crew Scheduling Problem
Te EV and crew Scheduling can be clarifed more clearly by breaking it into subproblems and giving an integrated description.We initially establish the concepts by introducing the following terminologies [1,65]: Te EVSP involves generating several blocks and assigning each to an EV.Te blocks are constructed by organizing the EV's daily work, starting from a pull-out from a depot, followed by a sequence of trips, and ending at a pullin to the same depot.Te objective is to minimize feet size and variable operating costs, which include trip times, idle times, and deadheads [66].Te optimization is subject to three constraints: (a) Each trip can only be assigned to one EV (b) Each EV must begin and end its daily work with a pull-out from and pull-in to the same depot, respectively (c) Two consecutive trips for each EV must be time-and energy-compatible Figure 1 depicts the EVSP in a time-space network.Te trips comprise three departure (or arrival) points, namely P 1 , P 2 , and P 3 .D represents the set of depots, and R represents the set of recharge points.Tere are four types of arcs in the network: a pull-out arc connects a depot to a trip, a pull-in arc connects a trip to a depot, a trip-link arc connects two trips, and a recharge-link arc connects a trip to another trip through a visit to a hidden recharge point.An EV has to temporarily return to a depot, also known as a depot return when the gap between two consecutive trips is signifcant.Maintaining the EV's energy during scheduling via recharging is imperative.

Crew Scheduling Problem.
Crew scheduling aims to create a feasible schedule (several shifts) to cover all tasks within a single day of vehicles (all blocks).Te objectives of CSP are twofold: minimize both the crew size and the total wage costs while adhering to the following constraints: (a) Each trip is assigned to a single shift (b) Each crew's relief occurs at the specifed RO (c) Each shift must confrm all operational requirements and labor laws, known as a legal shift Te labor laws pertaining to the CSP are intricate and multifaceted.Below, we provide a summary of typical constraints that restrict the efcacy of shifts: (1) Te length of a spell must not exceed the stipulated upper limit (2) Te length of a shift should not surpass the maximum length designated for the respective shift type (3) Te working hours for a shift must fall within the minimum and maximum limits specifed for the corresponding shift type (4) Te driving time during a shift should not exceed the minimum and maximum driving time allowances set for the respective shift type (5) During a straight shift, meal breaks must be taken at the designated time and location (6) For split shifts, check-in and check-out times must not occur earlier than the earliest check-in time nor later than the latest check-out time prescribed EVCSP aims to generate a feasible schedule for EVs and crews to cover all tasks, i.e., all trips.Te objectives of EVCSP are to minimize feet size and crew size, deadheading time, idle time, and wage costs.Te crews are permitted to carry out crossovers at relief points.Te schedule is subject to complex constraints [67].In particular, the following universal constraints must be satisfed: (a) Each trip must be covered by only one EV (b) Each EV must be handled by only one crew simultaneously, but another crew can replace the crew (c) Each EV must start its frst trip from a depot and end its daily work there (d) Te connection of any two consecutive EV trips must be compatible regarding time and energy (e) Each crew's relief must be carried out at the specifed RO (f ) Each shift must comply with all operational constraints and labor laws Tis paper is dedicated to addressing the single depot EVCSP, where EVs are responsible for both pull-out and pull-in operations at a single depot.Figure 3 illustrates the EV blocks and crew shifts simultaneously from integrated EV and crew scheduling for executing the timetabled trips as shown in Figure 4.

Related Assertions of Fleet Size and Crew
Size.Let T � {1, 2, . .., n} denote the set of timetabled trips.Tis section introduces the notions related to time compatibility.

Defnition 1 (Θ). Let t s
i and t e i denote the start and end time of trip i, and DH ij refers to the deadheading time from trip i to trip j.Bertossi et al. [68] defne the compatibility iΘj of any two trips, i and j, as Otherwise, trip i is time incompatible with trip j (iΘj).
Defnition 3 (Incompatible degree, ID).Suppose U is an incompatible set of T, then the number of trips in U is the incompatible degree, i.e., ID(U) � |U|.

Journal of Advanced Transportation
Defnition 4 (Maximum incompatible degree, MID).MID represents the largest ID among all incompatible sets of T, i.e., MID(T) � max ID(U) | ∀in compatible set U of T  .By referring to the decomposition theorem [69], we derive the theoretical minimum feet size (TMF) for the VCSP.

Theorem 6. Let T be the set of timetabled trips. Ten, the TMF for the VCSP is equal to MID(T).
Proof.It is reasonable to assume that the set T, equipped with the time compatibility relation, forms a partially ordered set (poset).For a poset P, elements a and b are comparable only if either a ≤ b or b ≤ a; otherwise, they are noncomparable.A subset S of P is called a chain if every two elements in S are comparable.A subset S of P is independent if every two elements in S are noncomparable.For the VCSP, we defne a trip as an element in the poset and use the time compatibility of trips to establish the comparability relation.Ten, a block corresponds to a chain.Dilworth's decomposition theorem states that the minimum number of chains partitioning a poset P equals the maximal number of independent elements.Consequently, the TMF for the VCSP is equivalent to MID(T).Teorem 6 is true.

□ Corollary 7. For the EVCSP, MID(T) provides a lower bound for the feet size.
Proof.Since EVs have limited battery capacity, we need to consider both the nodes' time and energy compatibility (see Section 3.3).As a result, its feet size is not less than that of VCSP.

6
Journal of Advanced Transportation

Integrated Design for Electric Vehicle and Crew Scheduling Based on Minimum Cost Flow
In graph theory, MCF is a network with direct arcs and nodes.It requires a least-cost path starting from a given node, followed by several nodes connected by directed arcs, and ending at a specifed node.Let G(N, A) be a directed network consisting of the arc cost c ij and capacity (upper bound, u ij , and lower bound, l ij ) associated with every arc (i, j) belonging to A. Each node i ∈ N possesses several resources b i .Te MCF model (MCFM) can be formulated as follows: Te objective is to minimize the total cost, with the capacity constraint and conservation of fows represented by ( 3) and ( 4), respectively.If arc (i, j) is selected, x ij > 0; otherwise, x ij � 0. We now develop an integrated design for EVSP and CSP based on the MCF.

Integrated Design for EVCSP.
We design four critical elements to transform EVCSP into an MCF problem: nodes, directed arcs, cost, and constraints.
Incorporating both the EV and crew constraints, along with their associated limitations, into the EVCSP model presents signifcant complexity, and thus, building the model directly becomes difcult.As a result, we employ a design based on a set of predetermined potential shifts, which act as the precondition for the integrated EVCSP model (EVCSPM).
Statement 9. Te potential shifts are legal, i.e., each potential shift complies with various labor laws, and all its spells are time-compatible.

Design of the
Nodes.Suppose T is the set of timetabled trips, D is the set of depots, and W is the set of feasible spells.We defne two types of nodes.If the shifts are defned as nodes, EVCSP can be illustrated in Figure 5.However, it is not feasible since the cost of the shift nodes needs to be defned in EVCSPM, which becomes a set partitioning CSP model and is incapable of handling EVSP.

Design of the Directed Arcs.
Given the existence of two types of nodes, fve directed arcs follow: (1) A pull-out arc connects a depot to a spell.
(2) A pull-in arc connects a spell to a depot.
(3) A spell-link arc connects two spells.(4) A recharge-link arc connects a spell to another spell through a hidden recharge point.(5) A depot-return arc connects two spells with a temporary depot stop if the time gap between the consecutive spells is large enough (e.g., 3 h).An EV does not recharge in a depot-return arc.
Te spell node consists of multiple trips connected by trip-link arcs.We defne the trip-link arc as an implicit arc, while the pull-out, pull-in, spell-link, and recharge-link arcs are explicit.
A spell is feasible if all implicit arcs within it are time-and energy-compatible.An explicit arc is also feasible, provided that its compatibility is met (see Section 4.3 for the defnition of arc compatibility).

Design of the Cost.
We present the arc cost and shift cost below.Te arc cost represents the connection cost between consecutive nodes, which comprises deadheading time, idle time, and recharge cost (if recharging is required).Te shift cost includes the trip connection cost within each spell included in the shift and the total wage cost.
Specifcally, the arc cost C ij between nodes i and j is defned as follows: where t e i represents the end time of trip i, t s j is the start time of trip j, and T rt is the recharging time.
Te shift cost C s of shift s is defned as follows: where C t represents the trip connection cost of spell t included in s, comprising the idle time and deadheading time between adjacent trips.Te total wage cost of s is represented by h(s).
For a viable integrated schedule, both C ij and C t constitute elements of the vehicle schedule cost, whereas h(s) contributes to the crew schedule cost.
Statement 11.Adding the fxed trip cost to the arc and shift costs is unnecessary.
Since a feasible schedule must cover all the timetabled trips, the trip cost remains constant regardless of the selected schedule.

Constraints on the Paths.
To satisfy the complex constraints associated with EVCSP for a chosen path, we impose the following constraints on the EV fow: constraint (1) ensures the path's integrity, while constraints (2) and (3) aim to create integrated schedules, d i , d j ∈ D.
(1) Each path must start from a source node d i , followed by a sequence of feasible nodes connected by directed arcs, ending at a sink node d j .i � j, when the path needs to return to the home depot (2) Each node in a selected path can be covered by only one selected shift (3) Te selected paths and shifts should cover each timetabled trip precisely once where DH ir represents the deadheading time from the arrival point of trip i to the recharge point r and DH rj denotes the deadheading time from r to the departure point of trip j.

Energy Compatibility.
Te energy consumption for executing trip i is denoted by e i , and the EV energy left before serving trip i is denoted by e s i .If trip-link arc(i, j) exists and is selected in a spell, then e s j � e s i − e i − DE ij , where DE ij represents the deadhead energy consumption from the arrival point of trip i to the departure point of trip j.
Te energy consumption for executing spell p is denoted by E p , and the EV energy left before serving spell p is E s p .Te energy left after serving spell p is noted as E e p , which is equal to E s p − E p .If a spell-link arc (p, q) exists and is selected, then E s q � E s p − E p − DE pq , where DE pq signifes the deadhead energy consumption from the arrival point of the last trip in p to the departure point of the frst trip in q.
We set a threshold, E min , to avoid EV breakdown during the spell (trip) serving.For two consecutive trips, i and j, in a spell, only those that are time-compatible can be evaluated for energy compatibility.Te trip-link arc (i, j) exists if the following formula (11)  where DE jr is the deadhead energy consumption from the arrival point of trip j to r.
Similarly, for two spells, p and q, we can only discuss their energy compatibility if they are time-compatible.Let us assume that p and q are time-compatible for a trip link.Te spell-link arc (p, q) exists if they are energy-compatible, which defned as where DE qr is the deadhead energy consumption from the arrival point of the last trip in q to r. Assume that spells p and q are time-compatible for recharge link.If formula (12) is not fulflled but conforms to formula (13) represented below, a recharge-link arc (p, q) exists where DE qr signifes the deadhead energy consumption from the arrival point of the last trip in q to r.In all cases, the EV can reach the recharging station before reaching E min .

Recharging and Discharging of EV Batteries.
Given the limitation of EV battery capacity, it is crucial to develop efective recharging strategies and monitor the EV's energy consumption.

Energy Consumption of an EV.
We calculate the energy consumption during the trip and deadhead while considering the states of prevailing driving and standstill.Urban EVs in the bus market are generally required to operate at a relatively stable speed.Fontana [64] demonstrates that the net energy consumption linked to acceleration is almost zero along a specifc path under certain simplifying assumptions.In calculating the prevailing driving energy consumption, we applied the following formula proposed by Fontana [64], which accounts for various factors, including air density, driving speed, air conditioning usage, and complex road surfaces.
Te formula consistently measures the energy consumption per unit distance under the driving speed, v(m/s).Within the formula, the symbol η represents the efciency parameter, ρ (kg/m 3 ) is the air density, C ω is the EV's drag coefcient, A f (m 2 ) refers to the frontal area, μ represents the friction coefcient, m (kg) is the EV's mass, g(m/s 2 ) is the gravitational constant, and α(radians) measures the road angle, whereas P acc (W) represents the energy consumption used up by accessory loads, including air conditioners, headlights, and EV management systems.[70] set the parameters as ρ � 1.2 kg/m 3 , C ω � 0.29, A f � 2.27 m 2 , η � 0.9, g � 9.8m/s 2 , α � 0, and μ � 0.012.Te air conditioner consumes 7000 W of power P acc if turned on and 2000 W otherwise.Let m EV denote the weight of the EV, c p denote the passenger capacity, and w avg denote the average adult weight.Ten, the total weight of the EV under the crew-only scenario is m � m EV + w avg , whereas the total weight under the fully loaded scenario is m � m EV + c p w avg .Proposition 12 shows that in the absence of air conditioning, the function for the EV's energy consumption per unit distance f(v) is minimized when v � 13.16m/s ≈ 47km/h, while in the presence of air conditioning, it is minimized when v � 19.98m/s ≈ 72km/h.However, in practice, the speed of EVs is often limited to 25∼40 km/h for safety reasons.Terefore, we set v � 40km/h.

Proposition 12. EV's per-distance energy consumption
Te energy consumption of an EV during a standstill is approximately equal to P acc .
Let D i and D ij be the fxed distances traveled for trip i and deadhead from i to j (i, j ∈ T ∪ D ∪ R), respectively.Te energy consumption e i and e ij for trip i and deadhead from i to j, respectively, can be calculated as follows: where T i is the trip time taken for trip i. □

Recharging Strategy.
We employ the current mainstream recharge strategy, which involves slow recharging at night and fast recharging during daily operations.Prior to initiating daily operations, the EVs undergo full charging.
For the recharge-link arc(p, q) to exist, spells p and q must be time-compatible for the recharge link, E e p − DE pq − E q − DE qr < E min and E e p − DE pr ≥ E min , which taking into consideration the EV energy left after serving spell p (E e p ), the energy consumption of spell q (E q ), and the deadhead energy consumptions (DE pq , DE qr , and DE pr ).
Assuming the EV battery capacity is denoted as E full (kW), the fast-recharge power as P f (kW), and the recharge time as T rt (min).Let the updated EV energy after recharging at recharge point r be denoted as E, which is given by else.

⎧ ⎨ ⎩ (16)
Tus, the EV energy left before serving spell q is E s q � E − DE rq .Te determination of whether the connection arc between spells complies with the energy constraint cannot be made in advance.It can only be ascertained once the EV's completed spells are known during the scheduling process.Tis will indicate whether the EV can execute subsequent Journal of Advanced Transportation spells using either the spell-link arc or the recharge-link arc.If the remaining energy of an EV cannot support the execution of a spell during the scheduling process, then the spell will not be considered for selection.However, the spell may still be selected if the EV goes to the recharge point for recharging, and the recharge link between the spell and the last spell currently selected by the EV is compatible in terms of time.

Integrated Model for Electric Vehicle and Crew Scheduling
As described in Section 3, the EVCSP involves identifying the optimal sequence of feasible nodes connected by directed arcs to cover all tasks at minimum cost.Each path must originate from and terminate at a node within the depot set D. Te sequence of intermediate nodes must be feasible and connected by directed arcs.x w i ,w j + w j : w j ,w i ∈SL ∪ RL ∪ DR x w j ,w i +

􏽘
w j : d i ,w j ∈PO E e w j � 10 Journal of Advanced Transportation Te decision variable x ij takes a value of 1 if the arc (i, j) is selected.Similarly, y s takes a value of 1 if the shift s is selected and 0 otherwise.Formula (17) aims to minimize the total cost comprising operating and wage costs.Tis is achieved through the cost defnitions in formulas ( 6)- (9).Formulas ( 18)-( 20) represent the conservation of fows, which ensures that each selected spell node is covered by only one EV.Formula (21) represents the conservation of depots, which ensures an equal feet size to pull-out from and pull-in to a depot.Formula ( 22) represents the constraint of trips, which ensures that each trip is covered by only one crew.Formula (23) represents the energy state transition of EVs.Formula (24) represents the remaining energy constraint of EVs, which must always be kept above E min .Finally, formulas ( 25)-( 28) represent the value constraints of the decision variables.We have assessed the feasibility of the EVCSPM by solving an instance for which the optimal schedule is known in advance, using the GUROBI solver.
Research on EVCSP is extremely limited.Our model's complexity is compared to the only two EVCSP models, EVCSPM-1 [7] and EVCSPM-2 [34], using two indicators: the number of variables and constraints.Table 3 displays the results, where B represents the set of blocks and S represents the set of shifts, |D| � p, |W| � q, |S| � m, |T| � n, |B| � r.
In Table 3, the inequality n 2 + m + 4n < 2pq + q 2 + m << r + m holds.Te EVCSPM-2 has the fewest decision variables compared to other models, while the EVCSPM model maintains a reasonable number of variables.In practice, the feasibility of spells is restricted by various labor regulations.Consequently, 5q + p + n << n 2 + 2n < 2n + n 2 .As a result, the EVCSPM imposes the fewest constraints.Overall, the EVCSPM demonstrates a low level of complexity.
Efcient resource utilization is the main objective of scheduling.
Statement 13.To limit the feet and crew size, substitute formula (17) with (29), where C veh and C crew refer to the fxed cost of EV and crew, respectively, while α, β ∈ (0, +∞) represent adjustment parameters.
Choosing a pull-out arc represents selecting an empty EV that must be utilized.Consequently, if a pull-out arc is chosen as part of the path, a signifcant enough cost of αC veh is added as a penalty that could reduce the feet size.Similarly, selecting a shift s requires a crew to be available.Terefore, if a shift s is chosen as part of the path, a cost of βC crew is added as a penalty that could reduce the crew size.
Typically, an EV requires depart from and return to the same depot.Journal of Advanced Transportation Statement 14.Assuming that each path must cover a maximum of two spells (constrained by formula ( 30)), the subsequent formula (31) ensures that the path returns to the home depot.

Solution Method
Tis section proposes a hybrid approach for the EVCSP that integrates both the heuristic method and ILP.Te fundamental approach is compiling the potential shifts using a matching-based heuristic and subsequently solving EVCSP iteratively with an ILP solver named GUROBI.Te heuristic method, employing a matching-based approach, generates shift set to comply with a range of labor regulations and restrains the crew size through a set of "soft constraints" represented as flter conditions.Te heuristic methodology comprises three steps: tierpartitioning, spell-constructing, and shift-generating.Algorithm 1 of the tier-partitioning step splits the timetabled trips T � {1, 2, . .., n} into several nonoverlapping incompatible sets labeled as S 0 , S 1 , . .., S K , with T arranged in ascending order by departure time.Here, S i � {j|jϵT & tier(j) � i}, with tier(j) representing the tier number for trip j, i � 0, 1, . .., K.
We construct the spells with partitioned trip tiers S 0 , S 1 , . .., S K .However, generating all feasible spells can be challenging when solving realistic EVCSP.Tus, to address this issue, we use Algorithm 2 to fnd the spells led by each trip of each tier in turn.Specifcally, the algorithm the following restrictions: (1) the spell comprises l pieces (spell_l) where the linking arcs are the edges of the maximum cardinality matching between adjacent tiers, p ≤ l ≤ q, and (2) the feasible length of the spell is limited to [len_Min, len_Max], as specifed in labor regulations.Here, spell_S represents the set of spells, and len_spell corresponds to the spell's length, defned as the time interval between the end time of the preceding trip and the start time of the initial trip within the shift.
Te shift-generating Algorithm 3 generates shift set referred to as PS.Considering labor regulations, Algorithm 3 restraints the minimum and maximum break and work times.Here, break_MinStr and break_MaxStr denote the minimum and maximum break times, respectively.Similarly, work_Min and work_Max represent the minimum and maximum work times, where the work duration is calculated as the diference between the shift's time span and the break time.sT i and eT i signify the start and end times of spell i , and the tw ij indicates the work time of a straight shift (i, j).
Each straight shift generated by Algorithm 3 consists of two spells.PS is constructed to include all tripper shifts to ensure that they cover all timetabled trips.Each tripper shift in PS only comprises one spell.Te schedule-producing Algorithm 4 updates the optimal integrated schedule by circularly solving the EVCSP subproblem, where F represents the iteration threshold, #shift represents the number of shifts, and EVCSP_shift_S′ is the EVCSP with the potential shifts set shift_S′.
Te framework of the hybrid approach is illustrated in Figure 6, where T is the timetabled trips.

Experiments and Results
A series of experiments are conducted based on a case study of bus route 2 in Xiaogan, Hubei, China (XGR2), which operates pure EVs.Te XGR2 route spans 12.7 km and has 30 stops, servicing 270 trips daily.Te EVs maintain a consistent departure interval of 5∼8 min throughout the day.Te EVs used are of the pure EV type XML6105, with a weight of 11,000 kg, rated capacity for 40 passengers, and battery capacity of 140 kWh.Te average weight of an adult passenger is 62 kg.Te fast-and slow-recharge power is 160 kW and 60 kW, respectively.We obtain eight variant instances (T1∼T8) from XGR2 to test our method and model.Te distribution of timetabled trips for each instance is illustrated in Figure 7.
In Section 6.1, we implement orthogonal experiments to determine the optimal parameter settings for our hybrid heuristic method and EVCSPM.In Section 6.2, we compare our method with GUROBI via comparative experiments.Subsequently, we test the performance of EVCSPM versus the sequential model in Section 6.3.Lastly, we conduct a sensitivity analysis on the parameters in Section 6.4. 4 displays the guidelines for work assignments for various shift types in the test instances.#spell indicates the number of spells.A 1-spell shift unequivocally consists of only one spell, whereas a 2-spell shift includes two consecutive spells with an intervening break.

Experiments for Optimal Parameter Settings. Table
We assigned a cost of 1,000 for the utilization of each EV or crew, denoted as C veh � C crew � 1,000.Additionally, there is a small variable cost of 1 for every minute an EV operates outside the depot and a cost of 0.1 for each minute, the crew works.Te fxed recharge cost, C r , is set at 15, recharge time T rt at 30 min, and energy threshold E min at 10 kW.EVCSPM (1) PS, i ⟵ 1, F, n, SC ⟵ ∅ (2) while i < F do (3) call GUROBI to fnd a minimal #shift crew schedule shift_S for the CSP with PS as the potential shifts (4) randomly selecting n shifts from PS and incorporating them into shift_S to create shift S ′ (5) call GUROBI to fnd an integrated schedule SC ′ for the EVCSP shift S ′ (6) if fit(SC) > fit(SC ′ ) (7) then SC ⟵ SC ′ (8) aim at the blocks in SC ′ , construct a new shift set to extend to PS (9) i ⟵ i + 1 (10) Accordingly, p has the most signifcant efect on feet size.Similarly, the optimal combination for crew size is α 1 β 3 p 1 (or p 2 ) q 3 .Te Journal of Advanced Transportation parameters afect crew size in order: (main) p ⟶ q ⟶ α(β) (minor).Te optimal combination for feet + crew size is α 3 β 1 p 1 q 3 .Te parameters afect the feet + crew size in order: (main) p ⟶ q ⟶ α(β) (minor).Te optimal combination for the cost of T1 is α 3 β 1 p 1 (or p 2 ) q 2 , while that of T2 is α 2 β 2 p 3 q 2 .Te parameters afect the cost in order: (main) q ⟶ p ⟶ α (β) (minor).Prioritizing the minimization of feet + crew size, it is evident that p 1 (or p 2 ) q 3 is the most competitive option.α and β have a marginal infuence on all four items.Tus, we select α 2 and β 2 based on their higher frequency of occurrence.Te optimal factor level is α 2 β 2 p 2 q 3 , which implies α � 2, β � 2, p � 2, and q � 6.

Experiments on Hybrid Heuristic Method and GUROBI.
Tis section aims to verify the efectiveness of the proposed heuristic method by comparing it to GUROBI using problems T1∼T8.GUROBI solves the EVCSP with PS generated by Algorithms 1-3 as the potential shifts.Te results are presented in Table 8, where #recharge refers to the number of recharges and the relative percentage deviations (RPDs) over the schedule produced by GUROBI are provided.
Table 8 shows that GUROBI cannot solve problems T1∼T6.Te sizes of the feet and crew and the number of recharges generated by the hybrid heuristic method for T7 and T8 are the same as those produced by GUROBI.Te average RPD in terms of cost for T7 and T8 is only 0.3%, but the average time taken by the heuristic method is only onesixth of GUROBI's.Terefore, we employ this method, as the results produced are sufciently good and efcient to evaluate EVCSPM.

Experiments on EVCSPM and Two-Stage Sequential
Model.Te section compares the proposed EVCSPM with the two-stage sequential model (TSM).TSM comprises the EVSP model, followed by the CSP model.We formulate the EVSP model by incorporating EV energy state transfer and energy threshold constraints into the traditional VSP model [71].We adopt the classic set covering model [65] for crew scheduling.
Ideally, the same algorithm should be used to evaluate the performance of both models, but our heuristic method is tailored to EVCSPM and not easily adaptable to TSM.To ensure fairness to TSM, we solve it by sequentially processing the EVSP and CSP models with GUROBI.Moreover, because of the NP-hard property of EVCSPM and the limitations imposed by GUROBI's problem-solving capabilities, the energy constraint of EVSP is disregarded during the scheduling process for TSM.As a result, TSM can only provide a lower bound for EVSP's optimal EV schedule.We enumerate all feasible spells with the generated EV schedule and then generate potential shifts for the succeeding CSP model using Algorithm 3.
Te comparison of schedules for problems T1∼T8 is conducted using EVCSPM with the heuristic approach and TSM with GUROBI.Table 9 presents the relevant data on the number of tiers for timetabled trips and the resulting spells and shifts for both models.Specifcally, #tier indicates the count of tiers, while #spell_i (i � 2, 3, 4, 5, 6) signifes the count of spell_i.Te counts of spells (#spell) and shifts (#shift) overall are also included in the table.Table 10 presents additional details on the resulting schedules for both models.Te RPDs, computed over the schedule proposed by TSM, are also included.
Table 9 shows that EVCSPM produces an average of 2322.75 spells and 132599.75shifts, while TSM generates an average of 654.5 spells and 13696.63shifts.Te potential shifts generated by TSM are only one-tenth of those generated by EVCSPM.Tis diference may be explained by the obtained EV schedule limiting the construction of TSM's potential shifts.Te results in Table 10 indicate that EVCSPM and TSM exhibit similar performance in terms of the number of recharges.Both models propose schedules with the same feet size for problems T1∼T2 and T4∼T8.However, for T3, the schedule obtained by EVCSPM has a feet size of three greater than that of TSM.Overall, TSM outperforms EVCSPM in terms of feet size.For crew size, both models propose schedules with the same crew size for problems T7-T8.However, for problems T1-T6, EVCSPM outperforms TSM regarding crew size, with RPDs ranging from −2.5% to −5.1%.Regarding feet + crew size, the schedule obtained by EVCSPM surpasses TSM only for T3, with a positive RPD of 3.6%, while the average RPD is −1.3%.EVCSPM also outperforms TSM in terms of feet + crew size.For cost, EVCSPM outperforms TSM in terms of cost only for T6, with a positive RPD of 3.4%.However, the average RPD for cost is −8.7%.Finally, the average elapsed time for solving EVCSPM is 96.78s, while TSM requires 2371.75s, even without considering the energy constraint.Terefore, EVCSPM outperforms TSM regarding crew size, feet + crew size, cost, and elapsed time.
To gain a deeper understanding of the performance of EVCSPM and TSM, we illustrate the schedules pertaining to feet size, crew size, feet + crew size, and cost in Figure 8.
Te results illustrated in Figure 8 indicate EVCSPM's superior performance across the three subgraphs, except subgraph (a), as evidenced by the positioning of the EVCSPM polylines below corresponding TSM polylines.It has been confrmed that, in terms of crew size, feet + crew size, and cost, EVCSPM outperforms TSM.Given the priority of minimizing feet and crew size, we assert that EVCSPM is generally superior to TSM in EV and crew scheduling.
6.4.Sensitivity Analysis.Tis section conducts a sensitivity analysis of EVCSPM by examining the impact of critical parameters on feet size, crew size, number of EV recharges, and cost.Specifcally, we investigate the efects of battery capacity E full , recharging time, and recharging power in equation ( 16) on these performances while considering the infuence of coefcients α and β in equation (29).Te aim is to provide a comprehensive understanding of the sensitivity of the EVCSPM model.Te impact of coefcients α and β on EVCSPM regarding feet size and crew size is determined by analyzing T7 with various values of α and β in the [0, 0.06] range.Te result is illustrated in Figure 9.
Figure 9 shows that the crew size declines as the value of either α or β increases.Tis suggests that the feet size required decreases as α or β becomes larger.When α is held constant, the graph reveals a high absolute slope value for the frst surface at β values between 0 and 0.02.Tis denotes that alterations in β within the given interval signifcantly infuence crew size.Conversely, for α values between 0.02 and 0.06, the frst surface displays smoothness, and its slope is zero when beta values exceed 0.03.Consequently, within the range of β ≥ 0.02, any changes made to β basically have no impact on the crew size.Similarly, the second surface displays continuous steepness between 0 and 0.04 for α and β, hence implying that alterations made to both α and β in the given interval have a considerable efect on feet size.However, when α, β ≥ 0.04, the graph takes a straight line form, indicating that changes made to α and β are incapable of revising the feet size.To sum up, α perturbs the feet size, while β afects both the feet and crew sizes.Nonetheless, these infuences vanish when α, β ≥ 0.02, which results in the feet size and crew size remaining at 17.
Te impact of battery capacity E full on the feet size, crew size, and the number of recharges is analyzed by conducting tests on T1 under fast recharge with varying E full 120∼160 kWh, as depicted in Figure 10.
Figure 10 shows that the crew size always remains at 39, regardless of the increase in E full .Te changes in E full do not impact the crew size.Moreover, when E full ≥130 kWh, the feet size remains constant at 19, while it slightly fuctuates between 19 and 20 in the range of 120∼130 kWh.Te efect of changes in E full on the feet size decreases as the capacity takes a smaller value (120∼130 kWh), and this efect completely vanishes when E full ≥ 130. Additionally, along with the increase in E full , #recharge shows a consistent downward trend.Te larger the battery capacity, the fewer recharges are required.#recharge has a relatively slow decline within either 120∼135 or 140∼160 kWh.However, the number of recharges sharply shrinks from 11 to 5 with an increase in E full from 135 to 140 kWh.Terefore, the changes in E full signifcantly infuence the number of recharges, especially when 135 ≤ E full ≤ 140 kWh.Consequently, it can be inferred that the number of recharges is susceptible to any changes in E full , while the feet size and crew size remain insensitive.It is worth noting that EVCSP degenerates into VCSP when E full ≥ 160 kWh.
Finally, we investigate the impact of recharge power and recharge time on feet size, crew size, and the number of recharges.To do so, we conduct tests on T1 with various recharge times under E full � 140 kWh, fast-recharge power of 160 kW, and slow-recharge power of 60 kW.We present the fndings in Figures 11 and 12.
From Figures 11 and 12, the feet and crew sizes remain at 19 and 39, respectively, indicating that they are not infuenced by recharging power and time.Te feet size displays a decreasing pattern with an increase in recharging time, irrespective of recharging power, whereby fast-recharge power 160 kW or slow-recharge power 60 kW is utilized.Te higher the recharging power, the lower the feet size required.For fast-recharge power 160 kW, the feet size fuctuates by a maximum of two every 5 min, remaining at 9, 5, and 3 during the time intervals [10,15], [25,35], and [50,60], respectively.Similarly, for slow-recharge power 60 kW, the feet size varies by a maximum of two every 5 min, remaining at 3 and 1 during the time intervals [50,60] and [65,80], respectively.Under the same recharging time, the feet size remains identical between the two recharging powers, indicating its sensitivity to recharging time and insensitivity to recharging power.However, the cost increases proportionally with an increase in recharging time, irrespective of the recharging power used, whether 60 or 160 kW.Te cost increases with an increase in recharging power.For the same recharging time, the cost diference between the two recharge powers is negligible, particularly when 30 ≤ T rt ≤40 min, indicating that the cost is generally insensitive to recharging time.In conclusion, changes in recharging power and time merely infuence the frequency of EV recharges.Fast-recharge (160 kW)

Conclusions
Tis paper proposes a complete integrated model, namely EVCSPM, for the electric vehicle (EV) and crew scheduling.EVCSPM is derived based on minimum cost fow.For modeling, we integrate design nodes, directed arcs, cost and constraints, and time and energy compatibility of nodes.A case study has been reported on the real instance of bus route 2 of Xiaogan in Hubei, China (XGR2).
As for comparing EVCSPM with the two-stage sequential model (TSM), it involves the EV scheduling model frst and then followed by the crew scheduling model.Based on several problem instances derived from XGR2, EVCSPM outperforms TSM regarding crew size, feet + crew size, and cost.Te average RPDs of crew size, feet + crew size, and cost are −2.9%,−1.3%, and −8.7%, respectively.Additionally, the average solving time of EVCSPM is approximately one-twentieth of TSM, even the latter overlooks EV energy constraints.Te integrated model outperforms the sequential model as it possesses additional fexibility.
None of the integer linear programming (ILP) solvers can be directly used to solve the integrated model since it is the integer nonlinear caused by EV energy constraints and NP-hard for even both sequential subproblems.Terefore, this paper develops a hybrid method that comprises a matching-based heuristic and GUROBI for EVCSPM.Our method approaches the theoretical optimum, but the elapsed time is reduced to 1/60 compared to the ILP solver.Future work involves further exploration of the proposed method and its ability to efciently overcome larger instances.

Figure 2
Figure 2 details the composition of three 2-spell shifts pertaining to some EV work.

10 BFigure 3 :
Figure 3: EV schedules b 1 , b 2 , b 3 , b 4 .Crew schedules s 1 , s 2 , s 3 , s 4 , s 5 .R is the 30 min recharge of the EV.B is the legal 30 min break that the crew has to avoid working blocks of more than 4 h.Te crew's working time cannot be up to 8 h.

Figure 4 :
Figure 4: Te list of timetabled trips involves two departure (or arrival) points, A and B. A-B and B-A are two directions of the trips.Te second line is the timetable for each trip.Te trip time of each trip is 1 h.Te deadheading time from A to B (or B to A) is 1 h.

( 1 )
Te depot node d, d ∈ D. (2) Te spell node w, w ∈ W. Te related nodes for w represent one or more feasible spell nodes in the same potential shift.Statement 10.Defning the shift as a node is infeasible.

Figure 6 :
Figure 6: Te framework of the hybrid heuristic.

Figure 7 :
Figure 7: Distribution of service trips over the day for instances T1∼T8.#service trips are the number of simultaneous service trips.

Figure 8 :Figure 9 :
Figure 8: Results produced by EVCSPM and TSM regarding feet size, crew size, feet + crew size, and cost.

Figure 10 :
Figure 10: Te sensitivity of feet size, crew size, and number of recharges to the changes in battery capacity.#recharge is the number of recharges.

Figure 11 :
Figure 11: Te sensitivity of feet size, crew size, cost, and the number of recharges to the changes in recharging time under fast-recharge power 160 kW.

Figure 12 :
Figure 12: Te sensitivity of feet size, crew size, cost, and the number of recharges to the changes in recharging time under slow-recharge power 60 kW.

Table 1 :
A summary of the studies related to the integrated VCSP models and algorithms.
refers to the task unit, which includes a start time at the departure point, an end time at the arrival point, and a duration known as trip time.

)
Journal of Advanced Transportationwhere R denotes the set of recharge points and C r represents the fxed recharge cost.DH ij is the deadheading time between the arrival point of trip i and the departure point of trip j, DH ir (DH id ) is the deadheading time between the arrival point of trip i and a recharge point r (depot d), DH rj (DH dj ) is the deadheading time between a recharge point r (depot d) and the departure point of trip j, ID ij stands for idle time for a spell-link arc (i, j), and ID irj denotes the idle time for recharge-link arc(i, j).ID ij and ID irj are given as follows: 3.2.Compatibility of Arcs.Creating explicit arcs, including pull-out, pull-in, spell-link, and recharge-link arcs, is crucial to EVCSP, while forming implicit arcs, i.e., trip-link arcs, serves as the foundation for the spell node.An arc is present only if it satisfes both time and energy compatibility.
(10)1.Time Compatibility.Two consecutive trips, i and j, within a spell are considered time-compatible if formula (1) is satisfed.Tis defnition can be extended to spell link.Suppose the last trip in spell p is denoted as trip i, and the frst trip in spell q is denoted as trip j.If formula (1) is met, the spell-link arc (p, q) is time-compatible.Similarly, the recharge-link arc (p, q) is time-compatible if formula(10)is satisfed is satisfed.
DE pq − E q − DE qr ≥ E min i.e., E e q − DE qr ≥ E min  , Table 2 lists the symbols used in EVCSPM, where d i , d j ∈ D, w i , w j ∈ W, and t i ∈ T.
j : w i ,w j ∈SL ∪ RL ∪ DR

Table 2 :
Sets, parameters, and variables of the EVCSPM.
j Deadhead energy consumption from r to w j DE w i ,r Deadhead energy consumption from w i to r Variables x w i .wj �1, if the arc from w i to w j is selected; �0, otherwise x d i .wj �1, if the arc from d i to w j is selected; �0, otherwise x w i .dj �1, if the arc from w i to d j is selected; �0, otherwise

Table 3 :
Te number of variables and constraints for the EVCSP models.

Table 5 :
Tree levels for each of the three factors.

Table 6 :
Results of the orthogonal test proposed by the hybrid heuristic method on solving EVCSPM for optimal parameter settings (instances: T1∼T2).

Table 7 :
Results of the range analysis for optimal parameter settings (instances: T1∼T2).

Table 10 :
Schedules generated by EVCSPM and two-stage sequential models.