Targeted optimal-path problem for electric vehicles with connected charging stations

Path planning for electric vehicles (EVs) can alleviate the limited cruising range and “range anxiety”. Many existing path optimization models cannot produce satisfactory solutions due to the imposition of too many assumptions and simplifications. The targeted optimal-path problem for electric vehicles (EV-TOP), which is proposed in the paper, aims at identifying the targeted optimal path for EVs under the limited battery level. It minimizes the travel cost, which is composed of the travel time and the total time that is spent at charging stations (CSs). The model is much more realistic due to the prediction and the consideration of the waiting times at CSs and more accurate approximations of the electricity consumption function and the charging function. Charging station information and the road traffic state are utilized to calculate the travel cost. The EV-TOP is decomposed into two subproblems: a constrained optimal path problem in the network (EV1-COP) and a shortest path problem in the meta-network (EV2-SP). To solve the EV1-COP, the Lagrangian relaxation algorithm, the simple efficient approximation (SEA) algorithm, and the Martins (MS) deletion algorithm are used. The EV2-SP is solved using Dijkstra’s algorithm. Thus, a polynomial-time approximation algorithm for the EV-TOP is developed. Finally, two computational studies are presented. The first study assesses the performance of the travel cost method. The second study evaluates the performance of our EV-TOP by comparing it with a well-known method.


Introduction
In the last few years, governments and automotive companies have recognized the potential contributions of electric vehicles (EVs) to energy saving and environmental protection [1,2]. They have been encouraging the ownership of EVs through economic incentives, which include purchase subsidies, tax exemptions, tax credits, and electricity subsidies [3][4][5]. However, compared with gasoline vehicles, electric vehicles face limited cruising ranges, long charging times, and remote charging stations [6]. EV drivers may prefer gasoline vehicles due to their "range anxiety" [7]. Therefore, the development of battery technology, the construction and layout of charging facilities, and path planning have become essential for overcoming the above problems. Currently, many automakers and battery manufacturers are developing new technologies for improving EV autonomy and reducing charging time. For example, General Motors reinvested USD 20 million into the GM Global Battery Systems Lab for the PLOS  Literature review

Optimal path methods for EVs
The problem of routing a vehicle with limited fuel and refueling was originally defined by Ichimori et al. [15]. The vehicle starts at a specified origin, stops and refuels at refueling vertices on the way and arrives at a specified destination. Its algorithm is a two-stage shortest path computation: constructing a new network that is composed of all the shortest paths between all pairs of refueling vertices (shorter than the cruising range) and finding the shortest path between the origin and the destination in the new network. The well-known Dijkstra's algorithm [16] is applied to solve the problem. Lawler considered the same problem but regarded the travel time instead of the length as the cost of the arc [17]. He developed two polynomial algorithms by applying the Bellman-Ford method and the Floyd-Warshall method [18,19]. However, both objective functions neglect the impact of refueling operations. This may result in vehicles refueling more often than necessary or refueling even when the energy level is high. To limit the number of stops for refueling, the two-stage shortest path problem (SP) of EVs was modified by Alder et al. [20]. Two scenarios (the maximum number of stops for refueling was specified versus not specified) are studied to identify a more reasonable path in the electric vehicle shortest walk problem (EV-SWP). The paper also provides polynomial algorithms. The EV-SWP has been frequently reviewed and compared by other studies. However, the maximum number of stops for charging instead of the impact of refueling operations is considered. The value of the maximum number is difficult to determine and may affect the solution.
The optimal routing problem with limited fuel is equivalent to the weight-constrained shortest path problem (WCSP) if the weight (fuel consumption) and the cost of each arc are not related and vehicles cannot refuel [21,22]. Therefore, modified WCSPs were presented in other studies. Smith et al. [23] reviewed the WCSP with refueling and presented new algorithms that exploit the inter-replenishment path structure. The WCSP is NP-hard and has been discussed extensively in the literature [24][25][26]. Thus, Smith et al. focused on the processing method, the algorithm presentation, and the result comparison instead of the problem definition. The cost of the optimal path in the studies that are discussed above is the travel time or length. According to Artmeier et al. [27], the objective of the routing problem of EVs is to find energy-efficient paths rather than short or fast paths due to the limited battery capacity. They formalized the energy-optimal routing problem as a special case of the WCSP: the energy value may be negative, which corresponds to energy recuperation. A prefix-bounded shortest path tree with respect to function absorp is computed to solve the problem. The energy consumptions are constant among arcs and are unrelated to the arc length and the traffic state. However, in practice, EVs may become more fuel efficient as the average speed increases, particularly at local arterials [28]. To the best of our knowledge, only Goeke and Schneider and Lin et al. computed consumptions over actual road networks while considering the parameters and loads of the EV [29,30]. In this paper, we assume that the energy (electricity) consumption of an EV that is traversing a link is related to the distance and to the average travel speed. Many methods are available for estimating the average travel time and travel speed [31,32] using automatic number plate recognition data. Many other studies about urban road transportation, which include queue length estimation, traffic demand estimation, and saturation degree estimation, are also based on such information [33][34][35]. Consequently, ANPR data are utilized in this paper for average travel time and travel speed estimation.

Charging planning
None of these optimal routing problems of EVs consider charging planning according to the battery charging process, the station capacities, and the levels of service (LOSs) at the charging stations (CSs).
In terms of the battery charging process, the research on the electric vehicle routing problem (EV-RP) provides detailed guidance on the charging policy and the charging function approximation. The charging policies can be classified into two groups according to the assumptions: full charging policies [36] and partial charging policies [37]. Under a full charging policy, the battery capacity is fully restored every time an EV reaches a CS, while under a partial charging policy, the level of charge (or, equivalently, the time that is spent at each CS) is a decision variable [38]. By analyzing the data from quick charging piles at various public CSs (the vehicle ID, the charging time, the charging electricity, the levels of battery at the beginning and the end, and the charging price), we find that most EVs are fully charged (approximately 85% of the battery), while a few EVs during commuting hours are not. This may be because the drivers of the EVs in the latter case are anxious to reach their destinations and there are CSs at the destinations. They prefer partial charging on the way and recharging again at the destinations. Therefore, we study an optimal routing problem under these two types of charging policies. In addition, the charging function approximations are divided into three groups: constant charging times [6,39], linear charging functions [36,40] and nonlinear charging functions [38]. In practice, the charging time that is spent at each CS depends on the charging rate and the battery level when the EV arrives/leaves. Furthermore, the charging process is divided into two phases at a specified maximum value of the battery's terminal voltage: In the first phase, the battery level increases quickly and linearly with time. In the second phase, the battery level increases slowly and concavely with time [38]. Therefore, a constant time is not reasonable unless a depleted battery is replaced with a fully charged one. A linear charging function cannot accurately calculate the charging time similar to a nonlinear function unless EVs partially charge at CSs. Thus, a piecewise charging function is used in this paper.
In terms of the station capacities and the LOSs at the charging stations, most research on EV-RP assumes that the CSs can simultaneously handle an unlimited number of EVs. In practice, each CS is typically equipped with only a few chargers. EVs may join a queue for charging. Their travel costs will increase substantially due to the waiting time. In the optimal routing problem that is proposed here, the predicted waiting time is an important component of the travel cost. The CS capacity and the level of service (LOS) play restrictive roles. Few studies have been conducted on the estimation and prediction of the waiting time at the CS. Hanabusa and Horiguchi formulate the waiting time according to M/M/1 queueing theory from the relationship between the electric capacity of the CS and the electric demand of EVs for charging [41]. Keskin et al. handle time-dependent waiting times by discretizing the time and dividing the planning horizon into a set of time intervals. The arrival rate of EVs is approximated as a piecewise linear function of time. For an EV that is arriving at any CS in any time interval, the expected waiting time in the queue can be calculated using the arrival rate approximation and the steady-state equations of the M/G/1 queueing system [42]. Both methods assume that each charging station is equipped with a single charger and calculate the arrival rate using the historical data. Furthermore, they provide only an average waiting time for all the EVs during the same interval. However, there is often more than one charger at a single CS. The waiting time also varies with the arrivals, preferences, and charging times of EVs, the CSs, and the time periods. Thus, reliance on an average estimate of the waiting time may result in a large error. A distribution can provide both the waiting time and its reliability. Given a waiting time distribution at each CS during each time period, EVs that vary in terms of reliability preferences can more effectively select a reasonable CS and a targeted path. Data from connected charging piles, which include historic data (vehicle ID, charging time, charging electricity, the levels of battery at the beginning and the end, charging price, etc.) and real-time data (occupancy status, vehicle ID, starting time, level of the battery, time required, etc.), provide important information for the prediction of waiting time at CSs.
The remainder of this paper is organized as follows: Section 2 formally introduces the targeted optimal-path problem for EVs (EV-TOP) by describing the problem and modeling important variables, including the prediction of waiting times at CSs, the selected charging stations, the congestion-dependent electricity consumption, and the piecewise charging function. Section 3 develops a polynomial-time approximation algorithm by solving the two subproblems. Section 4 evaluates the EV-TOP by describing the study area and presenting two computational experiments. Finally, Section 5 presents the conclusions of the paper and discusses future research.

Targeted optimal-path problem for electric vehicles
The prototypical problem that we study is to identify the targeted optimal path for an EV from its origin to its destination. The EV may charge once or more times at CSs. Consequently, any solution path is composed of several segments, namely, subpaths. All the subpaths are limited by the battery level. The optimal path refers to the path that corresponds to the lowest time cost for both basic travel and charging operations. The targeted optimal path is identified via the proposed travel-cost method.

Problem description
We consider a regional road network, which is represented by a complete graph G = (V, E). The vertex set V = {1, 2, . . ., N} is a combination of nodes, which represent conventional intersections (CIs) and charging stations (CSs); |V| = N. The arc set E = {(i, j), 8i, j� V} corresponds to the links that connect two neighboring nodes in V; |E| = M. Each link is associated with four nonnegative attributes: travel time t ij , travel speed v ij , electricity consumption e ij , and distance l ij . t ij is the average travel time of all the vehicles on the same link from the collected data (e.g., automatic number plate recognition data). It is updated every time interval T (e.g., 5 min) in real time. Travel speeds are assumed to be constant over each link.
The origin and destination nodes of an EV are denoted by o and d, where o, d� V. The EV has an initial battery level of B 0 , which ranges from B min to B at o, where B is the battery capacity and B min is the minimum reserve level. All the CSs are public quick charging stations. They vary in terms of capacity. The impact of charging operations is considered: the travel cost of the EV is composed of the travel time and the total time that is spent at CSs (a sum of the waiting time w, the base time loss f, and the charging time c). Consequently, as the number of stops for charging p increases, the travel cost may increase. Therefore, here, no limit is imposed on the number of stops p.
Binary variables x ijk and y jk are defined to denote the selection of links and CSs. x ijk is equal to 1 if the EV traverses link (i,j)�E over subpath k = 1, 2, . . ., p+1 and to 0 otherwise. y jk is equal to 1 if the EV charges at CS j over subpath k and to 0 otherwise.
Finally, we define the EV-TOP as the problem of finding the least-cost path that begins at o, charges at CSs in S, and ends at d. Feasible solutions to the EV-TOP satisfy the following conditions: 1) the travel cost is minimal; 2) the electricity consumption over any subpath that begins at o and ends at a node in d[ S is less than B 0 -B min ; and 3) the electricity consumption over any subpath that starts at a node in S and ends at a node in d[ S is less than B'-B min , where B' is the battery level when the EV finishes charging and is also the initial battery level over the next subpath. The integer programming formulation of the EV-TOP, which uses decision variables x ijk and y jk , is as follows: subject to : Eq (1) is the objective function, which minimizes the travel cost. Via the consideration of charging operations, the generation of solutions with excessive charging stops can be avoided. A vector X denotes a path between o and d. It is a sequence of vertices. The base time loss f j is the minimum amount of time that is spent at CS j, which includes driving into the station, looking for an unoccupied charging pile, paying, and leaving the station. As the name indicates, it is a constant and it depends on the location, the scale, and the parking rules of each CS. Its value can be determined via investigation. w j and c jk denote the waiting time and the charging time, respectively, at CS j over subpath k. A prediction method for the waiting time at a CS and a piecewise linear charging function with 2 pieces are proposed in Section Modeling of variables. They are used to calculate w j and c jk . S' denotes the available CS set for the EV, where S' �S. It depends on the location, the typical paths, and the waiting time reliability of the EV and is described in detail in Section Modeling of variables.
Constraint (2) ensures that the conservation laws hold for each vertex: the number of outgoing arcs equals the number of incoming arcs at each vertex. The functions f 1 and f 2 depend on the types of the vertices and the sequence number of the subpath; additional details will be provided in a later section. According to Constraints (3) and (4), the EV must charge at one (at most) of the CSs in S' and the EV cannot charge at CS j unless it passes link (i,j). Constraints (5) and (6) limit the electricity consumption over the subpaths to ensure that EVs can arrive at the ending vertex prior to running out of battery. The limited electricity consumption depends on the initial battery levels (B 0 and B') at the beginning vertex over the first subpath or other subpaths. It will be calculated in Section Modeling of variables. The decision variables are expressed in Constraints (7) and (8).

Modeling of variables
Prediction of the waiting times at CSs. We assume that the arrival of EVs obeys a Poisson distribution with parameter λt and the charging time obeys an exponential distribution with parameter 1/μ. The hypothesis is supported by the one-sample Kolmogorov-Smirnov (K-S) test. The test results that are obtained using historical data (the arrivals and the charging times of EVs) for 10 CSs during every 60-min interval are presented in Table 1. Therefore, the prediction of the waiting time distribution can be based on an M/M/n/m/1/C queueing model. The probability that an EV must wait longer than t at a CS is calculated via Eqs (9) and (10).
where λ j is the average arrival rate of EVs at CS j; μ j is the average service rate of CS j; n j , m j Targeted optimal-path problem for electric vehicles and R j are the number of chargers, the parking capacity, and the offered load, respectively, at CS j; and R j <n j �m j is satisfied to ensure the stability of the M/M/n/m/1/C queueing system. The average arrival rate varies substantially among the time periods, while the average charging time is stable. Therefore, a prediction of λ j instead of a historical value can improve the prediction of the waiting time distribution. Given the number of EVs that must be charged during time period (t 0 ,t 0 +Δt) in the network and the fraction of the EVs that select CS j, the prediction of the average arrival rate at CS j is expressed as Eq (11).
where Q c denotes the number of EVs that must be charged during time period (t 0 ,t 0 +Δt) in the network, P j denotes the fraction of EVs that select CS j, and P ij denotes the probability that EV i chooses CS j for charging. The value of Q c is known with connected charging stations. P ij is modeled using the multinomial logit model as follows: ( where U ij is the utility function for EV i selecting CS j for charging; z ij,1 and z ij,2 denote variables that are related to CS j for EV i and depend on the estimated average waiting time at the CS and the distance to the CS, respectively; ε ij captures the collective impact of all unobserved factors that affect the EV's choice; and φ 1 and φ 2 are the coefficients of z ij,1 and z ij,2 , respectively. EVs differ in terms of waiting time reliability preferences due to differences in the travel objective, the driving habits, and the battery level, among other factors. Therefore, the predicted waiting time depends on the probability threshold, as expressed by Eq (14).
where w j denotes the predicted waiting time at CS j; α is the probability threshold, which corresponds to the reliability preference of the EV; and w is a value that satisfies P{w j �w} = a. Description of the selected charging station. An EV always charges at CSs along feasible paths. Therefore, removing CSs that are far away from the most frequent paths from the set of possible solutions will improve the algorithm. The available CS set S' satisfies Eq (15). A charging station s in the available CS set S' must have a distance l s,z to any typical path P z that does not exceed a threshold value l max . l s,z is the minimum of the Euclidean distances from s to all the nodes along the typical path P z . l s,z,i denotes the Euclidean distance from s to node i along P z . The typical paths between a pair of nodes correspond to the most frequent Z paths that are identified using historical data (GPS data or ANPR data).
Congestion-dependent electricity consumption. As discussed above, the electricity consumption e ij over a link is related to the distance l ij and the travel speed v ij . The EV will consume more electricity when it drives too slow or too fast. The value of e ij is calculated via Eq (16).
where ψ denotes the base energy consumption rate, namely, the electricity consumption per kilometer at the optimal speed v b (which is equal to 45 km/h in the paper) and θ is the influence factor of the difference between the actual speed and the optimal speed. Thus, the battery level b jk of the EV that arrives at CS j over subpath k is as follows: ( where B' k is the initial battery level over subpath k and the battery level when the EV finishes charging over subpath k-1. Its value depends on the charging policies and the subpath. Piecewise charging function. The charging process at a charging pile of ρ kw is approximated using a piecewise linear function with 2 pieces, as presented in Fig 1. In the first stage, the actual charging rate is ρ and the maximum battery level is Bη 1 . In the second stage, the actual charging rate is ρ�β and the maximum battery level is Bη 2 . β denotes the attenuation rate and β<1. As discussed in Section Literature, most EVs that are fully charging at public quick CSs typically sacrifice the last 15% capacity of the battery to save time and money, namely, η 2 = 85%. If the EV arrives at CS j over subpath k with a battery level of b jk , its charging time c jk under various charging policies that are based on the piecewise linear function is calculated via Eq (18).
The EV will not prefer partial charging unless it's over subpath p. Thus, B' k will be equal to  Bη 2 if k�p, as expressed in Eq (19). Over the pth subpath, EVs may prefer to utilize the partial charging policy to reduce the total travel time. They will stop charging once the battery level B' p+1 reaches Bη 2 γ, as expressed in Eq (20), in which γ denotes the partial rate and γ <1. Its value depends on the EV's preferences.
( where δ is a charging policy indicator and δ = 0 or 1 indicates whether the EV chooses partial charging over the pth subpath or not.

Solving the EV-TOP
Two-stage shortest path problem. The CSP and the WCSP are known to be NP-hard. Since they are special cases of the EV-TOP, the EV-TOP is also NP-hard. Thus, the EV-TOP is transformed into a two-stage shortest path problem. In the first stage, the constrained shortest path problem in G = (V, E), namely, the EV1-COP for short, aims at identifying all the optimal paths between any two vertices among the origin, the destination, and S'. It is a special case of the EV-TOP in which p = 0. Consequently, a meta-network G' = (V', E') is constructed. The meta-node set V' is composed of the originating and destination vertices and the available CS The objective of the EV1-COP m is to minimize the travel time (denoted by f(x m )) over the path between O-D pair m, as expressed in Eq (21). A vector x m denotes a path between O-D pair m. It is a sequence of vertices. Constraint (22)  Then, EV2-SP is formulated in Eqs (25)- (32).
such that 8 > < > : 8 > > < > > : Eq (25) is the objective function, which minimizes the travel cost over the path X. The charging time at each CS is calculated based on the full charging policy, as expressed by Constraint (29). A charging time difference Δc will be induced if the EV prefers partial charging over the last subpath. Therefore, an item δΔc is added into Eq (25). Constraint (26) defines the cost of each meta-arc in G' (denoted by tt ij ) as the travel time over the optimal subpath x � m . Constraint (27) ensures that the conservation laws are obeyed and the origin and destination are as specified, similar to Constraint (22). Constraints (28) and (29) readjust the waiting time and the charging time of the EV at CS j. The charging time difference Δc is calculated by Constraint (30). y j indicates whether the EV charges (y j = 1) or not (y j = 0) at CS j, which is determined by meta-node j and X ij , as expressed in Constraint (31): 1) we don't consider the charging operation at the destination node d, namely, if CS j is vertex d, we let y j = 0; 2) the EV cannot charge at CS j unless the EV passes vertex j; and 3) the EV will charge at CS j once the EV passes vertex j. Constraint (32) defines the decision variables X ij in G'. The final optimal path between o and d is denoted by X � .

Solution strategy
Similarly, as a special case of the EV-TOP, the EV1-COP is also NP-hard. First, a strongly polynomial-time approximation algorithm is proposed in this section for solving the EV1-COP. We apply the Lagrangian relaxation algorithm [43] using Lagrangian duality theory [44], the subgradient method and the Handler-Zang algorithm in the first step to obtain the initial lower and upper bounds. In the second step, the simple efficient approximation (SEA) algorithm [45] and the MS deletion algorithm [46] are used to obtain an ε-approximated subpath by closing the gap between the upper and lower bounds. Second, Dijkstra's algorithm is applied to solve the EV2-SP. Thus, the EV-TOP is solved and the optimal path is determined.
Dual of the EV1-COP. Eq (33) defines a Lagrangian function by introducing a variable λ m (the Lagrangian multiplier λ m �0) and a relaxed Constraint (23) to the objective function of the EV1-COP m .
Thus, the original EV1-COP m is equivalent to a new relaxed problem without Constraint (23). Eq (34) presents the relationship, in which f � is the optimal objective function value of the EV1-COP m .
The dual formation, namely, EV1-COP-D m , is introduced for solving the relaxed problem, as expressed in Eq (35). L � is the optimal objective function value of the EV1-COP-D m .
does not exceed f � . Thus, there may be a gap between the optimal objective function values Targeted optimal-path problem for electric vehicles of the EV1-COP m and of the EV1-COP-D m . Hence, we solve the EV1-COP-D m and obtain the upper and lower bounds on its optimal solution, which are denoted as L ub and L lb . ε-approximated subpath. Given an instance subpath x and a desired degree of accuracy ε > 0, subpath x is an ε-approximated subpath to the EV1-COP m if Eq (35) is satisfied. It is determined using the dynamic programming algorithm with the lower and upper bounds, namely, L ub and L lb , that were obtained in the first step.
where f(x) is the objective function value of the EV1-COP m on subpath x.

Time complexity
In the first step of solving the EV1-COP m , the time complexity of the Lagrangian relaxation algorithm is O(Mlog 2 M)×O(M+ NlogN) [43]. In the second step, the SEA algorithm has a time complexity of O(MN(loglogN+1/ε) [45]. The overall run time of the EV1-COP m algorithm is the sum of the two terms. It is asymptotically dominated by O(M 2 log 2 M+ MNlog 3 M+MN/ε). The construction of G' must solve the EV1-COP m N'-1 times. Thus, the time that is required for transforming G to G' is O(N'(M 2 log 2 M+ MNlog 3 M+MN/ε)). Furthermore, Dijkstra's algorithm is used to solve the EV2-SP in G' and its time complexity is O(M'+N'logN') [47]. Overall, the time complexity of the algorithm for solving the EV-TOP is O(N'(M 2 log 2 M+ MNlog 3 M+MN/ε)).

Evaluation
The EV-SWP, which was proposed by Alder et al. [20], has been frequently reviewed and evaluated by other studies on optimal path methods for EVs. We compare our EV-TOP with the EV-SWP in the section to evaluate our proposed method. We present two computational experimental studies: The first study assesses the performance of the travel cost method, namely, more accurately approximating the electricity consumption function and considering the waiting time at CSs. Since the travel cost in the EV-SWP is the distance, the effects of charging operations are neglected. The second study evaluates the performance of our EV-TOP by comparing the optimal paths and LOSs at CSs that are based on the EV-TOP with those that are based on the EV-SWP.

Network and parameters
The EV-TOP is evaluated in the road network G = (V,E) of a region in Hangzhou, with |V| = 49, |E| = 163, and |S| = 10. Then, we generated 20 random networks that reasonably resembled the real-word road network. The EV-TOP and the EV-SWP are tested on randomly generated data to further evaluate the significance of the improvement.
The study network G is as illustrated in Fig 3, where links are represented by black lines, nodes are represented by black points and CSs are circled in red. Its south side stretches from Node 49 in the west to Node 36 in the east, with a straight-line distance of 15 km. Its east side stretches from Node 36 in the south to Node 30 in the north with a straight-line distance of 10 km.
There are ten charging stations. Table 2 lists the number of charging piles and the base time loss at each CS.
For simplicity, we select three main types of EVs in the actual road network, which correspond to the development of battery technology. Their performance parameters, except α, which are obtained by fitting the charging function to real data, are listed in Table 3. The fitting curves are plotted in Fig 4.

Benefits of the travel cost method
Benefits of the electricity consumption function. The EV-CSP always limits the total distance or the total electricity consumption to avoid the EV running out of battery. However, the existing methods assume that the electricity consumption over each link is constant or related to the link length. In practice, the optimal path may become an infeasible solution. A consumption function that considers the speed over the link, as expressed in Eq (16), can better avoid this scenario. Table 4 demonstrates the advantage of using this function with an example. The base consumption rate, the initial battery level and the battery capacity of the example EV are 0.2 kw�h/km, 3 kw�h and 5 kw�h, respectively, and e 1 / e 2 denotes the electricity consumption that is unrelated/related to the average speed over each link.
According to Table 4, the total electricity consumption over the least-cost path that uses e 1 is 2.63 kw�h, which is less than 3 kw�h. Thus, the least-cost path is exactly the optimal path. However, that value if e 2 is used is 3.26 kw�h. Hence, the least-cost path is not a feasible solution.
Benefits of waiting time prediction. The waiting time at a CS is an important component of the travel cost, especially at peak hours. Ignoring the waiting time may affect the charging    Table 5. Path 2 has the minimum basic travel cost. The travel cost values are 63.6 min, 64.0

Performance comparison
This section applies the EV-TOP and the EV-SWP to 400 EVs of three types in the study area and in 20 randomly generated networks to compare their performances. Table 6 presents important details on each randomly generated network G g , including the number of vertices |V g |, the number of arcs |E g |, the number of CSs |S g |, and the number of each type of EVs (Q 1 Comparison of optimal paths. The optimal solutions of the EV-TOP and the EV-SWP are denoted by X � 1 and X � 2 , respectively. These EVs differ in terms of origins and destinations. Table 7 lists examples and comparisons. Each row presents the details of the optimal paths for each EV, which include the battery capacity, the initial battery level, the origin, the destination, the total travel times of X � 1 and X � 2 , the total distances of X � 1 and X � 2 , the average speeds of X � 1 . The total distance along X � 1 increases 8.6%, while the total time savings that is based on the EV-TOP is up to 3685 min, which represents 14.5% of the total travel cost based on the EV-SWP. Furthermore, the smaller average speed and lower electricity consumption along X � 1 indicate that the EV-TOP trades a small increase in the distance for substantial decreases in the travel time and the electricity consumption. EVs of the first type stop fewer times for charging along X � 1 compared to EVs of the other two types. That is because the latter two have high battery capacity while the study area is small. EVs can arrive at any node from any node with a full battery. The advantage of reducing the number of charging operations can be more readily observed on a larger road network, for example, a highway network. The other two types of EVs charge once at most. The charging operation and optimization method have little influence on the optimal path. To further analyze the significances and the origins of the time savings and the consumption savings, the travel cost, the travel speed, and the consumptions of X � 1 and X � 2 for each EV of the first type in the 20 randomly generated networks are considered. The Friedman test is a nonparametric test that compares two or Targeted optimal-path problem for electric vehicles more matched or paired groups. It is conducted to identify significant differences in the travel cost, the travel speed and the consumption between X � 1 and X � 2 for each EV. Each randomly generated network G g corresponds to three Friedman tests that use Q 1 g paired travel costs, Q 1 g paired travel speeds, and Q 1 g paired consumptions. Fig 6 presents the results of the Friedman tests and the mean percentage differences. The mean percentage differences of the travel cost and the consumption are 20.11% and 12.53%, respectively. All the significance probabilities of the travel cost and the consumption in the 20 randomly generated networks are far less than 0.05. Hence, the improvement of the  EV-TOP is significant in terms of time savings and consumption savings. Meanwhile, the travel speed average increases up to 22.68%. Its significance probabilities in the 20 randomly generated networks are far less than 0.05. Therefore, the significant improvements of the EV-TOP in terms of time savings and consumption savings are due to the avoidance of congested links and CSs. Comparison of the LOSs at the CSs. The optimization methods and the corresponding optimal paths of 400 EVs also influence the level of service at each CS. We compare the charging details and the LOSs at ten CSs to further analyze the performance of the EV-TOP. The LOS at a CS depends on the stops for charging, the charging time, and the CS capacity, among other factors. Many criteria could be used. We use the average number of stops for charging per charging pile (p ave ) and the average waiting time per stop (w ave ) to reflect the LOS. Fig 7 plots the average stops for charging per charging pile and the average waiting time per stop at ten CSs based on the EV-SWP and the EV-TOP in different lines. The values at CS 14, CS 23, and CS 45 differ significantly between the two methods. In addition, the average number of stops for charging and the average waiting time based on the EV-TOP are relatively low. They also differ little among the ten CSs. In contrast, those values are much higher and fluctuate substantially with CSs. Hence, EV-TOP can balance the LOSs at CSs by reducing the number of stops for charging and by selecting the more reasonable CSs. Thus, the waiting time at CSs declines and the LOS improves. This is further supported by the Friedman test, which is conducted later.
The number of stops for charging, the base time losses, the waiting times, and the charging times at ten CSs for the EV-TOP and the EV-SWP are listed in Table 8. Comparing each pair of rows, in addition to the total number of stops for charging, the total base time loss, the total waiting time, and the total charging time are reduced by the EV-TOP. The time savings are 72 min, 2239 min, and 291 min, respectively, for a total of 2602 min. They account for 70.6% (2602/3685 � 100%) of the total time savings. Hence, the improvement of the EV-TOP relies mainly on the decrease of the waiting time at CSs, followed by the decrease of the travel time and the decrease of the charging time.
Similarly, the Friedman tests are conducted to identify significant differences in the average number of stops for charging per charging pile and the average waiting time per stop among the ten CSs in the 20 randomly generated networks. The results of the four Friedman tests on the 20 groups of ten-matched p ave based on the EV-TOP, the 20 groups of ten-matched p ave based on the EV-SWP, the 20 groups of ten-matched w ave based on the EV-TOP, and the 20 groups of ten-matched w ave based on the EV-SWP are presented in Table 9. The test results demonstrate that the EV-SWP results in significantly different average numbers of stops for charging and average waiting times among the ten CSs. In contrast, there is no significant difference in the average number of stops for charging or the average waiting time using the EV-TOP. Thus, the EV-TOP can balance the LOSs at CSs.
According to the comparisons of the optimal paths and the LOS at each CS, the performance of the EV-TOP is improved by 1) trading a small distance increase for a significant travel time decrease and 2) balancing the LOS at each CS. Targeted optimal-path problem for electric vehicles