Neural network solving method and system suitable for path planning problem, medium, terminal and program product
By modeling the path planning problem as a Markov decision process and combining angle awareness and dynamic candidate set filtering methods, the problem of insufficient generalization ability of neural route solvers in large-scale path planning problems is solved, and more efficient solution results are achieved.
Patent Information
- Application Number
- CN202610293571.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-11
- Publication Date
- 2026-06-09
AI Technical Summary
Existing neural route solvers lack generalization ability when dealing with large-scale and differently distributed path planning problems, resulting in a mismatch between the local decision-making environment between training and testing, and are particularly difficult to adapt to scale changes under computational resource constraints.
The path planning problem is modeled as a Markov decision process. A pre-defined angle-aware candidate set filter and a dynamic candidate set filter based on the k-nearest neighbor algorithm are used. The candidate set is dynamically expanded to adapt to large-scale problems through candidate set filtering during the training and testing phases of the Transformer model.
It improves the generalization ability of path planning problems, enhances the solution efficiency and accuracy for large-scale problems, reduces computational costs, and enhances the adaptability of the model to different scales and distributions.
Smart Images

Figure CN122174885A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of path planning technology, and in particular to a neural network solution method, system, medium, terminal and program product applicable to path planning problems. Background Technology
[0002] The Vehicle Routing Problem (VRP), Capacitated Vehicle Routing Problem (CVRP), and Traveling Salesman Problem (TSP) are typical NP-hard (Non-deterministic Polynomial-hard) combinatorial optimization problems, applied in many real-world scenarios such as electronic design automation and transportation. Traditional methods require heuristic algorithms to optimally solve these problems, but these are computationally expensive. In recent years, neural route solvers, especially Transformer-based methods, have achieved comparable or even better results than traditional methods on small to medium-sized instances of synthetic benchmark datasets and in real-world scenarios. Despite their excellent performance, neural route solvers still struggle to achieve generality when handling large-scale and dissimilar problems. This limitation is primarily due to computational resource constraints, as solving and training on large-scale instances is prohibitively expensive with current computing budgets; therefore, most models are trained on small-scale datasets. As the problem size increases, the decision-making environment changes significantly, with variations in the number, density, and absolute distance range of candidate nodes, leading to a severe mismatch between training and testing distributions. While training on multiple scales and distributions can partially improve generalization ability, it is impractical to comprehensively cover all scales and distributions.
[0003] To address this, existing research has proposed various methods to improve the generalization ability of neural route solvers. Representative studies include distance-based candidate pruning to reduce irrelevant candidates, distance-based normalization to alleviate scale-related distance mismatch problems, multi-scale kNN (k-Nearest Neighbor) aggregation to capture changes in local density, and dynamic feature aggregation to encode each candidate using statistics from other unvisited nodes, which are highly invariant to scale and distribution variations. Despite these differences, they all share the common design choice of k-nearest neighbor-based candidate selection, based on empirical observations that high-quality solutions are predominantly composed of short edges, and the next node in the near-optimal path is usually located within a small local neighborhood. However, the kNN-based candidate set itself exhibits significant distributional variations across different instances in terms of scale and distribution, particularly in terms of geometric and directional diversity. As the problem size increases, the kNN neighborhood tends to be dense and directionally uniform local regions, leading to a mismatch between the local decision-making environments during training and testing. Furthermore, the problem is exacerbated by the inability to adapt to changes in scale or data distribution when using a fixed neighborhood size k.
[0004] Therefore, it is necessary to provide a neural network solution method, system, medium, terminal, and program product suitable for path planning problems to solve the above-mentioned problems in the prior art. Summary of the Invention
[0005] In view of the shortcomings of the prior art described above, the purpose of this application is to provide a neural network solution method, system, medium, terminal and program product applicable to path planning problems, so as to solve the technical problem that the prior art is difficult to adapt to the poor generalization ability caused by the increase in the scale of path planning problems.
[0006] To achieve the above and other related objectives, a first aspect of this application provides a neural network solution method for path planning problems, comprising: modeling the path planning problem as a Markov decision process, defining the current node of the path planning problem as the state of the Markov decision process, and defining the candidate nodes of the current node as the action space of the Markov decision process; a preset angle-aware candidate set filter selects candidate nodes for training based on the input current node, the set of unvisited nodes, a preset number of candidate nodes, and a preset number of angle partitions, to form a training candidate set; inputting the training candidate set into a Transformer model for training, and deploying the trained Transformer model; during testing, a dynamic candidate set filter based on the k-nearest neighbor algorithm selects candidate nodes for testing based on the input current node, the set of unvisited nodes, the instance path size, a preset calibration cardinality, a preset local coherence threshold, and a preset global baseline threshold, to form a test candidate set; inputting the test candidate set into the deployed trained Transformer model to output the probability of the next node, and selecting the next node based on the probability of the next node to update the state.
[0007] In some embodiments of the first aspect of this application, the preset angle-aware candidate set filter filters candidate nodes for training based on the input current node, unvisited node set, preset number of candidate nodes, and preset number of angle partitions to form a training candidate set. The specific process includes: dividing the unvisited node set into several uniform angle partitions with the current node as the center, and selecting the nearest neighbor candidate node from each angle partition with unvisited nodes; if the total number of nearest neighbor candidate nodes selected from the angle partitions is less than the preset number of candidate nodes, then selecting the nearest neighbor candidate node from the unvisited nodes in the unvisited node set based on the k-nearest neighbor algorithm, until the preset number of candidate nodes is reached.
[0008] In some embodiments of the first aspect of this application, during the test, a dynamic candidate set filter based on the k-nearest neighbor algorithm filters candidate nodes for testing according to the input current node, unvisited node set, instance path size, preset calibration base, preset local coherence threshold, and preset global baseline threshold, to form a test candidate set. The specific process includes: calculating the basic number of candidate nodes based on the instance path size and the preset calibration base. Based on the k-nearest neighbor algorithm, select the node closest to the current node from the unvisited node set. The candidate nodes are selected to form a test candidate set, and the following calculations are performed: The average distance from each candidate node to the current node is used to select the unvisited node from the set of unselected unvisited nodes that is closest to the current node as a candidate node to be expanded, and the candidate node to be expanded and the distance are updated. The average distance from each candidate node to the current node; based on a preset local coherence threshold, a preset global baseline threshold, and... The average distance from each candidate node to the current node and the updated number of candidate nodes to be expanded. If the average distance from each candidate node to the current node meets a preset condition, the candidate node to be expanded is added to the test candidate set to expand the test candidate set; otherwise, the expansion is terminated.
[0009] In some embodiments of the first aspect of this application, the calculation of the basic number of candidate nodes is based on the instance path size and a preset calibration base. Its formula is:
[0010] ;
[0011] in, The number of candidate nodes based on; For instance path size; This is the preset calibration baseline.
[0012] In some embodiments of the first aspect of this application, the formula for the preset judgment condition is:
[0013] and ;
[0014] in, This represents the distance from the candidate node to be expanded to the current node; This is the threshold for local coherence. This is the global baseline threshold. ; for The average distance from each candidate node to the current node; For candidate nodes to be expanded and The average distance from each candidate node to the current node.
[0015] In some embodiments of the first aspect of this application, an encoder based on a Transformer model encodes the input current node, starting point, training candidate set, or test candidate set, and inputs the encoded context information into the decoder of the Transformer model to output the probability of the next node.
[0016] To achieve the above and other related objectives, a second aspect of this application provides a neural network solution system for path planning problems, comprising: a modeling module for modeling the path planning problem as a Markov decision process, defining the current node of the path planning problem as the state of the Markov decision process, and defining the candidate nodes of the current node as the action space of the Markov decision process; a training candidate set filtering module for using a preset angle-aware candidate set filter to filter candidate nodes for training based on the input current node, unvisited node set, preset number of candidate nodes, and preset number of angle partitions, to form a training candidate set; and a model deployment module for outputting the training candidate set to... The data is fed into a Transformer model for training, and the trained Transformer model is then deployed. A test candidate set filtering module, based on the k-nearest neighbor algorithm, uses a dynamic candidate set filter to select candidate nodes for testing based on the input current node, unvisited node set, instance path size, preset calibration cardinality, preset local coherence threshold, and preset global baseline threshold, thus forming a test candidate set. A next node selection module inputs the test candidate set into the deployed, trained Transformer model, outputs the probability of the next node, and selects the next node based on this probability to update the state.
[0017] To achieve the above and other related objectives, a third aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method.
[0018] To achieve the above and other related objectives, a fourth aspect of this application provides a computer program product comprising computer program code that, when executed on a computer, causes the computer to implement the method.
[0019] To achieve the above and other related objectives, a fifth aspect of this application provides an electronic terminal, including a memory, a processor, and a computer program stored in the memory; the processor executes the computer program to implement the method.
[0020] As described above, the neural network solution method, system, medium, terminal, and program product applicable to path planning problems of this application have the following beneficial effects:
[0021] First, the path planning problem is modeled as a Markov decision process, with the current node defined as the state of the Markov decision process and the candidate nodes defined as the action space. Then, a preset angle-aware candidate set filter selects a training candidate set based on the input current node, the set of unvisited nodes, the preset number of candidate nodes, and the preset number of angle partitions. The selected training candidate set is then input into a Transformer model for training, and the trained Transformer model is deployed. In the testing phase, a dynamic candidate set filter based on the k-nearest neighbor algorithm selects a test candidate set based on the input current node, the set of unvisited nodes, the instance path size, the preset calibration cardinality, the preset local coherence threshold, and the preset global baseline threshold. The selected test candidate set is input into the deployed trained Transformer model to output the probability of the next node, and the next node is selected and its state is updated based on the probability of the next node. This ensures that the local decision-making environment of the training and testing phases matches, and the test candidate set is dynamically expanded in the testing phase to adapt to large-scale path planning problems, thereby improving the generalization ability of solving path planning problems. Attached Figure Description
[0022] Figure 1 The diagram shown is a flowchart illustrating a neural network solution method for path planning problems in one embodiment of this application.
[0023] Figure 2 The diagram shown illustrates the working principle of a neural network solution method for path planning problems in one embodiment of this application.
[0024] Figure 3 This diagram illustrates the performance comparison results of TSP in one embodiment of this application.
[0025] Figure 4 The diagram shown is a performance comparison result of CVRP in one embodiment of this application.
[0026] Figure 5 This diagram illustrates the performance comparison results of the real datasets TSPLIB and CVRPLIB (Set-X) benchmark test sets in one embodiment of this application.
[0027] Figure 6 The diagram shown is a block diagram of a neural network solution system for path planning problems according to an embodiment of this application.
[0028] Figure 7 The diagram shown is a structural schematic of an electronic terminal according to an embodiment of this application. Detailed Implementation
[0029] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be noted that, unless otherwise specified, the following embodiments and features in the embodiments can be combined with each other.
[0030] In the embodiments of this application, the terms "first" and "second" are used to distinguish identical or similar items with essentially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and that the terms "first" and "second" do not necessarily imply that they are different.
[0031] It should be noted that, in the embodiments of this application, the words "exemplary" or "for example" indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0032] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.
[0033] Before providing a further detailed description of the present invention, the nouns and terms used in the embodiments of the present invention are explained, and the nouns and terms used in the embodiments of the present invention are subject to the following interpretations:
[0034] <1> A Markov Decision Process (MDP) is a mathematical model used to describe the process of making decisions in a stochastic environment. The main components of an MDP include: a state, which represents the state of the system at a given moment, typically represented by... Indicates an action, which is the choice of action a decision-maker can take in each state; it is usually represented by... Transition probability describes the probability of transitioning to the next state after taking an action in the current state. It is typically expressed in terms of... ,in This is the current state. It's an action. The next state is the reward, which is the feedback the decision-maker receives after the state transition. This indicates that the state is... Take action below The instant reward received.
[0035] <2> The Transformer model is a deep learning architecture based on the self-attention mechanism. It abandons the sequential dependence of RNNs and the local convolution limitations of CNNs, and can capture the global associations at any position in a sequence at once. Its architecture includes an encoder and a decoder. The encoder consists of multiple stacked layers, each containing a multi-head self-attention network and a feedforward network to extract global features of the input sequence. The decoder adds a masking mechanism (to prevent seeing future words) and cross-attention (to focus on the encoder output) in addition to the multi-head self-attention to gradually generate the output sequence.
[0036] <3> k-Nearest Neighbor (kNN) algorithm is a classification algorithm based on feature space similarity. It is one of the simplest algorithms in machine learning. Its core idea is that if most of the k nearest neighbors of a sample in the feature space belong to a certain category, then the sample is also classified into that category.
[0037] To facilitate understanding of the embodiments of this application, in conjunction with Figure 1 and Figure 2 Detailed explanation. Figure 1 A flowchart illustrating a neural network solution method for path planning problems, as shown in an embodiment of the present invention, is presented. Figure 2 This illustration shows a schematic diagram illustrating the working principle of a neural network solution method for path planning problems according to an embodiment of the present invention. The neural network solution method for path planning problems in this embodiment includes the following steps:
[0038] Step S11: Model the path planning problem as a Markov decision process, define the current node of the path planning problem as the state of the Markov decision process, and define the candidate nodes of the current node as the action space of the Markov decision process.
[0039] Specifically, the path planning problem is modeled as a Markov decision process, meaning that each decision depends only on the current state and not on how the current state was reached historically. This simplifies the complexity of the path planning problem and allows for iterative decision-making. The current node of the path planning problem is defined as the state of the Markov decision process. Furthermore, the starting point, unvisited node locations, and requirements (for CVRP) are also defined as states, with the specific state definition tailored to different path planning problems. The candidate nodes of the current node are defined as the action space of the Markov decision process, selected from the set of unvisited nodes. The state transition probability represents the probability of choosing the next action and reaching the next state based on the current state, and it is derived through model inference.
[0040] Step S12: The preset angle-aware candidate set filter selects candidate nodes for training based on the input current node, unvisited node set, preset number of candidate nodes, and preset number of angle partitions to form a training candidate set.
[0041] By designing a pre-defined angle-aware candidate set filter, the selected training candidate set not only ensures angle diversity, but also includes the nearest neighbor node by supplementing the nearest neighbor node. This ensures that the node distribution during small-scale training is aligned with the node distribution during large-scale testing, overcoming the problem of mismatch between the local decision-making environment between training and testing caused by the increase in the scale of the path planning problem.
[0042] In some embodiments of this application, the preset angle-aware candidate set filter selects candidate nodes for training based on the input current node, unvisited node set, preset number of candidate nodes, and preset number of angle partitions to form a training candidate set. The specific process includes: dividing the unvisited node set into several uniform angle partitions with the current node as the center, and selecting the nearest neighbor candidate node from each angle partition with unvisited nodes; if the total number of nearest neighbor candidate nodes selected from the angle partitions is less than the preset number of candidate nodes, then selecting the nearest neighbor candidate node from the unvisited nodes in the unvisited node set based on the k-nearest neighbor algorithm, until the preset number of candidate nodes is reached.
[0043] Specifically, during the training phase, an angle-aware candidate set filter was designed. The selected training candidate set is used as input data for model training in small-scale path planning problems, effectively avoiding the limitation of a single perspective and improving the ability to perceive the decision-making environment from multiple angles. The specific process of the angle-aware candidate set filter in selecting training candidate sets is as follows: based on the current node... Unvisited node set Divided into different A uniform angular partition Then, a nearest neighbor candidate node is selected from each angle partition to ensure angle diversity; if an angle partition has no unvisited nodes, no new nodes are added. If the preset number of candidate nodes has not been reached after adding angle nearest neighbors... Then, the remaining nodes are added in distance-sorted order and added to the list. For example, the preset number of candidate nodes is selected. With the current node Using a circle as the center, include the set of unvisited nodes within the constructed problem area, and then partition the problem area into a predetermined number of angles. The four angular partitions are evenly divided. If each of these four angular partitions contains an unvisited node, then the nearest neighbor candidate node is selected from each of the four angular partitions and included in the training candidate set. That is, four candidate nodes are selected and included in the training candidate set. Since there are not yet six candidate nodes, the remaining nodes need to be sorted by distance and two more candidate nodes are added to the training candidate set. This completes the selection of candidate nodes in the training candidate set.
[0044] Step S13: Input the training candidate set into the Transformer model for training, and deploy the trained Transformer model.
[0045] The training candidate set selected in step S12 is input into the Transformer model for training, so that the trained Transformer model learns the ability to perceive the decision-making environment from multiple perspectives.
[0046] Step S14: During testing, the dynamic candidate set filter based on the k-nearest neighbor algorithm filters candidate nodes for testing according to the input current node, unvisited node set, instance path size, preset calibration base, preset local coherence threshold and preset global baseline threshold, so as to form a test candidate set.
[0047] By dynamically expanding the candidate nodes in the test candidate set during testing using a dynamic candidate set filter based on the k-nearest neighbor algorithm, the algorithm adapts to large-scale path planning problems and improves the generalization ability of solving path planning problems.
[0048] In some embodiments of this application, during the test, a dynamic candidate set filter based on the k-nearest neighbor algorithm filters candidate nodes for testing according to the input current node, unvisited node set, instance path size, preset calibration base, preset local coherence threshold, and preset global baseline threshold, to form a test candidate set. The specific process includes: calculating the basic number of candidate nodes based on the instance path size and the preset calibration base. Based on the k-nearest neighbor algorithm, select the node closest to the current node from the unvisited node set. The candidate nodes are selected to form a test candidate set, and the following calculations are performed: The average distance from each candidate node to the current node is used to select the unvisited node from the set of unselected unvisited nodes that is closest to the current node as a candidate node to be expanded, and the candidate node to be expanded and the distance are updated. The average distance from each candidate node to the current node; based on a preset local coherence threshold, a preset global baseline threshold, and... The average distance from each candidate node to the current node and the updated number of candidate nodes to be expanded. If the average distance from each candidate node to the current node meets a preset condition, the candidate node to be expanded is added to the test candidate set to expand the test candidate set; otherwise, the expansion is terminated.
[0049] In some embodiments of this application, the calculation of the basic number of candidate nodes is based on the instance path size and a preset calibration base. Its formula is:
[0050] ;Formula (1)
[0051] in, The number of candidate nodes based on; For instance path size; This is the preset calibration baseline.
[0052] In some embodiments of this application, the formula for the preset judgment condition is:
[0053] and ;Formula (2)
[0054] in, This represents the distance from the candidate node to be expanded to the current node; This is the threshold for local coherence. This is the global baseline threshold. ; for The average distance from each candidate node to the current node; For candidate nodes to be expanded and The average distance from each candidate node to the current node.
[0055] Specifically, a dynamic candidate set filter based on the k-nearest neighbor algorithm was designed during the testing phase, employing dynamic... The value-based approach is designed as a two-stage, step-by-step local neighborhood expansion method. The first stage is: in each decoding step... In, from the current node of Starting with the nearest neighbor region, a basic region is calculated according to formula (1). Nearest neighbor set Then, based on a distance-based acceptance criterion, some additional neighboring nodes are added appropriately. The second stage is: from the basic k-nearest neighbor set... Expand the scope and gradually determine whether to add the next one. The decision is based on the distance between the candidate node to be expanded and the current node. The average distance from the current node to all candidate nodes in the updated test candidate set is as follows: It should not exceed the average distance of the current k nearest neighbor set. To ensure continuity, while not exceeding the average distance of the basic k-nearest neighbor set. This is to ensure that nodes are not added indefinitely. The process involves determining whether a candidate node to be expanded should be incorporated into the test candidate set based on the judgment conditions given in formula (2). If formula (2) is satisfied, the candidate node to be expanded is incorporated into the test candidate set, thus completing the expansion of the test candidate set. If formula (2) is not satisfied, the expansion is stopped, and the basic test candidate set is maintained. By dynamically constructing the test candidate set during the testing phase, rich node information is provided to the model, giving full play to the model's decoding capabilities, while avoiding interference from irrelevant nodes.
[0056] It should be noted that the basis for scaling in the logarithmic form of formula (1) is chosen. Nearest neighbor set The two reasons are: First, to increase While this can improve coverage and information richness, it also amplifies candidate noise and computational cost. Secondly, from the perspective of attention-based decoding, each decoder layer densely aggregates information into the candidate set through secondary attention interactions; therefore, the effective context capacity of the decoder grows superlinearly with the size of the candidate set and the depth of the decoder. This increases with the instance path size of the path planning problem. With the increase in [something], a slowly growing candidate budget is sufficient to provide increasingly richer candidate-level context for selection. Approximately The value of is chosen so that a considerable context capacity can be maintained at different scales, while avoiding excessively large and non-distributive candidate sets, which would otherwise introduce noise and unnecessary computation.
[0057] Step S15: Input the test candidate set into the deployed and trained Transformer model to output the probability of the next node, and select the next node according to the probability of the next node to update the state.
[0058] In some embodiments of this application, the encoder based on the Transformer model encodes the input current node, starting point, training candidate set or test candidate set, and inputs the encoded context information into the decoder of the Transformer model to output the probability of the next node.
[0059] Specifically, the model accepts information about the current node, the starting point, and candidate nodes (the features of candidate nodes include statistical information about other unvisited nodes), encodes this information through an encoder, and calculates the probability of the next node through a decoder. Based on the probability of the next node, the model selects the next node and updates the state.
[0060] To further explain the working principle of the neural network solution method for path planning problems in this application, a specific example of CVRP (Continuous Vehicle Processing) in logistics delivery is used. The warehouse is located at (0, 0), and there are 50 convenience stores to deliver to. Each convenience store has a specific location and demand (e.g., 0.5 tons). Each vehicle has a capacity of, for example, 5 tons, and the goal is to minimize the total distance. First, CVRP is modeled as a Markov decision process, and the current node, starting point (warehouse), unvisited node locations, and demands are defined as states. All unvisited nodes are defined as the action space, which is then compressed into candidate nodes for the current node. The state transition probability is that the next node is selected, and the user moves to the next node to update the state. Then, an angle-aware candidate set filter is used during the training phase. For each current node, 8 fixed candidate nodes are selected from the 50 unvisited nodes to form the training candidate set. For simplicity, the specific selection process is not described in detail. The selected 8 candidate nodes are input into the model for training, and the trained model is then deployed. During the testing phase, when faced with a new delivery task whose distribution differs from the training set, a dynamic candidate set filter based on the k-nearest neighbor algorithm is used to select test candidate sets. For simplicity, the specific selection process will not be described further. The selected test candidate set is input into the deployed model, which outputs the probability of the next node to select the next node and updates the position of the current node, thereby completing the CVRP solution.
[0061] To verify the technical effectiveness of the neural network solution method for the path planning problem proposed in this application, it was tested on the same artificially synthesized MSVDRP (Multi-Stage Vehicle Dispatching and Routing Problem) benchmark set as INVIT (Invariant Nested View Transformer) and DGL (Dynamic Global-Local Information Aggregation for Scalable VRP Generalization with Self-Improvement Learning). This benchmark set provides a unified Euclidean routing instance suite with different sizes and distribution variations. Specifically, it includes four distributions for TSP and CVRP: Uniform, Clustered, Explosion, and Implosion, with each distribution corresponding to a different instance size. Performance comparisons were made between this application (ANCO, Attention-based Neural Combinatorial Optimization) and several representative neural solution pathways. These representative pathways can be categorized according to their use of kNN information. Schemes that do not use kNN include Omni-VRP, LEHD, BQ, and PointerFormer; schemes that use kNN include ELG, INVIT, and DGL. Publicly available pre-trained models were used, adhering to their default settings, and the evaluation metric was gap (%), i.e., the relative difference in solution quality compared to the optimal solution obtained by traditional heuristic solvers. Figure 3 and Figure 4 As shown, the model achieves optimal or near-optimal results across different scales and distributions of the TSP problem, particularly reducing the gap by up to 3.17% on large-scale problems. It also performs well on large-scale CVRP problems, with a gap of approximately 2%. Furthermore, the model inference speed of this application is among the fastest, far exceeding the time required by heuristic solvers (1.7 days on the TSP-10000).
[0062] In addition, experiments were conducted on the real-world datasets TSPLIB and CVRPLIB (Set-X) benchmark sets. Figure 5As shown, the gap results of TSPLIB and CVRPLIB are basically consistent with the results of the synthetic dataset. They have achieved the best results on large-scale problems of TSP, and have also achieved good results on large-scale problems of CVRPLIB.
[0063] Figure 6 This is a schematic block diagram of a neural network solution system for path planning problems provided in an embodiment of this application. Figure 6 As shown, the neural network solution system 600 for path planning problems includes:
[0064] Modeling module 601 is used to model the path planning problem as a Markov decision process, defining the current node of the path planning problem as the state of the Markov decision process, and defining the candidate nodes of the current node as the action space of the Markov decision process.
[0065] The training candidate set filtering module 602 is used by the preset angle perception candidate set filter to filter candidate nodes for training based on the input current node, unvisited node set, preset number of candidate nodes, and preset number of angle partitions, so as to form a training candidate set.
[0066] The model deployment module 603 is used to input the training candidate set into the Transformer model for training, and to deploy the trained Transformer model;
[0067] The test candidate set filtering module 604 is used during testing. The dynamic candidate set filter based on the k-nearest neighbor algorithm filters candidate nodes for testing according to the input current node, unvisited node set, instance path size, preset calibration base, preset local coherence threshold and preset global benchmark threshold, so as to form a test candidate set.
[0068] The next node selection module 605 is used to input the test candidate set into the deployed and trained Transformer model, output the probability of the next node, and select the next node according to the probability of the next node to update the state.
[0069] It should be understood that the specific process of each module performing the above-mentioned steps has been described in detail in the above method embodiments, and will not be repeated here for the sake of brevity.
[0070] It should also be understood that the module division in the embodiments of this application is illustrative and only represents a logical functional division; in actual implementation, there may be other division methods. Furthermore, the functional modules in the various embodiments of this application can be integrated into a single processor, exist as separate physical entities, or be integrated into a single module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0071] Figure 7 This is a schematic block diagram of the electronic terminal provided in an embodiment of this application. Figure 7 As shown, the electronic terminal 700 includes at least one processor 701, a memory 702, at least one network interface 703, and a user interface 705. The various components in the electronic terminal 700 are coupled together via a bus system 704. It is understood that the bus system 704 is used to implement communication between these components. In addition to a data bus, the bus system 704 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in… Figure 7 The general will label all buses as bus systems.
[0072] The user interface 705 may include a monitor, keyboard, mouse, trackball, clicker, button, touchpad, or touch screen.
[0073] It is understood that memory 702 can be volatile memory or non-volatile memory, or both. Non-volatile memory can be read-only memory (ROM) or programmable read-only memory (PROM), used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM) and synchronous static random access memory (SSRAM). The memories described in the embodiments of this invention are intended to include, but are not limited to, these and any other suitable categories of memory.
[0074] In this embodiment of the invention, the memory 702 is used to store various types of data to support the operation of the electronic terminal 700. Examples of this data include: any executable program for operation on the electronic terminal 700, such as operating system 7021 and application program 7022; operating system 7021 includes various system programs, such as framework layer, core library layer, driver layer, etc., for implementing various basic services and handling hardware-based tasks. Application program 7022 may include various applications, such as media player, browser, etc., for implementing various application services. The methods provided in this embodiment of the invention can be included in application program 7022.
[0075] The methods disclosed in the above embodiments of the present invention can be applied to or implemented by processor 701. Processor 701 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 701 or by instructions in software form. The processor 701 may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Processor 701 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. General-purpose processor 701 may be a microprocessor or any conventional processor, etc. The steps of the accessory optimization method provided in the embodiments of the present invention can be directly reflected as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, which is located in memory. The processor reads the information in the memory and combines it with its hardware to complete the steps of the aforementioned method.
[0076] In an exemplary embodiment, the electronic terminal 700 may be used by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), or complex programmable logic devices (CPLDs) to execute the aforementioned method.
[0077] According to the method provided in the embodiments of this application, this application also provides a computer program product, which includes: computer program code, which, when run on a computer, causes the computer to execute... Figures 1 to 5 The method of any of the embodiments shown.
[0078] According to the method provided in the embodiments of this application, this application also provides a computer-readable storage medium storing program code, which, when executed on a computer, causes the computer to perform... Figures 1 to 5 The method of any of the embodiments shown.
[0079] As used in this specification, the terms "component," "module," "system," etc., are used to refer to computer-related entities, hardware, firmware, combinations of hardware and software, software, or software in execution. For example, a component can be, but is not limited to, a process running on a processor, a processor, an object, an executable file, an execution thread, a program, and / or a computer. As illustrated, applications running on computing devices and computing devices can both be components. One or more components may reside in a process and / or an execution thread, and components may be located on a single computer and / or distributed among two or more computers. Furthermore, these components can be executed from various computer-readable media on which various data structures are stored. Components can communicate, for example, via local and / or remote processes based on signals having one or more data packets (e.g., data from two components interacting with another component between a local system, a distributed system, and / or a network, such as the Internet interacting with other systems via signals).
[0080] Those skilled in the art will recognize that the various illustrative logical blocks and steps described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this application.
[0081] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0082] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0083] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0084] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0085] In the above embodiments, the functions of each functional unit can be implemented entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. A computer program product includes one or more computer instructions (programs). When the computer program instructions (programs) are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. Available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., high-density digital video discs (DVDs)), or semiconductor media (e.g., solid-state disks (SSDs)).
[0086] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0087] In summary, to address the technical problem that existing technologies struggle to adapt to the poor generalization ability resulting from the increasing scale of path planning problems, this application provides a neural network solution method, system, medium, terminal, and program product suitable for path planning problems. First, the path planning problem is modeled as a Markov decision process, with the current node defined as the state of the Markov decision process and the candidate nodes defined as the action space. Then, based on a preset angle-aware candidate set filter, a training candidate set is selected according to the input current node, the set of unvisited nodes, a preset number of candidate nodes, and a preset number of angle partitions. Finally, the selected training candidate set is input into a Transformer model. The Transformer model is trained and then deployed. During the testing phase, a dynamic candidate set filter based on the k-nearest neighbor algorithm selects test candidate sets based on the input current node, unvisited node set, instance path size, preset calibration cardinality, preset local coherence threshold, and preset global baseline threshold. The selected test candidate set is input into the deployed trained Transformer model to output the probability of the next node, and the next node is selected and its state is updated based on the probability of the next node. This ensures that the local decision-making environment of the training and testing phases matches, and the test candidate set is dynamically expanded during the testing phase to adapt to large-scale path planning problems, thereby improving the generalization ability to solve path planning problems. Therefore, this application effectively overcomes the various shortcomings of the prior art and has high industrial application value.
[0088] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this application should still be covered by the claims of this application.
Claims
1. A neural network solution method for path planning problems, characterized in that, include: The path planning problem is modeled as a Markov decision process. The current node of the path planning problem is defined as the state of the Markov decision process, and the candidate nodes of the current node are defined as the action space of the Markov decision process. The preset angle-aware candidate set filter selects candidate nodes for training based on the input current node, unvisited node set, preset number of candidate nodes, and preset number of angle partitions, thus forming a training candidate set; The training candidate set is input into the Transformer model for training, and the trained Transformer model is deployed. During testing, the dynamic candidate set filter based on the k-nearest neighbor algorithm filters candidate nodes for testing according to the input current node, unvisited node set, instance path size, preset calibration base, preset local coherence threshold and preset global baseline threshold, to form a test candidate set; The test candidate set is input into the deployed and trained Transformer model to output the probability of the next node, and the next node is selected based on the probability of the next node to update the state.
2. The neural network solution method for path planning problems according to claim 1, characterized in that, The preset angle-aware candidate set filter selects candidate nodes for training based on the input current node, unvisited node set, preset number of candidate nodes, and preset number of angle partitions, to form a training candidate set. The specific process includes: Centered on the current node, divide the set of unvisited nodes into several uniform angular partitions, and select the nearest neighbor candidate node from each angular partition with unvisited nodes. If the total number of nearest neighbor candidate nodes selected from the angle partition is less than the preset number of candidate nodes, then the nearest neighbor candidate node is selected from the unvisited nodes in the unvisited node set based on the k-nearest neighbor algorithm until the preset number of candidate nodes is reached.
3. The neural network solution method for path planning problems according to claim 1, characterized in that, During the test, a dynamic candidate set filter based on the k-nearest neighbor algorithm selects candidate nodes for the test based on the input current node, the set of unvisited nodes, the instance path size, the preset calibration base, the preset local coherence threshold, and the preset global baseline threshold, to form a test candidate set. The specific process includes: The basic number of candidate nodes is calculated based on the instance path size and the preset calibration baseline. ; Based on the k-nearest neighbor algorithm, select the nearest neighbor from the unvisited node set to the current node. The candidate nodes are selected to form a test candidate set, and the following calculations are performed: The average distance from each candidate node to the current node; Select the unvisited node from the set of unselected unvisited nodes that is closest to the current node as a candidate node to be expanded, and update the candidate node to be expanded and the unvisited ... The average distance from each candidate node to the current node; Based on preset local coherence thresholds, preset global baseline thresholds, The average distance from each candidate node to the current node and the updated number of candidate nodes to be expanded. If the average distance from each candidate node to the current node meets a preset condition, the candidate node to be expanded is added to the test candidate set to expand the test candidate set; otherwise, the expansion is terminated.
4. The neural network solution method for path planning problems according to claim 3, characterized in that, The basic number of candidate nodes is calculated based on the instance path size and the preset calibration baseline. Its formula is: ; in, The number of candidate nodes based on; For instance path size; This is the preset calibration baseline.
5. The neural network solution method for path planning problems according to claim 3, characterized in that, The formula for the preset judgment condition is: and ; in, This represents the distance from the candidate node to be expanded to the current node; This is the threshold for local coherence. This is the global baseline threshold. ; for The average distance from each candidate node to the current node; For candidate nodes to be expanded and The average distance from each candidate node to the current node.
6. The neural network solution method for path planning problems according to claim 1, characterized in that, The encoder based on the Transformer model encodes the input current node, starting point, training candidate set or test candidate set, and inputs the encoded context information into the decoder of the Transformer model to output the probability of the next node.
7. A neural network solution system suitable for path planning problems, characterized in that, include: The modeling module is used to model the path planning problem as a Markov decision process, defining the current node of the path planning problem as the state of the Markov decision process, and defining the candidate nodes of the current node as the action space of the Markov decision process. The training candidate set filtering module is used by the preset angle perception candidate set filter to filter candidate nodes for training based on the input current node, unvisited node set, preset number of candidate nodes, and preset number of angle partitions, so as to form a training candidate set. The model deployment module is used to input the training candidate set into the Transformer model for training, and to deploy the trained Transformer model; The test candidate set filtering module is used during testing. The dynamic candidate set filter based on the k-nearest neighbor algorithm filters candidate nodes for testing according to the input current node, unvisited node set, instance path size, preset calibration base, preset local coherence threshold and preset global benchmark threshold to form a test candidate set. The next node selection module is used to input the test candidate set into the deployed and trained Transformer model, output the probability of the next node, and select the next node based on the probability of the next node to update the state.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 6.
9. A computer program product, characterized in that, The computer program product includes computer program code that, when run on a computer, causes the computer to implement the method as described in any one of claims 1 to 6.
10. An electronic terminal, comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the method as described in any one of claims 1 to 6.