A reversible state space breadth-first search method based on a three-layer sliding state set, an electronic device and a storage medium

By employing a three-layer sliding state set method in breadth-first search, the storage and deduplication efficiency issues in reversible state space are solved, achieving more efficient state space search, which is applicable to scenarios such as integrated circuit wiring, maze routing, and robot path planning.

CN123050561APending Publication Date: 2026-11-06SHANGHAI GUYUN IND CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611377100.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-07
Publication Date
2026-11-06

AI Technical Summary

Technical Problem

Existing breadth-first search leads to a significant increase in storage space, a decrease in deduplication efficiency, and insufficient cache utilization when dealing with reversible state spaces, especially in large-scale grid search scenarios where scalability is insufficient.

Method used

The method employs a three-layer sliding state set. By constructing a hierarchical search structure, duplicate judgments are only made within the current extended layer and its two preceding layers and the next layer of the state sliding window. Duplicate states are eliminated by set-based insertion of the next layer of state set or state-encoded unique insertion, thereby reducing the dependence on the globally visited state set.

Benefits of technology

It reduces storage overhead, improves query efficiency, enhances cache friendliness, strengthens scalability, is suitable for large-scale grid and path planning problems, and maintains the completeness and shortest level of search.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure QLYQS_27
    Figure QLYQS_27
  • Figure QLYQS_31
    Figure QLYQS_31
Patent Text Reader

Abstract

This invention discloses a width-first deduplication search method, electronic device, and storage medium for reversible state space based on a three-layer sliding state set, belonging to the fields of artificial intelligence search, path planning, and integrated circuit wiring optimization. This method addresses state space search problems with single-step reversible state transition characteristics. During the width-first search process, it maintains a three-layer sliding window consisting of the current extended layer, the previous layer, and the two layers prior to the current layer. For the generated candidate states within this three-layer sliding window, historical repetition is determined, and for the next layer state set being constructed, either set-based insertion or state-encoded unique insertion is performed. After the current layer expansion is complete, the three-layer sliding window is updated to consist of the next layer state set, the current extended layer state set, and the previous layer state set, and the historical layer state set before the three-layer window is discarded. This method leverages the hierarchical adjacency property formed by single-step reversible state transitions to reduce dependence on the globally visited state set. While satisfying single-step reversible state transitions, breadth-first layer-by-layer expansion, and unique insertion of the next layer's state set, it maintains the completeness of breadth-first search for reachable target states and the shortest hierarchy upon first reaching the target state, while simultaneously reducing the size of state deduplication storage and query overhead. This scheme is suitable for maze routing, chip wiring, robot path planning, slider problem solving, and graph search tasks on resource-constrained devices.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence search, graph theory search, path planning and electronic design automation, specifically to a reversible state space width-first deduplication search method based on a three-layer sliding state set, an electronic device and a storage medium. Background Technology

[0002] Breadth-First Search (BFS) is a fundamental method in state-space search and graph search. This method expands the search hierarchy layer by layer, typically guaranteeing that the first arrival at the target state corresponds to the shortest number of steps or the shortest level. Therefore, BFS is widely used in maze solving, path planning, slider problems, graph routing, and chip maze wiring.

[0003] When processing reversible state spaces, existing BFS typically requires maintaining a global visited state set (VisitedSet) and performing a deduplication operation on the global set after each new state is generated to avoid circular searches caused by state reversibility. As the search depth increases, the size of the global visited state set expands rapidly, leading to the following technical problems: (1) The state storage space increases significantly, easily causing memory bottlenecks; (2) The query efficiency decreases after the deduplication set size increases; (3) Large-scale data structures cannot fully utilize processor cache, resulting in increased memory access latency; (4) In resource-constrained devices or large-scale grid search scenarios, traditional solutions lack scalability.

[0004] Especially in scenarios such as integrated circuit wiring, maze routing, and long-distance path planning for robots, the search space is enormous, and local state transitions are often reversible. In these technological scenarios, reducing the storage and comparison costs required for repeated BFS decisions is a pressing issue in current technologies. However, in breadth-first search scenarios with single-step reversible state transitions, there is a local adjacency relationship between the next-step successor state of the current extended layer and the search level. Existing global visited state set deduplication methods typically do not fully utilize this hierarchical adjacency characteristic, instead uniformly storing and querying all historical visited states. This results in some historical layer states that are no longer likely to reappear as the next-step successor state of the current layer being retained for a long time. Therefore, while ensuring search completeness, existing technologies incur high storage and deduplication costs. Summary of the Invention

[0005] 3.1 Purpose of the Invention

[0006] The purpose of this invention is to provide a width-first deduplication search method, electronic device and storage medium based on a three-layer sliding state set for reversible state space, so as to solve the problems of high memory consumption, high deduplication overhead and insufficient cache utilization caused by the reliance of width-first search on the global visited state set in the prior art.

[0007] Furthermore, this invention utilizes the adjacency characteristics of the breadth-first search hierarchy formed by single-step reversible state transitions to limit the scope of historical repetition determination to a three-layer state sliding window consisting of the current extended layer, the previous layer, and the two layers before it. It also eliminates repetitions generated in the same layer by using set-based insertion of the next layer's state set being constructed or state-encoded unique insertion. This reduces the dependence on the globally visited state set while maintaining the completeness of breadth-first search for the reachable target state and the shortest hierarchy when first reaching the target state.

[0008] 3.2 Technical Solution

[0009] To achieve the above objectives, the present invention adopts the following technical solution:

[0010] When performing a breadth-first search in a state space with single-step reversible state transitions, a hierarchical search structure is constructed, and a three-layer sliding window consisting of the three nearest-three layer state sets is maintained. For the k-th layer expansion process, let the current expansion layer state set be L. k The previous layer state set is L k−1 The first two state sets are L k−2 ,

[0011] The next layer state set being constructed is L k+1 The three-layer state sliding window is represented as follows:

[0012] W k =L k ∪L k−1 ∪L k−2 ,

[0013] From the current extension layer state set L k Extract the state to be expanded s from the list, and apply the state transition operator a∈A to the state to be expanded s to generate candidate states:

[0014] s'=T(s,a), a∈A, s∈L k

[0015] For the candidate state s', this invention no longer performs global deduplication on all historical access states, but only on the current three-layer state sliding window W. k Internally, perform historical repetition checks; simultaneously, process the next-level state set L that is being constructed. k+1Perform set-based insertion or state-encoded unique insertion to eliminate insertions from the same current extension layer state set L. k The same candidate state generated from different parent states. Specifically, the repetition determination rule is expressed as:

[0016] D(s') = 1, s' ∈ L k ∪L k−1 ∪L k−2 ∪L k+1 ,

[0017] =0,s'∉L k ∪L k−1 ∪L k−2 ∪L k+1 .

[0018] Wherein, D(s')=1 indicates that the candidate state s' is a repeated state, and D(s')=0 indicates that the candidate state s' is a state to be retained; L k+1 This represents the next layer of state set being constructed. When D(s') = 0, the candidate state s' is added to the next layer of state set L. k+1 When D(s')=1, the candidate state s' is determined to be a duplicate state and discarded.

[0019] Furthermore, if the state transition operator a is a single-step reversible state transition operator, then for any state s i Transition to state s via operator a j Then, there exists an inverse operator a. −1 , so that:

[0020] T(T(s i ,a),a−1)=s i

[0021] Wherein, the operator a and the inverse operator a −1 Each corresponds to a search level step size in a breadth-first search.

[0022] Under the conditions of satisfying single-step reversible state transition, width-first layer-by-layer expansion, and unique insertion of the next layer's state set, the current expansion layer state set L k The successor state of any state in the three-state sliding window does not belong to the set of historical states preceding the three-state sliding window. The set of historical states preceding the three-state sliding window can be represented as:

[0023] L0∪L1∪⋯∪L k−3

[0024] Therefore, for state s∈L k The candidate state s'=T(s,a) generated by its first state transition has the following hierarchical pruning relationship:

[0025] s∈L k , s'=T(s,a) ⇒ s'∉L0∪L1∪⋯∪L k−3

[0026] Therefore, the set of historical states before the three-layer state sliding window does not need to participate in the historical repetition determination of the current candidate state s' and can be discarded during the hierarchical advancement process.

[0027] When the current extension layer state set L k After completing all expansions, update the three-layer state sliding window as follows:

[0028] {L k+1 ,L k ,L k−1}

[0029] The corresponding hierarchical update relationship is as follows:

[0030] L k−2 ←L k−1 , L k−1 ←L k , L k ←L k+1

[0031] In this way, the present invention retains only the three-layer state set related to the current width-first expansion, and uses the next layer state set L that is being constructed. k+1 This enables unique processing of duplicates generated at the same level, thereby reducing the dependence on the globally accessed state set, reducing the state storage size and the overhead of duplicate detection.

[0032] Furthermore, under the conditions of single-step reversible state transition, breadth-first layer-by-layer expansion, and unique insertion of the next layer's state set, the set of historical layer states before the three-layer state sliding window will not reappear as a successor state of the current expanded layer state. Therefore, discarding the set of historical layer states before the three-layer state sliding window will not lead to the erroneous discarding of undiscovered reachable states, nor will it change the shortest level corresponding to the first arrival of the target state in the breadth-first search. Thus, this invention can maintain the completeness of the breadth-first search for reachable target states and the shortest level while reducing memory consumption and deduplication overhead.

[0033] 3.3 Beneficial Effects

[0034] Compared with the prior art, the present invention has at least the following beneficial effects: (1) Reduced storage overhead: the maintenance of a global set of accessed states is changed to maintaining only a three-layer state sliding window, reducing the scale of duplicate data; (2) Improved query efficiency: the scale of the three-layer local set is relatively small, which is conducive to fast equality comparison and hash retrieval; (3) Improved cache friendliness: the state table is more likely to reside in the cache, reducing the cost of random memory access; (4) Enhanced scalability: in large-scale mesh, wiring and path planning problems, it can delay the memory exhaustion faced by traditional BFS; (5) Applicable to engineering deployment: applicable to scenarios such as EDA wiring, robot path planning and local search of embedded devices. (6) Eliminate duplicates generated in the same layer: By performing set-based insertion or state-encoded unique insertion on the next layer state set Lk+1 that is being constructed, the same candidate states generated by different parent states in the same current expansion layer can be eliminated; (7) Maintain search properties: Under the conditions of single-step reversible state transition, width-first layer-by-layer expansion and unique insertion of the next layer state set, the duplication determination of the three-layer state sliding window can achieve the same historical duplication elimination effect on the historical layer state set before the three-layer state sliding window as the global visited state set, without changing the completeness of the width-first search for the reachable target state, and maintaining the shortest level corresponding to the first arrival of the target state. Attached Figure Description

[0035] Figure 1 This is a schematic diagram of the overall process of the method of the present invention. Detailed Implementation

[0036] The invention will now be further described with reference to the accompanying drawings.

[0037] 5.1 Overall Process

[0038] like Figure 1 As shown, the present invention provides a width-first deduplication search method for reversible state space based on a three-layer sliding state set, which mainly includes the following process:

[0039] First, obtain the initial state s0 of the problem to be solved, the target determination conditions, and the set of state transition operators A. At least some of the state transition operators in the state transition operator set A used for breadth-first expansion are single-step reversible state transition operators. The target determination conditions can be set according to the specific task as reaching the target node, forming a valid connection path, achieving the target layout, satisfying path constraints, satisfying resource constraints, or satisfying a preset search termination condition.

[0040] Subsequently, a hierarchical queue structure for breadth-first search is constructed, and a three-layer state sliding window is initialized. The three-layer state sliding window includes at least the current extended layer state set L. k Previous layer state set L k−1and the first two state sets L k−2 At the initial moment, the initial state s0 can be used as the unique element of the current extended layer state set, and the previous layer state set and the previous two layer state sets can be initialized as empty sets.

[0041] Next, from the current extended layer state set L k Select the state to be expanded s in sequence, and apply one or more state transition operators a∈A to the state to be expanded s to generate the corresponding candidate state s'=T(s,a).

[0042] For each candidate state s', only in the current extended layer state set L k Previous layer state set L k−1 and the first two state sets L k−2 The historical repetition determination is performed within the three-layer state sliding window; simultaneously, the next layer state set L, which is being constructed, is also evaluated. k+1 Perform set-based insertion or state-coded unique insertion.

[0043] When candidate state s' has already appeared in the three-level sliding window of states, or has already appeared in the next level state set L being constructed. k+1 If the candidate state s' is found to be a duplicate state, it will be discarded and the target determination will no longer be performed on the candidate state s'.

[0044] When candidate state s' does not appear in the three-layer state sliding window and the next layer state set L being constructed k+1 When the condition is met, the candidate state s' is added to the next layer state set L. k+1 .

[0045] The candidate state s' is added to the next layer state set L. k+1 Then, if the candidate state satisfies the target determination condition, the corresponding search path, connection result, or shortest level result is output. If the candidate state s' does not satisfy the target determination condition, the current extended layer state set L is further expanded. k Other states in the current extended layer state set L. k If all states in the three-level sliding window have been expanded and no results have been output, then update the three-level sliding window to {L}. k+1 ,L k ,L k−1}, and continue to perform the next level of search.

[0046] 5.2 State Representation and State Coding

[0047] In this invention, the state can be represented in different ways depending on the specific application scenario.

[0048] In maze or grid path planning scenarios, the state can be represented as the current position coordinates, direction information, etc.

[0049] Information on passable areas, obstacles, or local maps. In robot path planning scenarios, state can be represented as the robot's current position, posture, joint configuration, motion constraints, collision constraints, or task stage information. In slider puzzle, chess search, or game endgame analysis scenarios, state can be represented as chessboard layout, piece positions, slider arrangement, empty space positions, current turn information, or positional constraints. In integrated circuit wiring or maze routing scenarios, state can be represented as the current node of the wiring path, occupied resources, etc.

[0050] Information on routing direction, interlayer via status, obstacle areas, design rule constraints, or path cost constraints.

[0051] To facilitate rapid comparison, preferably, state encoding values ​​are generated for each state. State encoding values ​​can be generated by serializing position vectors, connectivity relationships, obstacle information, board layout, grid occupancy information, wiring resource occupancy, or path constraint information. State encoding values ​​can be implemented using string encoding, integer encoding, bitmap encoding, hash encoding, tuple encoding, or compression encoding.

[0052] When determining whether a candidate state is duplicated with an existing state in a three-level sliding window, one can directly compare whether the state code values ​​are the same, or achieve fast retrieval based on hash tables, set structures, Bloom filters, bit vector indexes, or other data structures that can quickly determine equality.

[0053] It should be noted that the state code should reflect the necessary state information that affects the search equivalence. The information included in the state code may differ for different application scenarios. For example, in simple grid path planning, it may only include node coordinates; in a wiring task with resource constraints, it may include the current node, occupied wiring resources, direction constraints, and layer information; in a slider puzzle, it may include the complete chessboard layout.

[0054] 5.3 Repeatability Determination and Next-Level Unique Insertion

[0055] For the k-th layer expansion process, let the current expansion layer state set be L. k The previous layer state set is L k−1 The first two state sets are L k−2 The next layer of state set being constructed is L. k+1 The three-layer state sliding window can be represented as:

[0056] W k ={L k ,L k−1 ,L k−2}

[0057] From the current extension layer state set Lk After selecting a state s to be expanded, apply the state transition operator a∈A to it to generate candidate states:

[0058] s'=T(s,a).

[0059] For candidate state s', this invention performs two types of repetition determination. The first type is historical repetition determination, that is, determining whether candidate state s' already exists in the current extended layer state set L. k Previous layer state set L k−1 Or the first two state sets L k−2 The first type of decision is used to avoid candidate states falling into the historical state set maintained by the three most recent layers. The second type is the decision on duplicate generation of the same layer during the construction of the next layer, that is, to determine whether the candidate state s' already exists in the state set L of the next layer being constructed. k+1 This type of decision is used to prevent different parent states in the same current extended layer from generating the same candidate state and repeatedly inserting it into the state set of the next layer.

[0060] Therefore, the repeatability determination rule can be expressed as:

[0061] D(s') = 1, s' ∈ L k ∪L k−1 ∪L k−2 ∪L k+1 ,

[0062] =0,s'∉L k ∪L k−1 ∪L k−2 ∪L k+1 .

[0063] Where D(s') = 1 indicates that candidate state s' is a repeated state, and D(s') = 0 indicates that candidate state s' is a state to be retained. When D(s') = 1, candidate state s' is discarded and not added to the next level state set. When D(s') = 0, candidate state s' is added to the next level state set L. k+1 .

[0064] In this way, the present invention limits the scope of historical repetition determination to a three-layer state sliding window, and uses the next layer state set L k+1 Set-based insertion or state-encoded unique insertion eliminates duplicates generated at the same level, thereby avoiding the high memory consumption and high deduplication overhead caused by maintaining a global set of accessed states.

[0065] 5.4 Single-step reversible state transition and the principle of history layer pruning

[0066] In this invention, if the state transition operator a is a single-step reversible state transition operator, then for any state s i Transition to state s via operator aj Then, there exists an inverse operator a. −1 , so that:

[0067] s j =T(s i a)

[0068] and:

[0069] T(s j ,a−1)=s i .

[0070] It can be represented as:

[0071] T(T(s i ,a),a−1)=s i .

[0072] Wherein, the operator a and the inverse operator a −1 Each corresponds to a search level step size in a breadth-first search.

[0073] Under the conditions of single-step reversible state transition and width-first layer-by-layer expansion, if state s belongs to the current expansion layer state set L k If the candidate state s'=T(s,a) is generated by a single state transition, then the candidate state s' does not belong to the set of historical states before the three-layer sliding window.

[0074] L0∪L1∪⋯∪L k−3 .

[0075] The reason is that if the candidate state s' belongs to L0∪L1∪⋯∪L k−3 If there is a single-step reversible state transition relationship between s and s', then state s can be transitioned from s' to s' in one step. In this case, the breadth-first search level of state s should not exceed k−2, which is consistent with the fact that state s belongs to the current expansion layer L. k This is contradictory.

[0076] Therefore, under the above conditions, the set of historical layer states prior to the three-layer state sliding window will not reappear as a successor state of the current extended layer state. Thus, the set of historical layer states prior to the three-layer state sliding window can be discarded during the hierarchical progression process without participating in the historical repetition determination of the current candidate state.

[0077] It should be noted that the next-level state set L being constructed... k+1 While not part of the historical state set, it is used to eliminate duplicate insertions where different parent states in the same current extended layer generate the same candidate state. Therefore, this invention handles historical repetitions through a three-layer state sliding window, and uses the next layer state set L... k+1 Handle duplicate generation within the same layer.

[0078] Under the conditions of satisfying single-step reversible state transitions, breadth-first layer-by-layer expansion, and unique insertion of the next layer's state set, discarding the historical layer state set before the three-layer state sliding window will not lead to the erroneous discarding of undiscovered reachable states, nor will it change the shortest level corresponding to the first arrival of the target state in the breadth-first search. Therefore, this invention can maintain the completeness of the breadth-first search for reachable target states and the shortest level while reducing the state storage size and deduplication overhead.

[0079] 5.5 Three-layer sliding window update method

[0080] The core of this invention lies in limiting the repeatability determination range to the set of the three most recent layers. For the k-th layer expansion process, let: L k For the current extension layer state set; L k−1 For the previous layer's state set; L k−2 For the first two layers of state sets; L k+1 The state set of the next layer generated by the current extension layer;

[0081] Once the current layer has expanded, the three-layer state sliding window is updated according to the following relationship:

[0082] L k−2 ←L k−1 , L k−1 ←L k , L k ←L k+1

[0083] By using the above method, the system only retains the state information of the three most recent layers that are related to the current progress, thereby avoiding the long-term storage of all historical states, reducing memory usage and improving deduplication efficiency.

[0084] 5.6 Reverse Pruning Implementation Method

[0085] In some reversible state spaces, candidate states may be generated from the current state through a certain operator, and can be immediately returned to the original state through the inverse operator of that operator. These candidate states typically correspond to ineffective round-trip expansions between adjacent layers. For example, the current state s generates a candidate state s'=T(s,a) through operator a, if an inverse operator a exists... −1 , so that:

[0086] T(s',a −1 )=s,

[0087] Furthermore, since this candidate state only corresponds to the direct reversal of the previous step's transition, it can be pruned as a fallback candidate state. In a preferred embodiment, the parent state or parent operator used to generate the current state can be recorded. When expanding the current state, if a candidate state is equal to its parent state, or if an operator constitutes a direct inverse operation with the operator entering the current state, then the candidate state will not be added to the next level state set.

[0088] By using backtracking pruning, invalid round-trip expansion between adjacent layers can be reduced, further decreasing the number of candidate states generated and the number of repeated judgments. It should be noted that backtracking pruning can be used as a supplementary optimization measure to the three-layer state sliding window deduplication mechanism, rather than replacing it.

[0089] 5.7 Application Scenarios and Examples

[0090] This invention can be applied to a variety of breadth-first search tasks with reversible or locally reversible state transition characteristics.

[0091] In maze routing or grid path planning scenarios, the state can be represented as the current grid node, and the state transition operator can be represented as moving up, down, left, or right. In these scenarios, most movement operations have corresponding inverse operations. For example, the inverse operation of moving up is moving down, and the inverse operation of moving left is moving right. By employing the three-layer state sliding window of this invention, local deduplication and historical pruning can be performed without permanently storing all historical nodes.

[0092] In robot path planning scenarios, the state can be represented as robot pose, discretized position, or joint configuration, and the state transition operator can be represented as a discrete step size. For robots with reverse motion capabilities, operations such as moving forward, backward, left, right, or increasing / decreasing joint angles can constitute a single-step reversible state transition. This invention can reduce the storage requirements for historical state sets during long-distance planning.

[0093] In scenarios involving slider puzzles or chessboard searches, the state can be represented as a chessboard layout or slider arrangement, and the state transition operator can be represented as a space movement, a piece movement, or a legal move change. In scenarios that satisfy reversible movement rules, this invention can reduce the amount of duplicate data to be checked in breadth-first search.

[0094] In integrated circuit routing or maze routing scenarios, the state can be represented as the current node of the routing path, occupied resources, and constraint information. The state transition operator can be represented as advancing to adjacent routing resources. For partially reversible or locally reversible routing search processes, this invention can utilize local hierarchical adjacency characteristics to reduce the dependency on the global visited state set, thereby improving the search scalability in large-scale routing tasks.

[0095] In graph search tasks on resource-constrained devices, such as local path search tasks in embedded devices, edge computing devices, or mobile terminals, traditional global visited state sets can easily cause storage pressure due to limited memory capacity and cache resources. This invention reduces runtime memory usage and improves project deployment adaptability by using a three-layer state sliding window and a next-layer unique insertion mechanism.

[0096] 5.8 Implementation Methods of Electronic Equipment

[0097] The present invention also provides an electronic device, including a processor, a memory, and a computer program stored in the memory. When the computer program is executed by the processor, it implements the method steps of any of the above embodiments.

[0098] The electronic device can be a server, personal computer, embedded controller, mobile terminal, edge computing device, or a dedicated computing platform for electronic design automation. In one embodiment, when the processor executes the computer program, it expands the states layer by layer in a width-first manner and performs candidate state deduplication based on a three-layer state sliding window and a unique insertion mechanism for the next layer state set, thereby reducing the dependence on the globally visited state set.

[0099] 5.9 Storage Media Implementation Method

[0100] The present invention also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it implements the method steps of any of the above embodiments.

[0101] The computer-readable storage medium can be a disk, solid-state drive, flash memory, read-only memory, random access memory, or other media capable of storing program instructions. When the computer program is executed, the processor can acquire the initial state, target determination conditions, and a set of state transition operators, construct a three-layer state sliding window, generate candidate states, perform repetitive determination based on the three-layer state sliding window and the next layer state set, and update the three-layer state sliding window after the current layer expansion is completed, until the search path, shortest level result, or other target result is output.

[0102] Those skilled in the art should understand that various modifications, equivalent substitutions, and improvements can be made to the technical solutions of this invention without departing from the spirit and essence of this invention, and all such modifications, equivalent substitutions, and improvements should fall within the protection scope of this invention.

Claims

1. A width-first deduplication search method for reversible state space based on a three-layer sliding state set, characterized in that, Includes the following steps: S1: Obtain the initial state of the problem to be solved. Target determination conditions and set of state transition operators The set of state transition operators mentioned above At least some of the state transition operators used for width-first expansion are single-step reversible state transition operators; S2: Construct a hierarchical queue structure for breadth-first search and initialize a three-layer state sliding window, which includes at least the current extended layer state set. Previous layer state set and the first two state sets ; S3: From the current extension layer state set Take out the states to be expanded one by one. Apply a state transition operator to the state to be expanded. Generate candidate states ; S4: Regarding the candidate state Only in the three-layer state sliding window Internally, perform historical repetition determination and check the next layer state set being constructed. Perform set-based insertion or state-encoded unique insertion; when the candidate state It already exists within the three-layer state sliding window, or in the next layer state set. If a state already exists in the set, it is considered a duplicate state; if the determination result is that the state is not a duplicate, the candidate state is added to the next layer of the state set. ; S5: In the candidate state Added to the next level state set Then, if the candidate state If the target determination condition is met, output the corresponding search path or the shortest level result; if the current extended layer state set If all states in the three-layer state sliding window have been expanded and no results have been output, then the three-layer state sliding window will be updated to... And continue to execute the next layer search; wherein, in the breadth-first search hierarchy formed by the single-step reversible state transition operator, the current extended layer state set The successor state of any state in the process does not belong to the set of historical states before the three-layer state sliding window, thereby reducing the dependence on the global set of visited states.

2. The method according to claim 1, characterized in that, In step S1, the single-step reversible state transition operator satisfies: for any state Calculator Transition to state Then, there exists an inverse operator. , so that: , in, For state transition functions, and the operator and the inverse operator Each corresponds to a search level step size in a breadth-first search.

3. The method according to claim 1, characterized in that, The repeatability determination in step S4 adopts the following rules: in, For the next layer of state set that is being built, This indicates that the candidate state is a repeated state. This indicates that the candidate state is a state to be retained.

4. The method according to claim 1, characterized in that, In step S5, in the current extension layer state set After all expansions are completed, the set of historical states before the three-layer state sliding window is discarded. Under the conditions of single-step reversible state transition, width-first layer-by-layer expansion, and unique insertion of the next layer state set, the repetition determination of the three-layer state sliding window can achieve the same historical duplication exclusion effect on the set of historical states before the three-layer state sliding window as the globally visited state set, without changing the completeness of the width-first search for the reachable target state, and maintaining the shortest level corresponding to the first arrival at the target state.

5. An electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, characterized in that, When the computer program is executed by the processor, it implements the method according to any one of claims 1 to 6.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1 to 6.