Abstract

With the rapid development of the electric vehicle industry, the problem of electric vehicle mileage limitation still exists. Recent studies focus on the minimum energy consumption path planning method or the charging route planning method, with a lack of studies considering midway charging scenarios. In this study, we propose a graph processing method for the electric vehicle, given the energy consumption and road conditions, and establish a mixed integer planning model for the electric vehicle path planning problem. The objective is the shortest time, with energy consumption as a constraint, aiming at the problem of shortest path planning for electric vehicles with midway charging. Taking into account real-time traffic information and energy consumption information related to road conditions, a three-step heuristic algorithm based on preprocessing traffic network, charging path planning, and subpath planning is proposed for the electric vehicle path planning problem. The simulation results show that the proposed method can determine optimal paths including charging stations and effectively alleviate electric vehicles’ “range anxiety” problem during medium- and long-distance travel.

1. Introduction

New energy vehicles, particularly electric vehicles, are a promising option for reducing the impact of road traffic on the environment. The promotion and application process for electric vehicles has become the primary restriction for pure electric vehicle development due to the limited range and low level of charge pile coverage, leading to the emergence of the electric vehicle “range anxiety” problem [1]. Especially in the north with cold winters and the south with hot summers, the problem is more serious. Based on the existing electric vehicle power battery materials, electric power storage technology, and existing infrastructure construction such as charging piles, it is important to investigate the method of path planning during driving to alleviate the “range anxiety” problem and promote the use of electric vehicles.

The shortest path planning problem (SPP) induced by the column generation algorithm for solving the vehicle path planning problem also emerged as a result. Exact algorithms for solving SPP have been researched extensively, including Dijkstra’s algorithm [2], Bellman–Ford’s algorithm [3], and Floyd’s algorithm [4]. The SPP is often solved by graph, including minimum energy path planning [5, 6] and electric vehicle charging path planning [7]. On the other hand, a variant of the constrained shortest path problem (CSPP) has also appeared [8], which is described in the literature. The differences between the CSPP and SPP problems are described in detail, and the common algorithms used to solve this problem are summarized. The shortest path planning problem for electric vehicles can be classified as CSPP [9, 10], and various algorithms have been proposed to solve this problem, such as heuristic algorithms combining the variable neighbourhood search algorithm and particle swarm optimization algorithm, or the branch-and-cut algorithm based on the LP algorithm and other accurate algorithms.

The CSPP finds the feasible optimal path subject to the resource constraint and does not consider the replenishment of resources. The electric vehicle shortest path planning problem that considers midway charging is closer to the constrained shortest path problem with relays (CSPPR) [1114]. The CSPPR is also defined in the graph and needs to find the feasible optimal path. It requires that the weights constrained to a certain node cannot exceed the given limit. Likewise, the power consumption of the electric vehicle cannot exceed its battery capacity during the trajectory. However, due to the occurrence of midrecharge, the problem has more possible feasible paths compared to CSPP. Recently, the CSPPR has generally been solved by the improved label-correcting algorithm as well as the heuristic algorithm [1520].

To solve the shortest path planning problem for electric vehicles considering charging, a more accurate model of energy consumption is required. The establishment of an energy consumption model is generally divided into two approaches, including the direct establishment of a simple model of energy consumption linearly related to driving distance, and taking into account the payload energy consumption model of the driving power and terrain of the vehicle and auxiliary equipment (air conditioner, heater, etc.) [2126]. In addition, it is feasible to use machine learning-related methods to predict the driving energy consumption of electric vehicles based on historical data [27, 28]. The driving status of EVs under the influence of different traffic conditions must also be taken into account, including the speed, driving time, and energy consumption of EVs under the influence of different speeds and durations of driving. Changes in traffic conditions while driving will affect final path planning outcomes. A common way is to consider the travel time attribute in detail in the road graph [2933]. Since different road links typically represent different road conditions, path planning for electric vehicles in different traffic conditions can be investigated.

This study establishes a mixed integer planning model for electric vehicles and proposes a three-step heuristic algorithm for preprocessing traffic network, charging path planning, and subpath planning. The model aims at the shortest travel time with the energy consumption constraints affected by the road conditions. Simulation results show that the proposed method can achieve optimal route planning results and effectively alleviate the “mileage anxiety” problem of electric vehicles in medium- and long-distance travel. Section 2 describes the electric vehicle problem considering charging. Section 3 introduces the graph deloop treatment and the model of the problem. Section 4 proposes a three-step heuristic algorithm to solve the problem, and finally, we verify the model and algorithm through simulation experiments.

2. Electric Vehicle Path Planning Problem Description

The electric vehicle path planning problem is established in the graph with the shortest path from the origin to the destination, to determine the feasible optimal driving path under the satisfaction of the electric vehicle energy consumption constraint. Electric vehicles are limited by battery capacity and have a lower range compared to traditional fuel cars, and during winter and summer climate extremes, air conditioners will further consume energy and decrease the effective driving distance. In addition, charging station facilities for pure electric vehicles are still under construction. There are only a few unevenly distributed in less-developed cities. The charging speed of electric vehicles will take a lot of time, and it is more difficult to popularize the exchange station than the charging station, which leads to the limitation of the driving range of electric vehicles and the problem of electric vehicle mileage anxiety. To address the problem of mileage anxiety, when planning the path of electric vehicles, it is necessary to take into account the dispatch location of charging stations and current battery energy, so that when insufficient battery power is available while driving, electric vehicles can reach charging stations to be charged in time with the remaining current energy, and to ensure that the whole electric vehicle driving route is optimal.

The electric vehicle path planning problem aims at optimal planning of electric vehicle driving routes, making decisions on the roadway nodes and charging station nodes so that the final planned paths have the minimum travel time. The traffic network model can be developed based on road conditions and traffic conditions such as road travel time and the average speed of the traffic flow. The problem is defined on a road network that includes node attributes and road segment attributes. The node attributes of the road network include intersection nodes and load station nodes, and the charge time in each charge station is known and fixed as an independent constant. The attributes of the road segments include the arcs connected to nodes and the weights of the paths on the arcs, such as path segment length and path segment travel time. According to the road segment length and road segment travel time, its speed can be calculated. Based on the electric vehicle energy consumption model, the road segment energy consumption can be calculated. Given the origin and destination, the shortest time path should be on the premise that the electric power is enough to reach the destination. When the distance between the starting place and the destination is close and the vehicle can be driven to the destination without recharging midway, only the shortest route of driving time from the starting place to the destination needs to be planned according to the driving time weights. When the distance between the starting place and the destination is far and the electric vehicle needs to charge halfway, it is necessary to determine the charging station nodes that can be reached by the electric vehicle and decide the charging station nodes for charging halfway to find the feasible optimal path. When the distance between the charging station and destination cannot be reached directly due to the limitation of battery capacity, the recharging station node needs to be decided before getting all charging stations and the complete driving path.

Electric vehicle power can be considered as a resource constraint in the constrained shortest path problem with relays (CSPPR), and the charging station is equivalent to replenishing the consumed resources at the point. Therefore, the problem can be classified as the CSPPR. The problem is to find the shortest path among all the paths that satisfy all the constraints and allows intermediate replenishment of satisfying the resource constraints.

As shown in Figure 1(a), it is assumed that the charging station is node 4, the battery capacity of the electric vehicle is 5, and the travel time of the road section is 1. As can be seen in the figure, the power consumption of the road segment is marked. There are two paths from the start point 1 to the endpoint 5, respectively, expressed as and , where path charges at the charging station node 4. Considering the power limit, only path is the feasible optimal solution. In Figure 1(b), is the travel time of the road section, and represents the power required to pass the road section. Assuming that node 2 is a charging station node, the battery capacity is still 5, and the feasible path from starting point 1 to ending point 4 includes , charged at node 2, , no charge required, and , charged at node 2. The three paths are all feasible solutions, but considering the travel time, the path is the optimal solution. In Figure 1(a), the only feasible solution is the optimal solution, which includes the loop . It is different from the general shortest path problem. That is, the solution with the loop is allowed in the electric vehicle path planning problem considering charging.

In summary, the electric vehicle path planning problem in this study ensures that the electric vehicle has enough power for driving in a complex traffic road network and makes decisions about the charging station nodes to find the minimum travel time path.

3. Establishment of the Problem Model

The electric vehicle path planning problem considering charging is to determine the optimal path given the actual traffic network and the battery capacity. Therefore, it is necessary to determine the connection between nodes in the traffic network, including whether the nodes connect directly and the weight of the connected sections between nodes, which means we need to establish a traffic network model. Furthermore, the power is related to the speed of the vehicle, and the speed affects the real-time position of electric vehicles in the road network. All of these are associated with electric vehicle charging stations. Therefore, it is necessary to determine the energy consumption model under the influence of speed. In order to determine when to charge the vehicle as well as the location of the charging station, and to plan a time-optimal path, the path planning model is required as well. Given that the optimal solution exists with loops, the graph can be processed based on the theory of strong connectivity and loop detection in the road network model established by graph theory, and the corresponding model can be built using the processed graph. As a result, this section will construct the traffic network model, the processed graph of the road network model, and the path planning model.

3.1. Traffic Network Model

The urban traffic network is composed of a large number of adjacent or intersecting roads, and the traffic flow in different sections may be different. To distinguish the difference between traffic flow on the road and the starting and stopping points of vehicles, the road network nodes are fixed, and the road between adjacent nodes is called the road section, so the road is composed of sections and nodes. Roads have corresponding traffic directions, and there are certain differences in road traffic flow in different directions, so the traffic flow in different directions may also be different. In many cases, the road traffic flow in the same direction between the adjacent two nodes is the same. The road impedance is used to represent the road traffic flow attribute. Although there is only one link between adjacent nodes, each node may have more than one adjacent node, so there can be more than one link connecting each node. The traffic network model is to establish a directional road network model including a road impedance model by taking the intersection and start-stop points of different traffic flows between roads as nodes and the roads connected between the nodes as sections.

3.1.1. Establishment of the Traffic Network Model

Graph theoretic modelling has become a widely used method in the field of traffic research. The graph is a mathematical structure used to describe the pairwise relationship between objects, composed of a large number of given points and lines connecting points. Nodes and straight segments are often used to describe the traffic network, where nodes represent intersections or vehicle start-stop points and straight segments represent sections between nodes. This study uses the directed graph in the graph theory method to model the traffic network. In order to consider the direction of the traffic network, the road attributes in the traffic network are assigned as the edges’ weights in the graph.

Nodes and sections constitute the essential elements of the traffic network. Nodes are not actual points but abstract concepts of actual road points such as intersections. The attributes of road traffic flow at nodes will change with time and affect the final planning results. Considering the particularity of EVRP, the node set also includes charging stations. To facilitate planning, we should identify nodes from number to , representing all the nodes included in the collection of and including all charging stations. A road section links two adjacent nodes, abstracted as an arc in graph theory. A road can have multiple sections, and individual sections have the same properties. Sections should be individually identified and associated with nodes. The section of the serial number is, respectively, nodes at both ends of the road. All sections are listed in collection . Road attributes include the length of the road itself and traffic flow attributes. The section length is set as , representing the length of section and listed in collection , representing the length attributes of all sections. The traffic flow attribute is represented by the section impedance, which is specific to section travel time . The road section impedance can be calculated by using the general impedance model, and the travel time set of all sections is set as . The intersection nodes are labelled 1–5 as shown in Figure 2(a), and the rest of the nodes are stops. The graph-theoretic method abstracts a traffic network of nine nodes comprising stops, and each node’s connection relation is illustrated in Figure 2(b).

The traffic network is defined as , where represents all nodes including intersections and charging stations, while denotes road section set, represents the length of road sections, and represents the travel time set through road sections, which is determined by the BPR impedance function. On the basis of the above analysis,

Establishing the traffic network needs to consider the adjacency relations between nodes, arcs, and other elements, which can be concluded from connectivity and direction. Connectivity refers to the connection between nodes in the traffic network, mainly including whether nodes are adjacent and whether adjacent nodes are passable. Directivity mainly considers whether there are differences in the attributes of different directions of the same road section. The attributes of the two directions of the same road section are different. The road section in a single direction of the traffic network may be connected but not reachable in the opposite direction, as shown in Figure 3. The directed graph is typically used to represent the traffic network.

Traffic network assignments include the adjacency list method and the adjacency matrix method. This study uses the adjacency matrix method. When node set is , the weight of edge is set to . When node is connected to node , ; otherwise, , which indicates the weight is infinite and the edge is not reachable. is set to 0 within the matrix, representing the node’s distance. The adjacency matrix of traffic network weight is expressed as follows:

3.1.2. Improved BPR Impedance Function Model

Road resistance is a quantitative index needed to select the optimal path. Different sections correspond to different road resistance. Road resistance can represent different concepts, including road traffic time, section length, and electric vehicle in the corresponding section of power consumption or travel expenses. This study uses travel time as traffic flow attributes. Road resistance is closely related to the road traffic flow, which is the number of accessible vehicles in this section during a specific period. When the traffic flow density increases, the traffic volume increases first and then decreases, and the traffic condition generally changes from unchecked to congested.

To simulate this process, the US Highway Bureau has put forward the BPR impedance function [34] through regression analysis of numerous data and established the monotonically increasing function related to road travel time and road flow. However, the function can’t reflect the changes in traffic conditions with increasing traffic volume. As shown in Figure 4, considering the large number of intersections in the city and the travel time of intersection nodes related to the traffic volume of the sections, the road weight is divided into two parts: the attributes of intersections and road sections. Section travel time is the sum of intersection travel time and linear section passage time, excluding any intersection. The road resistance of section consists of section impedance and node impedance , which are determined by the traffic state of sections. Road resistance is defined as follows:

The road impedance model describes the linear section of travel time related to traffic volume. When road traffic increases, the corresponding road travel time will increase. When the traffic increases to a certain degree, the road will be inaccessible. The BPR model introduces road saturation , which is positively correlated with traffic flow density. Due to the limit of the number of vehicles that the road can accommodate, there is a maximum road traffic density. Bounded by traffic flow and traffic jam , the passage time of linear sections is described as follows:where and are the parameters to be calibrated which are affected by traffic network traffic conditions, usually and .

The node impedance model describes the travel time of intersection nodes. The travel time calculation at intersections is more susceptible to traffic density than the section impedance model. Therefore, the required saturation division is more precise when the road is unblocked. When , the traffic situation at the intersection is relatively stable, and the number of vehicles reaching the intersection is equal to the number of departures. At this time, the impedance at the intersection only includes the delay and random delay caused by the signal lamp. When the traffic condition becomes worse and the road saturation is more significant than 0.8, the intersection traffic time also includes the waiting time of vehicles passing through the intersection. The node impedance model is established as follows:where refers to the saturation critical value and , , and are the influencing factors of road traffic conditions, usually .

In the entire impedance model, saturation is the only variable, and other parameters are calibrated according to traffic network conditions. The congestion status of the traffic network is determined, and path planning is carried out according to the saturation change of each road section. The model parameters are defined in Table 1.

3.2. Electric Vehicle Energy Consumption Model

EVRP needs to determine whether the electric power is enough for the whole journey. In other words, it is necessary to determine the power consumption of electric vehicles on the road. The power consumption of electric vehicles on the road is related to many factors, such as air conditioning temperature, air resistance, tire friction, and other factors. The braking force accelerates and decelerates when the car runs at a constant speed. At a constant high speed, the air resistance consumes the most energy, and at a lower speed, the power transmission system causes the most energy loss. From the perspective of aerodynamics, the energy consumption of electric vehicles is affected by air resistance and driveline resistance factors at a constant speed, ignoring the influence of auxiliary system factors such as air conditioning temperature. The energy consumption model of electric vehicles was established by referring to the energy consumption formula related to driving speed [35]:where is traffic speed, which is the ratio of road section distance to road section impedance. According to the known speed and travel time , the energy consumption model is used to calculate the power consumption required when passing the road section and determine whether the vehicle needs to charge midway according to the road section power consumption.

3.3. Eliminate Loop and Tarjan’s Algorithm

As the optimal solution will allow loop for the electric vehicle path planning problem considering charging, the loop must include the charging station node when it exists in the optimal solution. It is assumed that if there is no charging station node in the loop, there is no loop in the optimal path. The proof of this proposition is simple. If there is no charging station node in the loop and the loop is in the optimal path, it can be deduced that the optimal path does not need to charge in ; thus, the optimal path does not need to go through , and there is no loop in the optimal path, which is contradictory to the assumption. So when the loop exists in the optimal solution, it must include the charging station node.

The existence of charging loops for the optimal path can be divided into the following cases: the loop directly to charging station nodes and the loop including other noncharging station nodes, as shown in Figures 5(a) and 5(b). The optimal path in Figure 5(a) is with node 3 being the charging station node, where forms the loop. The optimal path in Figure 5(b) is with node 3 being the charging station node, where forms the loop. Since only the loop containing charging station nodes needs to be considered when finding the optimal path, it can be inferred that only the subloop containing charging stations needs to be eliminated from the graph. It is considered to use the idea of loop detection and Tarjan’s algorithm to eliminate loops.

First, the concept of strongly connected components is introduced. In a directed graph , two vertices are said to be strongly connected if there is a directed path from to and a directed path from to . We say that a directed graph is a strongly connected graph if every two vertices are strongly connected. The strongly connected subgraph of a directed nonstrongly connected graph is called a strongly connected component. The principle of forming a connected graph is that the tree itself is unidirectionally connected. If a child node points to its unique corresponding parent node, it forms a loop or a strongly connected graph.

The strong connectivity component is equivalent to the loop in the graph. If the detected loop includes the charging station node, it is equivalent to the strong connectivity component including the charging station node in its child node. In Figure 5(a), the strong connectivity component includes the charging station node, and the corresponding parent node is node 2. The strong connectivity component is formed when there are child nodes pointing to the parent node in the loop. In Figure 5(a), it is formed by child node 3 pointing to the parent node 2. Delooping can make child node 3 point to virtual node 2a, while node 2 and node 2a actually represent the same. When node 2 points to node 2a, the strongly connected component in Figure 5(a) becomes in Figure 5(c), which does not constitute a loop, and the graph processing is completed. At this time, using Figure 5(c) for path planning, the resulting shortest path will not include loops. After replacing virtual node 2a with the original node 2, the final path planning is completed.

Figure 5(a) represents a single child charging station node that is included in loop. If the loop contains multiple child nodes, as in Figure 5(b), the delooping method is the same, except that the child node pointing to the parent node is not the charging station node. The delooping needs the child node 5 directly to the parent node 2 that points to the virtual node 2a, and the virtual node 2a is actually the same as the original node 2. The graph after the delooping is shown in Figure 5(d).

The above analysis shows that it is necessary to first detect the loop containing the load station node and then find the parent node of the loop to finish processing the graph. Tarjan’s algorithm can effectively detect all strongly connected components of the graph and their corresponding parent nodes. It is based on the depth-first search method. The network deloop processing process is shown in Table 2.

3.4. Path Planning Model
3.4.1. Problem Description

The objective of this problem is to find the shortest time path among the feasible paths. To solve it, we introduce a directed graph after the delooping process satisfying the power constraint. The departure and destination in the graph have been defined. Based on the BPR function, the travel time in the road network can be calculated, and the energy consumption value of the electric vehicle can be calculated by equation (6). Charging is permitted at the charging station when the electric vehicle is low on electricity. The path planning optimization objective is to minimize the sum of road section travel time and charging time at charging stations.

The problem is defined in the processed graph , which has eliminated all loops containing charging stations. The set of all nodes is , and the set of all edges is . The set of charging station nodes is . The set of virtual nodes is , and the original node set corresponding to the virtual node is , in order with nodes in correspond to each other. and are generated after delooping and have no practical significance, which only symbolizes deloop processing.

The node attribute includes power when reaching the node and power and leaving the node . If is equal to , the electric vehicle is not charging at the node . If not, the vehicle is charging at the charging station , and . Road link includes the travel time attribute and the power consumption attribute . Figure 6 illustrates the node attributes and section attributes on the road network. The origin is node 1, and the destination is node 4. Assuming that the battery capacity of the electric vehicle is 5, there are three feasible paths from the starting point to the ending point, denoted by path , , and . The path and can charge at charging station node 3 or not. According to the power consumption of the road, path and are feasible only charging at the charging station 3. It is assumed that and are both charged at the charging station. Path is not feasible. The remaining power of the electric vehicle is 2 when it leaves node 2, while the power consumption of the electric vehicle needs 3 when it passes through the road section (2a, 4). In path and , the remaining power when leaving charging station node 3 is 5. The total power consumption of the path after charging is 4. Path and are both feasible. Since the goal of this problem is to minimize the travel time, the total travel time of path is 6 and is 7, so the optimal path is . The node attribute marked on the figure is the power and of each node corresponding to the optimal path .

3.4.2. Problem Hypothesis
(1)It is assumed that the traffic conditions will not change(2)The electric vehicle is fully charged when starting from the origin(3)Do not consider the queuing time at charging stations(4)Do not consider the energy recovering when the electric vehicle slows down(5)It is assumed that after arriving at the charging station, the vehicle will be fully charged(6)The road network has been delooped, eliminating the loops of the charging station node
3.4.3. Parameter Definition

The notation of the parameters is shown in Table 3.

3.4.4. Decision Variables

This study should determine the path nodes and charging station nodes passed from the starting point to the endpoint. Therefore, the decision variables are as follows:

Considering that the remaining power of electric vehicle varies depending on the selected path, it is also a variable that must be decided. The electric vehicle power when arriving at the node and leaving the node differs depending on whether the vehicle is charged at the charging station node. When reaching all nodes, the power needs to be greater than 0 to ensure that the EV can reach the destination.

3.4.5. Optimization Objective

The objective of the EVRP is usually the shortest distance, the shortest travel time, or minimum energy consumption. Among these, the optimization goal of EVRP in this study is the shortest total travel time considering the actual situation. Because of the charging problem of electric vehicles, the total driving time includes the time spent on each road section and the time needed to charge at the charging station. Therefore, the optimization objective of this study is to minimize the sum of section-time and charging time :

3.4.6. Constraint Equations
(1)Electric vehicle power constraints: Traffic network nodes include charging station nodes and intersection nodes. If electric vehicles need to be charged at the charging station node, the electric quantity of electric vehicles leaving the charging station is , which means the electric vehicle power is 100%. When electric vehicle arrives at intersection nodes or charging stations without charging, the electric quantity is , which means the remaining electricity at the node . The electric quantity at the next node is equal to the electric quantity of the current node minus consumed on the way. To ensure that the electric car has enough power, it is required that the power when arriving at any node is greater than zero.(2)Flow balance constraints: An electric car can only make one trip from and, ultimately, only one trip to . When the vehicle reaches node , it must drive away from the same node to ensure the flow balance of the node .(3)Constraints on the value of decision variables: The model is a nonlinear mixed integer programming model, and Constraint 9 appears as a product of decision variables that can be linearized by introducing auxiliary variables.
3.4.7. Model Linearization

Constraint 9 is nonlinear mainly because of the product of decision variables , the auxiliary variable , , and the following supplementary constraints are introduced:

Constraint 9 becomes a linear constraint.

The model linearization is completed and can be solved by CPLEX, and it will be validated in Section 5.

4. Three-Step Heuristic Algorithm of EVRP

In this study, we propose a three-step heuristic algorithm to solve the path planning problem of electric vehicles, including road network preprocessing, charging path planning and subpath planning. The objective is to solve the time shortest path, and the algorithm first determines whether charging is required on the way of driving. When charging is needed, the problem is divided into two parts: finding the time shortest charging path and planning the time shortest path from the starting point to each charging station node. It is assumed that the planned charging path is the shortest time path from the starting point to the endpoint, and the subpaths between the nodes of the charging path are connected to the final shortest time path. Therefore, it is important to determine the road network when planning the charging path. If the weight of the preprocessed road network is the time consumption of the feasible shortest path between the corresponding charging station nodes, the planned charging time shortest path is the optimal path. The preprocessed road network is a feasible road network for charging, and all the nodes connected in the road network are feasible and can be reached within the range of electric vehicles. The weights between the nodes are the optimal path weights of the corresponding feasible paths.

The feasible path means that the total energy consumption of the path is less than the electric vehicle battery capacity, and the vehicle does not need to be charged while driving. If the minimum energy consumption path is feasible, there must be a feasible path between the two nodes. If the minimum time path between nodes is feasible, the optimal path between two nodes is the minimum time path . The road network preprocessing is to determine the feasible charging traffic network. Charging path planning will plan the shortest time path according to the feasible charging traffic network, and subpath planning is to determine the feasible shortest path between nodes according to the planned charging station nodes. The electric vehicle path planning method is shown in Figure 7.

4.1. Traffic Network Preprocessing

In order to avoid repeatedly computing the path energy consumption between each node of the initial road network, especially the path energy consumption between the charging stations and the starting and ending points, and to speed up the path planning, the road network preprocessing is put forward. The charging feasibility road network contains only the starting point, charging station node, and the endpoint. The road network includes the information of feasible paths of road link and node . The weight set includes the information of optimal values of feasible paths of link . The road section travel time is determined by the BPR road resistance function in equation (5). The starting point , the ending point , and the set of feasible charging station nodes are considered as the set of nodes in the road network . The road network preprocessing steps are as follows.Step 1: Using Bellman–Ford’s algorithm to find the time shortest path of each two nodes in .Step 2: Using the energy consumption of the road section calculated by equation (6) to determine energy consumption of corresponding path . If , the time shortest path between road sections is the feasible optimal path, and . The charging feasibility road network in the road section weight is , which is the total time consumed corresponding to the path , and . If , the energy consumption of the path corresponding to the energy optimal path is calculated.Step 3: If , it means that there is a feasible path between nodes , and set . The weight of the section is temporarily determined as . If , there is no feasible path between nodes , and set , .Step 4: When every two nodes of have determined whether the corresponding path is feasible, the charging feasibility road network is processed completely. For example, the path from node to node via multiple intersection nodes is feasible, and it is considered as a generalized road section. The route connected between two nodes is considered as a virtual edge , and the cumulative weight between two nodes is the weight of the virtual edge.

Road network preprocessing is to determine the charging feasibility road network, including determining whether there is a feasible path between nodes and determining the optimal value of the feasible path between nodes. However, solving the feasible optimal path between all nodes is time-consuming and costly. We plan the minimum time path and the minimum energy path to replace solving the feasible optimal path.

First, when the minimum path between two nodes is feasible, the minimum time path must be the feasible optimal path between the corresponding nodes. Therefore, the feasible optimal path can be solved by finding the time minimum path. Assuming that the feasible optimal path between two nodes is , the minimum time path between nodes is , which is a feasible path. and are different paths, and the path target value is , . Since path is feasible and is the time minimum path, it can be concluded that . However, path is the feasible optimal path. Among all feasible paths, must be the smallest, so there must be . The assumption is not true, so it is proved that when the target minimum path between two nodes is feasible, the target minimum path must be the feasible optimal path between the corresponding nodes.

When the time minimum path is not a feasible path, in order to reduce the solution scale, the energy consumption minimum path is solved directly to process the charging feasibility road network. When the minimum energy consumption path between nodes is feasible, there must be a feasible path between the nodes, and when the minimum energy consumption path between nodes is not feasible, the two nodes must have no feasible path in the road network. Assuming that the minimum energy consumption path is not feasible, there is a feasible path between nodes , that is, and path exists. Its energy consumption , so can be deduced. However, the energy consumption of the energy minimum path must be less than . The assumption is contradictory and does not hold. As a result, when the minimum energy consumption path between nodes is not feasible, there must be no feasible path in the road network. When the minimum time path is not feasible and the minimum energy consumption path is feasible, the weight between nodes is at charging feasibility road network . When the path with the lowest energy consumption is not a feasible path, there must be no feasible path between nodes, and the weight value is set to the maximum value. Through the above treatment, we can get the charging feasibility road network.

The charging feasibility road network includes node path feasibility information and time-consuming weight information between nodes. Due to the energy recovery phenomenon during the driving of electric vehicles, the adjacency graph with energy consumption as the weight value may have negative weight value. Therefore, this study uses Bellman-Ford’s algorithm to plan the shortest path between each node.

As shown in Figure 8(a), nodes 1 and node 9 are the starting point and the ending point, respectively. Node 3, node 4, and node 8 are the charging station nodes. Only the starting point, the charging station nodes, and the ending point are reserved during traffic network preprocessing. Only nodes 1, 3, 4, 8, and 9 are reserved. Then, the feasibility of paths between these nodes is judged to determine whether the paths are feasible. That is, the feasible paths between nodes 1, 3, 4, 8, and 9 are determined. Calculating the corresponding power consumption of paths according to the road power consumption, compared with the electric power safety threshold, the judgment result is the virtual path (1, 3), (1, 4), (3, 4), (4, 8), (4, 9), and (8, 9) for the feasible path between nodes. The weight of these feasible paths in the feasible charging network is set to the total time consumption of the feasible optimal path between nodes. The paths between nodes (1, 8), (3, 8), and (3, 9) are infeasible, and the traffic network weights of these infeasible paths are set as the maximum value. The charging feasibility road network obtained by traffic network preprocessing is shown in Figure 8(b).

The steps of the traffic network preprocessing algorithm are shown in Table 4.

When the charging feasibility of road network is determined, the road network with path feasibility information between nodes in is formed, where , , and are starting points and endpoints, respectively, and denote the charging stations in the road network. denotes the set of edges of the road network . For example, supposing the starting point can reach the charging station without charge, at this time . Otherwise, . denotes the weight of the corresponding edge. If , the nodes and node are connected, and the weight between the two nodes is the value of the feasible optimal path .

4.2. Charging Path Planning Algorithm

As the feasible charging traffic network is determined, the traffic network with only the start point, charging station nodes, and endpoint, and the path feasibility information between nodes is formed, where , and are the start point and endpoint respectively, and orderly represent charging stations in the traffic network. represents the edge set in the traffic network . For example, suppose that the starting point can reach the charging station without charge, at which time and cannot be reached otherwise, , and inf represents the maximum value. represents the value of the corresponding edge. If , is the Euclidean distance between two nodes, and the maximum value between disconnected nodes is .

The charging feasibility road network path weights are set to the feasible optimal path weights between nodes. As a result, the planned charging path must be the feasible and optimal path when solving the charging path from the starting point to the endpoint based on the charging feasibility road network . The charging path in is , and the path takes time . Assuming that there exists a feasible optimal path and the two paths pass through different charging stations, the path must be the optimal path in and does not exist. The hypothesis is contradictory. The path is the optimal path.

This section is to solve the path planning problem whose objective is . Standard shortest path planning algorithms have been submitted a lot, such as Dijkstra’s algorithm, Floyd’s algorithm, and Bellman–Ford’s algorithm. Considering that Bellman–Ford’s algorithm can solve the shortest path planning problem in a graph structure with a negative weight edge, this study uses Bellman–Ford’s algorithm. Based on the idea of traverse and cycle, the steps of using Bellman–Ford’s algorithm to plan the charging path between terminals are as follows:Step 1: First initializing the distance from to each node in , and it is set to be infinite except .Step 2: denotes the set of all connected nodes of the starting point . According to the road section connectivity within , if the road section , determine whether the cumulative weight value will be better than the current distance from starting point to node . Since the initial distance to each node is set as infinite, the distance from to node can be updated to . Update all node distances in the set .Step 3: If the node is not the endpoint when updating the node distance, continue to update all connected nodes of . We need to judge whether the cumulative weight of the starting point to is less than the current distance of . When , the distance of needs to be updated as . Stop updating until the current node is the endpoint. At this point, the total time taken for the path from the endpoint is the current node distance .

The steps of the charging path planning section are shown in Table 5.

4.3. Subpath Planning

According to the charging path planning algorithm for the virtual shortest path, the virtual shortest path can be divided into subpaths with adjacent nodes, denoted as . Each blade path should be determined as the actual path in the initial network. Since the problem of electric vehicle power shortage has been solved by traffic network preprocessing and charging path planning, subpath planning only needs to consider the optimal driving time. The actual driving route of each subpath needs to be determined, and the goal is the shortest driving time. Finally, the shortest time path is solved for each subpath group to obtain the final driving path. Taking subpath as an example, using Bellman–Ford’s algorithm to obtain the optimal path , which is nodes passed by and where is the intersection node I in sequence passed in subpath. As shown in Figure 9(a), the charging path planning result is in the feasible charging network. The shortest time path from starting point 1 to charging station node 4 in the initial road network is , and the shortest time path from charging station node 4 to terminal 9 is . The final shortest path is , as shown in Figure 9(b).

Subpath planning algorithm steps are shown in Table 6.

5. Simulation Experiment

In this section, the model and the three-step heuristic algorithm are validated and compared for analysis. The experiments are run on AMD Ryzen 7 @ 3.20 GHz. In this study, simulation experiments are used to verify the correctness and validity of the algorithm, using public road network datasets for experimental analysis [36]. The model and algorithm are validated on five different sizes of road networks, namely, Sioux Falls network, Anaheim network, Barcelona network, Austin network, and Berlin Center network, respectively. The model was solved using Python 3.7 to call IBM ILOG CPLEX 12.9.0, with a solution time limit of 3000 s. The algorithm was also coded in Python 3.7.

5.1. Simulation Environment

The road network needs to be set up with road travel time, the connection of roadway sections, the length of the roadway sections, and the free flow time parameters. We use the BPR roadway impedance function to determine the travel time. The saturation degree is the only variable in the impedance model, and the rest of the parameters are calibrated according to the road network conditions. The saturation degree is randomly generated in 0–2, and the congestion condition of the road network is determined according to the saturation degree of each road segment. Taking the Sioux Falls network as an example, the saturation, free flow time of each road segment, and the road segment travel time data calculated using the BPR road resistance function are shown in Table 7.

According to the road section travel time calculated by BPR road resistance with the length of the road section in the data set, the average travel speed of the road section is determined. The corresponding road section energy consumption is calculated according to equation (6), and part of the data is shown in Table 7.

The Sioux Falls network includes 24 nodes with 76 edges. The Anaheim network includes 416 nodes with 914 edges. The Barcelona network includes 1020 nodes with 2522 edges. The Austin network includes 7388 nodes with 18,961 edges. The Berlin Center network consists of 12,981 nodes and 28,376 edges. The number of charging stations in each road network is set to one-tenth of the number of nodes in the whole road network. The locations of charging station nodes are evenly distributed in the road network, and in the Anaheim network, Barcelona network, Austin network, and Berlin Center network, which overlap with the actual map, charging station nodes are set more in the main roads. All charging station nodes are overlapped with the road network nodes. All charging station nodes coincide with road network nodes. The length and free flow time of each road network were verified by using the original data in the dataset. Six pairs of start and endpoints are set in each road network to analyze, and the start and endpoint pairs of each road network are randomly selected. All O-D pairs are shown in Table 8.

5.2. Analysis of Problem Model with Small-Scale Grids

As shown in Figure 10(a), the correctness of the deloop processing method and model is verified in the five-node grid graph. Road travel time and power consumption are labelled, and the graph can be briefly analyzed before verifying the model. When the electric vehicle battery capacity is 5, the starting point is node 1, the ending point is node 5, the charging station node is node 4, the feasible time minimum path between the starting and ending points is , and the graph needs to be delooped in order to invoke CPLEX to find the optimal solution of the model. According to the proposed delooping algorithm, the delooping processed graph is shown in Figure 10(b). The results of invoking CPLEX in the original road network and the deloop processed road network are shown in Table 9.

When the model is solved without delooping, the CPLEX directly using the original path network will have no solution. This is due to the flow balance constraints of the shortest path problem, which causes the model to ignore all loop solutions. When considering charging, there are cases where a loop solution will be better than a loop-free solution, and the constraints make it impossible to find the optimal solution, so delooping is very necessary and effective.

5.3. Model and Algorithm Comparison Analysis

We compare the CPLEX solution results with the three-step heuristic algorithm under different sizes of road networks, and the results are taken as the average of different O-D pairs. The experimental results are shown in Table 10. The experiments show that the algorithm can operate normally under a road network of about 12,000 nodes in size, while the invocation of CPLEX to solve road networks larger than 1,000 nodes has been unable to find the optimal solution in the specified time. Comparing the results of the two methods in the Sioux Falls, Anaheim, and Barcelona networks, the optimal solution can be found for both methods without significant differences. In larger networks, the algorithm can still find the optimal solution, which is more advantageous in terms of solution scale compared to the CPLEX.

6. Conclusion

In this study, we classify the electric vehicle path planning problem considering charging as a CSPPR problem and build a corresponding model to solve it. We propose a three-step heuristic algorithm considering the midway power shortage case, which plans the shortest path from the starting point to the endpoint on the basis of determining the charging route and reduces the complexity of problem-solving. The results show that the algorithm can effectively plan the route and give the optimal route containing the charging route in the case of insufficient power. The efficiency of the algorithm will be further optimized in the future to consider the dynamic path planning problem of electric vehicles under the accurate energy consumption estimation model.

Data Availability

The data presented in this study are available upon request from the corresponding author. The data are not publicly available due to privacy.

Conflicts of Interest

The authors declare that there are no conflicts of interest.

Acknowledgments

This study was funded by the National Natural Science Foundation of China, grant no. U1864206.