Electric freight vehicle intelligent scheduling method based on ant colony optimization and variable neighborhood search
By using ant colony optimization and variable neighborhood search algorithms, combined with traffic and power network data, the path planning of electric freight vehicles is optimized, solving the path feasibility and energy accessibility problems of electric freight vehicles in large-scale urban environments, and achieving efficient scheduling effects.
Patent Information
- Application Number
- CN202510859356.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-25
- Publication Date
- 2025-09-23
AI Technical Summary
Existing technologies make it difficult to achieve high-quality route planning and energy accessibility scheduling for electric freight vehicles in large-scale urban environments with multiple orders, multiple vehicles, and multiple charging constraints. Especially in the case of traffic network congestion and limited power resources, existing methods find it difficult to balance route feasibility and energy accessibility.
Ant colony optimization and variable neighborhood search algorithms are used, combined with transportation network and power network data, to build a scheduling model. Path planning is optimized through pheromone initialization, local pheromone update and variable neighborhood search. The insertion of charging stations is optimized through a removal heuristic strategy to achieve path optimization.
It improves the path quality and energy consumption control capabilities of electric freight vehicle scheduling, improves scheduling efficiency, and is suitable for multi-order and multi-vehicle scheduling tasks in complex urban environments.
Smart Images

Figure CN120688954A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of vehicle scheduling, and in particular to an intelligent scheduling method for electric freight vehicles based on ant colony optimization and variable neighborhood search. Background Art
[0002] Compared with traditional fuel-powered trucks, electric trucks introduce new challenges such as range limitations, battery capacity, and power replenishment. These characteristics place higher demands on vehicle scheduling strategies and path planning algorithms.
[0003] The Electric Vehicle Routing Problem (EVRP) is a complex combinatorial optimization problem that evolved from the classic Vehicle Routing Problem (VRP). In addition to considering basic constraints such as service demand and vehicle capacity, it also needs to comprehensively consider the following electrification characteristics: (1) battery capacity limitations and energy consumption models; (2) the limited number of charging stations and their uneven distribution;
[0004] Based on the above complex constraints, the solution of EVRP is generally considered to be an NP-hard problem, especially in actual electric freight scenarios, where its complexity increases exponentially with the increase in the number of orders, node density, and road complexity. In recent years, researchers have proposed a series of optimization algorithms for EVRP, including exact algorithms and heuristic methods. The former, such as branch-and-price and mixed integer programming models (MILP), have good performance on small-scale problems, but have low solution efficiency and are not suitable for real-time scheduling; the latter, such as ant colony optimization (ACO), genetic algorithm (GA), local search (LS), variable neighborhood search (VNS), etc., can obtain high-quality solutions within an acceptable time, and are therefore widely used in large-scale problems;
[0005] Among the many EVRP variants, the capacity-constrained electric freight routing problem is particularly typical. This problem, based on the basic EVRP model, further incorporates cargo load constraints, highlighting the complex coupling between power, capacity, and routing. In this context, the ant colony optimization algorithm, with its heuristic path selection mechanism inspired by the foraging behavior of ants in nature, demonstrates excellent global search capabilities and adaptability. However, ant colony systems have weak local search capabilities and are prone to premature convergence or local optimality.
[0006] Currently, there is a lack of an intelligent optimization algorithm-based dispatching solution for electric freight vehicles in dual-network convergence scenarios that can simultaneously address route feasibility, energy accessibility, and network real-time performance. Existing methods struggle to achieve both high-quality solutions and computational efficiency in large-scale urban environments with multiple orders, multiple vehicles, and multiple charging constraints. Therefore, in the context of dual-network convergence, an intelligent dispatching method for electric freight vehicles that combines the global path generation capabilities of ant colony optimization with the efficient local optimization capabilities of variable neighborhoods to collaboratively optimize path planning and charging scheduling has important theoretical significance and practical application value. Summary of the Invention
[0007] In order to overcome the defects and shortcomings of the existing technology, the present invention provides an intelligent scheduling method for electric freight vehicles based on ant colony optimization and variable neighborhood search. The present invention applies ant colony optimization and variable neighborhood search algorithms to the multi-order scheduling problem of electric freight vehicles in complex urban environments. It is suitable for large-scale delivery tasks with multiple vehicles, multiple orders, and multiple constraints, especially in actual environments facing traffic network congestion and limited power resources, and has good scheduling effect and energy consumption control capabilities.
[0008] In order to achieve the above object, the present invention adopts the following technical solutions:
[0009] The present invention provides an intelligent dispatching method for electric freight vehicles based on ant colony optimization and variable neighborhood search, comprising the following steps:
[0010] Collect historical data from the transportation network and power network, combine the historical data with the virtual road simulation model, and build an intelligent dispatch simulation model for electric freight vehicles;
[0011] Construct a directed graph, build an optimal path set, and calculate the total distance traveled by the electric freight vehicle;
[0012] Based on the ant colony algorithm and the variable neighborhood search algorithm, the driving route of the electric freight vehicle is calculated with the minimum total driving distance of the electric freight vehicle as the optimization goal, and the driving path plan is obtained, which specifically includes:
[0013] Initialize pheromones and construct an ant colony path. Each ant selects the next node by following a probabilistic rule until all client nodes are visited. The initial path is then divided into several sub-paths according to capacity constraints. The path solution is converted into a scheduling plan, and its objective function value is calculated.
[0014] After all ants have completed the path construction, the ant searching for the best historical solution adds additional pheromones to its corresponding route and applies variable neighborhood search to each path solution for local optimization;
[0015] Based on the removal heuristic strategy, redundant nodes are removed to obtain the optimal path of the electric freight vehicle and output the scheduling result.
[0016] As a preferred technical solution, a directed graph is constructed, which is specifically expressed as follows:
[0017] G=(V,A)
[0018] V={0∪I∪F ′}
[0019] Among them, node 0 represents the distribution center, node set I represents the customer set, and node set F ′ Charging station set, in edge set A, each edge (i, j) contains distance, unit power consumption, and travel time;
[0020] As a preferred technical solution, the pheromone is initialized, specifically as follows:
[0021]
[0022] Among them, τ ij represents the pheromone intensity from node i to node j, L nn is the initial path cost constructed by the nearest neighbor method, and n is the number of path nodes.
[0023] As a preferred technical solution, pheromones satisfy the following relationship:
[0024] τ min <τ ij <τ max
[0025]
[0026] Where, ρ represents the volatility of pheromone, L opt Represents the length of the current global optimal path, and pr is the set selection probability.
[0027] As a preferred technical solution, each ant selects the next node by following a probabilistic rule, which is specifically expressed as:
[0028]
[0029] Among them, η ij represents heuristic information, d ij represents the distance between node i and node j, α and β represent the weights used to balance pheromone strength and heuristic information, τ ij represents the pheromone intensity from node i to node j.
[0030] As a preferred technical solution, the optimization goal is to minimize the total driving distance of the electric freight vehicle, which can be expressed as:
[0031]
[0032] in, d ij Represents the distance between two service points.
[0033] As a preferred technical solution, a variable neighborhood search is applied to each path solution for local optimization, specifically including:
[0034] Let the current solution be P and define the neighborhood set as:
[0035] N={N1,N2,N3}
[0036] Among them, N1 is 2-opt, N2 is node exchange, and N3 is node insertion or removal;
[0037] Randomly select the neighborhood structure and generate neighborhood solutions;
[0038] Perform heuristic improvement in this neighborhood. If the solution P ′ If it is better than the current solution P, accept it, otherwise switch the neighborhood.
[0039] As a preferred technical solution, redundant nodes are removed based on a removal heuristic strategy, specifically including:
[0040] After the complete path is constructed, all candidate charging stations that may cause insufficient power are inserted. All inserted charging station nodes are scanned in reverse order and removed. If the path still meets the full power constraint after removing a charging station node, the node is marked as redundant and deleted. Ultimately, only the minimum charging set required to meet the path power constraint is retained.
[0041] As a preferred technical solution, the scheduling results include the service path of each vehicle, the corresponding charging plan, driving time and energy consumption estimation.
[0042] The present invention also provides a computer device comprising a processor and a memory for storing a program executable by the processor. When the processor executes the program stored in the memory, the above-mentioned intelligent scheduling method for electric freight vehicles based on ant colony optimization and variable neighborhood search is implemented.
[0043] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0044] The present invention constructs a dispatching graph model that integrates the transportation network and the power network. It initializes path pheromones based on a maximum-minimum ant colony system and defines a heuristic information function that considers energy accessibility and path distance. It constructs paths using a pheromone-heuristic joint selection probability rule and performs local pheromone updates during the construction process. After the path is constructed, a variable neighborhood search mechanism is used for path perturbation and local optimization. For paths with unreachable power, a removal heuristic strategy is applied to optimize charging station insertion. Finally, the dispatching path and evaluation results for electric freight vehicles are output. This invention combines the ant colony algorithm with a local search method and is suitable for multi-customer delivery scenarios with dual power and capacity constraints. It can effectively improve the path quality, energy consumption control capabilities, and dispatch efficiency of electric freight dispatching. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 Schematic diagram of the process of the intelligent dispatching method of electric freight vehicles based on ant colony optimization and variable neighborhood search of the present invention;
[0046] Figure 2 Schematic diagram of the process of the present invention. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0048] Example
[0049] like Figure 1 As shown, this embodiment provides an intelligent dispatching method for electric freight vehicles based on ant colony optimization and variable neighborhood search, including the following steps:
[0050] S1: Network modeling and basic parameter initialization;
[0051] The scheduling scenario in this embodiment involves two types of networks: transportation networks and power networks. For these networks, historical data such as road connectivity and travel times, as well as the spatial distribution of charging stations, electricity price changes, and charging station capacity, are collected. This historical data is then combined with a virtual road simulation model to establish a real-world intelligent scheduling simulation model for electric freight vehicles.
[0052] S2: Construct a directed graph G = (V, A), where V = {0∪I∪F ′}, node 0 represents the distribution center, node set I represents the customer set, node set F ′ Charging station set, in edge set A, each edge (i, j) contains information such as distance, unit power consumption, and travel time;
[0053] S3: Construct the optimal path set to optimize the minimum total driving distance of the electric freight vehicle;
[0054] Each customer has a fixed demand. The state of the electric freight vehicle includes the state of charge (SOC), load capacity Q, current task path P, and current node position i. Based on this, the optimization goal of this embodiment is to construct an optimal path set to optimize the minimum total driving distance of the electric freight vehicle, which is expressed as:
[0055]
[0056] in, Ensure that each customer node is visited only once by an electric freight vehicle, and that the vehicle has sufficient power throughout the delivery process, in accordance with the route's power accessibility.
[0057] S4: Using the ant colony algorithm and the variable neighborhood search algorithm, with the minimum total driving distance of the electric freight vehicles in the network as the optimization goal, the driving routes of the electric freight vehicles are calculated and the driving path plan is obtained, which specifically includes:
[0058] S41: Initialize pheromone;
[0059] Unlike traditional ant colony algorithms, this embodiment uses a maximum-minimum ant colony system for pheromone initialization and dynamically sets it based on the nearest neighbor path cost. This enhances the initial exploration of high-quality paths and effectively prevents premature convergence of the algorithm. This pheromone initialization strategy takes into account the pheromone information of roads already visited by ants, adjusting the impact of these visited roads on future path planning directions through different weights. Pheromones on roads with longer paths have less impact on the current path, while those on roads with shorter paths have a greater impact. When constructing solutions, ants use the road information implicit in the pheromones to guide the construction process.
[0060] In the initial stage, the edge pheromone value of the initialization stage is defined as:
[0061]
[0062] Among them, L nn is the initial path cost constructed by the nearest neighbor method, n is the number of path nodes, and the pheromone intensity is affected by the quality of the initial path, the more superior, the stronger;
[0063] In the intelligent dispatching optimization problem of electric freight vehicles, pheromones are distributed on the road. A pheromone matrix is constructed to continuously guide ants in choosing subsequent paths. The pheromone matrix is set as an n×n two-dimensional matrix, where n represents the sum of the number of customer nodes and the number of distribution center nodes, and τ ij represents the pheromone intensity from node i to node j, satisfying the following relationship:
[0064] τ min <τ ij <τ max
[0065] Among them, the upper and lower limits of pheromone are calculated as follows:
[0066]
[0067] Among them, the parameter ρ represents the volatility of pheromone, L opt represents the length of the current global optimal path, pr is the set selection probability, and the preferred value is 0.05;
[0068] S42: ant colony path construction;
[0069] This embodiment implements a local pheromone update mechanism during path construction, instantly adjusting the search preferences of path edges after each node jump to enhance local search capabilities and path diversity. This process takes into account the ants' historical information about the paths they have visited and considers in advance the impact of the next path selection on future path planning.
[0070] like Figure 2 As shown in Figure 1, at the beginning of each cycle, a group of ants is initialized. Each ant starts from the distribution center node 0 and constructs a path from the starting point to serve several customer nodes. During the path construction process, each ant needs to maintain several state variables: the current vehicle load, the battery level, the set of visited nodes, and the current constructed path.
[0071] S43: Ants select the next service node (path construction). In the sth step of path construction, each ant selects the next node by following a probabilistic rule. The specific strategy is as follows:
[0072]
[0073] Among them, η ij represents heuristic information, d ij represents the distance between two service points, α and β are used to balance the weights of pheromone intensity and heuristic information respectively;
[0074] In this embodiment, the node legitimacy is also checked. If the next candidate node j does not meet one of the following two conditions, its access right is excluded:
[0075] SOC I -e ij ·d ij ≥0
[0076] 0≤u i ≤C
[0077] The above two conditions represent the available power and the remaining capacity to load customer demand;
[0078] S44: Repeat step S43 until all client nodes are visited and the initial path construction is completed;
[0079] S45: path splitting;
[0080] The initial path is divided into several sub-paths according to the capacity constraint. If the number of nodes in the current sub-path exceeds the vehicle capacity, the sub-path is terminated and a new path is started. If there are unassigned nodes, a new path is constructed separately.
[0081] Whenever an ant completes a complete service path construction, its path solution will be converted into a scheduling plan and its objective function value will be calculated. The objective function includes the total length of the path:
[0082]
[0083] S46: global update of pheromones;
[0084] In the electric truck route optimization solution, the ant pheromone update method in the ant system is used. After all ants have completed the path construction, the ant that has searched for the best solution so far will add additional pheromones to its corresponding route:
[0085]
[0086] Among them, τ ij represents the pheromone left by the shortest path of this round of iteration, C best is the path length;
[0087] S47: Local optimization of path solutions;
[0088] To prevent the ant colony algorithm from falling into a local optimum, after the path is constructed, a variable neighborhood search (VNS) is applied to each path solution for local optimization. The current path is first perturbed to generate a perturbed solution, and then a heuristic local optimization is performed on the perturbed solution, which helps to improve the diversity of solutions and the ability to escape globally.
[0089] In this embodiment, neighborhood operations include but are not limited to 2-opt, node swapping, and segment insertion. Under the premise of meeting energy and capacity constraints, an "improve or switch" strategy is adopted to improve path quality and prevent falling into local optimality.
[0090] Specifically, this embodiment introduces a variable neighborhood search strategy to perform local perturbation and optimization on the constructed solution. Let the current solution be P, and define the neighborhood set N = {N1, N2, N3}, where N1 is 2-opt, N2 is node exchange, and N3 is node insertion / removal.
[0091] The optimization process mainly includes: 1. Perturbation phase: randomly select the neighborhood structure and generate neighborhood solutions; 2. Local search phase: perform heuristic improvement in the neighborhood, if the solution P ′ If it is better than the current solution P, accept it, otherwise switch the neighborhood;
[0092] S48: Arrange charging stations. After the path construction or local optimization is completed, if it is found that the power level of a certain section of the path is not reachable, a charging node needs to be inserted to ensure the feasibility of the path. This embodiment uses a removal heuristic strategy, which initially forces a feasible charging station to be inserted into all "insufficient power segments", and then reversely scans all charging stations. If the path feasibility and power feasibility are still met after removing the charging station, the charging station is marked as redundant and removed from the path.
[0093] Specifically, after the complete path is constructed, all candidate charging stations that may cause insufficient battery life are inserted. All inserted charging station nodes are scanned in reverse order and removed. If the path still meets the full battery life constraint after removing a charging station node, the node is marked as redundant and deleted. Ultimately, only the minimum charging set required to meet the path battery life constraint is retained.
[0094] S49: The scheduling result output returns the service path, corresponding charging plan, driving time and energy consumption estimation of each vehicle to achieve visualization and analysis support.
[0095] This embodiment constructs a dispatching graph model that integrates the transportation network and the power network; initializes the path pheromone based on the maximum and minimum ant colony system, and defines a heuristic information function that considers energy accessibility and path distance; uses the pheromone-heuristic joint selection probability rule to construct the path, and performs local pheromone updates during the construction process; after the path construction is completed, a variable neighborhood search mechanism is used to perform path perturbation and local optimization; for the path segments where power is unreachable, a removal heuristic strategy is applied to optimize the insertion of charging stations. Finally, the dispatching path and evaluation results of electric freight vehicles are output. The present invention combines the ant colony algorithm with the local search method, and is suitable for multi-customer distribution scenarios with dual constraints of power and capacity. It can effectively improve the path quality, energy consumption control capability and dispatching efficiency of electric freight dispatching, and can be widely used in urban transportation and intelligent computing fields.
[0096] This embodiment also provides a computing device, which can be a desktop computer, a laptop computer, a smart phone, a PDA handheld terminal, a tablet computer or other terminal device with a display function. The computing device includes a processor and a memory, and the memory stores one or more programs. When the processor executes the program stored in the memory, the above-mentioned electric freight vehicle intelligent scheduling method based on ant colony optimization and variable neighborhood search is implemented.
[0097] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be considered as equivalent replacement methods and are included in the scope of protection of the present invention.
Claims
1. An intelligent dispatching method for electric freight vehicles based on ant colony optimization and variable neighborhood search, characterized in that: The steps include: Collect historical data from the transportation network and power network, combine the historical data with the virtual road simulation model, and build an intelligent dispatch simulation model for electric freight vehicles; Construct a directed graph, build an optimal path set, and calculate the total distance traveled by the electric freight vehicle; Based on the ant colony algorithm and the variable neighborhood search algorithm, the driving route of the electric freight vehicle is calculated with the minimum total driving distance of the electric freight vehicle as the optimization goal, and the driving path plan is obtained, which specifically includes: Initialize pheromones and construct an ant colony path. Each ant selects the next node by following a probabilistic rule until all client nodes are visited. The initial path is then divided into several sub-paths according to capacity constraints. The path solution is converted into a scheduling plan, and its objective function value is calculated. After all ants have completed the path construction, the ant searching for the best historical solution adds additional pheromones to its corresponding route and applies variable neighborhood search to each path solution for local optimization; Based on the removal heuristic strategy, redundant nodes are removed to obtain the optimal path of the electric freight vehicle and output the scheduling result.
2. The electric freight vehicle intelligent scheduling method based on ant colony optimization and variable neighborhood search according to claim 1 is characterized in that: Construct a directed graph, specifically expressed as: G=(V,A) V={0∪I∪F ′ } Among them, node 0 represents the distribution center, node set I represents the customer set, and node set F ′ Charging station set, in the edge set A, each edge (i, j) contains distance, unit power consumption, and travel time.
3. The intelligent dispatching method for electric freight vehicles based on ant colony optimization and variable neighborhood search according to claim 2 is characterized in that: Initialize pheromone, specifically expressed as: Among them, τ ij represents the pheromone intensity from node i to node j, L nn is the initial path cost constructed by the nearest neighbor method, and n is the number of path nodes.
4. The electric freight vehicle intelligent scheduling method based on ant colony optimization and variable neighborhood search according to claim 3 is characterized in that: Pheromones satisfy the following relationship: t min <t ij <t max Where, ρ represents the volatility of pheromone, L opt Represents the length of the current global optimal path, and pr is the set selection probability.
5. The intelligent dispatching method for electric freight vehicles based on ant colony optimization and variable neighborhood search according to claim 1 is characterized in that: Each ant selects the next node by following a probabilistic rule, which is expressed as: Among them, η ij represents heuristic information, d ij represents the distance between node i and node j, α and β represent the weights used to balance pheromone strength and heuristic information, τ ij represents the pheromone intensity from node i to node j.
6. The electric freight vehicle intelligent scheduling method based on ant colony optimization and variable neighborhood search according to claim 2 is characterized in that: The optimization objective is to minimize the total driving distance of the electric freight vehicle, which can be expressed as: in, d ij Represents the distance between two service points.
7. The intelligent dispatching method for electric freight vehicles based on ant colony optimization and variable neighborhood search according to claim 1 is characterized in that: Apply variable neighborhood search to each path solution for local optimization, including: Let the current solution be P and define the neighborhood set as: N={N1,N2,N3} Among them, N1 is 2-opt, N2 is node exchange, and N3 is node insertion or removal; Randomly select the neighborhood structure and generate neighborhood solutions; Perform heuristic improvement in this neighborhood. If the solution P ′ If it is better than the current solution P, accept it, otherwise switch the neighborhood.
8. The intelligent dispatching method for electric freight vehicles based on ant colony optimization and variable neighborhood search according to claim 1 is characterized in that: Redundant nodes are removed based on a removal heuristic strategy, specifically including: After the complete path is constructed, all candidate charging stations that may cause insufficient power are inserted. All inserted charging station nodes are scanned in reverse order and removed. If the path still meets the full power constraint after removing a charging station node, the node is marked as redundant and deleted. Ultimately, only the minimum charging set required to meet the path power constraint is retained.
9. The intelligent dispatching method for electric freight vehicles based on ant colony optimization and variable neighborhood search according to claim 1 is characterized in that: The scheduling results include the service path of each vehicle, the corresponding charging plan, the driving time and the energy consumption estimation.
10. A computer device comprising a processor and a memory for storing a program executable by the processor, characterized in that: When the processor executes the program stored in the memory, it implements the intelligent scheduling method for electric freight vehicles based on ant colony optimization and variable neighborhood search as described in any one of claims 1 to 9.
Citation Information
Cited By
Optimization method and system for shifting and charging scheduling of vehicle in three-dimensional parking building
CN121303665A
Vehicle path optimization method applied to garbage collection
CN122133896A