Keywords

1 Introduction

On-demand transit is a mode of transportation, where vehicles operate with flexible routes and schedules within a zone to serve passenger ride requests [5]. Static on-demand transit, where all ride requests are known a-priori, has been used in transportation of elderly and disabled. In contrast, dynamic on-demand transit, where ride requests are received in real-time has gained traction lately due to technological developments in GPS-based location tracking, mobile communication and wireless payment. Consequently, many dynamic on-demand transit services (e.g. Uber, Lyft, Grab) linking drivers with riders using a smartphone application have been introduced recently [10]. However, on-demand public transit, where a fleet of small/medium size buses deployed to provide shared transit services to commuters is still an emerging area. For example, in Singapore, the first phase of on-demand transit service was contracted only in 2018 [6]. In an on-demand public transit service, buses respond to real-time demand by dynamically routing to pick-up and drop-off passengers. The quality of service (QoS) of on-demand public transit services is measured by factors such as maximum waiting-/riding- time etc. Hence, it imposes additional constraints on the operator of the on-demand public transit service (in contrast to a fixed route service) to intelligently manage the fleet such that profitability is maintained while assuring high QoS. This is further exacerbated with strict government regulations [11] to curb the usage of petroleum-based fuels, which necessitates the use of alternatives such as electric vehicles (EV). However, usage of EVs, even for fixed-route public transit, is at an early stage even in developed countries [8].

To this end, we proposed an on-demand public transit service using EVs in [9]. However, the use of EVs for public transit necessitates novel algorithms for optimal, real-time scheduling and routing to satisfy multiple constraints such as EV capacity, driving range and passenger travel time. Existing works by Uchimura et al. [12], Kawamura and Mukai [4], Tsubouchi et al. [2], Markovíc et al. [7], Uehara et al. [3], Archetti et al. [1], Zhu et al. [14] and Perera et al. [9] propose on-demand bus services with flexible routes serving demand originating in a zone. However, some of the works have been tested only for a limited number of buses [4, 12], scenarios with small number of passengers [2] and for relatively low rate of arrival of passenger requests [7]. Hence, the scalability of the proposed algorithms for relatively large number of passengers or vehicles and higher passenger incoming rates has not been validated. In some works, the proposed systems require advance reservations due to the excessive computation time of the algorithms and hence, is not suitable for real-time on-demand transit solutions [3]. Also, authors in [1, 4, 12] do not consider the limited driving range of EVs. Zhu et al. [14] proposed a dynamic path planning strategy based on a greedy algorithm for a peer-to-peer ride-sharing service. In the experiments, authors use characteristics of a Tesla model S car with five seats and supercharger facilities. Thus, the algorithm needs to be further verified with EV characteristics used for public transit. Similarly, our previous work in [9] proposed a hybrid GA to model an on-demand first mile transit service. However, we assume that at the scheduling instance, all EV have the same driving range and capacity, which in a practical scenario is limited to an instance such as service initialization. Thus, we advance the state-of-the-art by proposing a genetic algorithm (GA), which generates near-optimal results for a heterogeneous fleet of EV in real-time.

2 Proposed On-Demand Public Transit System

The proposed system consists of a heterogeneous fleet of EV (different seating capacities and driving ranges) dispersed in a zone, which respond to the ride-requests of passengers by picking them up from their origin and dropping them off at their destination. EV have a designated service zone, a maximum capacity and a driving range. Further, we assume that passengers request for the on-demand service near to their departure time using a smartphone. Thus, passenger origins, destinations and real-time traffic data can be saved in the database for computations. However, in this work, we assume that all passengers travel to a common destination such as the nearest transit hub. The objective is to devise a near-optimal set of routes and schedules in real-time for the fleet of EV such that total passenger travel time (waiting time + riding time) is minimized within constraints. We assume that the proposed GA is executed periodically and passenger requests received during that time as the demand and also that at execution time all EV are empty. Also, compared to [9], which guarantees a fixed maximum travel time constraint for each passenger, we introduce a location-based maximum travel time constraint. This modification ensures ride-sharing to be more practical and user-friendly for passengers nearer to the destination.

3 Methodology

Block diagram of the proposed GA is given in Fig. 1. First, the initial population is generated using random assignment and local search strategies. Next, the fitness of each chromosome is evaluated. Thereafter, parents are selected to perform genetic operations. After that, offspring are validated for the constraints followed by fitness evaluation. Finally, the population for the next generation is selected based on the fitness of individual chromosomes. At the end of population selection, if the termination criteria is satisfied the process outputs the schedule of the EV of the fittest chromosome, failing which the process is repeated.

Fig. 1.
figure 1

Block Diagram of the Proposed GA

Initial Population Generation: Initial population is a set of feasible solutions (chromosomes), which satisfy all the constraints. Each chromosome represents the route of all EV. The route shows the sequence in which passengers (genes) are picked-up by an EV. Thus, we propose to use the path-based encoding scheme to represent a chromosome. Hence, each passenger is represented using an integer. Figure 2 shows an example of 10 passengers, 3 EV and a chromosome. In a traditional GA for the VRP, initial population is generated using random assignment of passengers to each vehicle. However, as shown by Xiang et al. [13] good initial solutions expedite the convergence of GA. Hence, in addition to random assignment, we use nearest neighbor assignment (NNA), priority based assignment and hybrid assignment strategies to allocate passengers to EV. In the NNA, each passenger is assigned to the nearest EV in terms of time or distance. In the priority based assignment, priority is given to EV based on selected features such as EV capacity and driving range. For example, a chromosome can be generated by assigning passengers to the EV with the least remaining capacity. This strategy yields better results for cases with heterogeneous fleets. In the hybrid method, we use multiple combinations of the above strategies. However, in all chromosomes, EV capacity, driving range and passenger travel time constraints are checked to validate feasible solutions.

Fig. 2.
figure 2

Path-based Encoding of Chromosomes

Fitness Evaluation: Fitness of a chromosome is calculated by summing the fitness of each EV. Equation 1 shows the fitness of \(EV_{1}\) of the chromosome in Fig. 2. Here, \(R_{x,y}\) is the riding time from location x to y, and \(W_{j}\) is the waiting time for passenger j at the time of scheduling. However, based on the objective of the study, the reciprocal is used for evaluation of fitness.

$$\begin{aligned} F_{V_{1}} = (R_{V_{1},8} + R_{8,5} + R_{5,3} + R_{3,2} + R_{2,Dest}) * 4 + \sum _{j = 1}^{4} W_{j} ; \end{aligned}$$
(1)

Parent Selection: This is performed using the roulette wheel selection method. Here, each chromosome in the population is allocated a section of the wheel proportionate to the fitness of the chromosome.

Genetic Operators: Genetic operators produce the offspring by using crossover and mutation operators. Crossover reflects the actual reproduction operation while mutation ensures the genetic diversity. In the proposed GA, we use two crossover operators, heuristic and adoption crossover. In heuristic crossover shown in Fig. 3a, Clarke-Wright savings heuristic is used to find the gene for crossover. In adoption crossover shown in Fig. 3b, a single parent will transfer a gene to the other parent. Here also, Clarke-Wright savings heuristic is used to find the gene. Further, during adoption, we use the 2-opt local search to find the best position to insert the gene. For mutation, we use three operators, displacement, insertion and exchange mutation. In displacement mutation shown in Fig. 4a, the position of a randomly selected sub-tour of a parent is exchanged to optimize the route. We use the 2-opt local search heuristic to find the optimal position to exchange the sub-tour. In insertion mutation shown in Fig. 4b, a randomly selected gene is inserted into a different position in the route using 2-opt local search heuristic. In exchange mutation shown in Fig. 4c, two randomly selected genes from a parent are exchanged to produce a new offspring. This operator is used to preserve randomness of the population.

Fig. 3.
figure 3

Crossover Operators

Fig. 4.
figure 4

Mutation Operators

Constraint Validation: The offspring are validated for EV capacity and driving range violations and maximum passenger travel time violations. At this stage, an offspring which violates the constraints is removed from the population.

Population Selection: The proposed GA uses a constant population size. Hence, only the fittest chromosomes are retained in each generation. Thus, some parents and offspring are discarded from the population in each generation.

Termination Condition: The GA is terminated if we observe five consecutive generations without an improvement of the fittest chromosome. When it terminates, the GA outputs the best route that exist for the EV.

4 Results

GA proposed in Sect. 3 is implemented in C++. Baseline results are generated by modifying the optimal mathematical model presented in [9]. It is implemented using IBM ILOG CPLEX optimization studio 12.7.1 and solved using the in-built constraint programming solver. Runtime is measured on a PC with 16 GB RAM, running Windows 10 on an Intel Xeon E5-1650V2 CPU at 3.50 GHz. We generate test data using the real map shown in Fig. 5 in a locality surrounding a university. A university often provides fixed route shuttle services to the nearest rapid transit node, which further affirms the suitability of the selected locality. In this zone, demand can originate from any location. However, for clarity, we have limited them to 40 existing bus-stops. Figure 5 shows 5 bus-stops and the destination. In each experiment, origins of demand and supply are distributed randomly. Further, real-time traffic data is used to determine the travel time of passengers to the destination using existing public transit (Transit time) and private vehicles (Single Occupancy Vehicle (SOV) time). These values are used as upper and lower bounds of the travel time respectively for comparison. All parameters used in the experiments are given in Table 1. Here, a QoS of 2x implies that each passenger is guaranteed that travel time (waiting time + riding time) of the on-demand service will be less than double the time of a private vehicle ride (under prevailing traffic) to the destination. Further, we classify EV utilization as low (25%–49%), medium (50%–79%) and high (80%–100%).

Fig. 5.
figure 5

Locality for Experimental Data Generation

Table 1. Parameter Values

Computation Time: Figure 6a and 6b show the variation of the computation time and average passenger travel time of the proposed GA in comparison to Perera et al. [9] (henceforth referred to as state-of-the-art (SoA)). Experiments are performed with 25 EV with a driving range of 30 km, seating capacity of 8 and QoS of 4x. Even though computation time increases with demand for both cases, it is marginally higher of the proposed GA. This is due to the increase in initial population and the number of genetic operators. However, as given in Fig. 6b, the benefit of the proposed GA is significant compared to the SoA. Figure 6b also shows the average SOV- and transit- times. Results show that the average travel time obtained from the proposed GA is closer to the SOV time when utilization is low. Also, when utilization is high the proposed GA performs significantly better compared to the SoA.

Fig. 6.
figure 6

Homogeneous Fleet

Performance: In all experiments, parameters are randomly selected from Table 1 except for a fixed QoS of 4x. Figures 7a & 7b and Fig. 7c & 7d show the results for small and large test cases respectively. In general, the proposed GA gives near optimal results. On average, we observe a deviation of 4.1% of the travel time of the proposed GA compared to the baseline. Baseline results are not computed for large test cases due to the exponential time complexity. However, we observe that the travel time of the proposed GA is within the bounds except in Fig. 7c with 7 EV, where the travel time of the proposed GA is marginally higher than the upper-bound due to the high utilization. However, passengers still receive a door-to-door service compared to fixed route transit.

Fig. 7.
figure 7

Heterogeneous Fleet. ST: SOV Time, B: Baseline, P.GA: Proposed GA, TT: Transit Time

QoS and EV Utilization: Figure 8a and 8b show the variation of total travel time for different QoS and EV utilization levels for a case with 80 passengers. In all experiments, values of the parameters are randomly selected as given in Table 1 except for a fixed capacity of 10. Here, we observe the improved performance of the system (low QoS) at low utilization. This is due to the low ride-sharing ratio. Further, we observe that when utilization is high (Fig. 8a), the total travel time of the on-demand system marginally exceeding the transit time. However, passengers are still guaranteed a seat. Also, when both EV utilization and QoS values are high (80%, 2x, 20 min.) the on-demand system is unable to find a schedule which meets all the constraints. Further, in instances such as Fig. 8a, we observe that the proposed location-based QoS method generating a route in comparison to the fixed QoS method affirming that passengers get a better service from the location-based QoS method.

Fig. 8.
figure 8

Total Travel Time Variation with Location-based and Fixed QoS. P.GA: Proposed GA, ST: SOV Time, TT: Transit Time

5 Conclusion

This work proposes an on-demand public transit system using EV, which satisfies the point-to-point transit requests of passengers and a GA to solve the problem. Experiments performed using a real map show that the proposed GA not only generates near-optimal routes and schedules, but also improves the SoA at a marginal cost of computation time. In future, we plan to consider scheduling of EV in the presence of allocated passengers.