Dynamic batch processing method for the variable-size subproblem of the traveling salesman problem

CN122777288APending Publication Date: 2026-09-18PEKING UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610610290.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-06
Publication Date
2026-09-18

AI Technical Summary

Technical Problem

[0007]本发明提供一种面向旅行商问题变化尺寸子问题的动态批处理方法,用以解决现有技术中固定资源分配无法适应子问题尺寸长尾分布导致硬件利用率低下、单步迭代空闲存储体未能充分利用造成吞吐资源浪费,以及缺乏多簇打包与多尝试并行协同机制导致吞吐率与解质量难以兼顾的缺陷,实现基于子问题尺寸分布动态配置多簇并行处理与多尝试并行处理策略,在提高硬件吞吐率的同时支持通过多次独立尝试提升求解质量

Benefits of technology

[0018] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the dynamic batch processing method for the variable-size subproblem of the traveling salesman problem as described above.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122777288A_ABST
    Figure CN122777288A_ABST
Patent Text Reader

Abstract

This invention relates to the field of hardware-accelerated solution technology for combinatorial optimization problems, and provides a dynamic batch processing method for variable-size subproblems of the Traveling Salesman Problem (TSP). The method includes: obtaining a set of target subproblems obtained by divide-and-conquer clustering of the TSP, and determining the cluster size distribution of each subproblem to dynamically determine a packing strategy; mapping multiple subproblems to different logical partitions of an in-memory macro on the same execution core based on the packing strategy; and for a single subproblem, allocating inactive memory during a single-step iteration to multiple independent attempts for that subproblem and selecting a conflict-free subset of attempts; and performing parallel processing of multiple subproblems within the logical partition and multiple independent attempts within the conflict-free subset of attempts within the same clock cycle for dynamic batch processing. This achieves dynamic configuration of multi-cluster parallel processing and multi-attempt parallel processing strategies based on the subproblem size distribution, improving hardware throughput and solution quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of hardware-accelerated solution technology for combinatorial optimization problems, and in particular to a dynamic batch processing method for variable-size subproblems of the traveling salesman problem. Background Technology

[0002] Route planning has significant applications in logistics, traffic management, and urban infrastructure planning. Its core mathematical model is the Traveling Salesman Problem (TSP): given a number of stations and the distance between any two stations, find a closed path that visits each station exactly once and returns to the starting point, minimizing the total path length. Because this problem is nondeterministically polynomial-hard (NP-hard), the solution complexity increases exponentially with the number of stations, making efficient solutions for large-scale instances a persistent technical challenge in the industry.

[0003] For the large-scale traveling salesman problem (TSM), existing techniques generally employ a divide-and-conquer clustering strategy: first, the large set of stations is divided into several clusters (subproblems) based on their geometric distribution characteristics, with each cluster containing a smaller number of stations; then, the smaller TSM subproblems are solved independently for each cluster; finally, the solution paths of each cluster are merged into a global path. This method effectively alleviates the computational pressure of large-scale problems by reducing the search space of a single solution and lowering storage requirements, and has become the mainstream solution architecture.

[0004] However, in practical applications, the number of sites (i.e., cluster size) of each subproblem (cluster) after clustering decomposition often exhibits a significant long-tail distribution: in typical public benchmark libraries, there are a large number of small clusters containing only 1 to 8 sites, as well as a small number of large clusters containing 25 to 32 sites, and the distribution varies significantly between different problem instances and under different partitioning strategies. Small clusters require less storage resources and converge faster; while large clusters have a large solution space, and obtaining better solution quality usually requires more iterations and solution space exploration times.

[0005] Existing hardware implementations often employ a "one core, one cluster" or fixed batch size resource allocation approach. This means each execution core corresponds to a fixed subproblem, and the core's storage and computational resources are statically configured according to the maximum cluster size. While this approach can guarantee the iteration depth of a single cluster when cluster sizes are generally large, it has significant drawbacks when dealing with real-world long-tail distributions: First, when small clusters occupy the entire execution core, a large amount of storage and computational resources within the core remain idle, leading to low hardware utilization and limited overall throughput. Second, when large clusters occupy a single core, it is difficult to obtain sufficient iteration depth and number of attempts within a limited time, resulting in limited solution quality. Third, in path planning execution cores based on compute-in-memory macros, commonly used local search iterations (such as two nearest neighbor swaps) only require accessing a fixed number of weights in the distance matrix (e.g., four distances) per step. Only a few of the corresponding storage units are activated, while the rest remain idle during this cycle, further wasting throughput resources.

[0006] Furthermore, existing technical solutions lack a flexible mechanism for dynamically adjusting resource allocation based on cluster size distribution. They fail to unify "multi-cluster packaged processing" and "multi-trial parallel processing within the same cluster" into a configurable deployment strategy. They cannot flexibly balance throughput and solution quality based on problem distribution characteristics and solution quality requirements, thus making it difficult to simultaneously achieve efficient utilization of hardware resources and improved solution quality. Summary of the Invention

[0007] This invention provides a dynamic batch processing method for subproblems of the Traveling Salesman Problem with varying sizes. It addresses the shortcomings of existing technologies, such as fixed resource allocation failing to adapt to the long-tailed distribution of subproblem sizes, resulting in low hardware utilization; insufficient utilization of idle storage during single-step iterations leading to wasted throughput resources; and the lack of multi-cluster packaging and multi-trial parallel collaboration mechanisms making it difficult to balance throughput and solution quality. The method achieves dynamic configuration of multi-cluster parallel processing and multi-trial parallel processing strategies based on the subproblem size distribution, improving hardware throughput while supporting the improvement of solution quality through multiple independent attempts.

[0008] This invention provides a dynamic batch processing method for the varying size subproblem of the Traveling Salesman Problem, including: Obtain the target subproblem set obtained by divide-and-conquer clustering of the Traveling Salesman Problem, and determine the cluster size distribution of each subproblem; Based on the cluster size distribution of each sub-problem, the packaging strategy is dynamically determined; Based on the packaging strategy, multiple sub-problems are mapped to different logical partitions of the same in-memory computing macro in the same execution core, and for a single sub-problem, the memory that is not activated during the single-step iteration is allocated to multiple independent attempts of the single sub-problem. Determine whether the sets of memory banks accessed by each group of independent attempts are pairwise disjoint, and filter out the subset of attempts without conflicts; Within the same clock cycle, multiple sub-problem processing within the logical partition and multiple independent attempts within the conflict-free attempt subset are executed in parallel to perform dynamic batch processing of sub-problems of varying sizes.

[0009] In one possible implementation, the method further includes: The spin table, word line and complementary word line decoder and bit line reduction array of the in-memory computing macro are logically partitioned according to the number of subproblems, and each logical partition is configured with independent local word lines and local complementary word lines. Configure a valid signal for each memory bank. The valid signal is set only when a memory bank participates in the read operation of the current subproblem; otherwise, the memory bank is closed.

[0010] In one possible implementation, the method further includes: The execution core includes an energy difference calculation unit and a simulated annealing lookup table channel; The energy difference calculation unit and the simulated annealing lookup table channel are expanded to a parallel number of paths that match the number of logical partitions.

[0011] In one possible implementation, the method further includes: Multiple pseudo-random order generators are configured within the execution core, and each pseudo-random order generator generates corresponding candidate perturbations based on different random seeds; Based on the memory addresses that each group of independent attempts needs to access, the activation status of the memory is determined, and memory in an idle state is allocated to the independent attempts of the corresponding group. Each group of independent attempts maintains its own copy of the order table. When the energy difference of the independent attempts in a group meets the annealing criterion, the order table corresponding to that group is updated.

[0012] In one possible implementation, the method further includes: Obtain the set of memory accesses requested by each group of independent attempts; Determine whether there is an intersection between the memory access sets attempted independently by each group; If the sets of memory accesses attempted by each group are pairwise disjoint, then the groups of independent attempts are allowed to execute in parallel within the same clock cycle. If there are access conflicts in the memory access sets attempted independently by each group, then the subset of attempts in the scenario with the highest parallelism is selected and executed in a single cycle.

[0013] In one possible implementation, the method further includes: When the cluster size distribution contains sub-problems larger than a first preset size, each sub-problem is configured to exclusively occupy all storage resources of the execution core; When the cluster size distribution contains two sub-problems that are larger than the second preset size and smaller than the first preset size, a dual-cluster parallel strategy is configured to map the two sub-problems to different logical partitions respectively; When the cluster size distribution contains multiple sub-problems smaller than the second preset size, a three-cluster or four-cluster parallel strategy is configured to package and map the three or four sub-problems to different logical partitions of the same execution core.

[0014] In one possible implementation, the method further includes: Based on the cluster size distribution of the current batch of subproblems and the target solution quality requirements, configure multi-cluster parallel processing strategies and multi-trial parallel processing strategies independently or collaboratively. When cooperative configuration is enabled, the execution core resources released by multi-cluster parallel processing are allocated to multiple attempts of parallel processing of subproblems larger than a first preset size, while multiple independent attempts of the same subproblem are executed within a single core using free memory.

[0015] The present invention also provides a dynamic batch processing apparatus for the variable size subproblem of the traveling salesman problem, comprising the following modules: The acquisition module is used to acquire the target subproblem set obtained by divide-and-conquer clustering of the Traveling Salesman Problem, and to determine the cluster size distribution of each subproblem; The determination module is used to dynamically determine the packaging strategy based on the cluster size distribution of each sub-problem; The allocation module is used to map multiple sub-problems to different logical partitions of the same execution core's in-memory computing macro based on the packaging strategy, and to allocate the memory that is not activated during a single-step iteration to multiple independent attempts of the single sub-problem for each sub-problem. The filtering module is used to determine whether the sets of storage banks that each group of independent attempts needs to access are pairwise disjoint, and to filter out a subset of conflict-free attempts. The batch processing module is used to perform dynamic batch processing of subproblems of varying sizes in parallel within the same clock cycle, including processing multiple subproblems within the logical partition and multiple independent attempts within the conflict-free attempt subset.

[0016] 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 executes the computer program to implement the dynamic batch processing method for the variable-size subproblem of the traveling salesman problem as described above.

[0017] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the dynamic batch processing method for the variable-size subproblem of the traveling salesman problem as described above.

[0018] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the dynamic batch processing method for the variable-size subproblem of the traveling salesman problem as described above.

[0019] The present invention provides a dynamic batch processing method for variable-size subproblems of the Traveling Salesman Problem (TSP). This method obtains a set of target subproblems obtained by divide-and-conquer clustering of the TSP and determines the cluster size distribution of each subproblem. Based on the cluster size distribution of each subproblem, a packaging strategy is dynamically determined. Based on the packaging strategy, multiple subproblems are mapped to different logical partitions of an in-memory compute macro on the same execution core. For a single subproblem, memory that is not activated during a single-step iteration is allocated to multiple independent attempts of that single subproblem. It determines whether the sets of memory accessed by each group of independent attempts are pairwise disjoint and filters out a conflict-free subset of attempts. Within the same clock cycle, the processing of multiple subproblems within the logical partition and the multiple independent attempts within the conflict-free subset are executed in parallel to perform dynamic batch processing of variable-size subproblems. Compared to existing technologies, which suffer from low hardware utilization due to fixed resource allocation failing to adapt to the long-tail distribution of subproblem sizes, wasted throughput resources due to unused idle storage in single-step iterations, and difficulty in balancing throughput and solution quality due to the lack of multi-cluster packaging and multi-trial parallel collaboration mechanisms, this solution addresses these shortcomings. It utilizes two dynamically configurable deployment schemes—multi-cluster parallel processing and multi-trial parallel processing—and their collaboration to achieve dynamic configuration of multi-cluster parallel processing and multi-trial parallel processing strategies based on the subproblem size distribution. This improves hardware throughput while supporting enhanced solution quality through multiple independent attempts. Attached Figure Description

[0020] 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.

[0021] Figure 1 This is one of the flowcharts of the dynamic batch processing method for the variable size subproblem of the traveling salesman problem provided by the present invention.

[0022] Figure 2 This is the second flowchart of the dynamic batch processing method for the variable size subproblem of the traveling salesman problem provided by the present invention.

[0023] Figure 3 This is a schematic diagram of the TSPLIB reference library cluster size distribution provided by the present invention.

[0024] Figure 4This is a schematic diagram of the multi-cluster parallel processing structure provided by the present invention.

[0025] Figure 5 This is a schematic diagram of the multi-attempt parallel processing structure provided by the present invention.

[0026] Figure 6 This is a schematic diagram illustrating the dynamic batch processing throughput improvement effect provided by the present invention.

[0027] Figure 7 This is a schematic diagram of the structure of the dynamic batch processing device for the variable-size subproblem of the traveling salesman problem provided by the present invention.

[0028] Figure 8 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0029] 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.

[0030] To facilitate understanding of the embodiments of the present invention, further explanations and descriptions will be provided below with reference to the accompanying drawings and specific embodiments. These embodiments do not constitute a limitation on the embodiments of the present invention.

[0031] Figure 1 This is one of the flowcharts illustrating the dynamic batch processing method for the varying size subproblem of the Traveling Salesman Problem provided by this invention, such as... Figure 1 As shown, the method includes the following: S11. Obtain the target subproblem set obtained by divide-and-conquer clustering of the Traveling Salesman Problem, and determine the cluster size distribution of each subproblem.

[0032] In this embodiment of the invention, the large-scale traveling salesman problem (TSP) is first preprocessed using a divide-and-conquer clustering strategy, decomposing the original problem containing a large number of stations into several smaller subproblems (called clusters). Specifically, based on the geometric distribution characteristics of the stations, a geometric clustering algorithm is used to divide the station set into multiple clusters, each cluster representing a TSP subproblem. Subsequently, all subproblems to be processed in the current batch are obtained to form the target subproblem set, and the number of stations contained in each subproblem (i.e., cluster size) is counted. In practical applications, the cluster size after clustering usually exhibits a long-tail distribution: there are a large number of small clusters containing only 1 to 8 stations, a small number of large clusters containing 25 to 32 stations, and medium-sized clusters (such as 9 to 16 stations, 17 to 24 stations). Determining the cluster size distribution of each subproblem is the basis for subsequent dynamic batch processing strategy selection.

[0033] It should be noted that the embodiments of the present invention are applicable to any clustering setup of the largest size, not limited to 32 sites. This method can also be extended: smaller subproblems can be tightly packed together, such as a deployment of 6 problems (6+6+6+5+5+4=32), except that the chip imposes limitations on individual memory cores. In actual chips, the 32x32 is divided into 16 8x8 blocks, and different subproblems are not allowed to be stored across blocks. For example, if problems a and b are both 6 in size, and problem a is in block 1, even if there is extra space in block 1, problem b can only be stored in other blocks.

[0034] S12. Based on the cluster size distribution of each sub-problem, dynamically determine the packaging strategy.

[0035] Based on the cluster size distribution of the current batch of subproblems, a resource allocation strategy is dynamically selected. When the cluster size distribution includes subproblems larger than a first preset size, a single subproblem is configured to exclusively occupy all storage resources of the execution core. When the cluster size distribution includes two subproblems larger than a second preset size and smaller than the first preset size, a dual-cluster parallel strategy is configured, mapping the two subproblems to different logical partitions. When the cluster size distribution includes multiple subproblems smaller than the second preset size, a three-cluster or four-cluster parallel strategy is configured, packaging three or four subproblems and mapping them to different logical partitions of the same execution core.

[0036] Specifically, for example, when there are large-sized (larger than the first preset size) sub-problems in the batch (e.g., stations 25 to 32), a single sub-problem is configured to exclusively occupy all 16 memory banks of the execution core to ensure that the large cluster obtains sufficient iteration depth; when there are two medium-sized (larger than the second preset size but smaller than the first preset size) sub-problems (e.g., stations 9 to 16 and 9 to 16, or stations 17 to 24 and 1 to 8), a dual-cluster parallel strategy is configured; when there are multiple small-sized (smaller than the second preset size) sub-problems (stations 1 to 8), a three-cluster parallel strategy (e.g., a combination of stations 9 to 16 and two stations 1 to 8) or a four-cluster parallel strategy (four stations 1 to 8) can be configured. This dynamic packaging strategy is flexibly adjusted according to the actual cluster size combination, aiming to maximize the utilization of execution core resources.

[0037] S13. Based on the packaging strategy, multiple sub-problems are mapped to different logical partitions of the same execution core's in-memory computing macro, and for a single sub-problem, the memory that is not activated during the single-step iteration is allocated to multiple independent attempts of the single sub-problem.

[0038] Based on the packaging strategy determined in S12, multiple subproblems are mapped to a memory-computing macro on the same execution core. The memory-computing macro is physically divided into 16 independent storage blocks (4×4), and logically partitioned according to the number of subproblems (up to 4 groups). Each partition is configured with independent local word lines and complementary word lines to achieve physical isolation. For a single subproblem, during local search iterations (such as two nearest neighbor swaps), a single step only needs to access a fixed number of weights in the distance matrix (such as 4 distances), corresponding to activating only 1 to 4 storage blocks, while the remaining 12 to 15 storage blocks are idle. At this time, the idle storage blocks are allocated to multiple independent attempts for the subproblem. Each group attempts to use an independent pseudo-random order generator to generate different candidate perturbations (i.e., different pairs of two nearest neighbor swap path positions) based on different random seeds, thereby achieving parallel exploration of the same subproblem from multiple starting points.

[0039] S14. Determine whether the sets of storage volumes that each group of independent attempts needs to access are mutually exclusive, and filter out the subset of attempts without conflicts.

[0040] Before executing multiple independent attempts, a lightweight conflict detection unit determines whether the sets of memory banks accessed by each group of attempts overlap. Specifically, it obtains the set of memory bank access addresses requested by each group of independent attempts and determines whether these sets are pairwise disjoint. If the memory bank access sets corresponding to each group of attempts do not overlap (i.e., accessing different memory banks), these attempts can be executed in parallel within the same clock cycle. If there is a memory bank access conflict (i.e., multiple groups of attempts need to access the same memory bank simultaneously), only the conflict-free subset of attempts is enabled, and the conflicting attempts are allocated to different clock cycles for sequential execution to ensure that no memory bank access conflicts occur.

[0041] S15. Within the same clock cycle, perform parallel processing of multiple sub-problems within the logical partition and multiple independent attempts within the conflict-free attempt subset to perform dynamic batch processing of sub-problems with varying sizes.

[0042] Within the same clock cycle, two levels of processing are executed in parallel: first, a multi-cluster parallel processing level, where each logical partition within the execution core independently performs local search iterations and energy difference assessments for its corresponding subproblem; second, a multi-trial parallel processing level, where, for a single subproblem, each group of independent trials within the conflict-free trial subset selected by S14 is executed in parallel. Each group independently maintains its own copy of the order table, and when the energy difference of a group of trials meets the simulated annealing criterion, the corresponding order table for that group is updated. Through this dynamic batch processing mechanism, efficient utilization of hardware resources and improved solution quality are achieved.

[0043] The present invention provides a dynamic batch processing method for variable-size subproblems of the Traveling Salesman Problem (TSP). This method obtains a set of target subproblems obtained by divide-and-conquer clustering of the TSP and determines the cluster size distribution of each subproblem. Based on the cluster size distribution of each subproblem, a packaging strategy is dynamically determined. Based on the packaging strategy, multiple subproblems are mapped to different logical partitions of an in-memory compute macro on the same execution core. For a single subproblem, memory that is not activated during a single-step iteration is allocated to multiple independent attempts of that single subproblem. It determines whether the sets of memory accessed by each group of independent attempts are pairwise disjoint and filters out a conflict-free subset of attempts. Within the same clock cycle, the processing of multiple subproblems within the logical partition and the multiple independent attempts within the conflict-free subset are executed in parallel to perform dynamic batch processing of variable-size subproblems. Compared to existing technologies, which suffer from low hardware utilization due to fixed resource allocation failing to adapt to the long-tail distribution of subproblem sizes, wasted throughput resources due to insufficient utilization of idle storage in single-step iterations, and difficulty in balancing throughput and solution quality due to the lack of multi-cluster packaging and multi-trial parallel collaboration mechanisms, this method achieves dynamic configuration of multi-cluster parallel processing and multi-trial parallel processing strategies based on the subproblem size distribution through two dynamically configurable deployment schemes: multi-cluster parallel processing and multi-trial parallel processing, and their collaboration. This improves hardware throughput while supporting the enhancement of solution quality through multiple independent attempts.

[0044] Figure 2 This is the second flowchart of the dynamic batch processing method for the changing size subproblem of the Traveling Salesman Problem provided by this invention, as shown below. Figure 2 As shown, the method includes the following: like Figure 3 The diagram showing the cluster size distribution of the TSPLIB benchmark library illustrates that, after divide-and-conquer clustering, the number of sites in each cluster for the large-scale traveling salesman problem ranges from 1 to 32 in typical problems of the public benchmark library, with significant differences in distribution across different problem instances and partitioning strategies. Small clusters (e.g., 1 to 8 sites) can share a single set of in-memory macros and spin tables; medium clusters (e.g., 9 to 16 sites, 17 to 24 sites) can be combined in pairs or with several smaller clusters; large clusters (e.g., 25 to 32 sites) typically occupy a single execution core. Dynamic batch processing selects a packing configuration based on the current combination of cluster sizes to be solved, enabling a single core to process as many subproblems as possible within the same clock cycle or to attempt the same subproblem multiple times, thereby improving utilization and throughput.

[0045] S21. Logically partition the spin table, word line and complementary word line decoder and bit line reduction array of the in-memory macro according to the number of subproblems, and configure independent local word lines and local complementary word lines for each logical partition.

[0046] Based on the number of sub-problems determined by the packaging strategy, the in-memory computation macro within the execution core is logically partitioned. The in-memory computation macro includes a spin table (with storage distance matrix weights), word lines and complementary word lines decoders, and a bit line reduction array. These components are logically partitioned according to the number of sub-problems. For example, when using a four-cluster parallel strategy, as shown in the multi-cluster parallel processing structure diagram, 16 memory banks are divided into 4 groups, with each group of 4 memory banks corresponding to one sub-problem. Each logical partition is configured with independent local word lines and local complementary word lines to ensure physical isolation between partitions during read operations, avoiding cross-cluster read interference, and enabling each sub-problem to independently execute its iterative steps within the same clock cycle.

[0047] S22. Configure a valid signal for each memory bank, and set the valid signal only when a memory bank participates in the read operation of the current subproblem; otherwise, close the memory bank.

[0048] Each independent memory bank is configured with a valid signal. When the memory bank participates in the read operation of the current subproblem, its valid signal is set, activating the memory bank for data access; when the memory bank does not participate in the read operation in the current cycle, its valid signal is turned off, keeping the memory bank in a low-power state and preventing read interference. This mechanism ensures that only the memory banks actually involved in the computation are activated, reducing power consumption and avoiding signal interference from inactive memory banks to active memory banks.

[0049] S23. Expand the energy difference calculation unit and the simulated annealing lookup table channel to a parallel number of paths that match the number of logical partitions.

[0050] The energy difference calculation unit within the execution core (used to calculate the energy difference ΔE in local search iterations) and the simulated annealing lookup table channel (used to determine whether to accept a new solution based on temperature parameters and energy difference) are expanded from a single-path to a multi-path parallel structure. The number of paths is matched to the number of logical partitions. For example, when using quad-cluster parallelism, it is expanded to 4 parallel channels, enabling each logical partition to have independent energy difference calculation and annealing determination capabilities, supporting each partition to simultaneously complete energy difference evaluation and acceptance / rejection decisions within the same clock cycle.

[0051] Supported packaging configuration examples include: - A single cluster has 25 to 32 stations, occupying all 16 memory banks; - Two clusters (e.g., stations 9 to 16 and 9 to 16, or stations 17 to 24 and 1 to 8); - Three clusters (such as stations 9 to 16 and two stations 1 to 8); - Four clusters, each with 1 to 8 stations.

[0052] S24. Configure multiple sets of pseudo-random order generators within the execution core. Each set of pseudo-random order generators generates corresponding candidate perturbations based on different random seeds.

[0053] Multiple pseudo-random order generators (e.g., 4 groups) are configured within the execution kernel, each using a different random seed. Each generator group produces candidate perturbations, i.e., randomly selected path location pairs (site index pairs) of two nearest neighbor swaps, used to generate candidate solutions for the local search. Different random seeds ensure that each group attempts to explore different regions of the solution space, increasing the coverage of the solution space.

[0054] S25. Based on the memory addresses that each group of independent attempts needs to access, determine the memory activation status, allocate idle memory to the independent attempts of the corresponding group, and each group of independent attempts maintains its own order table copy. When the energy difference of the group of independent attempts meets the annealing criterion, update the order table corresponding to the group.

[0055] Based on the two nearest neighbor swap locations selected by each group of independent attempts, the memory addresses that need to be accessed are determined, thus identifying which memory banks are active and which are idle. Idle memory banks are then allocated to the corresponding groups of independent attempts. Each group of independent attempts maintains its own independent copy of the path / order table, recording the current path status. When the energy difference calculated by a group of attempts is deemed acceptable by simulated annealing criteria (e.g., accepted by the Metropolis criterion or a negative energy difference), only the order table copy corresponding to that group is updated, without affecting the attempt status of other groups.

[0056] S26. Obtain the set of memory accesses requested by each group of independent attempts.

[0057] Before executing parallel attempts, the memory address information required by each group to independently attempt the current step is collected, forming a memory access set for each group. This information is used for subsequent conflict detection and judgment.

[0058] S27. Determine whether there is an intersection between the memory access sets of each group that independently attempt to access the corresponding memory.

[0059] Each set of memory access attempts is compared pairwise to determine if there is any overlap. If the sets of memory access attempts are not paired, these attempts are allowed to execute in parallel within the same clock cycle. If the sets of memory access attempts of each independent group have access conflicts (i.e., at least two groups of attempts need to access the same memory), then the subset of attempts with the highest parallelism is selected and executed in a single cycle.

[0060] Specifically, such as Figure 5The diagram illustrates a multi-attempt parallel processing architecture. For clusters larger than 8 stations, a single-step local search (such as two-nearest neighbor swapping) activates only 1 to 4 memory banks based on a limited number of selected station indices, leaving the remaining 12 to 15 memory banks idle during that cycle. Multi-attempt parallel processing utilizes these idle memory banks to initiate multiple independent local search attempts for the same cluster.

[0061] Its working mechanism is as follows: Multiple sets (e.g., 4 sets) of pseudo-random order generators are configured within the kernel, each generating different candidate perturbations (i.e., different pairs of two nearest neighbor swapping paths). A lightweight conflict detection unit determines whether the sets of memory banks accessed by the multiple attempts are pairwise disjoint: if they are disjoint, all attempts can be executed in parallel within the same clock cycle; if a conflict exists, a subset of attempts with the highest parallelism is selected and executed in a single cycle. Each attempt maintains its own independent copy of the order table. If the energy difference of a group is accepted by the annealing criterion, the order table corresponding to that group is updated.

[0062] For clusters with 9 to 16 stations, the number of parallel attempts supported is approximately twice that of other clusters; approximately three times that of clusters with 17 to 24 stations; and approximately four times that of clusters with 25 to 32 stations. Parallel processing with multiple attempts improves throughput while simultaneously enhancing the solution quality of the cluster through multiple independent random explorations: within the same number of iterations, more independent attempts mean a larger solution space coverage, which is beneficial for obtaining better paths.

[0063] Figure 6 This is a schematic diagram illustrating the dynamic batch processing throughput improvement effect provided by the present invention. Multi-cluster parallel processing and multi-attempt parallel processing can be enabled independently or simultaneously to form a joint strategy. Multi-cluster parallel processing packages small and medium clusters, and the freed-up execution cores can be scheduled to more large clusters or more batches of clusters; multi-attempt parallel processing utilizes idle memory within a single core to perform multiple parallel attempts on the same cluster. When both are enabled simultaneously, the core resources released by multi-cluster processing can be used to perform multiple parallel attempts on several large clusters respectively; while within a single core, if the current configuration is a single large cluster, multi-attempt processing can fully utilize idle memory within that core.

[0064] Experimental results show that enabling multi-cluster parallel processing alone results in an average throughput improvement of approximately 22.14%; enabling multi-attempt parallel processing alone results in an improvement of approximately 62.23%; and the combined strategy achieves an average throughput improvement of approximately 84.17%. The improvement from the combined strategy exceeds the sum of the individual improvements, demonstrating a synergistic effect: multi-cluster processing releases execution cores by consolidating small clusters, and these released cores can be allocated to multiple parallel attempts in large clusters, thereby maximizing both core utilization and memory utilization. Furthermore, the increased number of independent attempts resulting from multi-attempt parallel processing contributes to improved solution quality.

[0065] The method of this invention has been implemented and tested on a path planning processor using a 28-nanometer complementary metal-oxide-semiconductor (CMOS) process. The processor integrates 16 path planning execution cores, with each core's in-memory compute macro organized into 16 independent memory banks in a 4×4 configuration, supporting multi-cluster logical partitioning and multi-attempt parallel execution.

[0066] Tests were conducted on six typical Traveling Salesman Problems (covering 101 to 14051 sites) in a publicly available benchmark library. Experimental results show that enabling only multi-cluster parallel processing results in an average throughput improvement of approximately 22.14%; enabling only multi-trial parallel processing results in an average throughput improvement of approximately 62.23%; and the combined strategy of both results in an average throughput improvement of approximately 84.17%. In terms of solution quality, multi-trial parallel processing can complete more independent attempts in the same amount of time, which is beneficial for obtaining a better path ratio.

[0067] The chip operates stably with a supply voltage of 0.7 to 0.9 volts, and achieves a throughput of approximately 2.44 × 10⁻⁶ at 0.85 volts and 250 MHz on a 442-site benchmark problem. 4 One task per second. The above results validate the effectiveness of dynamic batch processing and the two deployment schemes and their synergy.

[0068] Taking real-time path planning of Automated Guided Vehicles (AGVs) in large-scale intelligent warehousing centers as an example: In modern intelligent warehousing systems, hundreds of AGVs need to perform picking tasks between high-density shelves. Each picking order corresponds to a traveling salesman problem: the AGV needs to pick up goods from several storage locations (stations) and return to the starting point, with the shortest possible path. Due to significant differences in orders, the sub-problems after task clustering exhibit a typical long-tail distribution: small-batch orders involve only 3-5 storage locations (small clusters), while bulk picking tasks during peak sales periods may involve 25-30 storage locations (large clusters).

[0069] Traditional deployment schemes employ a fixed resource allocation of "one core, one task": each path planning chip core is bound to one AGV task, with storage resources configured according to the maximum scale. This leads to severe resource mismatch—when processing small orders, a large amount of in-memory storage within the chip is idle, and AGVs queue up waiting for planning results; when processing large orders, the single-core computing power is insufficient, making it difficult to complete enough iteration steps within milliseconds, limiting path quality, increasing AGV travel distance, and raising energy consumption.

[0070] After applying the dynamic batch processing method of this invention, the path planning chip of the warehouse center can analyze the size distribution of the current orders to be processed in real time: multiple small orders (such as four 5-position orders) are packaged into four logical partitions of the same execution core for parallel processing, and the released core resources can be scheduled for large orders; at the same time, for large orders, taking advantage of the characteristic that only a part of the memory is activated in a single iteration, the idle memory is allocated to multiple independent attempts (parallel exploration from different random starting points), and under the guarantee of the conflict detection unit, multiple energy difference assessments are completed within the same clock cycle.

[0071] Real-world testing shows that on a 28nm path planning processor, this method improves system throughput by approximately 84.17%, with a single chip capable of processing over 24,000 AGV path planning requests per second. The planning wait time for large-order AGVs is reduced from hundreds of milliseconds to milliseconds, and by obtaining better paths through multiple parallel attempts, the average AGV travel distance is reduced by 8%-12%, significantly lowering warehouse operating costs and order fulfillment time.

[0072] The present invention provides a dynamic batch processing method for variable-size subproblems of the Traveling Salesman Problem (TSP). This method obtains a set of target subproblems obtained through divide-and-conquer clustering of the TSP and determines the cluster size distribution of each subproblem. Based on the cluster size distribution of each subproblem, a packaging strategy is dynamically determined. Based on the packaging strategy, multiple subproblems are mapped to different logical partitions of an in-memory macro on the same execution core. For a single subproblem, memory that was not activated during a single-step iteration is allocated to multiple independent attempts for that single subproblem. It determines whether the sets of memory accessed by each group of independent attempts are pairwise disjoint, and filters out a conflict-free subset of attempts. Within the same clock cycle, the processing of multiple subproblems within the logical partition and the multiple independent attempts within the conflict-free subset are executed in parallel to perform dynamic batch processing of variable-size subproblems. Thus, through two dynamically configurable deployment schemes—multi-cluster parallel processing and multi-attempt parallel processing—and their synergy, the method achieves dynamic configuration of multi-cluster parallel processing and multi-attempt parallel processing strategies based on the subproblem size distribution, improving hardware throughput while supporting improved solution quality through multiple independent attempts.

[0073] The following describes the dynamic batch processing apparatus for the variable-size subproblem of the traveling salesman problem provided by the present invention. The dynamic batch processing apparatus for the variable-size subproblem of the traveling salesman problem described below can be referred to in correspondence with the dynamic batch processing method for the variable-size subproblem of the traveling salesman problem described above.

[0074] Figure 7 This is a schematic diagram of the structure of the dynamic batch processing device for the varying size subproblem of the traveling salesman problem provided by the present invention, specifically including: The acquisition module 701 is used to acquire the target subproblem set obtained by divide-and-conquer clustering of the Traveling Salesman Problem, and to determine the cluster size distribution of each subproblem. For detailed explanations, please refer to the relevant descriptions in the above method embodiments; they will not be repeated here.

[0075] The determination module 702 is used to dynamically determine the packing strategy based on the cluster size distribution of each sub-problem. For detailed explanations, please refer to the relevant descriptions in the above method embodiments; they will not be repeated here.

[0076] The allocation module 703 is used to map multiple subproblems to different logical partitions of the same in-memory macro on the same execution core based on the packaging strategy, and for a single subproblem, allocate memory that has not been activated during a single-step iteration to multiple independent attempts of that single subproblem. For detailed explanations, please refer to the relevant descriptions in the above method embodiments; they will not be repeated here.

[0077] The filtering module 704 is used to determine whether the sets of storage banks to be accessed by each group of independent attempts are pairwise disjoint, and to filter out a subset of attempts without conflicts. For detailed explanations, please refer to the relevant descriptions in the above method embodiments; they will not be repeated here.

[0078] The batch processing module 705 is used to perform parallel processing of multiple sub-problems within the logical partition and multiple independent attempts within the conflict-free attempt subset within the same clock cycle, in order to perform dynamic batch processing of sub-problems with varying sizes. For detailed explanations, please refer to the relevant descriptions in the above method embodiments; they will not be repeated here.

[0079] 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 communications bus 840, wherein the processor 810, the communications interface 820, and the memory 830 communicate with each other through the communications bus 840. The processor 810 can call logical instructions in the memory 830 to execute a dynamic batch processing method for variable-size subproblems of the Traveling Salesman Problem. This method includes: obtaining a set of target subproblems obtained by divide-and-conquer clustering of the Traveling Salesman Problem, and determining the cluster size distribution of each subproblem; dynamically determining a packing strategy based on the cluster size distribution of each subproblem; mapping multiple subproblems to different logical partitions of an in-memory compute macro on the same execution core based on the packing strategy, and for a single subproblem, allocating memory that was not activated during a single-step iteration to multiple independent attempts of that single subproblem; determining whether the sets of memory accessed by each group of independent attempts are pairwise disjoint, and filtering out a conflict-free subset of attempts; and executing the processing of multiple subproblems within the logical partition and the multiple independent attempts within the conflict-free subset in parallel within the same clock cycle to perform dynamic batch processing of the variable-size subproblems.

[0080] 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, 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.

[0081] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the dynamic batch processing method for variable-size subproblems of the Traveling Salesman Problem provided by the above methods. The method includes: obtaining a set of target subproblems obtained by divide-and-conquer clustering of the Traveling Salesman Problem, and determining the cluster size distribution of each subproblem; dynamically determining a packing strategy based on the cluster size distribution of each subproblem; mapping multiple subproblems to different logical partitions of an in-memory compute macro of the same execution core based on the packing strategy, and allocating memory that is not activated during a single-step iteration to multiple independent attempts of the single subproblem for a single subproblem; determining whether the sets of memory to be accessed by each group of independent attempts are pairwise disjoint, and filtering out a conflict-free subset of attempts; and executing the processing of multiple subproblems within the logical partition and the multiple independent attempts within the conflict-free subset in parallel within the same clock cycle to perform dynamic batch processing of variable-size subproblems.

[0082] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements a dynamic batch processing method for variable-size subproblems of the Traveling Salesman Problem provided by the above methods. The method includes: obtaining a set of target subproblems obtained by divide-and-conquer clustering of the Traveling Salesman Problem, and determining the cluster size distribution of each subproblem; dynamically determining a packing strategy based on the cluster size distribution of each subproblem; mapping multiple subproblems to different logical partitions of an in-memory compute macro of the same execution core based on the packing strategy, and allocating memory that is not activated during a single-step iteration to multiple independent attempts of the single subproblem for each subproblem; determining whether the sets of memory to be accessed by each group of independent attempts are pairwise disjoint, and filtering out a conflict-free subset of attempts; and executing the processing of multiple subproblems within the logical partition and the multiple independent attempts within the conflict-free subset in parallel within the same clock cycle to perform dynamic batch processing of variable-size subproblems.

[0083] 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.

[0084] 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.

[0085] 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 dynamic batch processing method for the varying size subproblem of the Traveling Salesman Problem, characterized in that, include: Obtain the target subproblem set obtained by divide-and-conquer clustering of the Traveling Salesman Problem, and determine the cluster size distribution of each subproblem; Based on the cluster size distribution of each sub-problem, the packaging strategy is dynamically determined; Based on the packaging strategy, multiple sub-problems are mapped to different logical partitions of the same in-memory computing macro in the same execution core, and for a single sub-problem, the memory that is not activated during the single-step iteration is allocated to multiple independent attempts of the single sub-problem. Determine whether the sets of memory banks accessed by each group of independent attempts are pairwise disjoint, and filter out the subset of attempts without conflicts; Within the same clock cycle, multiple sub-problem processing within the logical partition and multiple independent attempts within the conflict-free attempt subset are executed in parallel to perform dynamic batch processing of sub-problems of varying sizes.

2. The method according to claim 1, characterized in that, The method of mapping multiple sub-problems to different logical partitions of an in-memory macro based on the packaging strategy includes: The spin table, word line and complementary word line decoder and bit line reduction array of the in-memory computing macro are logically partitioned according to the number of subproblems, and each logical partition is configured with independent local word lines and local complementary word lines. Configure a valid signal for each memory bank. The valid signal is set only when a memory bank participates in the read operation of the current subproblem; otherwise, the memory bank is closed.

3. The method according to claim 2, characterized in that, The execution core includes an energy difference calculation unit and a simulated annealing lookup table channel; the method further includes: The energy difference calculation unit and the simulated annealing lookup table channel are expanded to a parallel number of paths that match the number of logical partitions.

4. The method according to claim 3, characterized in that, The method of allocating unactivated memory during a single-step iteration to multiple independent attempts of a single subproblem includes: Multiple pseudo-random order generators are configured within the execution core, and each pseudo-random order generator generates corresponding candidate perturbations based on different random seeds; Based on the memory addresses that each group of independent attempts needs to access, the activation status of the memory is determined, and memory in an idle state is allocated to the independent attempts of the corresponding group. Each group of independent attempts maintains its own copy of the order table. When the energy difference of the independent attempts in a group meets the annealing criterion, the order table corresponding to that group is updated.

5. The method according to claim 4, characterized in that, The step of determining whether the sets of memory banks accessed by each group of independent attempts are pairwise disjoint, and filtering out a subset of conflict-free attempts, includes: Obtain the set of memory accesses requested by each group of independent attempts; Determine whether there is an intersection between the memory access sets attempted independently by each group; If the sets of memory accesses attempted by each group are pairwise disjoint, then the groups of independent attempts are allowed to execute in parallel within the same clock cycle. If there are access conflicts in the memory access sets attempted independently by each group, then the subset of attempts in the scenario with the highest parallelism is selected and executed in a single cycle.

6. The method according to claim 1, characterized in that, The dynamic determination of the packing strategy based on the cluster size distribution of each sub-problem includes: When the cluster size distribution contains sub-problems larger than a first preset size, each sub-problem is configured to exclusively occupy all storage resources of the execution core; When the cluster size distribution contains two sub-problems that are larger than the second preset size and smaller than the first preset size, a dual-cluster parallel strategy is configured to map the two sub-problems to different logical partitions respectively; When the cluster size distribution contains multiple sub-problems smaller than the second preset size, a three-cluster or four-cluster parallel strategy is configured to package and map the three or four sub-problems to different logical partitions of the same execution core.

7. The method according to claim 1, characterized in that, The method further includes: Based on the cluster size distribution of the current batch of subproblems and the target solution quality requirements, configure multi-cluster parallel processing strategies and multi-trial parallel processing strategies independently or collaboratively. When cooperative configuration is enabled, the execution core resources released by multi-cluster parallel processing are allocated to multiple attempts of parallel processing of subproblems larger than a first preset size, while multiple independent attempts of the same subproblem are executed within a single core using free memory.

8. A dynamic batch processing device for the varying size subproblem of the traveling salesman problem, characterized in that, include: The acquisition module is used to acquire the target subproblem set obtained by divide-and-conquer clustering of the Traveling Salesman Problem, and to determine the cluster size distribution of each subproblem; The determination module is used to dynamically determine the packaging strategy based on the cluster size distribution of each sub-problem; The allocation module is used to map multiple sub-problems to different logical partitions of the same execution core's in-memory computing macro based on the packaging strategy, and to allocate the memory that is not activated during a single-step iteration to multiple independent attempts of the single sub-problem for each sub-problem. The filtering module is used to determine whether the sets of storage banks that each group of independent attempts needs to access are pairwise disjoint, and to filter out a subset of conflict-free attempts. The batch processing module is used to perform dynamic batch processing of subproblems of varying sizes in parallel within the same clock cycle, including processing multiple subproblems within the logical partition and multiple independent attempts within the conflict-free attempt subset.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the dynamic batch processing method for the variable-size subproblem of the traveling salesman problem as described in any one of claims 1 to 7.

10. A non-transitory 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 dynamic batch processing method for the variable-size subproblem of the traveling salesman problem as described in any one of claims 1 to 7.