Distribution route optimization method and device based on adaptive termination

By using an adaptive termination delivery route optimization method and a stopping strategy classifier to determine the search status in real time, the problem of low computational efficiency and unreliable solution quality in existing technologies is solved, thus achieving efficient and intelligent optimization of delivery routes.

CN121882401APending Publication Date: 2026-04-17MACAU UNIV OF SCI & TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
MACAU UNIV OF SCI & TECH
Filing Date
2025-12-25
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing technologies suffer from low computational efficiency and unreliable solution quality in delivery route optimization. They cannot dynamically adjust the computational budget, achieve intelligent resource allocation, or guarantee thorough exploration of potential route spaces.

Method used

An adaptive termination-based delivery route optimization method is adopted. By obtaining the search status of the current time step of the route improvement trajectory, an adaptive termination signal is generated using a stopping strategy classifier to determine whether to terminate the search in real time and generate the globally optimal route.

Benefits of technology

It significantly shortens the solution time, saves computational resources, improves system efficiency, ensures solution quality, and achieves the optimal trade-off between resources and solution quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121882401A_ABST
    Figure CN121882401A_ABST
Patent Text Reader

Abstract

The invention discloses a distribution route optimization method and device based on adaptive termination. The method comprises the steps of obtaining a route improvement track of a distribution problem instance; extracting a search state of the current time step of the route improvement track in real time, and inputting the search state to a stop strategy classifier to obtain a self-adaptive stop signal; if the self-adaptive termination signal does not reach the preset threshold value, triggering an improvement device to generate a new candidate route based on the search state of the current time step, and updating the route improvement track; iteration is carried out until the adaptive termination signal reaches a threshold value; outputting a globally optimal route from the route improvement trajectory in response to the adaptive termination signal reaching a threshold; the stopping strategy classifier is obtained by training a route improvement track mark data set. According to the method, unnecessary iteration steps are greatly reduced, so that the reasoning time of solution is remarkably shortened, computing resources are saved, and the quality of the optimal solution is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of combinatorial optimization and deep learning technology, and in particular to a delivery route optimization method and apparatus based on adaptive termination. Background Technology

[0002] Combinatorial optimization, a crucial branch of operations research and computer science, aims to find the optimal solution from a finite number of feasible solutions. Iterative improvement strategies, a key paradigm in this field, approximate the global optimum by progressively optimizing suboptimal solutions. These methods are widely applied in the Traveling Salesman Problem (TSP) and its variations. The Pickup and Delivery Problem (PDP), a significant extension of TSP, holds considerable value in practical applications such as logistics, intelligent transportation, and supply chain management.

[0003] Existing technologies mainly fall into three categories: traditional heuristic algorithms employ a fixed number of iterations or simple stopping criteria; neural network-based construction strategies generate approximate solutions in one step through data-driven approaches; and deep learning search paradigms (Learning to Search, L2S) are used to train networks and iteratively improve the base solution. These methods typically achieve higher quality solutions by allocating more computational resources during inference. However, they suffer from the following drawbacks:

[0004] (1) The contradiction between computational efficiency and solution quality is prominent. Although increasing computational resources can improve the solution quality, it significantly prolongs the reasoning time.

[0005] (2) The computational budget cannot be dynamically adjusted based on the difficulty of the problem instance and the search status;

[0006] (3) A single-generation reasoning paradigm cannot guarantee a thorough exploration of the potential route space.

[0007] (4) The inability to achieve intelligent resource allocation results in low overall computing efficiency. Summary of the Invention

[0008] This invention provides a delivery route optimization method and apparatus based on adaptive termination, which solves the defects of low computational efficiency and inability to guarantee the quality of route solutions in the prior art, and realizes efficient and intelligent optimization of delivery routes.

[0009] This invention provides a delivery route optimization method based on adaptive termination, comprising:

[0010] Obtain route improvement trajectories for delivery problem instances;

[0011] The search state of the improved route trajectory at the current time step is extracted in real time and input into the stopping strategy classifier to obtain an adaptive termination signal. If the adaptive termination signal does not reach a preset threshold, the improver is triggered to generate a new candidate route and update the improved route trajectory based on the search state at the current time step. This process is repeated until the adaptive termination signal reaches the threshold.

[0012] In response to the adaptive termination signal reaching a threshold, the globally optimal route is output from the improved route trajectory;

[0013] The stopping strategy classifier is trained using a route improvement trajectory label dataset.

[0014] According to the delivery route optimization method based on adaptive termination provided by the present invention, the search state includes one or more of the following:

[0015] Route solution; historical best route solution; cost of route solution; cost of historical best route solution; stall counter.

[0016] According to the delivery route optimization method based on adaptive termination provided by the present invention, the step of extracting the search state of the current time step of the improved route trajectory in real time and inputting it into a stopping strategy classifier to obtain an adaptive termination signal specifically includes:

[0017] The search state is encoded based on a dual encoding architecture to generate the embedding vectors of the route solution and the historical best route solution;

[0018] Based on the embedding vector and the search state, a graph-level embedding is obtained;

[0019] Based on the graph-level embedding and the search state, historical summary information is obtained;

[0020] An adaptive termination signal is generated based on the graph-level embedding and the historical summary information.

[0021] According to the delivery route optimization method based on adaptive termination provided by the present invention, the stopping strategy classifier is trained through a route improvement trajectory label dataset, specifically including:

[0022] Iterative search is performed using a pre-trained improver to generate route improvement trajectories corresponding to each delivery problem instance, wherein the route improvement trajectory includes the search state at multiple time steps;

[0023] Determine the optimal stopping time step for each of the route improvement trajectories, and assign a binary classification label to the search state at each time step in the route improvement trajectory based on the optimal stopping time step, to obtain a route improvement trajectory labeled dataset;

[0024] Based on the improved trajectory labeling dataset and loss function, the loss is determined.

[0025] Adjust the parameters of the stopping strategy classifier based on the loss.

[0026] According to the delivery route optimization method based on adaptive termination provided by the present invention, the loss function is as follows:

[0027]

[0028] in,

[0029]

[0030] w c (y t )=1+βy t ,β<0;

[0031] D represents the route improvement trajectory labeling dataset. This represents the search state at time step t for the nth delivery problem instance; The binary classification label representing the nth delivery problem instance at time step t; For standard binary cross-entropy loss; w t (t) represents the time weight, t * The optimal time step; γ is the penalty factor, T is the maximum number of iterations; w c (y t ) represents the category weight, and β represents the penalty factor.

[0032] According to the delivery route optimization method based on adaptive termination provided by the present invention, the step of obtaining graph-level embedding based on the embedding vector and the search state specifically includes:

[0033] Constructing the instantaneous state vector

[0034] The change vector is constructed using the following formula.

[0035] in,

[0036]

[0037] Among them, e t The embedding vector represents the route solution; c represents the embedding vector of the historical optimal route solution; t Indicate the cost of the route solution; k represents the cost of the historical best route solution. t Represents a stall counter; ρ t,iThe cosine similarity between the embedding vector of the route solution at node i and the embedding vector of the historical best route solution; e t,i Indicates that node i is in the path solution τ t The embedding vector; This indicates that node i is in the historical optimal solution. Embedding vector; ρ t,i This indicates that the same node i is in the embedding vector e t,i , The cosine similarity between nodes, where V is the set of all nodes;

[0038] The change vector δ t The graph aggregator input to the stopping policy classifier yields the graph-level embedding.

[0039] The instantaneous state vector s t The input is fed into the graph aggregator to obtain graph-level embeddings.

[0040] According to the delivery route optimization method based on adaptive termination provided by the present invention, the step of obtaining historical summary information based on the graph-level embedding and the search state specifically includes:

[0041] Embed the graph level By concatenating the cost of the route solution in the search state with the cost of the historical best route solution, we obtain the concatenated state vector ζ. t ;

[0042] Update historical summary information using the following formula:

[0043] h t =α·h t-1 +(1-α)·ζt

[0044] Where h0=ζ0 and α∈[0,1] are momentum hyperparameters that control the influence of past search states.

[0045] The present invention also provides a delivery route optimization device based on adaptive termination, comprising:

[0046] The acquisition module is used to acquire route improvement trajectories for delivery problem instances;

[0047] The iteration module is used to extract the search state of the improved route trajectory at the current time step in real time, input it into the stopping strategy classifier, and obtain an adaptive termination signal. If the adaptive termination signal does not reach a preset threshold, the improver is triggered to generate a new candidate route and update the improved route trajectory based on the search state at the current time step. The iteration continues until the adaptive termination signal reaches the threshold.

[0048] The output module is configured to output the globally optimal route from the improved route trajectory in response to the adaptive termination signal reaching a threshold.

[0049] The stopping strategy classifier is trained using a route improvement trajectory label dataset.

[0050] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the method for adaptive termination-based delivery route optimization as described above.

[0051] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for adaptive termination-based delivery route optimization as described above.

[0052] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the delivery route optimization method based on adaptive termination as described above.

[0053] Compared with the prior art, the beneficial effects of the present invention are:

[0054] This invention uses a stopping strategy classifier to determine the search state in real time, effectively capturing the optimal stopping time step, terminating searches with diminishing returns in advance, and significantly reducing unnecessary iteration steps. This significantly shortens the inference time for solving the problem, saves computing resources, and improves system efficiency. At the same time, by quickly converging on simple instances and allocating more resources to complex instances, it achieves the optimal trade-off between resources and solution quality at the system level.

[0055] This invention uses labeled trajectory data generated by existing improvement strategies to train a stopping strategy classifier in a supervised manner, enabling it to accurately estimate the improvement potential at each intermediate step of the inference trajectory, thereby ensuring the quality of the optimal solution. Attached Figure Description

[0056] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0057] Figure 1 This is a schematic diagram of the effectiveness analysis of the improvement steps for a given search range according to an embodiment of the present invention, wherein (a) is the improvement trajectory of an instance and (b) is the distribution of the minimum time steps required to achieve the highest performance.

[0058] Figure 2 This is a flowchart illustrating the delivery route optimization method based on adaptive termination according to an embodiment of the present invention.

[0059] Figure 3 This is a schematic diagram of neural neighborhood search guided by a similar improved strategy according to an embodiment of the present invention.

[0060] Figure 4 This is a schematic diagram of a neural search framework with adaptive termination signals according to an embodiment of the present invention.

[0061] Figure 5 This is a schematic diagram of the structure of a stopping strategy classifier according to an embodiment of the present invention.

[0062] Figure 6 This is a schematic diagram of the training framework according to an embodiment of the present invention.

[0063] Figure 7 This is a schematic diagram of the structure of a delivery route optimization device based on adaptive termination according to an embodiment of the present invention;

[0064] Figure 8 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Detailed Implementation

[0065] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0066] The Traveling Salesman Problem (TSP) is a cornerstone of combinatorial optimization, and a closely related variant is the Delivery Problem (PDP), which has wide applications in logistics, transportation, and supply chain management. Recently, intelligent vehicles have demonstrated great potential in accomplishing various practical tasks. Many neural network-based optimization frameworks have been designed to narrow the performance gap between pure machine learning methods and state-of-the-art optimizers. Neural network-based construction strategies can generate high-quality approximate solutions in a data-driven manner. However, the inference paradigm of single-step generation cannot guarantee careful exploration of the potential route space.

[0067] The deep learning-based search paradigm, L2S, aims to train and use a network to iteratively improve existing base solutions, rather than determining the entire solution in one step. A fundamental aspect of these iterative methods is that allocating more computation at inference time generally yields higher-quality solutions. This approach increases the likelihood of finding a better solution but inevitably slows down inference time. Therefore, an improvement strategy can be viewed from the perspective of Test-Time Scaling (TTS), where each additional computational step is an investment in obtaining a better solution. However, this also presents the key challenge of high computational costs.

[0068] Adaptability has long been a crucial aspect of efficient deep learning. Recent findings in large-scale inference models (LRMs) demonstrate that the effectiveness of test-time extensions varies with cue difficulty. However, in the field of combinatorial optimization, discussions and strategies for computationally optimal test-time extensions remain scarce. Delivery problem instances vary greatly in route length, spatial distribution, and priority constraints, thus the effort required for convergence can differ by orders of magnitude. Existing neural improvement strategies typically fix the number of inference steps to a static hyperparameter during the inference process.

[0069] Analysis of the most advanced boosting improvement strategies to date reveals significant differences in the optimal number of steps (optimal time steps) across different instances, such as... Figure 1 As shown, the distribution of required improvement steps exhibits a severely right-skewed long-tail pattern, indicating that most of the effective gains are achieved in the early iterations. This observation of diminishing marginal returns suggests that, for many instances, only a small fraction of the initial improvement steps substantially contribute to the quality of the solution.

[0070] This invention provides an innovative adaptive inference framework by incorporating a gating network into the inference process to introduce a stopping policy, which is then set as an adversarial controller within the iterative optimization loop. Simultaneously, labeled trajectory data generated from existing improvement strategies is used to train a classifier in a supervised manner, enabling it to accurately estimate the improvement potential at each intermediate step of the inference trajectory.

[0071] like Figure 2 As shown, the present invention provides a delivery route optimization method based on adaptive termination, comprising the following steps:

[0072] Step 200: Obtain the route improvement trajectory for delivery problem instances;

[0073] Step 201: Extract the search state of the current time step of the improved route trajectory in real time, input it into the stopping strategy classifier, and obtain the adaptive termination signal; if the adaptive termination signal does not reach the preset threshold, trigger the improver to generate a new candidate route and update the improved route trajectory based on the search state of the current time step; iterate until the adaptive termination signal reaches the threshold.

[0074] Step 202: In response to the adaptive termination signal reaching a threshold, output the globally optimal route from the improved route trajectory;

[0075] The stopping strategy classifier is trained using a route improvement trajectory label dataset.

[0076] Specifically, a delivery problem (PDP) can be formalized as a problem consisting of n jobs, where each job i consists of a pair of related requests: a pickup request, denoted as p. i And a subsequent delivery request, denoted as d i The inherent directed link structure of each job consists of ordered tuples (p... i ,d i The complete set of jobs is defined as follows: make This is the set of all nodes—including repository v0. Each node... represent A point in the sequence τ = (σ0, σ1, ..., σ...). A feasible route is a sequence τ = (σ0, σ1, ..., σ...). 2n+1 ), where σ0=σ 2n+1 =v0, To encode the access order, a sorting function can be defined. r(σ k ) = k, and through Enforce fetch / delivery dependencies. The goal is to minimize the total Euclidean travel cost. Where ||·|| denotes the Euclidean norm. The overall goal of solving PDP instances is to find the complete set containing all possible τ. Find the smallest c.

[0077] In step 200 above, a pre-trained improver can be used to iteratively search for routes to delivery problem instances within a given time constraint T, serving as a regular neural search inference process. The improved route trajectory is then stored, thus obtaining the improved route trajectory for the delivery problem. The improver's strategy can be Neural Neighborhood Search (N2S), Neural Collaborative Search (NCS), or any other strategy or algorithm capable of iteratively optimizing the path solution; no restrictions are placed here.

[0078] Following the standard L2S paradigm, the route improvement trajectory of the above delivery problem instance can be defined as a series of feasible route solutions and their associated costs (c t =c(τ) t For example, the total Euclidean cost of the journey is expressed as:

[0079] Ψ t ={(τ0,c0),(τ1,c1),...,(τ t ,c t )} (1)

[0080] Let π φ This indicates the improvement strategy of the improver, extracted from the initial construction path. The generation of the improved trajectory is a sequential process, in which a feasible solution is iteratively enhanced by an improvement strategy. This is done recursively.

[0081]

[0082] Or, equivalently, for an improvement strategy with a fixed computational budget of T iterations:

[0083]

[0084] The improved trajectory can be constructed iteratively through a continuous "destruction-repair" process, where each pair of neighboring routes (τ) t ,τ t+1 All of these require a single conversion action. This action is achieved by selecting a pick-up / drop-off job (p). i ,d i ) and reinsert it into the new position to form, such that p i Following closely on node v j After that, d i Following closely on node v k After that. Therefore, the action a used to change the route. t Represented as {(p i ,d i ),(vj ,v k )}.like Figure 3 As shown, for a given route, the improved trajectory Ψ t The action {(p1,d1),(v0,d2)} removes the job and re-inserts it into a new feasible position to create the next route, placing p1 after v0 and d1 after d2.

[0085] In step 201 above, the search state of the improved route trajectory at the current time step can include the current state or historical states. For example, the search state may include one or more of the following: route solution; historical best route solution; cost of the route solution; cost of the historical best route solution; stall counter. For example, the search state can be defined as follows:

[0086]

[0087] Among them, the route solution τ t This refers to the delivery route plan currently generated by the improver at the t-th iteration of the improvement process. It is a sequence of feasible paths, such as τ. t = (v0, p1, d2, p3, d1, ..., v0), which must satisfy all priority constraints for pickup and delivery. Historical best route solution. It refers to the solution with the lowest cost among all route solutions from the start of the iteration (time step 0) to the current time step t, i.e. Updated as the search progresses. These updates allow us to assess the structural differences between the current solution and historical best solutions, thus indicating whether the search is exploring promising new regions. The cost c of the route solution... t The solution τ is the current route. t The total cost of the journey is typically calculated as the sum of the Euclidean distances between all adjacent nodes in the path. (Cost of the historical best route solution) It is the best historical route solution The corresponding cost is the lowest cost value achieved from the beginning to the current step t, defined in Ψ. t The role of runtime metrics in the growth process in decision-making: (1) Judging improvement: if This means that a better route solution has been found, and an update is needed. and And stop counter k t Reset. (2) Assess potential: With c t The difference reflects the gap between the current solution and the known optimal solution, and is an important basis for judging whether further improvement is possible. Stagnation counter k t =tt bst This indicates that since the last improvement The number of steps since then, where t bst It is the time step when the historical best solution is found. Smaller k t A high kt indicates that a better solution has recently been found, and the search may still be in a "golden age," making it worthwhile to continue investing in it. Conversely, a continuously increasing and large kt strongly suggests that the algorithm may have plateaued or reached a local optimum, and the marginal benefit of continuing the search is very low. In this case, the stopping strategy tends to issue a termination signal to avoid wasting computational resources.

[0088] The stopping strategy classifier (hereinafter referred to as the classifier) ​​outputs an adaptive termination signal based on the search state described above. Since the classifier makes decisions based on the search state, it can automatically identify and differentiate delivery problem instances of varying complexity. The impact of the search state on the decision has been described in the above explanation of the search state and will not be repeated here. The adaptive termination signal can be a probability signal, a confidence signal, or other quantifiable signals, used to indicate whether to terminate the search. If the adaptive termination signal does not reach a preset threshold, the improver is triggered to generate new candidate routes and update the improved route trajectory based on the search state at the current time step. For example, when the adaptive termination signal is a probability signal, and the preset threshold is set to 0.5, if the adaptive termination signal output is greater than 0.5, the optimal route is found, prematurely terminating the search with diminishing returns, significantly reducing unnecessary iteration steps, and thus significantly shortening the reasoning time for solving the problem. Conversely, if the adaptive termination signal output is less than or equal to 0.5, computational resources are allocated to continue searching, while the improved route trajectory is updated and participates in the next iteration search. By adjusting the preset threshold of the classifier, different efficiency-quality trade-offs can be easily achieved. Increasing the threshold (e.g., setting it to 0.7) makes the classifier more "cautious" in making decisions to continue, tending to stop earlier and saving computing resources; decreasing the threshold (e.g., setting it to 0.3) makes the classifier more "lenient," allowing more search steps to strive for a better solution.

[0089] In step 202 above, if the adaptive termination signal reaches the threshold, the globally optimal route is output from the route improvement trajectory.

[0090] like Figure 4 As shown, the neural search framework with adaptive termination provided in this embodiment of the invention exemplifies the method described in the above embodiments. The improver, through... The representation improvement policy stops the classifier by using f θ (Ψ t The stopping policy is represented by f. θ It is a mapping function, that is, an improvement trajectory Ψ on the route. y A stopping strategy classifier f θPredict the probability that the delivery problem instance has reached the optimal termination time step.

[0091]

[0092] During inference, due to computational limitations, the improved trajectory Ψ of the terminal route is... T It is unreachable, therefore the stopping policy classifier must start from the current partial state Ψ. t The optimal stopping time step is predicted in real time. If the stopping policy classifier issues a continuation signal, Ψ is iteratively expanded. t Conversely, if it issues a termination signal, the iteration is interrupted and returns to Ψ at the currently predicted optimal stopping time step. t .

[0093] This invention uses a stopping strategy classifier to determine the search state in real time, effectively capturing the optimal stopping time step, terminating searches with diminishing returns in advance, and significantly reducing unnecessary iteration steps. This significantly shortens the inference time for solving the problem, saves computing resources, and improves system efficiency. At the same time, by quickly converging on simple instances and allocating more resources to complex instances, it achieves the optimal trade-off between resources and solution quality at the system level.

[0094] Optionally, the real-time extraction of the search state of the improved trajectory at the current time step, and inputting it into the stopping strategy classifier to obtain an adaptive termination signal, specifically includes:

[0095] The search state is encoded based on a dual encoding architecture to generate the embedding vectors of the route solution and the historical best route solution;

[0096] Based on the embedding vector and the search state, a graph-level embedding is obtained;

[0097] Based on the graph-level embedding and the search state, historical summary information is obtained;

[0098] An adaptive termination signal is generated based on the graph-level embedding and the historical summary information.

[0099] Specifically, such as Figure 5 As shown, the stopping policy classifier can consist of an encoder network, a graph aggregator, and a decoder. The search state is encoded based on a dual-encoding architecture, and the embedding vectors of the route solution and the historical best route solution can be generated through a route encoder network. To address the well-known compatibility issue between location features and node features, these features are first encoded independently following a traditional approach. Then, these generated embeddings are passed through multiple Transformer layers with a synthetic attention mechanism. Each layer contains a location feedforward network and a novel synthetic attention mechanism, integrating residual connections and instance normalization. Simultaneously, pre-trained weights are utilized to accelerate training in order to efficiently construct the stopping policy.

[0100] For example, the input state seen by the classifier is A dual-encoding architecture with shared route encoder weights is employed. Two identical encoders process two route solutions to produce dense embeddings, i.e., e t =Encoder(τ t )and To allow the classifier to fully understand the improved state at any time step t, we first solve τ for the current route. t and the best solution to date Embeddings are generated. This leads to the construction of the following rich instantaneous state vectors:

[0101] Optionally, to further enrich the features representing the context of the improved search process, a simplified change vector δ is defined. t It only contains relative search information.

[0102]

[0103] in, It is an embedded difference. It is the e of each node t and The cosine similarity between them. ρ t,i The cosine similarity between the embedding vector of the route solution at node i and the embedding vector of the historical best route solution; e t,i Indicates that node i is in the path solution τ t The embedding vector; This indicates that node i is in the historical optimal solution. Embedding vector; ρ t,i This indicates that the same node i is in the embedding vector e t,i , Cosine similarity between them It is the set of all nodes.

[0104] Change vector δ t This design captures the solution τ of the current route. t and the best historical solution The relationship between these factors is used to predict the likelihood of future improvements, rather than simply making decisions based on whether current costs are reduced. A significant structural difference (reflected in δ) t A positive (or negative) signal usually indicates that the search is in an active exploratory phase, with untapped potential. Conversely, prolonged structural stagnation strongly suggests diminishing returns. This vector will then be aggregated into a single graph-level representation via a pooling mechanism.

[0105] Based on the embedding vector and the search state, the graph-level embedding can be obtained through a graph aggregator. Specifically, this includes:

[0106] Construct the change vector δ t The change vector δ t The graph aggregator input to the stopping policy classifier yields the graph-level embedding.

[0107] The instantaneous state vector s t The input is fed into the graph aggregator to obtain graph-level embeddings.

[0108] To obtain a compact graph-level representation from node embeddings, a fusion-based aggregator can be employed, for example. This aggregation mechanism encodes the current solution, historical best solutions, and their differences. Specifically, mean-pooled node features and individual node embeddings are projected into a low-dimensional space. These projected features are then fused using element-wise addition, followed by a dual pooling strategy of mean and maximum pooling on all nodes to form the final graph representation. The resulting graph-level embeddings are then concatenated with auxiliary scalar values ​​for cost and stagnation counters.

[0109] Optionally, historical summary information is obtained based on the graph-level embedding and the search state. Specifically, the graph-level embedding... By concatenating the cost of the route solution in the search state with the cost of the historical best route solution, we obtain the concatenated state vector:

[0110]

[0111] Update historical summary information using the following formula:

[0112] h t =α·h t-1 +(1-α)·ζ t (10)

[0113] Where h0=ζ0 and α∈[0,1] are momentum hyperparameters that control the influence of past search states.

[0114] Through h in the formula t-1 It carries a smooth summary of all historical states up to the previous step. This is achieved by combining it with the new state vector ζ. t Weighted fusion, updated h tIt can perceive the direction and rhythm of the search process, such as whether the cost is continuously and rapidly decreasing or has entered a plateau and fluctuates slowly. This provides a smooth, implicit generalization of the search dynamics. It enhances the robustness of the stopping strategy, making it less susceptible to being misled by unavoidable random fluctuations during the search process, thus enabling more stable decisions. For example, even if the current step cost rises slightly, if the historical trend is a strong decline, the stopping strategy may judge it as normal fluctuation and choose to continue the search.

[0115] Based on the graph-level embedding and the historical summary information, the generation of an adaptive termination signal can be achieved through a decoder. Specifically, the decoder network is an MLP prediction head trained as the final stop signal generator, which combines and processes the detailed current state with the historical summary into a final, comprehensive feature vector. This vector is then passed to the prediction head, a three-layer MLP, which outputs a single logit.

[0116] The graph aggregator will convert the instantaneous state vector s t Graph-level embeddings formed by aggregation; h t It is historical summary information.

[0117] The sigmoid activation function is then applied to the logit to produce a stopping probability P(stop|t), consistent with the learning objective (11). Finally, a policy is derived by simply integrating a threshold λ = 0.5 to decide at each step whether to continue (0) or terminate (1) the search.

[0118]

[0119] Among them, f θ (x t ) is the mapping function of the classifier. It is the final decision, and λ is the preset threshold.

[0120] During inference, the iterative search process runs in a loop that alternates between two core components: an improvement strategy and a stopping strategy. At each step, Ψ t Both are evaluated by a stopping policy, which is a classifier trained to predict the end of the improved trajectory. If it does not terminate, the improved policy will move the current route τ. t Apply a single exploratory adjustment to generate new candidate routes τ t+1 When f θ (x t The process terminates when c = 1, and optionally c t Compare with the optimal cost of storage for any final refinement. It is worth noting that... This represents the globally optimal route found throughout the entire improvement trajectory, determined after optimization is complete.

[0121] Optionally, the stopping strategy classifier is trained using a route improvement trajectory label dataset, specifically including:

[0122] Iterative search is performed using a pre-trained improver to generate route improvement trajectories corresponding to each delivery problem instance, wherein the route improvement trajectory includes the search state at multiple time steps;

[0123] Determine the optimal stopping time step for each of the route improvement trajectories, and assign a binary classification label to the search state at each time step in the route improvement trajectory based on the optimal stopping time step, to obtain a route improvement trajectory labeled dataset;

[0124] Based on the improved trajectory labeling dataset and loss function, the loss is determined.

[0125] Adjust the parameters of the stopping strategy classifier based on the loss.

[0126] Specifically, such as Figure 6 As shown, the training process is divided into three stages.

[0127] In the first stage, the improver generates a set of route improvement trajectories: Iterative search is performed using a pre-trained improver to generate route improvement trajectories corresponding to each delivery problem instance. These trajectories contain search states across multiple time steps. Specifically, the method is as follows: Based on the problem size determined by the number of jobs, a training dataset for PDP50 is constructed by sampling from a given distribution. The coordinates of pickup and delivery nodes are within a two-dimensional unit square range [0,1]. 2 Uniform sampling was used to generate a dataset containing 131,072 PDP instances. The dataset was divided into a 95% training set and a 5% validation set. Data was generated using roll-outs. An initial dataset was prepared by pairing the improved trajectories generated by the pre-trained improver. Two representative works were selected as the base improvement strategies: Neural Neighborhood Search (N2S) and Neural Cooperative Search (NCS). In π φ Under fixed conditions, perform T search rounds on each problem instance until the time budget is exhausted, T = {800, 1000, 1500, 2000, 3000}, thus obtaining a set of improved route trajectories.

[0128] In the second stage, mark the optimal improvement time step: determine the optimal stopping time step for each of the route improvement trajectories, and based on the optimal stopping time step, assign a binary classification label to the search state at each time step in the route improvement trajectory, obtaining a route improvement trajectory labeled dataset; specifically as follows, through a series of exploratory adjustments, this process aims to discover a new route to improve the historical best solution The learning objective of the improver is to build a better and longer Ψ T to reduce However, there are variations in the diminishing returns of additional search steps. For a given set of route improvement trajectories, the optimal stopping time step t for each route improvement trajectory can be calculated by examining the complete improvement rounds * .

[0129]

[0130] Typically, t * <<T, as shown in Figure 1 (b). After constructing the initial dataset, a binary classification label y is added to each time step of each route improvement trajectory in the set of route improvement trajectories through a post - processing hook[[ID=--]] t , where:

[0131]

[0132] Finally, the following route improvement trajectory labeled dataset is obtained:

[0133]

[0134] In the third stage, the sampling and training stage: Determine the loss based on the route improvement trajectory labeled dataset and the loss function; adjust the stop policy classifier parameters according to the loss. Specifically, equivalently reformulate the original prediction task into multiple binary classification tasks as the training objective in the iterative process at each time step t to reduce the learning difficulty

[0135] p θ (t≥t * |Ψ t ) = f θ (x t ) ∈ [0, 1]; (16) Optionally, the loss function is as follows:

[0136]

[0137] where, <00005​​​​​t ,β<0; (19)

[0139] D represents the route improvement trajectory labeling dataset. This represents the search state at time step t for the nth delivery problem instance; The binary classification label representing the nth delivery problem instance at time step t; For standard binary cross-entropy loss; w t (t) represents the time weight, t * The optimal time step; γ is the penalty factor, T is the maximum number of iterations; w c (y t ) represents the category weight, and β represents the penalty factor.

[0140] Specifically, starting with the naive BCE loss widely used in various classification tasks, this invention proposes a weighted BCE loss with innovative weights designed for personalized scenarios.

[0141] l θ (x t ,y t )=-[y t logf θ (x t )+(1-y t log(1-f) θ (x t (20)

[0142] To penalize premature stopping while retaining the signal at each step, the loss is constructed from two interpretable weights.

[0143] First, the following time weights w are proposed. t To integrate t and t * The relative time step distance between them amplifies false positives in early steps and false negatives in late steps. Secondly, in the case of iterative inference, false positives are more costly than false negatives, so a class weight offsets the label imbalance by reducing the weight of positive examples (stops).

[0144] These weights are applied to adjust the loss for each sample, and then the dynamically weighted BCE loss is minimized. The complete objective becomes the loss formula (17).

[0145] This design allows early steps to maintain influence, and through w c Compensation for class skew stabilizes the gradient while keeping the training pressure consistent with the actual stopping requirements. During the hyperparameter tuning phase, the weights of time and class-aware loss significantly contribute to the overall classification performance.

[0146] The implementation of the embodiments of the present invention has been described in detail above. The technical effects of the embodiments of the present invention will be analyzed below to better verify the innovation of the present invention.

[0147] (1) Evaluation indicators

[0148] The evaluation is conducted based on two metrics. First, the effectiveness of the stopping signal classifier itself is evaluated. To this end, embodiments of the present invention report the optimal stopping point (y) within the predicted search range T. t Precision, recall, and F1 score (=1). In this case, high recall indicates that the stopping strategy terminates effectively after finding the optimal solution. Furthermore, high precision indicates that when the strategy decides to stop, it is a reliable decision, thus reducing the risk of prematurely terminating the search.

[0149] (2) Stop signal classifier performance

[0150] First, the performance of the core mechanism of the method—the stopping signal classifier—is evaluated. Table 1 summarizes its effectiveness on test sets with different strategies and time ranges. Notably, high recall was observed in most settings (e.g., 0.942 for neural neighborhood search at T=3000), indicating that the classifier effectively captures the optimal stopping point and avoids excessive computation. Meanwhile, precision remains competitive (up to 0.770), especially under larger budgets, demonstrating reliable early stopping when further gains are unlikely. Strong F1 scores across all problem sizes highlight the model's ability to maintain a robust balance between efficiency and accuracy.

[0151] Table 1 shows the performance of the terminating classifier across different search ranges T on the PDP50 test set.

[0152]

[0153] These binary classification metrics were reported by treating the stopping signal (i.e., the termination signal) as a positive class. The classification performance was found to fluctuate depending on the composition of the training dataset with different maximum iteration time steps.

[0154] (3) Validity of each step

[0155] One requirement for efficient scaling during testing is the adaptive allocation of computation to different instances, where each additional computational step is an investment in a better solution. To quantify computational efficiency, a per-step effectiveness metric is used:

[0156]

[0157] Where c0 is the cost of the initial route. It represents the optimal cost after exactly k improvement steps, where k represents the total number of steps actually performed. A larger η(k) indicates a greater reduction in the average cost per unit computation, and therefore higher overall efficiency. This metric is calculated per instance and then averaged over the entire test set. η(k) is reported in two cases:

[0158] (i) Fixed termination, where the step budget is preset as k = T, T ∈ {800, 1000, 1500, 2000, 3000}.

[0159] (ii) Adaptive termination, where It is a stopping step driven by data predicted by the classifier.

[0160] Table 2 shows the performance comparison on PDP50 test cases.

[0161]

[0162] By comparing the fixed termination strategy commonly used in traditional search with the adaptive termination strategy proposed in this embodiment of the invention, the results show that this embodiment of the invention provides an average cost reduction return for each improved inference step.

[0163] As shown in Table 2, the adaptive termination mechanism of this invention significantly amplifies the marginal benefit of each improvement step. For the neural neighborhood search improver, the average cost reduction per step increases from 0.0065-0.0244 under a fixed budget to 0.0271-0.0739 under adaptive termination, equivalent to a gain of 3 to 7 times. Using neural cooperative search as a baseline model, even stronger results are shown: the efficiency per step is improved by approximately 6 to 13 times across all ranges. This improvement is consistent across every test range T, indicating that the stopping strategy reliably truncates the search once the returns diminish, thus utilizing computation more efficiently than any static termination rule.

[0164] The adaptive termination-based delivery route optimization device provided by the present invention will be described below. The adaptive termination-based delivery route optimization device described below and the adaptive termination-based delivery route optimization method described above can be referred to in correspondence.

[0165] like Figure 7 As shown, the present invention provides a delivery route optimization device based on adaptive termination, comprising the following modules:

[0166] Module 700 is used to obtain route improvement trajectories for delivery problem instances.

[0167] The iteration module 710 is used to extract the search state of the current time step of the improved route trajectory in real time, input it to the stopping strategy classifier, and obtain an adaptive termination signal. If the adaptive termination signal does not reach a preset threshold, the improver is triggered to generate a new candidate route and update the improved route trajectory based on the search state of the current time step. The iteration continues until the adaptive termination signal reaches the threshold.

[0168] Output module 720 is configured to output a globally optimal route from the improved route trajectory in response to the adaptive termination signal reaching a threshold.

[0169] The stopping strategy classifier is trained using a route improvement trajectory label dataset.

[0170] According to the delivery route optimization device based on adaptive termination provided by the present invention, the search state includes one or more of the following:

[0171] Route solution; historical best route solution; cost of route solution; cost of historical best route solution; stall counter.

[0172] According to the present invention, a delivery route optimization device based on adaptive termination is provided, wherein the search state of the improved route trajectory at the current time step is extracted in real time and input into a stopping strategy classifier to obtain an adaptive termination signal. The device further includes:

[0173] A route encoder network is used to encode location features and node features based on a dual-encoding architecture to generate the route solution and the embedding vectors of the historical best route solution;

[0174] A graph aggregator is used to obtain graph-level embeddings based on the embedding vector and the search state;

[0175] The historical state update module is used to obtain historical summary information based on the graph-level embedding and the search state;

[0176] A route decoder network is used to generate an adaptive termination signal based on the graph-level embedding and the historical summary information.

[0177] According to the present invention, a delivery route optimization device based on adaptive termination is provided, wherein the stopping strategy classifier is trained using a route improvement trajectory labeling dataset, specifically comprising:

[0178] Iterative search is performed using a pre-trained improver to generate route improvement trajectories corresponding to each delivery problem instance, wherein the route improvement trajectory includes the search state at multiple time steps;

[0179] Determine the optimal stopping time step for each of the route improvement trajectories, and assign a binary classification label to the search state at each time step in the route improvement trajectory based on the optimal stopping time step, to obtain a route improvement trajectory labeled dataset;

[0180] Based on the improved trajectory labeling dataset and loss function, the loss is determined.

[0181] Adjust the parameters of the stopping strategy classifier based on the loss.

[0182] According to the present invention, a delivery route optimization device based on adaptive termination is provided, wherein the loss function is as follows:

[0183]

[0184] in,

[0185]

[0186] w c (y t )=1+βy t ,β<0;

[0187] D represents the route improvement trajectory labeling dataset. This represents the search state at time step t for the nth delivery problem instance; The binary classification label representing the nth delivery problem instance at time step t; For standard binary cross-entropy loss; w t (t) represents the time weight, t * The optimal time step; γ is the penalty factor, T is the maximum number of iterations; w c (y t ) represents the category weight, and β represents the penalty factor.

[0188] According to the present invention, a delivery route optimization device based on adaptive termination is provided, wherein obtaining a graph-level embedding based on the embedding vector and the search state specifically includes:

[0189] Constructing the instantaneous state vector

[0190] The change vector is constructed using the following formula.

[0191] in,

[0192]

[0193] Among them, e t The embedding vector represents the route solution; c represents the embedding vector of the historical optimal route solution; t Indicate the cost of the route solution; k represents the cost of the historical best route solution. t Represents a stall counter; ρ t,i The cosine similarity between the embedding vector of the route solution at node i and the embedding vector of the historical best route solution; e t,i Indicates that node i is in the path solution τ t The embedding vector; This indicates that node i is in the historical optimal solution. Embedding vector; ρ t,i This indicates that the same node i is in the embedding vector e t,i , Cosine similarity between them It is the set of all nodes;

[0194] The change vector δ t The graph aggregator input to the stopping policy classifier yields the graph-level embedding.

[0195] The instantaneous state vector s t The input is fed into the graph aggregator to obtain graph-level embeddings.

[0196] According to the present invention, a delivery route optimization device based on adaptive termination is provided, wherein obtaining historical summary information based on the graph-level embedding and the search state specifically includes:

[0197] Embed the graph level By concatenating the cost of the route solution in the search state with the cost of the historical best route solution, we obtain the concatenated state vector ζ. t ;

[0198] Update historical summary information using the following formula:

[0199] h t =α·h t-1 +(1-α)·ζ t

[0200] Where h0=ζ0 and α∈[0,1] are momentum hyperparameters that control the influence of past search states.

[0201] Figure 8 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 8As shown, the electronic device may include a processor 810, a communications interface 820, a memory 830, and a communication bus 840. The processor 810, communications interface 820, and memory 830 communicate with each other via the communication bus 840. The processor 810 can call logical instructions from the memory 830 to execute a delivery route optimization method based on adaptive termination.

[0202] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, 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 described in the various embodiments of the present invention. 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.

[0203] On the other hand, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the adaptive termination-based delivery route optimization method provided by the above methods.

[0204] In another aspect, the present invention also provides a computer program product, the computer program product including a computer program that can be stored on a non-transitory computer-readable storage medium, and when the computer program is executed by a processor, the computer is able to execute the delivery route optimization method based on adaptive termination provided by the above methods.

[0205] The device embodiments described above are merely illustrative. 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 modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0206] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0207] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A delivery route optimization method based on adaptive termination, characterized in that, include: Obtain route improvement trajectories for delivery problem instances; The search state of the current time step of the improved trajectory is extracted in real time and input into the stopping strategy classifier to obtain an adaptive termination signal; If the adaptive termination signal does not reach the preset threshold, the improver is triggered to generate a new candidate route and update the improved route trajectory based on the search state of the current time step; this process is repeated until the adaptive termination signal reaches the threshold. In response to the adaptive termination signal reaching a threshold, the globally optimal route is output from the improved route trajectory; The stopping strategy classifier is trained using a route improvement trajectory label dataset.

2. The delivery route optimization method based on adaptive termination according to claim 1, characterized in that, The search status includes one or more of the following: Route solution; historical best route solution; cost of route solution; cost of historical best route solution; stall counter.

3. The delivery route optimization method based on adaptive termination according to claim 2, characterized in that, The process of extracting the search state of the current time step of the improved trajectory in real time and inputting it into the stopping strategy classifier to obtain an adaptive termination signal specifically includes: The search state is encoded based on a dual encoding architecture to generate the embedding vectors of the route solution and the historical best route solution; Based on the embedding vector and the search state, a graph-level embedding is obtained; Based on the graph-level embedding and the search state, historical summary information is obtained; An adaptive termination signal is generated based on the graph-level embedding and the historical summary information.

4. The delivery route optimization method based on adaptive termination according to claim 1, characterized in that, The stopping strategy classifier is trained using a route improvement trajectory labeling dataset, and specifically includes: Iterative search is performed using a pre-trained improver to generate route improvement trajectories corresponding to each delivery problem instance, wherein the route improvement trajectory includes the search state at multiple time steps; Determine the optimal stopping time step for each of the route improvement trajectories, and assign a binary classification label to the search state at each time step in the route improvement trajectory based on the optimal stopping time step, to obtain a route improvement trajectory labeled dataset; Based on the improved trajectory labeling dataset and loss function, the loss is determined. Adjust the parameters of the stopping strategy classifier based on the loss.

5. The delivery route optimization method based on adaptive termination according to claim 4, characterized in that, The loss function is as follows: in, w c (y t )=1+βy t ,β<0; D represents the route improvement trajectory labeling dataset. This represents the search state at time step t for the nth delivery problem instance; The binary classification label representing the nth delivery problem instance at time step t; For standard binary cross-entropy loss; w t (t) represents the time weight, t * The optimal time step; γ is the penalty factor, T is the maximum number of iterations; w c (y t ) represents the category weight, and β represents the penalty factor.

6. The delivery route optimization method based on adaptive termination according to claim 3, characterized in that, The process of obtaining graph-level embeddings based on the embedding vectors and the search state specifically includes: Constructing the instantaneous state vector The change vector is constructed using the following formula. in, Among them, e t The embedding vector represents the route solution; c represents the embedding vector of the historical optimal route solution; t Indicate the cost of the route solution; k represents the cost of the historical best route solution. t Represents a stall counter; ρ t,i The cosine similarity between the embedding vector of the route solution at node i and the embedding vector of the historical best route solution; e t,i Indicates that node i is in the path solution τ t The embedding vector; This indicates that node i is in the historical optimal solution. Embedding vector; ρ t,i This indicates that the same node i is in the embedding vector e t,i , Cosine similarity between them It is the set of all nodes; The change vector δ t The graph aggregator input to the stopping policy classifier yields the graph-level embedding. The instantaneous state vector s t The input is fed into the graph aggregator to obtain graph-level embeddings.

7. The delivery route optimization method based on adaptive termination according to claim 3, characterized in that, The process of obtaining historical summary information based on the graph-level embedding and the search state specifically includes: Embed the graph level By concatenating the cost of the route solution in the search state with the cost of the historical best route solution, we obtain the concatenated state vector ζ. t ; Update historical summary information using the following formula: h t =a·h t-1 +(1-a)·g t Where h0=ζ0 and α∈[0,1] are momentum hyperparameters that control the influence of past search states.

8. A delivery route optimization device based on adaptive termination, characterized in that, include: The acquisition module is used to acquire route improvement trajectories for delivery problem instances; The iterative module is used to extract the search state of the current time step of the improved trajectory in real time, input it into the stopping strategy classifier, and obtain the adaptive termination signal. If the adaptive termination signal does not reach the preset threshold, the improver is triggered to generate a new candidate route and update the improved route trajectory based on the search state of the current time step; this process is repeated until the adaptive termination signal reaches the threshold. The output module is configured to output the globally optimal route from the improved route trajectory in response to the adaptive termination signal reaching a threshold. The stopping strategy classifier is trained using a route improvement trajectory label dataset.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the delivery route optimization method based on adaptive termination as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the delivery route optimization method based on adaptive termination as described in any one of claims 1 to 7.