Right-angle steiner tree construction method and system considering obstacle avoidance
Patent Information
- Application Number
- CN202311409886.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-27
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2043-10-27
AI Technical Summary
[0007]然而,现有的基于强化学习的RSMT问题解法,无法规避给定障碍物的情况
Smart Images

Figure CN117390449B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence, machine learning, and reinforcement learning, and in particular to a method and system for constructing a right-angle Steiner tree that takes obstacle avoidance into account. Background Technology
[0002] like Figure 1 As shown, the Rectilinear Steiner Minimum Tree (RSMT) problem is to find a tree, given a set of points and a grid graph, such that the tree connects all the given points, all edges of the tree are along the horizontal or vertical direction of the grid graph, and the total length of the tree is minimized.
[0003] RSMT (Robotic Resource Management) is an important problem in combinatorial optimization and a typical NP-hard problem, widely used in chip routing, path planning, and other scenarios. With the development of artificial intelligence, recent works have employed reinforcement learning and other AI algorithms to solve RSMT, achieving better efficiency than the traditional GeoSteiner method. However, as its application scope continues to expand, the obstacle-avoidance RSMT problem (OARSMT) is gaining increasing attention; yet, no algorithm currently employs reinforcement learning to solve the OARSMT problem.
[0004] In Lin CW, Huang SL, Hsu KC, et al. Efficient multi-layer obstacle-avoiding rectilinear Steiner tree construction [C] / / 2007IEEE / ACM International Conference on Computer-Aided Design.IEEE, 2007:380-385, a heuristic algorithm was proposed to solve the multi-layer winding OARSMT problem. The first step is to establish a Delaunay triangulation circle and connect all the nodes; the second step is to construct a minimum spanning tree with obstacle weighting on the established Delaunay triangulation circle; the third step is to right-angle the tree and correct the bus length using three-dimensional U-shaped line segments.
[0005] In Liu J, Chen G, Young EF Y. Rest: Constructing rectilinear steiner minimum tree via reinforcement learning [C] / / 2021 58th ACM / IEEE Design Automation Conference (DAC). IEEE, 2021:1135-1140, a reinforcement learning algorithm for solving the RSMT problem was proposed. It learns the rectilinear edge sequence (RES) of the RSMT problem through an Actor-Critic network, and can achieve higher efficiency than GeoSteiner while ensuring smaller loss.
[0006] like Figure 2 As shown, the existing work "Rest: Constructing rectilinear Steiner minimumtree via reinforcement learning" (REST) includes an Actor network and a Critic network. The Actor network is an autoencoder used to encode and decode a point set V into a RES, denoted as res. The Critic network is used to predict the optimal total length b(V) of the RSMT for the point set V. By minimizing the expected increment of the total length L(V, res) of the Actor network output res relative to b(V), and minimizing the difference between the total length b(V) predicted by the Critic network and the actual total length of the RSMT output by the Actor network, the Actor network and the Critic network converge, completing the training. The RES output by the trained Actor network given new sample points is the desired result. Concatenating these RES in sequence yields the final RSMT.
[0007] However, existing reinforcement learning-based solutions to the RSMT problem cannot avoid situations where there are given obstacles. Summary of the Invention
[0008] To address the aforementioned shortcomings, this invention proposes a right-angle Steiner tree construction method based on reinforcement learning that considers obstacle avoidance. The key idea of this invention is to add auxiliary points around the obstacle, so that the right-angled side that would normally cross the obstacle can turn through these auxiliary points to avoid the obstacle.
[0009] To achieve the above objectives, the technical solution of this invention provides a method for constructing a right-angle Steiner tree considering obstacle avoidance, comprising the following steps: S1: Randomly generate a training set, where each sample in the training set contains a point set V and an obstacle quad set T; S2: Add auxiliary points to each sample and add the auxiliary points to the corresponding point set V to form a new point set V′; S3: Construct an Actor-Critic network, where the input of the Actor network is the point set V′ and the output is the right-angle side sequence res, and the input of the Critic network is the point set V′ and the output is the total length b(V) of the predicted RSMT; S4: Train the Actor-Critic network by setting an optimization objective until convergence; S5: Given a new sample, which also contains a point set V and an obstacle quad set T, obtain a new point set V′ with added auxiliary points according to step S2 above, and input V′ into the trained Actor-Critic network to obtain RES; S6: Traverse the 8 transformations of RES to obtain the optimal RES.
[0010] Further, in step S1, the point set obstacle quadruple set Among them, (ldx i ldy i rux i ruy i ) indicates the coordinates of the lower left corner (ldx) i ldy i ) and the coordinates of the upper right corner (rux) i ruy i The rectangular region defined by ) where n represents the number of points contained in the point set and m represents the number of obstacle rectangular blocks.
[0011] Furthermore, auxiliary points are added as follows: for each point (x i y i Draw straight lines along the x-axis and y-axis respectively. If the straight lines pass through obstacles, make auxiliary points at the contact points.
[0012] Furthermore, the optimization objectives include:
[0013] (1) Minimize the res output of the Actor network res The expected increment of the total length L(V′, res) relative to b(v) ∑ r∈R (b(V′)-L(V′,r))p θ (r|V′), where θ is the training parameters of the Actor network, and R is the set of all valid RES;
[0014] (2) Minimize the difference between the total length b(v) predicted by the Critic network and the actual total length of RSMT output by the Actor network. Where ψ is the parameter of the Critic network, and B is the number of sampled RES; and
[0015] The two objectives mentioned above are optimized using gradient descent.
[0016] Furthermore, in step S6, the eight transformations include: rotating the point set by 0 degrees, 90 degrees, 180 degrees, and 270 degrees, as well as whether to swap the x and y coordinates; and in step S6, the tree with the shortest total length among the eight transformations that does not intersect with the obstacle is selected as the final RSMT solution.
[0017] The technical solution of this invention also provides a right-angle Steiner tree construction system considering obstacle avoidance, which includes the following modules: a training set generation module, used to randomly generate a training set, wherein each sample in the training set contains a point set V and an obstacle quadruple set T; an auxiliary point addition module, used to add auxiliary points to each sample and add the auxiliary points to the corresponding point set V to form a new point set V′; and an Actor-Critic network construction module, used to construct an Actor-Critic network, wherein the input of the Actor network is the point set V′, and the output is the right-angle side sequence res, and the output of the Critic network is... The input is a point set V′, and the output is the total length b(V) of the predicted RSMT. The Actor-Critic network training module is used to train the Actor-Critic network until convergence by setting an optimization objective. The new sample point set generation module is used to generate a new sample, which also contains a point set V and an obstacle quadruple set T, and then obtain a new point set V′ with auxiliary points added according to the above step S2. V′ is input into the trained Actor-Critic network to obtain RES. The optimal RES acquisition module is used to traverse the 8 transformations of RES to obtain the optimal RES.
[0018] Furthermore, in the training set generation module, the point set obstacle quadruple set Among them, (ldx i ldy i rux i ruy i ) indicates the coordinates of the lower left corner (ldx) i ldy i ) and the coordinates of the upper right corner (rux) i ruy i The rectangular region defined by ) where n represents the number of points contained in the point set and m represents the number of obstacle rectangular blocks.
[0019] Furthermore, the auxiliary point adding module adds auxiliary points in the following manner: for each point (x i y i Draw straight lines along the x-axis and y-axis respectively. If the straight lines pass through obstacles, make auxiliary points at the contact points.
[0020] Furthermore, in the Actor-Critic network training module, the optimization objectives include:
[0021] (1) Minimize the res output of the Actor network res The expected increment of the total length L(V′, res) relative to b(v) ∑ r∈R (b(V′)-L(V′,r))p θ (r|V′), where θ is the training parameters of the Actor network, and R is the set of all valid RES;
[0022] (2) Minimize the difference between the total length b(v) predicted by the Critic network and the actual total length of RSMT output by the Actor network. Where ψ is the parameter of the Critic network, and B is the number of sampled RES; and
[0023] The Actor-Critic network training module optimizes the two objectives mentioned above using gradient descent.
[0024] Furthermore, in the optimal RES acquisition module, the 8 transformations include: rotating the point set to 0 degrees, 90 degrees, 180 degrees, and 270 degrees, as well as whether to swap the x and y coordinates; and the optimal RES acquisition module selects the tree with the shortest total length among the 8 transformations that has no intersection with the obstacle as the final RSMT solution. Attached Figure Description
[0025] Figure 1 This is a diagram illustrating the RSMT problem;
[0026] Figure 2 This is a REST diagram;
[0027] Figure 3 This is a flowchart illustrating the method of the present invention;
[0028] Figure 4 This is a schematic diagram of an embodiment of the present invention;
[0029] Figure 5 (a) and (b) are schematic diagrams of the solutions to the RSMT problem without obstacle avoidance and the RSMT problem with obstacle avoidance in this invention, respectively. Detailed Implementation
[0030] The technical solution of the present invention will be further described below with reference to specific embodiments, but the present invention is not limited to these embodiments.
[0031] In an embodiment of the present invention, a method for constructing a right-angle Steiner tree considering obstacle avoidance includes the following steps: S1: Randomly generate a training set, where each sample in the training set contains a point set V and an obstacle quad set T; S2: Add auxiliary points to each sample and add the auxiliary points to the corresponding point set V to form a new point set V′; S3: Construct an Actor-Critic network, where the input of the Actor network is the point set V′ and the output is the right-angle side sequence res, and the input of the Critic network is the point set V′ and the output is the total length b(V) of the predicted RSMT; S4: Train the Actor-Critic network by setting an optimization objective until convergence; S5: Given a new sample, which also contains a point set V and an obstacle quad set T, obtain a new point set V′ with added auxiliary points according to step S2 above, and input V′ into the trained Actor-Critic network to obtain RES; S6: Traverse the 8 transformations of RES to obtain the optimal RES.
[0032] Further, in step S1, the point set obstacle quadruple set Among them, (ldx i ldy i rux i ruy i ) indicates the coordinates of the lower left corner (ldx) i ldy i ) and the coordinates of the upper right corner (rux) i ruy i The rectangular region defined by ) where n represents the number of points contained in the point set and m represents the number of obstacle rectangular blocks.
[0033] Furthermore, auxiliary points are added as follows: for each point (x i y i Draw straight lines along the x-axis and y-axis respectively. If the straight lines pass through obstacles, make auxiliary points at the contact points.
[0034] Furthermore, the optimization objectives include:
[0035] (1) Minimize the res output of the Actor network res The expected increment of the total length L(V′, res) relative to b(v) ∑ r∈R (b(V′)-L(V′,r))p θ (r|V′), where θ is the training parameters of the Actor network, and R is the set of all valid RES;
[0036] (2) Minimize the difference between the total length b(v) predicted by the Critic network and the actual total length of RSMT output by the Actor network. Where ψ is the parameter of the Critic network, and B is the number of sampled RES; and
[0037] The two objectives mentioned above are optimized using gradient descent.
[0038] Furthermore, in step S6, the eight transformations include: rotating the point set by 0 degrees, 90 degrees, 180 degrees, and 270 degrees, as well as whether to swap the x and y coordinates; and in step S6, the tree with the shortest total length among the eight transformations that does not intersect with the obstacle is selected as the final RSMT solution.
[0039] In other embodiments of the present invention, a right-angle Steiner tree construction system considering obstacle avoidance is also provided, comprising the following modules: a training set generation module for randomly generating a training set, wherein each sample in the training set contains a point set V and an obstacle quadruple set T; an auxiliary point addition module for adding auxiliary points to each sample and adding the auxiliary points to the corresponding point set V to form a new point set V′; and an Actor-Critic network construction module for constructing an Actor-Critic network, wherein the input of the Actor network is the point set V′, the output is the right-angle side sequence res, and the output of the Critic network is the right-angle side sequence res. The network takes a point set V′ as input and outputs the total length b(V) of the predicted RSMT. The Actor-Critic network training module trains the Actor-Critic network until convergence by setting an optimization objective. The new sample point set generation module generates a new sample, which also contains a point set V and an obstacle quadruple set T. Then, following step S2 above, a new point set V′ with auxiliary points is obtained. V′ is input into the trained Actor-Critic network to obtain RES. The optimal RES acquisition module iterates through the eight transformations of RES to obtain the optimal RES.
[0040] Furthermore, in the training set generation module, the point set obstacle quadruple set Among them, (ldx i ldy i rux i ruy i ) indicates the coordinates of the lower left corner (ldx) i ldy i ) and the coordinates of the upper right corner (rux) i ruy i The rectangular region defined by ) where n represents the number of points contained in the point set and m represents the number of obstacle rectangular blocks.
[0041] Furthermore, the auxiliary point adding module adds auxiliary points in the following manner: for each point (x i y i Draw straight lines along the x-axis and y-axis respectively. If the straight lines pass through obstacles, make auxiliary points at the contact points.
[0042] Furthermore, in the Actor-Critic network training module, the optimization objectives include:
[0043] (1) Minimize the res output of the Actor network res The expected increment of the total length L(V′, res) relative to b(v) ∑ r∈R (b(V′)-L(V′,r))p θ (r|V′), where θ is the training parameters of the Actor network, and R is the set of all valid RES;
[0044] (2) Minimize the difference between the total length b(v) predicted by the Critic network and the actual total length of RSMT output by the Actor network. Where ψ is the parameter of the Critic network, and B is the number of sampled RES; and
[0045] The Actor-Critic network training module optimizes the two objectives mentioned above using gradient descent.
[0046] Furthermore, in the optimal RES acquisition module, the 8 transformations include: rotating the point set to 0 degrees, 90 degrees, 180 degrees, and 270 degrees, as well as whether to swap the x and y coordinates; and the optimal RES acquisition module selects the tree with the shortest total length among the 8 transformations that has no intersection with the obstacle as the final RSMT solution.
[0047] like Figure 3 As shown, the key idea of this invention is to add auxiliary points around the obstacle, allowing the vehicle to turn through these auxiliary points instead of crossing the right-angled side of the obstacle, thereby avoiding the obstacle. The specific solution is as follows:
[0048] (1) Randomly generate a training set, where each sample in the training set contains a point set. obstacle quadruple set Among them, (ldx i ldy i rux i ruy i ) indicates the coordinates of the lower left corner (ldx) i ldy i ) and the coordinates of the upper right corner (rux) i ruy iThe rectangular region defined by ) where n represents the number of points contained in the point set and m represents the number of obstacle rectangular blocks.
[0049] (2) Add auxiliary points for each sample. The auxiliary points are added as follows: For each point (x i y i Draw straight lines along the x-axis and y-axis respectively. If the straight lines pass through obstacles, make auxiliary points at the contact points.
[0050] (3) Add auxiliary points to point set V to form a new point set V′.
[0051] (4) Construct an Actor-Critic network, where the input of the Actor network is the point set V′, and the output is the sequence of right-angled sides res. The input of the Critic network is the point set V′, and the output is the total length b(V) of the RSMT it predicts. The optimization objective includes two aspects: first, minimizing the expected increment ∑ of the total length L(V′, res) of the Actor network output L(V′, res) relative to b(v). r∈R (b(V′)-L(V′,r))p θ (r|V′), where θ are the training parameters of the Actor network, and R is the set of all valid RES. Secondly, minimize the difference between the total length b(V) predicted by the Critic network and the actual total length of the RSMT output by the Actor network. Where ψ is the parameter of the Critic network, and B is the number of sampled RES.
[0052] (5) Optimize the two objectives mentioned above using the gradient descent method until convergence.
[0053] (6) Given a new sample, which also contains a set of points and obstacle quadruple set Following steps (2) and (3) above, a new point set V′ with auxiliary points is obtained. Input V′ into the trained Actor network to obtain RES.
[0054] (7) Consider the eight transformations of RES, namely rotating the point set by 0, 90, 180 and 270 degrees, and whether to swap the x and y coordinates. We select the tree with the shortest total length among the eight transformations that has no intersection with the obstacles as the final solution of RSMT.
[0055] In a specific embodiment, the Actor network employs an autoencoder, and the Critic network employs an encoder with the same structure as the Actor network but different parameters, which is then connected to a multilayer perceptron. The optimization method used is stochastic gradient descent.
[0056] like Figure 4 As shown, the sample contains four initial points and several obstacle regions. Figure 5 As shown in (a), the solution to RSMT implemented using the REST method will cross the obstacle region; as Figure 5 As shown in (b), by adding auxiliary points, the obstacle area can be bypassed, thus solving the OARSMT problem.
[0057] In solving the RSMT problem, this invention enables the RES to bypass obstacles by adding auxiliary points, thus achieving the construction of an obstacle-avoiding RSMT.
[0058] The above description is merely a preferred embodiment of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the inventive concept of the present invention, and these all fall within the protection scope of the present invention. For example, the Actor-Critic network in the present invention can be replaced with other reinforcement learning algorithms such as DDPG, SAC, and PPO; the optimization method can be different from gradient descent, using algorithms such as Adam; furthermore, other similar methods can be used to add auxiliary points. It is understood that all of the above modifications fall within the protection scope of the present invention.
Claims
1. A method for constructing a right-angle Steiner tree considering obstacle avoidance, characterized in that, The steps include the following: S1: Randomly generate a training set, where each sample in the training set contains a set of points. V and obstacle quadruple set T ; S2: Add auxiliary points to each sample and add the auxiliary points to the corresponding point set. V To form a new point set V' ; S3: Construct an Actor-Critic network, where the input to the Actor network is a set of points. V' The output is a sequence of right-angled sides. RES The input to the Critic network is a set of points. V' The output is the total length of the RSMT it predicts. b(V) ; S4: Train the Actor-Critic network until it converges by setting an optimization objective; S5: Given a new sample, which also contains a point set Ṽ and an obstacle quad set T̃, then follow step S2 to obtain a new point set Ṽ' with auxiliary points added. Input Ṽ' into the trained Actor-Critic network to obtain RES; S6: Iterate through the 8 transformations of RES to obtain the optimal RES; In step S1, the point set obstacle quadruple set ,in, Indicates the coordinates of the lower left corner and the coordinates of the upper right corner The defined rectangular region, where n represents the number of points contained in the point set, and m represents the number of obstacle rectangular blocks; In step S4, the optimization objectives include: (1) Minimize the output of the Actor network RES Total length L(V', RES) Compared to b(v) Expected increment ,in, θ These are the training parameters of the Actor network. R The set of all valid RES; (2) Minimize the total length of the Critic network prediction. b(v) Difference between the actual total length of RSMT output by the Actor network and the actual total length of RSMT ,in, Here, B represents the parameters of the Critic network, and B is the number of sampled RES. The gradient descent method is used to optimize the two objectives mentioned above.
2. The method according to claim 1, characterized in that, In step S2, auxiliary points are added as follows: for each point ( x i , y i Draw straight lines along the x-axis and y-axis respectively. If the straight lines pass through obstacles, make auxiliary points at the contact points.
3. The method according to claim 1, characterized in that, In step S6, the eight transformations include: rotating the point set by 0 degrees, 90 degrees, 180 degrees, and 270 degrees, and whether to swap the x and y coordinates; and In step S6, the tree with the shortest total length among the eight transformations that does not intersect with the obstacles is selected as the final RSMT solution.
4. A right-angle Steiner tree construction system considering obstacle avoidance, characterized in that, Includes the following modules: The training set generation module is used to randomly generate training sets, where each sample contains a set of points. V and obstacle quadruple set T ; The auxiliary point addition module is used to add auxiliary points to each sample and add the auxiliary points to the corresponding point set. V To form a new point set V' ; The Actor-Critic network building module is used to construct Actor-Critic networks, where the input to the Actor network is a set of points. V' The output is a sequence of right-angled sides. RES The input to the Critic network is a set of points. V' The output is the total length of the RSMT it predicts. b(V) ; The Actor-Critic network training module is used to train the Actor-Critic network until it converges by setting an optimization objective. The new sample point set generation module is used to generate a new sample, which also contains a point set Ṽ and an obstacle quad set T̃. Then, according to the auxiliary point addition module, a new point set Ṽ' with auxiliary points is obtained. Ṽ' is input into the trained Actor-Critic network to obtain RES. The optimal RES acquisition module is used to traverse the 8 transformations of RES to obtain the optimal RES; In the training set generation module, point sets obstacle quadruple set ,in, Indicates the coordinates of the lower left corner and the coordinates of the upper right corner The defined rectangular region, where n represents the number of points contained in the point set, and m represents the number of obstacle rectangular blocks; In the Actor-Critic network training module, the optimization objectives include: (1) Minimize the output of the Actor network RES Total length L(V', RES) Compared to b(v) Expected increment ,in, θ These are the training parameters of the Actor network. R The set of all valid RES; (2) Minimize the total length of the Critic network prediction. b(v) Difference between the actual total length of RSMT output by the Actor network and the actual total length of RSMT ,in, Here, B represents the parameters of the Critic network, and B is the number of sampled RES. The Actor-Critic network training module optimizes the two objectives mentioned above using gradient descent.
5. The system according to claim 4, characterized in that, The auxiliary point addition module adds auxiliary points as follows: For each point ( x i , y i Draw straight lines along the x-axis and y-axis respectively. If the straight lines pass through obstacles, make auxiliary points at the contact points.
6. The system according to claim 4, characterized in that, In the optimal RES acquisition module, the 8 transformations include: rotating the point set by 0 degrees, 90 degrees, 180 degrees and 270 degrees, and whether to swap the x and y coordinates; and the optimal RES acquisition module selects the tree with the shortest total length that has no intersection with the obstacle among the 8 transformations as the final RSMT solution.