Steiner tree construction method and apparatus based on undirected adjacent edge-weighted connected graph
By initializing and updating path information in the undirected adjacent edge-weighted connectivity graph, and generating a Steiner tree in combination with equal weighting, the problem of low construction accuracy in the existing technology is solved, and a more efficient and accurate Steiner tree construction is achieved.
Patent Information
- Application Number
- PCT/CN2024/094929
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-05-24
- Filing Date
- 2024-05-23
- Publication Date
- 2024-11-28
Smart Images

Figure CN2024094929_28112024_PF_FP_ABST
Abstract
Description
Steiner tree construction method and device based on undirected adjacent edge weighted connected graph
[0001] This application claims priority to the Chinese patent application number 202310594105.3 filed on May 24, 2023, entitled “Method and device for constructing a Steiner tree based on a weighted connected graph with undirected adjacent edges”. All contents of the patent are incorporated herein. Technical Field
[0002] This article relates to the field of path optimization, and in particular to a method and device for constructing a Steiner tree based on an undirected adjacency edge weighted connected graph. Background Art
[0003] For an undirected weighted connected graph G = (V, E) with edge cost c1: and a group The Steiner tree problem of a graph is to find a tree containing all the nodes in T. Minimizing c1(E(S)) is one of the most studied problems in combinatorial optimization.
[0004] In the prior art, Steiner trees based on undirected weighted connected graphs of adjacent edges are constructed based on the principle of local optimality. For example, a method based on a minimum spanning tree (MST) is used. The main steps of this method include: (1) constructing a minimum spanning tree (MST) for an iteration starting point set (T); (2) adding Steiner nodes to the iteration starting point set and reconstructing the MST for the expanded iteration starting point set to obtain a minimum spanning tree with a smaller c1(E(MST)). This method of constructing a Steiner tree based on the principle of local optimality lacks a mechanism for optimizing the combination of adjacent edges between paths, resulting in a problem of low Steiner tree construction accuracy.
[0005] For an undirected node-weighted connected graph G = (V, E), node cost c2: and a group The node-weighted Steiner tree (NWST) problem is to find a tree containing all the nodes in T. Minimizing c2(V(S)) is an extension of the standard Steiner tree problem.
[0006] In the prior art, a Steiner tree based on an undirected weighted connected graph of nodes is constructed based on a heuristic algorithm. A step of constructing a Steiner tree based on a heuristic algorithm includes: (1) obtaining an undirected weighted connected graph of nodes; (2) initializing each iteration starting point (terminal node, node in T) to a value; (3) increasing the value of the iteration starting point (node in T) by a given amount until the value reaches a sufficient amount to obtain at least one non-iterative starting point, which is connected to at least two iteration starting points based on the weight of at least one non-terminal node (the sum of the values of at least two iteration starting points is greater than or equal to the sum of the weights of at least one non-iterative starting point that connects them); (4) connecting at least two iteration starting points that meet the above conditions and at least one non-iterative starting point that connects them to form a connected component; (5) judging whether all terminal nodes are connected; if not, treating the found connected component as a super iterative starting point and jumping to (2) to continue the next iteration; if so, deleting any redundant nodes from the obtained non-terminal nodes and returning to the constructed Steiner tree. The method of constructing the Steiner tree based on the undirected node-weighted connected graph also lacks a combination optimization mechanism for adjacent edges between paths, and cannot handle the situation when the connection method of the nodes affects the node weight.
[0007] Summary of the Invention
[0008] This paper aims to solve the problem that the existing Steiner tree construction methods based on undirected adjacency edge weighted connected graphs and undirected node weighted connected graphs lack an optimization mechanism for the combination of adjacent edges between paths, resulting in low Steiner tree construction accuracy.
[0009] In order to solve the above technical problems, in one embodiment of the present invention, a method for constructing a Steiner tree based on an undirected adjacency edge weighted connected graph is provided, comprising:
[0010] S1, obtain the undirected weighted connected graph of adjacent edges and the iteration starting point of the optimization target in the target business scenario; initialize the shortest path information of the iteration starting point, the cumulative moving step length, the cumulative diffusion weight of the iteration starting point associated with itself and the iteration starting point associated with the iteration starting point, and the shortest path information of the node including the predecessor node and the shortest path length, to determine the shortest path;
[0011] S2. For the adjacent edge on the currently determined subgraph and the shortest path, if an iteration starting point associated with its end node does not pass through the adjacent edge, determine diffusion information; the diffusion information includes: the diffusing node, the diffused node, and the to-be-diffused iteration starting point, where the to-be-diffused iteration starting point belongs to the iteration starting point associated with the diffusing node but has not diffused to the diffused node through the adjacent edge; the subgraph contains multiple paths connecting different iteration starting points;
[0012] Determine the static diffusion weight of the starting point of the to-be-diffused iteration from the diffusion node to the diffused node according to the optimization target, diffusion information and the cumulative diffusion weight of the to-be-diffused iteration starting point;
[0013] S3, taking the node with the unprocessed adjacent edge in the currently determined shortest path as the pathfinding node, and determining the static movement weight of the unprocessed adjacent edge of the pathfinding node according to the optimization target, the iteration starting point associated with the two end nodes of the unprocessed adjacent edge of the pathfinding node, and the shortest path length of the end node associated with the iteration starting point;
[0014] S4, screening out the unprocessed adjacent edge with the minimum static movement weight as the target adjacent edge, and the diffusion node with the minimum static diffusion weight as the target diffusion node; determining whether the minimum static movement weight is less than the minimum static diffusion weight, if so, executing steps S5 and S7, if not, executing steps S6 and S7;
[0015] S5, updating the cumulative moving step length to the minimum static moving weight, setting each target adjacent edge as processed in turn, updating the pathfinding node and its shortest path information and the static moving weight of the unprocessed adjacent edge based on each target adjacent edge, updating the diffusion information and static diffusion weight, determining the path connecting different iteration starting points and adding it to the subgraph;
[0016] S6, sequentially diffuse the to-be-diffused iteration starting point of the target diffusion node to the relevant diffused nodes. If the diffused node is not associated with the to-be-diffused iteration starting point, associate the to-be-diffused iteration starting point with it, determine the number of adjacent edge diffusion iteration starting points, update the cumulative diffusion weight of the newly associated iteration starting point of the relevant diffused node to the minimum static diffusion weight, and update the diffusion information, static diffusion weight, and static movement weight.
[0017] S7, determine whether all iteration starting points are connected together, if not, jump to step S4, if so, repeat step S6 until the cumulative moving step length is less than the minimum static diffusion weight;
[0018] S8, using the weights of the adjacent edges in the subgraph and the number of diffusion iteration starting points, determine the average weights of the adjacent edges, and generate a Steiner tree based on the average weights of the subgraph and the adjacent edges.
[0019] In another embodiment of the present invention, a Steiner tree construction device based on an undirected adjacency edge weighted connected graph is provided, comprising:
[0020] An initialization unit is used to obtain an undirected weighted connected graph of adjacent edges and an iteration starting point for the optimization target in the target business scenario; initialize the shortest path information of the iteration starting point, the cumulative moving step length, the cumulative diffusion weight of the iteration starting point associated with itself and the iteration starting point associated with the iteration starting point, and the shortest path information of the node, including the predecessor node and the shortest path length, for determining the shortest path;
[0021] A diffusion information determination unit is configured to determine diffusion information for an adjacent edge on a currently determined subgraph and a shortest path, if an iteration starting point associated with an end node thereof does not pass through the adjacent edge; the diffusion information includes: a diffusing node, a diffused node, and an iteration starting point to be diffused, wherein the iteration starting point to be diffused belongs to an iteration starting point associated with the diffusing node but has not diffused to the diffused node through the adjacent edge; the subgraph contains multiple paths connecting different iteration starting points;
[0022] Determine the static diffusion weight of the starting point of the to-be-diffused iteration from the diffusion node to the diffused node according to the optimization target, diffusion information and the cumulative diffusion weight of the to-be-diffused iteration starting point;
[0023] a pathfinding information determining unit, configured to use a node with an unprocessed adjacent edge in a currently determined shortest path as a pathfinding node, and determine a static movement weight of the unprocessed adjacent edge of the pathfinding node based on an optimization objective, an iteration starting point associated with both end nodes of the unprocessed adjacent edge of the pathfinding node, and a shortest path length of an end node associated with the iteration starting point;
[0024] The first judgment unit is used to select the unprocessed adjacent edge with the minimum static movement weight as the target adjacent edge and the diffusion node with the minimum static diffusion weight as the target diffusion node; determine whether the minimum static movement weight is less than the minimum static diffusion weight, and if so, the path optimization unit executes the operation; if not, the diffusion processing unit executes the operation;
[0025] The path optimization unit is used to update the cumulative moving step length to the minimum static moving weight, set each target adjacent edge as processed in turn, update the pathfinding node and its shortest path information and the static moving weight of the unprocessed adjacent edge according to each target adjacent edge, update the diffusion information and static diffusion weight, determine the path connecting different iteration starting points and add it to the subgraph;
[0026] a diffusion processing unit, configured to sequentially diffuse the to-be-diffused iteration starting point of the target diffusion node to the relevant diffused nodes; if the diffused node is not associated with the to-be-diffused iteration starting point, associate the to-be-diffused iteration starting point with it; determine the number of adjacent edge diffusion iteration starting points; update the cumulative diffusion weight of the newly associated iteration starting point of the relevant diffused node to the minimum static diffusion weight; and update the diffusion information, static diffusion weight, and static movement weight;
[0027] The second judgment unit is used to judge whether all the iteration starting points are connected together. If not, the first judgment unit continues to execute. If so, the diffusion processing unit continues to execute until the cumulative moving step size is less than the minimum static diffusion weight;
[0028] The Steiner tree generation unit is used to determine the average weight of the adjacent edges by using the weights of the adjacent edges in the subgraph and the number of diffusion iteration starting points, and generate a Steiner tree according to the average weights of the subgraph and the adjacent edges.
[0029] In another embodiment of the present invention, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in any of the aforementioned examples when executing the computer program.
[0030] In another embodiment of the present invention, a computer storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor of a computer device, the method described in any of the above embodiments is implemented.
[0031] The Steiner tree construction method and device based on an undirected adjacent edge weighted connected graph provided in this article, after determining that all iteration starting points are connected together, continue to diffuse the iteration starting points, taking into account the problem of adjacent edge combination optimization, and can avoid discarding the more optimal path of the combination optimization. Moreover, by combining the diffusion of iteration starting points and path optimization, it is possible to quickly determine the number of paths (i.e., subgraphs) containing more connections between different iteration starting points and the number of adjacent edge diffusion iteration starting points in the subgraph. Based on the number of adjacent edge diffusion iteration starting points, the average weight of each adjacent edge diffusion iteration starting point is determined, and a Steiner tree is generated based on the average weight of the subgraph and adjacent edges, which can improve the efficiency and accuracy of Steiner tree construction.
[0032] In order to make the above and other purposes, features and advantages of this article more obvious and easy to understand, the following specifically cites preferred embodiments and provides detailed descriptions in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the embodiments of this article or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of this article. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0034] FIG1 shows a flow chart of a method for constructing a Steiner tree based on an undirected adjacent edge weighted connected graph according to an embodiment of the present invention;
[0035] FIG2 is a schematic diagram showing another unprocessed adjacent edge according to an embodiment of this invention;
[0036] FIG3A shows a schematic diagram of an undirected mixed weighted connected graph according to an embodiment of the present invention;
[0037] FIG3B shows a schematic diagram of an undirected weighted connected graph of adjacent edges according to an embodiment of the present invention;
[0038] FIG4 shows a flow chart of the path optimization process according to an embodiment of the present invention;
[0039] FIG5 shows a flow chart of a Steiner tree construction process according to an embodiment of the present invention;
[0040] FIG6 shows a flowchart of a Steiner tree construction process for multiple optimization objectives according to an embodiment of the present invention;
[0041] FIG7 shows a structural diagram of a Steiner tree construction device based on an undirected adjacent edge weighted connected graph according to an embodiment of the present invention;
[0042] FIG8A shows a schematic diagram of an undirected weighted connected graph of adjacent edges according to a specific embodiment of the present invention;
[0043] FIG8B and FIG8C are schematic diagrams showing Steiner trees constructed under a certain value of adjacent edges in the undirected adjacent edge weighted connected graph of FIG8A;
[0044] FIG8D shows a schematic diagram of a subgraph obtained after the first iteration in the Steiner tree construction process according to an embodiment of this invention;
[0045] FIG8E shows a schematic diagram of a subgraph obtained after the second iteration in the Steiner tree construction process according to an embodiment of this invention;
[0046] FIG8F is a schematic diagram showing the final determination of a subgraph during the Steiner tree construction process according to an embodiment of this invention;
[0047] FIG8G shows a schematic diagram of a Steiner tree constructed under another value of the adjacent edges of the undirected adjacent edge weighted connected graph of FIG8A ;
[0048] FIG9 shows a structural diagram of a computer device according to an embodiment of the present invention;
[0049] 10A and 10B show schematic diagrams of construction and replacement of a local connection graph;
[0050] FIG. 10C shows an undirected weighted connected graph with adjacent edges of a specific example.
[0051] Explanation of the symbols in the accompanying drawings: 701, initialization unit; 702, diffusion information determination unit; 703, path finding information determination unit; 704, first judgment unit; 705, path optimization unit; 706, diffusion processing unit; 707, second judgment unit; 708, Steiner tree generation unit; 902, computer device; 904, processor; 906, memory; 908, driving mechanism; 910, input / output module; 912, input device; 914, output device; 916, presentation device; 918, graphical user interface; 920, network interface; 922, communication link; 924, communication bus. DETAILED DESCRIPTION
[0052] The following will be combined with the accompanying drawings to clearly and completely describe the technical solutions in the embodiments of this document. Obviously, the embodiments described are only part of the embodiments of this document, not all of the embodiments. Based on the embodiments of this document, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this document.
[0053] It should be noted that the terms "first," "second," and the like in the specification and claims herein and in the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, apparatus, product, or device comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to these processes, methods, products, or devices.
[0054] This specification provides method operation steps as described in the embodiments or flowcharts, but more or fewer operation steps may be included based on routine or non-creative work. The order of steps listed in the embodiments is only one way of executing the steps among many orderings and does not represent the only execution order. When a system or device product is actually executed, the method can be executed in the order shown in the embodiments or the drawings or in parallel.
[0055] It should be noted that the Steiner tree construction method and device based on the undirected adjacent edge weighted connected graph in this article can be used in the fields of very large-scale integrated circuit design (VLSI), telecommunications networks, medical care, and biological networks. It can also be applied to other fields involving finding paths connecting multiple nodes. This article does not limit its specific application fields.
[0056] In one embodiment of the present invention, a Steiner tree construction method based on an undirected adjacency edge weighted connected graph is provided to address the problem that the existing Steiner tree construction methods based on undirected adjacency edge weighted connected graphs and undirected node weighted connected graphs lack an optimization mechanism for combining adjacency edges between paths, resulting in low Steiner tree construction accuracy. Specifically, as shown in FIG1 , the method includes:
[0057] Step S1: Obtain an undirected weighted connected graph of adjacent edges and an iteration starting point of the optimization target in the target business scenario; initialize the shortest path information of the iteration starting point, the cumulative moving step length, the cumulative diffusion weight of the iteration starting point associated with itself and the iteration starting point associated with the iteration starting point, and the shortest path information of the node including the predecessor node and the shortest path length, for determining the shortest path;
[0058] Step S2: For the adjacent edge on the currently determined subgraph and the shortest path, if an iteration starting point associated with its end node does not pass through the adjacent edge, determine diffusion information; the diffusion information includes: the diffusing node, the diffused node, and the to-be-diffused iteration starting point, where the to-be-diffused iteration starting point belongs to the iteration starting point associated with the diffusing node but has not diffused to the diffused node through the adjacent edge; the subgraph contains multiple paths connecting different iteration starting points;
[0059] Determine the static diffusion weight of the starting point of the to-be-diffused iteration from the diffusion node to the diffused node according to the optimization target, diffusion information and the cumulative diffusion weight of the to-be-diffused iteration starting point;
[0060] Step S3, taking the node with unprocessed adjacent edges in the currently determined shortest path as the pathfinding node, and determining the static movement weight of the unprocessed adjacent edges of the pathfinding node according to the optimization target, the associated iteration starting points of the two end nodes of the unprocessed adjacent edges of the pathfinding node, and the shortest path length of the end nodes associated with the iteration starting points;
[0061] Step S4: Filter out the unprocessed adjacent edge with the minimum static movement weight as the target adjacent edge, and the diffusion node with the minimum static diffusion weight as the target diffusion node; determine whether the minimum static movement weight is less than the minimum static diffusion weight; if so, execute steps S5 and S7; if not, execute steps S6 and S7;
[0062] Step S5: Update the cumulative moving step length to the minimum static moving weight, set each target adjacent edge as processed in turn, update the pathfinding node and its shortest path information and the static moving weight of the unprocessed adjacent edge based on each target adjacent edge, update the diffusion information and static diffusion weight, determine the path connecting different iteration starting points, and add it to the subgraph;
[0063] Step S6: sequentially diffuse the iterative starting point to be diffused of the target diffusion node to the relevant diffused nodes. If the diffused node is not associated with the iterative starting point to be diffused, associate the iterative starting point to be diffused with it, determine the number of adjacent edge diffusion iterative starting points, update the cumulative diffusion weight of the newly associated iterative starting point of the relevant diffused node to the minimum static diffusion weight, and update the diffusion information, static diffusion weight, and static movement weight.
[0064] Step S7, determine whether all iteration starting points are connected together, if not, jump to step S4, if so, repeat step S6 until the cumulative moving step length is less than the minimum static diffusion weight;
[0065] Step S8: using the weights of the adjacent edges in the subgraph and the number of diffusion iteration starting points, determine the average weights of the adjacent edges, and generate a Steiner tree based on the average weights of the subgraph and the adjacent edges.
[0066] This implementation considers the issue of combinatorial optimization of adjacent edges during path optimization, avoiding discarding more optimal paths from combinatorial optimization. Furthermore, by combining iterative starting point diffusion with path optimization, it can quickly determine paths (i.e., subgraphs) that contain more connections between different iterative starting points and the number of adjacent edge diffusion iterative starting points within the subgraph. Based on the number of adjacent edge diffusion iterative starting points, the amortized weight of each adjacent edge diffusion iterative starting point is determined. A Steiner tree is generated based on the amortized weights of the subgraph and adjacent edges, improving the efficiency and accuracy of Steiner tree construction.
[0067] Specifically, in step S1, the target business scenario is determined according to the application scenario of this article. The applicable scenarios of this article include but are not limited to very large-scale integrated circuit design, telecommunication networks, phylogenetics, routing, etc.
[0068] The undirected weighted connected graph is pre-determined based on the target business scenario. The undirected weighted connected graph includes the weights of the nodes and the adjacent edges between nodes for each optimization objective.
[0069] During initialization, the cumulative movement step length is zero, the cumulative diffusion weight associated with the iteration starting point is zero, the predecessor node of the iteration starting point is empty, and the shortest path length is zero. Nodes with shortest path information are nodes in the shortest path. The cumulative movement step length represents the weighted distance traveled from the iteration starting point during the shortest path and subgraph search process. For non-iteration starting points, the cumulative diffusion weights associated with the same iteration starting point can be different for different nodes. The cumulative diffusion weight of the iteration starting point associated with any node represents the amortized weighted distance traveled by the iteration starting point to any node.
[0070] During initialization, the iteration start point associated with a non-iteration start point is empty.
[0071] The subgraph contains any path that connects at least two iteration starting points. The subgraph contains nodes and adjacent edges in some shortest paths, and also includes adjacent edges that are not part of the shortest path but can connect different iteration starting points.
[0072] In step S2, for the adjacent edge on the currently determined subgraph and the shortest path, if an iteration starting point associated with its end node does not pass through the adjacent edge, it includes the following types:
[0073] The first is that an iteration starting point associated with one end node is not associated with the other end node. For example, the iteration starting point associated with end node A is {node 1, node 2}, and the iteration starting point associated with end node B is {node 1, node 2, node 3, node 4}. Nodes 1 and 2 pass through the adjacent edge, while nodes 3 and 4 do not pass through the adjacent edge. In this case, end node B is the diffusion node, end node A is the diffused node, and the nodes to be diffused are iteration starting points 3 and 4. For node B, the iteration starting point is determined from B through the adjacent edge.<A,B> Two diffusion information diffused to A.
[0074] The second type is that an iteration starting point associated with one end node is associated with the other end node, that is, the two end nodes have the same iteration starting point, but the same iteration starting point does not pass through the adjacent edge, then the diffusion information is determined for the two end nodes.
[0075] The static diffusion weight of the diffusion node from the diffusion node to the diffused node at the starting point of the diffusion iteration can provide basic information for enhancing the combination characteristics of the optimization target.
[0076] In step S3, the static movement weight of the unprocessed adjacent edges of the pathfinding node is used to expand the search range with the minimum value, find the adjacent edges of the valuable construction tree, expand the boundary of the influence range of the next expansion iteration starting point, and provide a minimum larger search space for enhancing the combination characteristics of the optimization target.
[0077] In a specific embodiment, when the optimization objective is to minimize the sum of the weights of all adjacent edges in the Steiner tree (for example, the optimization objective is to minimize the length of the VLSI global routing line), the process of determining the static movement weight and the static diffusion weight includes:
[0078] 1) Choose one of the following two methods to calculate the static movement weight:
[0079] Method 1: Static movement weight = (the sum of the shortest path lengths of the path-finding nodes associated with the iteration starting point among the two end nodes of the unprocessed adjacent edge + the weight of the unprocessed adjacent edge) / the number of path-finding nodes associated with the iteration starting point among the two end nodes of the unprocessed adjacent edge.
[0080] Method 2:
[0081] (1) When only one of the two end nodes of an unprocessed adjacent edge is a pathfinding node, the static movement weight = the shortest path length of the pathfinding node + the weight of the unprocessed adjacent edge / the number of iteration starting points associated with the pathfinding node.
[0082] (2) As shown in Figure 2, when both end nodes of an unprocessed adjacent edge are pathfinding nodes, the static movement weight = L2 + (Lx / (K1 + K2), where x = (L2 - L1) × K1, L is the weight of the unprocessed adjacent edge; L1 is the shortest path length of one end node of the unprocessed adjacent edge, associated with K1 iteration starting points; L2 is the shortest path length of the other end node of the unprocessed adjacent edge, associated with K2 iteration starting points, and L1 < = L2.
[0083] Method 1 can find a better subgraph than method 2, and thus find a better result. Method 2 can speed up the connection of the starting point of the iteration, reduce the number of adjacent edges that need to be processed, and end the iteration as soon as possible.
[0084] In method 1, the number of pathfinding nodes associated with the iteration starting point among the two end nodes of the unprocessed adjacent edges is equal to the number of pathfinding nodes among the two end nodes of the unprocessed adjacent edges. After completing the shortest path query, calculations such as diffusion of the iteration starting point and query subgraph can be performed.
[0085] 2) Static diffusion weight = cumulative diffusion weight of the iterative starting point to be diffused + weight of the adjacent edge between the diffusing node and the diffused node / (number of iterative starting points to be diffused + number of iterative starting points that have been diffused).
[0086] When the optimization goal is to minimize the sum of the weights of the adjacent edges in the path from the preset iteration starting point to other iteration starting points (for example, when the optimization goal is to minimize the VLSI global routing delay), the process of determining the static movement weight and the static diffusion weight includes:
[0087] 1) Static movement weight = (the sum of the shortest path lengths of the pathfinding nodes associated with the iteration starting point among the two end nodes of the unprocessed adjacent edge + the weight of the unprocessed adjacent edge) / the number of pathfinding nodes associated with the iteration starting point among the two end nodes of the unprocessed adjacent edge.
[0088] 2) Static diffusion weight = cumulative diffusion weight of the starting point of the diffusion iteration + weight of the adjacent edge between the diffusion node and the diffused node.
[0089] In step S4, when the minimum static movement weight is greater than or equal to the minimum static diffusion weight, the iteration starting point is preferentially diffused within the minimum static movement weight range, so that as many iteration starting points as possible are used in the calculation of the static movement weight during pathfinding, providing a control mechanism for enhancing the combined characteristics of the optimization target.
[0090] Step S5 can realize the update of the shortest path and the subgraph. When the shortest path and the subgraph are updated, the diffusion information and the static diffusion weight can be updated by calling step S2.
[0091] In step S7, when all iteration starting points have been connected together, it indicates that a path connecting all iteration starting points has been determined. In order to avoid losing the adjacent edges of the combined optimization (i.e., the adjacent edges belonging to multiple paths), more paths that can connect all iteration starting points are determined by continuing to execute step S6. When there is no more diffusion information, the minimum static diffusion weight is regarded as infinite. The cumulative moving step length is less than the minimum static diffusion weight, indicating that the adjacent edge no longer has the possibility of diffusion of the iteration starting point, that is, the adjacent edge no longer has the possibility of being evenly distributed. Within the allowed range, the iteration starting point is fully diffused and the weight of the adjacent edge is distributed as much as possible.
[0092] In step S8, the weight of the adjacent edge in the subgraph is divided by the number of different iterative starting points diffused through the adjacent edge to obtain the weight cost required for each diffusion of an iterative starting point, that is, the average weight of the adjacent edge is obtained, and the average weight of the adjacent edge is used to replace the original weight of the adjacent edge to generate the Steiner tree.
[0093] In one embodiment of the present invention, the undirected adjacency edge weighted connectivity graph of the optimization target under the target business scenario in the above step S1 is directly obtained according to the optimization target under the target business scenario; or the undirected mixed weighted connectivity graph obtained by the optimization target under the target business scenario is converted in the following manner, wherein the undirected mixed weighted connectivity graph includes at least weighted nodes:
[0094] (1) When the weight of a weighted node is related to its adjacent edges, the number of adjacent edges of the weighted node is calculated, and the same number of interconnected nodes are inserted according to the calculated number, so that these inserted nodes are respectively connected to the adjacent edges of the weighted node; based on the weight of the weighted node, the weight of the adjacent edges between the inserted nodes is calculated.
[0095] As shown in Figures 3A and 3B, let p2 in Figure 3A be the weighted node associated with the adjacent edge, and let nodes p2,1, p2,2, and p2,3 in Figure 3B be the insertion nodes of weighted node p2. The path weights of p1, p2,1, p2,3, and p3 are the path weights of p1, p2, and p3. The path weights of p1, p2,1, p2,2, and p4 are the path weights of p1, p2, and p4. The path weights of p3, p2,3, p2,2, and p4 are the path weights of p3, p2, and p4.
[0096] (2) When the weight of a weighted node is independent of its adjacent edges, the weight of the weighted node is transferred to the adjacent edges of the weighted node. Assume that p2 in Figure 3A is a weighted node that is independent of its adjacent edges. Because all iterative starting points must appear in the constructed Steiner tree, the weight of the iterative starting point can be regarded as zero; half of the weight of the non-iterative starting point is added to all adjacent edges of the non-iterative starting point. After the transfer, the adjacent edges<p1,p2> Weight = adjacent edge before transfer<p1,p2> The weight of the node p2 + the weight of the node p2 / 2, and similarly the adjacent edge<p3,p2> and<p4,p2> By adding half of node p2 to the adjacent edge, it can be exactly equivalent to the cost of all paths passing through node p2. That is, the sum of the weights of the two adjacent edges of any path passing through node p2 is exactly equal to the node weight passing through p2 and the original weights of the two adjacent edges.
[0097] In one embodiment of the present invention, in order to include more valuable nodes and adjacent edges in the subgraph (e.g., combinatorially optimized path nodes and adjacent edges), after step S7 determines that all iteration starting points are connected together, in addition to repeatedly executing step S6, the following steps are also included:
[0098] The threshold is determined based on the current cumulative moving step length using the following formula: K0×current cumulative moving step length, where 2>=K0>=1;
[0099] Return to step S4 and execute until there are no more pathfinding nodes and diffusion nodes or the accumulated moving step length is equal to the threshold.
[0100] The subgraph determined in this embodiment contains more paths, which can improve the accuracy of constructing the subsequent comprehensive graph Steiner tree.
[0101] In one embodiment of the present invention, as shown in FIG4 , step S5 updates the pathfinding node and its shortest path information and the static movement weight of the unprocessed adjacent edges according to each target adjacent edge, updates the diffusion information and the static diffusion weight, determines the path connecting different iteration starting points, and adds it to the subgraph, including:
[0102] Step S51: If only one of the two end nodes of a target adjacent edge is a pathfinding node, determine the shortest path information containing the target adjacent edge for the other end node of the target adjacent edge, determine whether the other end node of the target adjacent edge has an unprocessed adjacent edge, and if so, use the other end node of the target adjacent edge as a pathfinding node, determine the static movement weight of the unprocessed adjacent edge of the newly added pathfinding node, and jump to step S54;
[0103] Step S52: If both end nodes of a target adjacent edge are pathfinding nodes, and if the static movement weight of the target adjacent edge is greater than the shortest path length of the end nodes of the target adjacent edge or the weight of the target adjacent edge is 0, then calculate the mutual difference of the iteration starting points associated with each end node of the target adjacent edge. If the mutual difference is not empty, then determine the path connecting different iteration starting points based on the shortest path information of the node and the target adjacent edge and add it to the subgraph, and jump to step S54;
[0104] Step S53: If both end nodes of the target adjacent edge are pathfinding nodes, and the static movement weight of the target adjacent edge is equal to the shortest path length of one end node of the target adjacent edge, then the shortest path information including the target adjacent edge is determined for the end node of the target adjacent edge, and the adjacent node on the shortest path of the end node is set as p i and p j , the corresponding associated iteration starting point set is set i and set j , calculate the iteration starting point set set i with set j If the mutual difference is not empty, the path connecting different iteration starting points is determined based on the shortest path information of the node and the target adjacent edge and added to the subgraph;
[0105] Step S54: calling step S2 to update diffusion information and static diffusion weight.
[0106] Specifically, assuming the iteration starting point sets associated with the two end nodes of the target adjacent edge are Set 1 and Set 2, respectively, the mutual difference between the iteration starting points associated with each end node of the target adjacent edge is not empty if: at least one iteration starting point in Set 1 is not in Set S2, and at least one iteration starting point in Set S2 is not in Set S1. In step S53, the mutual difference between the iteration starting point sets associated with any two adjacent nodes of the end node is examined.
[0107] In one embodiment of the present invention, step S6 of updating the diffusion information, static diffusion weight, and static movement weight includes:
[0108] If the diffused node is one of the pathfinding nodes, then call step S3 to determine the static movement weight of the unprocessed adjacent edges of the diffused node;
[0109] If the diffused node is associated with a new iteration starting point relative to its adjacent edges in the subgraph, then call step S2 to update the diffusion information and update the static diffusion weight of the diffused node to diffuse the new iteration starting point to its adjacent nodes;
[0110] If the cumulative diffusion weight of the iteration starting point t that the diffusion node previously diffused to the diffused node is greater than the cumulative diffusion weight of the node to be diffused that the diffusion node diffused to the diffused node, then the cumulative diffusion weight of the iteration starting point t that the diffusion node previously diffused to the diffused node is updated to the cumulative diffusion weight of the node to be diffused.
[0111] In one embodiment of this invention, as shown in FIG5 , step S8 generates a Steiner tree based on the amortized weights of the subgraphs and adjacent edges, including:
[0112] Step S81, delete the non-iteration starting point and the corresponding adjacent edge in the subgraph with only one adjacent edge, and determine whether there is a closed loop in the subgraph. If not, execute steps S82 and S84; if so, execute steps S83 and S84;
[0113] Step S82, using the subgraph as a Steiner tree;
[0114] Step S83, using the amortized weights of the adjacent edges in the subgraph to update the weights of the adjacent edges in the subgraph, and generating a Steiner tree based on the subgraph;
[0115] Step S84: if the undirected adjacency edge weighted connected graph is obtained from the undirected mixed weighted connected graph and the node weights are related to the connected adjacency edges, then the relevant nodes and adjacency edges in the Steiner tree are restored to weighted nodes.
[0116] When step S83 is executed, the weights of the adjacent edges in the subgraph are updated using the amortized weights of the adjacent edges in the subgraph, that is, the original weights of the adjacent edges are replaced with the amortized weights of the adjacent edges.
[0117] In step S81, if the subgraph has a closed loop, it means that there are redundant edges, and the deletion of the redundant edges does not affect the connectivity of all iteration starting points.
[0118] In one embodiment of the present invention, the step S82 of generating a Steiner graph according to the subgraph includes:
[0119] The subgraph is regenerated using the method described in the previous embodiment, and the following replacements are made during the subgraph generation process:
[0120] (1) For any optimization goal, the static movement weight of the unprocessed adjacent edge = (the sum of the shortest path lengths of the pathfinding nodes associated with the iteration starting point among the two end nodes of the unprocessed adjacent edge + the weight of the unprocessed adjacent edge) / the number of end nodes associated with the iteration starting point among the two end nodes of the unprocessed adjacent edge;
[0121] For any optimization objective, if the diffusion node and the diffused node are on the shortest path, the shortest path length of the diffusion node is less than or equal to the shortest path length of the diffused node, and the static diffusion weight = the cumulative diffusion weight of the starting point of the diffusion iteration + the weight of the adjacent edge between the diffusion node and the diffused node;
[0122] (2) In step S52, the mutual difference between the iteration starting points associated with each end node of the target adjacent edge is calculated. If the mutual difference is not empty, it is changed to: the iteration starting points associated with each end node of the target adjacent edge cannot be connected together through the path in the subgraph.
[0123] (3) In step S53, the iteration starting point set set is calculated. i with set j The mutual difference between them, if the mutual difference is not empty, changes to: the iteration starting point set i with set j The iteration starting points in cannot be connected together by paths in the subgraph.
[0124] After regenerating the subgraph, the non-iteration starting point and the corresponding adjacent edge with only one adjacent edge in the regenerated subgraph are deleted to obtain the Steiner tree.
[0125] This embodiment can quickly generate a high-quality subgraph by re-performing the subgraph search process on the equally weighted subgraph when a closed loop is found in the subgraph, without considering the problem of adjacent edge combination. The diffusion information restriction that the shortest path length of the diffusing node is less than or equal to the shortest path length of the diffused node can further reduce the number of diffusion times at the starting point of the iteration and speed up the Steiner generation.
[0126] In one embodiment of this invention, in order to further improve the efficiency of the aforementioned step of determining whether all iteration starting points are connected together, the iteration starting point associated merged set is initialized, and the iteration starting point associated merged set includes its own node.
[0127] In step S6, the to-be-diffused iteration starting point of the target diffusion node is diffused to the relevant diffused node. If the diffused node is not associated with the to-be-diffused iteration starting point, the to-be-diffused iteration starting point is associated with it, and the cumulative diffusion weight of the newly associated iteration starting point of the relevant diffused node is updated to the minimum static diffusion weight. The method further includes: merging the merged sets associated with the iteration starting points associated with the diffused node to obtain a new merged set, and associating all the iteration starting points in the new merged set with the new merged set.
[0128] Determining whether all iteration starting points are connected together includes: determining whether the merged set associated with the iteration starting point includes all iteration starting points; if so, determining that all iteration starting points are connected together.
[0129] In one embodiment of the present invention, in the above-mentioned process of regenerating the subgraph, step S7 further includes:
[0130] Determine whether some of the iteration starting points in the currently determined subgraph are connected together. If so, abstract the local connection graph consisting of the connected iteration starting points, nodes on the connection path, and adjacent edges in the currently determined subgraph into an abstract node, and establish a mapping relationship between the abstract node and the local connection graph; replace the local connection graph in the current subgraph and the undirected weighted connected graph with the abstract node, and add the abstract node as the iteration starting point, and re-execute the above steps of determining the subgraph, determining the amortized weights of the adjacent edges, and generating the Steiner tree on the undirected weighted connected graph;
[0131] If not, determine whether all iteration starting points are connected together. If so and there is an abstract node, replace the abstract node in the subgraph with its mapped local connection graph.
[0132] In detail, an abstract node indicates that in the subsequent subgraph determination process, the distance between its internal nodes is 0, and it is a cluster viewed from the outside. The abstract node is treated as an ordinary iteration starting point. After connecting a few iteration starting points at the lowest cost, the entire process is rerun, gradually reducing the number of iteration starting points and reducing the weighted distribution of errors caused by the diffusion of iteration starting points, thereby improving the quality of the generated Steiner tree.
[0133] As shown in Figure 10A, the gray nodes are iteration starting points. Nodes 12 and 13 can connect iteration starting points 1, 2, and 3 together. Then nodes 1, 2, 3, 12, 13 and adjacent edges <1, 13>, <12, 13>, <2, 12>, and <3, 12> constitute a local connection graph, which is replaced by node 21 in Figure 10B.
[0134] In one embodiment of this invention, when multiple optimization objectives are included, as shown in FIG6 , the multi-optimization objective Steiner tree construction process includes:
[0135] Step S601, determining the subgraphs of each optimization target using the method shown in the embodiment of FIG1 ;
[0136] Step S602: merging the subgraphs of each optimization target according to the importance of each optimization target to obtain a comprehensive subgraph;
[0137] The adjacent edges of the comprehensive subgraph are the union of the adjacent edges of each optimization target subgraph, and the nodes of the comprehensive subgraph are the union of the nodes of each optimization target subgraph. The weight of each adjacent edge in each subgraph of the comprehensive subgraph is determined as follows: if the adjacent edge belongs to the subgraph, then the weight of the adjacent edge in the subgraph is the average weight of the adjacent edge in the subgraph; if the adjacent edge does not belong to the subgraph, then the weight of the adjacent edge in the subgraph is the original weight of the adjacent edge in the undirected weighted connected graph of adjacent edges.
[0138] Step S603: Generate a Steiner tree based on the integrated subgraph.
[0139] In step S601 , the subgraphs of the optimization targets are subgraphs updated using the amortized weights.
[0140] The importance of the optimization target in step S602 can be set manually or predetermined. This document does not limit the method for determining the importance of each optimization target.
[0141] When implementing step S603 , reference may be made to the embodiment shown in FIG. 5 or the prior art, which is not limited herein.
[0142] In one embodiment of the present invention, the above S6 further includes: recording the minimum cumulative moving step length corresponding to when any two iteration starting points t1 and t2 are first associated with the same node;
[0143] The above S2 also includes: when the iteration starting point t2 can be along the adjacent edge<p1,p2> When spreading from node p2 to node p1, it is also necessary to determine whether the following conditions are met. If so, the iteration starting point t2 is determined along the adjacent edge<p1,p2> Diffusion information from node p2 to node p1:
[0144] The iteration starting point t1 does not pass through the adjacent edge<p1,p2> ;or
[0145] Iteration starting point t1 through adjacent edges<p1,p2> Diffusion from node p2 to node p1; or
[0146] Iteration starting point t1 through adjacent edges<p1,p2> Diffusion from node p1 to node p2 and iteration starting point t2 along the adjacent edge<p1,p2> The static diffusion weight from the node p2 to the node p1 is less than or equal to K×the minimum cumulative moving step length, where K>=2.
[0147] If the minimum cumulative moving step is not recorded, the minimum cumulative moving step corresponding to the connection between any two iteration starting points t1 and t2 defaults to infinity. This embodiment can avoid excessive diffusion requirements, improve iteration efficiency, avoid the additional overhead caused by excessive combinations of iteration starting points (when the iteration starting point diffuses, the longer the path, the more other iteration starting points it passes through, and the smaller the combination significance tends to be), increase the difference in path length between iteration starting points after amortization, and improve the accuracy of Steiner tree generation.
[0148] For example, as shown in FIG10C , in FIG10C , 9x / 5>a>3x / 2, the iteration starting points are 0, 1, 2, and the optimal tree is {{0,1,2,3},{<1,3>,<2,3>,<3,0>}}.
[0149] If the current cumulative moving step size at the end of an iteration is large enough, and if the diffusion of the iteration starting point is not restricted, the iteration starting points 0, 1, and 2 in the figure above will pass through every adjacent edge. This makes the average calculation meaningless or reduces its value, failing to effectively increase the degree of change in the adjacent edge weights after the combined average calculation and improve the quality of the Steiner tree generated.
[0150] For example, let K = 2, and iteration starting points 0 and 1 meet at node 4, and the minimum cumulative moving step recorded is a / 2. The cumulative diffusion weight of iteration starting point 0 diffusing to node 2 along the path 0-5-2 is a, which reaches the maximum value. The cumulative diffusion value of iteration starting point 1 diffusing to node 2 along the path 1-6-2 is a, which reaches the maximum value. (1) If the above conditions are not restricted, iteration starting point 0 will continue to diffuse along path 2-6, and iteration starting point 1 will continue to diffuse along path 2-5, and eventually all adjacent edges will pass through nodes 0, 1, and 2. (2) If the above conditions are restricted, generation starting point 0 can continue to diffuse along path 2-6 according to the original conditions. This path has only one adjacent edge <2,6>, and iteration starting point 1 passes through this adjacent edge. The minimum cumulative moving step of iteration starting points 0 and 1 being associated with the same node 4 for the first time is a / 2. If any of the above three restrictions are not met, generation starting point 0 cannot continue to diffuse along path 2-6, and there is no need to define related diffusion information.
[0151] In one embodiment of this invention, the above S2 further includes: if a node p1 is connected to an adjacent edge<p1,p2> If the iterative starting point of the diffusion to node p2 does not have the same iterative starting point as the other adjacent nodes of node p2 that diffuse to p2, then node p2 is used as the diffusion node, p1 is used as the diffused node, and node p2 is associated but not connected by adjacent edges.<p1,p2> The starting point of the iteration that diffuses to the node p1 is the node to be diffused.
[0152] This embodiment can reduce excessive diffusion of iteration starting points, avoid excessive combination of iteration starting points, increase the difference in path lengths between iteration starting points after amortization, and improve the accuracy of Steiner tree generation.
[0153] Based on the same inventive concept, this document also provides a Steiner tree construction device based on an undirected adjacency-weighted connected graph, as described in the following embodiments. Since the principle of solving the problem by the Steiner tree construction device based on an undirected adjacency-weighted connected graph is similar to that of the Steiner tree construction method based on an undirected adjacency-weighted connected graph, the implementation of the Steiner tree construction device based on an undirected adjacency-weighted connected graph can be referred to the Steiner tree construction method based on an undirected adjacency-weighted connected graph, and the repeated parts will not be repeated here.
[0154] Specifically, as shown in FIG7 , the Steiner tree construction device based on the undirected adjacency edge weighted connected graph includes:
[0155] Initialization unit 701 is used to obtain an undirected weighted connected graph of adjacent edges and an iteration starting point of the optimization target in the target business scenario; initialize the shortest path information of the iteration starting point, the cumulative moving step length, the cumulative diffusion weight of the iteration starting point associated with itself and the iteration starting point associated with the iteration starting point, and the shortest path information of the node including the predecessor node and the shortest path length, for determining the shortest path;
[0156] Diffusion information determination unit 702 is configured to determine diffusion information for an adjacent edge on a currently determined subgraph and a shortest path, if an iteration starting point associated with an end node thereof does not pass through the adjacent edge. Diffusion information includes: a diffusing node, a diffused node, and an iterative starting point to be diffused, where the iterative starting point to be diffused is an iteration starting point associated with the diffusing node but has not diffused to the diffused node through the adjacent edge. The subgraph may contain multiple paths connecting different iterative starting points.
[0157] Determine the static diffusion weight of the starting point of the to-be-diffused iteration from the diffusion node to the diffused node according to the optimization target, diffusion information and the cumulative diffusion weight of the to-be-diffused iteration starting point;
[0158] A pathfinding information determining unit 703 is configured to use a node with an unprocessed adjacent edge in the currently determined shortest path as a pathfinding node, and determine a static movement weight of the unprocessed adjacent edge of the pathfinding node based on an optimization objective, an associated iteration starting point of the two end nodes of the unprocessed adjacent edge of the pathfinding node, and a shortest path length of the end nodes associated with the iteration starting point.
[0159] The first judgment unit 704 is used to select the unprocessed adjacent edge with the minimum static movement weight as the target adjacent edge and the diffusion node with the minimum static diffusion weight as the target diffusion node; determine whether the minimum static movement weight is less than the minimum static diffusion weight, and if so, the path optimization unit 705 executes the operation; if not, the diffusion processing unit 706 executes the operation;
[0160] The path optimization unit 705 is used to update the cumulative moving step length to the minimum static moving weight, sequentially set each target adjacent edge as processed, update the pathfinding node and its shortest path information and the static moving weight of the unprocessed adjacent edge based on each target adjacent edge, update the diffusion information and static diffusion weight, determine the path connecting different iteration starting points, and add it to the subgraph;
[0161] The diffusion processing unit 706 is configured to sequentially diffuse the to-be-diffused iteration starting point of the target diffusion node to the associated diffused nodes. If the diffused node is not associated with the to-be-diffused iteration starting point, the to-be-diffused iteration starting point is associated with it, the number of adjacent edge diffusion iteration starting points is determined, the cumulative diffusion weight of the newly associated iteration starting point of the associated diffused node is updated to the minimum static diffusion weight, and the diffusion information, static diffusion weight, and static movement weight are updated.
[0162] The second judgment unit 707 is used to judge whether all the iteration starting points are connected together. If not, the first judgment unit continues to execute. If so, the diffusion processing unit continues to execute until the cumulative moving step size is less than the minimum static diffusion weight;
[0163] The Steiner tree generation unit 708 is configured to determine the average weights of the adjacent edges using the weights of the adjacent edges in the subgraph and the number of diffusion iteration starting points, and to generate a Steiner tree based on the average weights of the subgraph and the adjacent edges.
[0164] After determining that all iteration starting points are connected together, this embodiment continues to diffuse the iteration starting points, taking into account the problem of adjacent edge combination optimization, which can avoid discarding the more optimal path of the combination optimization. Moreover, by combining the diffusion of iteration starting points and path optimization, it is possible to quickly determine the number of paths (i.e., subgraphs) that contain more connections between different iteration starting points and the number of adjacent edge diffusion iteration starting points in the subgraph. Based on the number of adjacent edge diffusion iteration starting points, the average weight of each adjacent edge diffusion iteration starting point is determined, and a Steiner tree is generated based on the average weight of the subgraph and adjacent edges, which can improve the efficiency and accuracy of Steiner tree construction.
[0165] To more clearly illustrate the Steiner tree construction process, the following example uses the optimization objective of minimizing VLSI global routing length. Specifically, when defining static diffusion weight and static movement weight, each node-associated iteration starting point has an equal weight, significantly reducing these values. These associated iteration starting points contribute to the weights of adjacent edges, ensuring that each contributing iteration starting point contributes equally to the weights of the adjacent edges.
[0166] (1) Assuming adjacent edges<p1,p2> For the adjacent edge in the subgraph or for the adjacent edge on the determined shortest path, let the iteration starting point associated with node p1 be iteration starting point t1, and iteration starting point t1 does not pass through the adjacent edge<p1,p2> , then the iteration starting point t1 is the iteration starting point to be diffused, node p1 is the diffusion node, and node p2 is the diffused node. Then node p1 will connect the iteration starting point t1 through the adjacent edge<p1,p2> The static diffusion weight diffused to node p2 = the cumulative diffusion weight of the iteration starting point t1 associated with node p1 + the adjacent edge<p1,p2> The weight of / (the number of iterative starting points to be diffused + the number of iterative starting points that have been diffused).
[0167] Assume that node p2 is not associated with any iteration starting point. When the iteration starting point t1 diffuses from node p1 to node p2, node p2 is associated with the iteration starting point t1. The cumulative diffusion weight of the iteration starting point t1 associated with node p2 = node p1 connects the iteration starting point t1 through the adjacent edge<p1,p2> The static diffusion weight diffused to node p2.
[0168] (2) The static movement weight refers to the unprocessed adjacent edges of the pathfinding node. Assume that node p1 is a pathfinding node and the unprocessed adjacent edges of node p1 are<p1,p2> , the adjacent edges are not processed<p1,p2> The static movement weight calculation method includes:
[0169] When adjacent edges are not processed<p1,p2> When only one pathfinding node p1 is associated with the iteration starting point, the adjacent edges are not processed.<p1,p2> The static moving weight of the unprocessed adjacent edge is the shortest path length of the node p1 associated with the iteration starting point in the two end nodes of the unprocessed adjacent edge + (the unprocessed adjacent edge<p1,p2> The weight of / the number of iteration starting points associated with node p1);
[0170] When adjacent edges are not processed<p1,p2> When both end nodes are pathfinding nodes and associated iteration starting points, assume: unprocessed adjacent edges<p1,p2> The weight is L, the shortest path length of node p1 is L1, the shortest path length of node p2 is L2, node p1 is associated with K1 iteration starting points, p2 is associated with K2 iteration starting points (p1 and p2 can be associated with a common node), L1<=L2.
[0171] L2 is greater than L1, and the nodes associated with node P1 need to be on the adjacent edge<p1,p2> Occupy a part of the weight x, and let each iteration starting point associated with p1 occupy the weight x / K1, so that x / K1+Ll=L2→x=(L2-L1)×K1.
[0172] Unprocessed adjacent edges<p1,p2> The remaining weight Lx is shared by the K1 nodes associated with p1 and the K2 nodes associated with p2. The weight value occupied by the iteration starting point associated with each node is (Lx) / (K1+K2).
[0173] In summary, when adjacent edges are not processed<p1,p2> When both end nodes are pathfinding nodes and associated iteration starting points, adjacent edges are not processed<p1,p2> The static movement weight of is:
[0174] L1+x / K1+(Lx) / (K1+K2)=L2+(Lx) / (K1+K2)=L2+(L-(L2-L1)×K1) / (K1+K2).
[0175] During program design, the following definitions can be used to record the iteration starting point of node association, the cumulative diffusion weight, and the number of iteration starting points of the static diffusion weight passing through the adjacent edges.
[0176] Definition 1: [node1, t1, v1] represents the node node1 associated with the iteration starting point t1, and the cumulative diffusion weight associated with t1 is v1, where when node1 is the iteration starting point, it may be equal to t1;
[0177] Definition 2: [node1, t1, v1, node2, v2] indicates that node node1 is associated with the iteration start point t1, the cumulative diffusion weight associated with t1 is v1, where v1 may be equal to t1 when node1 is the iteration start point. The static diffusion weight of spreading the iteration start point t1 associated with node1 along the adjacent edge <node1, node2> to node2 is v2;
[0178] Definition 3: [<node1, node2>, num], the number of different iteration start points passing through the adjacent edge <node1, node2>.
[0179] Specifically, as shown in Figure 8A, nodes 1, 2, and 0 are iteration start points; the weights of the adjacent edges <0, 1>, <1, 2>, <2, 0> are a, which is greater than 0, and the weights of other adjacent edges are x. Take K0 as 2.
[0180] 1. When x = 2a / 3, 2a == 3x, there are two equivalent non-isomorphic Steiner trees, as shown in Figures 8B and 8C.
[0181] 2. When x > 2a / 3, any two of the adjacent edges <0, 1>, <1, 2>, <2, 0> and their end nodes form a Steiner tree, as shown in Figure 8C.
[0182] 3. When a / 2 < x < 2a / 3, the process of determining the Steiner tree includes:
[0183] 3.1 Initialization:
[0184] (1) The cumulative moving step is 0; determine the shortest path information for the iteration start points 0, 1, and 2: the shortest path length is 0, and the predecessor node is empty; the iteration start points associated with the iteration start points 0, 1, and 2 and their cumulative diffusion weights are: [0, 0, 0], [1, 1, 0], [2, 2, 0], and the iteration start points associated with other nodes are empty.
[0185] (2) At this time, the subgraph is empty, and the shortest path only includes the iteration start points. Therefore, there are no diffusion nodes.
[0186] (3) Nodes 0, 1, and 2 in the shortest path all have unprocessed adjacent edges, so these three nodes are path-finding nodes. Specifically:
[0187] The unprocessed adjacent edges of the path-finding node 0 are: <0, 1>, <0, 2>, <0, 3>;
[0188] The unprocessed adjacent edges of the path-finding node 1 are: <0, 1>, <1, 2>, <1, 3>;
[0189] The unprocessed adjacent edges of the path-finding node 2 are: <2, 1>, <0, 2>, <2, 3>;
[0190] The two end nodes of the adjacent edge <0,1> are both pathfinding nodes, and their static movement weight = L2 + (L-(L2-L1)×K1) / (K1+K2) = 0 + (a-(0-0)×1) / 2 = a / 2;
[0191] Similarly, the static movement weight of the adjacent edge <0,2> is a / 2;
[0192] Similarly, the static movement weight of the adjacent edge <2,1> is a / 2;
[0193] If only one end node of the adjacent edge <0,3> is a pathfinding node, then the static movement weight of the adjacent edge <0,3> = the shortest path length of the two end nodes of the unprocessed adjacent edge associated with the pathfinding node p1 of the iteration starting point + (the length of the unprocessed adjacent edge<p1,p2> The weight of the node p1 / the number of iteration starting points associated with the node p1) = 0 + (x / 1) = x, where p1 is node 0;
[0194] Similarly, the static movement weight of the adjacent edge <1,3> = x;
[0195] Similarly, the static movement weight of the adjacent edge <2,3> = x.
[0196] 3.2 First iteration:
[0197] (4) Minimum static movement weight = min(a / 2, x) = a / 2, the target adjacent edges are <0,1>, <0,2>, <2,1>; the diffusion node set is empty, the static diffusion weight does not exist, and is considered infinite; then a / 2 < infinity, and the path optimization step (the above step S5) is executed.
[0198] (5) Cumulative moving step length = a / 2, set the target adjacent edge <0,1> as processed, and the optimization process is as follows:
[0199] a. Both end nodes of the target adjacent edge <0,1> are pathfinding nodes, and the static movement weight a / 2 of the target adjacent edge <0,1> is greater than the shortest path length 0 between the two end nodes of the target adjacent edge <0,1>. The iteration starting points associated with the end nodes 0 and 1 of the target adjacent edge <0,1> are {0} and {1}, respectively. The difference between the iteration starting points associated with nodes 0 and 1 is not null. The target adjacent edge <0,1> is added to the subgraph. The shortest path from node 0 to the associated iteration starting point is null. The same applies to node 1.
[0200] b. Update the diffusion node set: Iteration starting points 0 and 1 do not pass through the adjacent edge <0,1>. The diffusion node set is updated to {0,1}. Diffusion node 0 can diffuse its associated iteration node 0 to node 1, that is, node 1 is the diffused node, and the associated node 0 is the node to be diffused; diffusion node 1 can diffuse its associated iteration node 1 to node 0, that is, node 0 is the diffused node, and the associated node 1 is the node to be diffused.
[0201] Calculate the static diffusion weight: the cumulative diffusion weight of iteration starting point 0 associated with diffusion node 0 is 0, the weight of the adjacent edge <0,1> is a, the number of diffusible iteration starting points associated with diffusion node 0 but not associated with node 1 is 1, and the number of iteration starting points that have diffused from diffusion node 0 to node 1 is 0. According to the previous formula, the static diffusion weight of diffusion node 0 diffusing node 0 to node 1 is 0 + a / (1 + 0) = a.
[0202] Similarly, the static diffusion weight of diffusion node 1 diffusing node 1 to node 0 to be diffused is 0+a / (1+0)=a.
[0203] The processing of the target adjacent edges <0,2> and <2,1> refers to the above steps, and the final diffusion node set is {0,1,2}.
[0204] c. The unprocessed adjacent edges of pathfinding node 0 are: <0,3>;
[0205] The unprocessed adjacent edges of pathfinding node 1 are: <1,3>;
[0206] The unprocessed adjacent edge of pathfinding node 2 is: <2,3>.
[0207] (6) The iteration starting points 0, 2, and 1 are connected together, the threshold is a, and nodes 0, 1, and 2 all have unprocessed adjacent edges, so the pathfinding nodes and diffusion nodes are not empty, and the cumulative moving step length = a / 2 < threshold a, and the second iteration is executed.
[0208] The subgraph obtained after the first iteration is shown in FIG8D .
[0209] 3.3 Second iteration:
[0210] (1) The minimum static movement weight is = x, and the target adjacent edges are <0,3>, <3,2>, <3,1>;
[0211] The static diffusion weights of diffusion node 0 that diffuses node 0 to nodes 1 and 2 are both a, i.e., [0,0,0,1,a] and [0,0,0,2,a];
[0212] The static diffusion weights of diffusion node 1 that diffuses node 1 to nodes 0 and 2 are both a, i.e., [1,1,0,0,a] and [1,1,0,2,a];
[0213] The static diffusion weights of diffusion node 2 that diffuses node 2 to nodes 1 and 0 are both a, i.e., [2,2,0,1,a] and [2,2,0,0,a];
[0214] Then the minimum diffusion weight is a.
[0215] (2) Minimum static diffusion weight = a > minimum static movement weight = x, then the path optimization step (the above-mentioned step S5) is executed.
[0216] (3) Cumulative moving step length = minimum static moving weight x. The optimization process is as follows:
[0217] a. Set the target adjacent edge <0,3> to processed. If only node 0 is a pathfinding node for the target adjacent edge <0,3>, determine the shortest path information for node 3 including the target adjacent edge <0,3>: the predecessor node is 0, and the shortest path length = the cumulative moving step length x;
[0218] Node 3 has unprocessed adjacent edges <1,3><2,3>, so node 3 is added as a pathfinding node, and node 0 no longer has unprocessed adjacent edges. The current pathfinding nodes include {1,2,3};
[0219] Iteration starting point 0 does not pass through the adjacent edge <0,3>. Node 0 of the target adjacent edge <0,3> can diffuse its associated iteration starting point 0 to node 3. Node 0 is already a diffusion node. The iteration starting point 0 associated with diffusion node 0 of the target adjacent edge <0,3> can diffuse to node 3 through the adjacent edge <0,3>. Its static diffusion weight = the cumulative diffusion weight 0 of iteration starting point 0 associated with node 0 + the weight of the adjacent edge <0,3> / 1 = 0 + x / 1 = x.
[0220] The unprocessed adjacent edges of path-finding node 3 are: <1,3><2,3>, the unprocessed adjacent edges of path-finding node 1 are: <1,3>, and the unprocessed adjacent edges of path-finding node 2 are: <2,3>.
[0221] b. Set the target adjacent edge <1,3> to processed. Both end nodes 1 and 3 of the target adjacent edge <1,3> are pathfinding nodes, and the static movement weight x of the target adjacent edge <1,3> is equal to the shortest path length x of node 3. Then, determine the shortest path information for end node 3 that includes the target adjacent edge <1,3>: the predecessor node is 1, and the shortest path length = the cumulative movement step length x.
[0222] The adjacent nodes of node 3 are 1 and 0, the iteration starting point set associated with node 1 is {1}, the iteration starting point set associated with node 0 is {0}, and the difference between the iteration starting points associated with node 1 and node 0 is not empty. Then, the target adjacent edges <1,3> and <0,3> are added to the subgraph, and the shortest path from node 0 to the associated iteration starting point is empty. The same applies to node 1.
[0223] Node 1 has no unprocessed adjacent edges, so the pathfinding nodes include {2,3}.
[0224] The iteration starting point 1 associated with the diffusion node 1 of the target adjacent edge <1,3> can be diffused to node 3 through the adjacent edge <1,3>. Node 1 is already a diffusion node, and its static diffusion weight = the cumulative diffusion weight 0 of the iteration starting point 1 associated with node 1 + the weight of the adjacent edge <1,3> / 1 = 0 + x / 1 = x;
[0225] The unprocessed adjacent edges of path-finding node 3 are: <2,3>; the unprocessed adjacent edges of path-finding node 2 are: <2,3>.
[0226] c. Set the target adjacent edge <2,3> to processed. Both end nodes 2 and 3 of the target adjacent edge <2,3> are pathfinding nodes, and the static movement weight x of the target adjacent edge <2,3> is equal to the shortest path length x of node 3. Then, determine the shortest path information for end node 3 that includes the target adjacent edge <2,3>: the predecessor node is 2, and the shortest path length = the cumulative movement step length x;
[0227] The adjacent nodes of node 3 are 2, 1 and 0. The iteration starting point set associated with node 2 is {2}, the iteration starting point set associated with node 1 is {1}, and the iteration starting point set associated with node 0 is {0}. If the difference between any two sets is not empty, then the target adjacent edge <2,3> is added to the subgraph, and the shortest path from node 0 to the associated iteration starting point is empty. The same applies to nodes 1 and 2.
[0228] Nodes 2 and 3 no longer have unprocessed adjacent edges, and the pathfinding node does not exist. The iteration starting point 2 associated with the diffusion node 2 of the target adjacent edge <2,3> can be diffused to node 3 through the adjacent edge <2,3>. Node 2 is already in the diffusion node set.
[0229] The static diffusion weight of the iteration starting point 2 associated with the diffusion node 2 of the target adjacent edge <2,3> that can be diffused to the node 3 through the adjacent edge <2,3> = the cumulative diffusion weight of the node 2 associated with the node 2 0 + the weight of the adjacent edge <2,3> / 1 = 0 + x / 1 = x;
[0230] (4) The iteration starting points 0, 2, and 1 are all connected together, and the threshold is a; the pathfinding node set is empty, the diffusion node set {0, 1, 2} is not empty, and the cumulative moving step length = a / 2 < threshold a, and the third iteration is performed.
[0231] The subgraph obtained after the second iteration is shown in FIG8E .
[0232] 3.4 Third iteration:
[0233] (1) The pathfinding node set is empty, the minimum static movement weight does not exist and is considered infinite; the minimum static diffusion weight is x, and the target diffusion nodes are 0, 1, and 2;
[0234] The static diffusion weight of diffusion node 0 diffusing node 0 to node 3 is x, that is, [0,0,0,3,x];
[0235] The static diffusion weight of diffusion node 1 diffusing node 1 to node 3 is x, that is, [1, 1, 0, 3, x].
[0236] The static diffusion weight of diffusion node 2 that diffuses node 2 to node 3 is x, that is, [2, 2, 0, 3, x].
[0237] (2) If the minimum static diffusion weight = x < the minimum static movement weight is infinite, then the diffusion step (step S6 above) is executed:
[0238] Target diffusion node 0: The iteration starting point associated with target diffusion node 0 is iteration node 0, but adjacent node 3 has no associated node, so the node to be diffused is 0. The static diffusion weight x of node 0 to be diffused from target diffusion node 0 through the adjacent edge <0,3> to the diffused node 3 is equal to the minimum static diffusion weight x. Therefore: node 0 to be diffused, along the adjacent edge <0,3>, diffuses to node 3 and is set as the iteration starting point associated with node 3. The cumulative diffusion weight associated with the newly associated iteration starting point 0 of node 3 is the minimum diffusion weight x.
[0239] Target diffusion node 1: The iteration starting point associated with target diffusion node 1 is iteration starting point 1, but adjacent node 3 has no associated node, so the node to be diffused is 1. The static diffusion weight x of node 1 to be diffused from target diffusion node 1 through the adjacent edge <1,3> to the diffused node 3 is equal to the minimum static diffusion weight x. Therefore: node 1 to be diffused, along the adjacent edge <1,3>, diffuses to node 3 and is set as the iteration starting point associated with node 3. The cumulative diffusion weight associated with the newly associated iteration starting point 1 of node 3 is the minimum diffusion weight x.
[0240] Target diffusion node 2: The iteration starting point associated with target diffusion node 2 is iteration starting point 2, but adjacent node 3 has no associated node. Then the node to be diffused is 2. The static diffusion weight x of node 2 to be diffused from target diffusion node 2 through the adjacent edge <2,3> to node 3 is equal to the minimum static diffusion weight x. Therefore: node 2 to be diffused, along the adjacent edge <2,3>, diffuses to node 3 and is set as the iteration starting point associated with node 3. The cumulative diffusion weight associated with the newly associated iteration starting point 2 of node 3 is the minimum diffusion weight x.
[0241] The number of iteration starting points passed by the adjacent edges:
[0242] [<0,1>,0],[<2,1>,0],[<0,2>,0],[<0,3>,1],[<1,3>,1],[<2,3>,1].
[0243] (3) The pathfinding node set is empty and no static movement weights need to be updated.
[0244] (4) In step (2), the associated nodes are set for node 3 for the first time, and the diffusion node set is updated to {0, 1, 2, 3}. The iteration starting points associated with node 3 are iteration starting points 0, 1, and 2, among which the associated nodes 0 and 1 can be diffused to node 2, the associated nodes 0 and 2 can be diffused to node 1, and the associated nodes 2 and 1 can be diffused to node 0.
[0245] The static diffusion weight of diffusion node 3 that diffuses its associated iteration node 0 to node 1 through the adjacent edge <3,1> = the cumulative diffusion weight of iteration starting point 0 associated with node 3 + (weight of adjacent edge <3,1> / (2+0)) = x+x / 2;
[0246] The static diffusion weight of diffusion node 3 that diffuses its associated iteration node 0 to node 2 through the adjacent edge <3,2> = the cumulative diffusion weight of iteration starting point 0 associated with node 3 + (weight of adjacent edge <3,2> / (2+0)) = x+x / 2;
[0247] The static diffusion weight of diffusion node 3 that diffuses its associated iteration node 1 to node 0 through the adjacent edge <3,0> is = the cumulative diffusion weight of iteration starting point 1 associated with node 3 + (weight of adjacent edge <3,0> / (2+0)) = x+x / 2;
[0248] The static diffusion weight of diffusion node 3 that diffuses its associated iteration node 1 to node 2 through the adjacent edge <3,2> = the cumulative diffusion weight of iteration starting point 1 associated with node 3 + (weight of adjacent edge <3,2> / (2+0)) = x+x / 2;
[0249] The static diffusion weight of diffusion node 3 that diffuses its associated iteration node 2 to node 1 through the adjacent edge <3,1> = the cumulative diffusion weight of iteration starting point 2 associated with node 3 + (weight of adjacent edge <3,1> / (2+0)) = x+x / 2;
[0250] The static diffusion weight of diffusion node 3 that diffuses its associated iteration node 2 to node 0 through the adjacent edge <3,0> is = the cumulative diffusion weight of iteration starting point 2 associated with node 3 + (weight of adjacent edge <3,0> / (2+0)) = x+x / 2;
[0251] (5) Nodes 0, 1, 2, and 3 all have iteration starting points that need to be diffused, and the set of diffused nodes remains unchanged.
[0252] (6) The iteration starting points 0, 2, and 1 are all connected together, the threshold is a, the pathfinding node set is empty, the diffusion node set {0, 1, 2, 3} is not empty, and the cumulative moving step length = a / 2 < threshold a, and the fourth iteration is performed.
[0253] 3.5 Fourth iteration:
[0254] (1) The pathfinding node set is empty, the minimum static movement weight does not exist and is considered infinite; the minimum static diffusion weight is 3x / 2, and the target diffusion node is 3;
[0255] The static diffusion weight of diffusion node 3 diffusing node 0 to be diffused to node 1 is 3x / 2, that is, [3,0,x,1,3x / 2];
[0256] Simplified representations of other diffusion processes are: [3,0,x,2,3x / 2], [3,1,x,0,3x / 2], [3,1,x,2,3x / 2], [3,2,x,0,3x / 2], [3,2,x,1,3x / 2].
[0257] (2) If the minimum static diffusion weight = 3x / 2 < the minimum static moving weight is infinite, then the diffusion step is executed:
[0258] Target diffusion node 3:
[0259] Target diffusion node 3 is associated with iteration starting point 0, and adjacent node 1 is not associated with iteration starting point 0. Therefore, the static diffusion weight 3x / 2 of associated node 0 from target diffusion node 3 to adjacent node 1 via adjacent edge <1,3> is equal to the minimum static diffusion weight 3x / 2. Therefore, associated node 0 is diffused along adjacent edge <1,3> to node 1 and is set as the iteration starting point associated with node 1. The cumulative diffusion weight associated with the newly associated iteration starting point 0 for node 1 is the minimum diffusion weight 3x / 2. The number of iteration starting points passed through the adjacent edge is: [<0,1>,0], [<2,1>,0], [<0,2>,0], [<0,3>,1], [<1,3>,2], [<2,3>,1].
[0260] The target diffusion node 3 is associated with iteration starting point 2, and adjacent node 1 is not associated with iteration starting point 2. Then the static diffusion weight 3x / 2 of associated node 2 diffused from target diffusion node 3 to adjacent node 1 through the adjacent edge <1,3> is equal to the minimum static diffusion weight 3x / 2. Then associated node 2 is diffused to node 1 along the adjacent edge <1,3> and set as the iteration starting point associated with node 1. The cumulative diffusion weight associated with the newly associated iteration starting point 2 of node 1 is the minimum diffusion weight 3x / 2.
[0261] The number of iterative starting points passed by the adjacent edges: [<0,1>,0],[<2,1>,0],[<0,2>,0],[<0,3>,1],[<1,3>,3],[<2,3>,1];
[0262] Similarly, from node 3, the associated nodes 1 and 2 are diffused to node 0, and from node 3, the associated nodes 1 and 0 are diffused to node 2.
[0263] The number of iterative starting points that the adjacent edges pass through: [<0,1>,0],[<2,1>,0],[<0,2>,0],[<0,3>,3], [<1,3>,3], [<2,3>,3].
[0264] (3) The pathfinding node set is empty and no static movement weights need to be updated.
[0265] (4) After node 0 is newly associated with nodes 1 and 2, the iteration starting points associated with node 0 include iteration starting points 0, 1, and 2. Similarly, nodes 1 and 2 are associated with all iteration starting points.
[0266] (5) All iteration starting points are associated with nodes 0, 1, 2, and 3, and there is no diffusion node.
[0267] (6) The iteration starting points 0, 2 and 1 are all connected together, the threshold is a, the pathfinding node is none, the diffusion node is none, the iteration ends, and the step of generating the Steiner tree is executed.
[0268] 3.6 Spanning Tree
[0269] (1) There are no nodes or adjacent edges that need to be deleted in the subgraph. There is a cycle in the remaining path. Execute (2) and then jump to (3).
[0270] (2) The number of different iteration starting points passing through the adjacent edges <0,3><1,3><2,3> is 3. The weights of the adjacent edges <0,3><1,3><2,3> in the subgraph are all updated to x / 3. The number of different iteration starting points passing through the adjacent edges <0,1>, <1,2>, and <0,2> is 0, and the weights do not change, as shown in Figure 8F.
[0271] (3) Based on the subgraph obtained in step (2), a Steiner tree is generated, as shown in FIG8G . Specifically, the Steiner tree can be generated based on the MST method, or the subgraph can be regenerated using the method described in the previous embodiment. The following replacements are made during the subgraph generation process:
[0272] (1) For any optimization goal, the static movement weight of the unprocessed adjacent edge = (the sum of the shortest path lengths of the pathfinding nodes associated with the iteration starting point among the two end nodes of the unprocessed adjacent edge + the weight of the unprocessed adjacent edge) / the number of end nodes associated with the iteration starting point among the two end nodes of the unprocessed adjacent edge;
[0273] For any optimization objective, if the diffusion node and the diffused node are on the shortest path, the shortest path length of the diffusion node is less than or equal to the shortest path length of the diffused node, and the static diffusion weight = the cumulative diffusion weight of the starting point of the diffusion iteration + the weight of the adjacent edge between the diffusion node and the diffused node;
[0274] (2) In step S52, the mutual difference between the iteration starting points associated with each end node of the target adjacent edge is calculated. If the mutual difference is not empty, it is changed to: the iteration starting points associated with each end node of the target adjacent edge cannot be connected together through the path in the subgraph.
[0275] (3) In step S53, the iteration starting point set set is calculated. i with set j The mutual difference between them, if the mutual difference is not empty, changes to: the iteration starting point set i with set j The iteration starting points in cannot be connected together by paths in the subgraph.
[0276] After regenerating the subgraph, the non-iteration starting point and the corresponding adjacent edge with only one adjacent edge in the regenerated subgraph are deleted to obtain the Steiner tree.
[0277] In one embodiment, a computer device is provided. As shown in FIG9 , computer device 902 may include one or more processors 904, such as one or more central processing units (CPUs), each of which may implement one or more hardware threads. Computer device 902 may also include any memory 906 for storing any type of information, such as code, settings, data, and the like. For example, and without limitation, memory 906 may include any one or more combinations of the following: any type of RAM, any type of ROM, a flash memory device, a hard disk, an optical disk, and the like. More generally, any memory may use any technology to store information. Furthermore, any memory may provide volatile or non-volatile retention of information. Furthermore, any memory may represent a fixed or removable component of computer device 902. In one embodiment, when processor 904 executes associated instructions stored in any memory or combination of memories, computer device 902 may perform any operation of the associated instructions. Computer device 902 also includes one or more drive mechanisms 908, such as a hard disk drive mechanism, an optical disk drive mechanism, and the like, for interacting with any memory.
[0278] The computer device 902 may further include an input / output module 910 (I / O) for receiving various inputs (via input devices 912) and for providing various outputs (via output devices 914). A specific output mechanism may include a presentation device 916 and an associated graphical user interface 918 (GUI). In other embodiments, the input / output module 910 (I / O), input devices 912, and output devices 914 may not be included, and the computer device 902 may simply be a computer device in a network. The computer device 902 may further include one or more network interfaces 920 for exchanging data with other devices via one or more communication links 922. One or more communication buses 924 couple the components described above together.
[0279] The communication link 922 may be implemented in any manner, for example, via a local area network, a wide area network (e.g., the Internet), a point-to-point connection, etc., or any combination thereof. The communication link 922 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc., governed by any protocol or combination of protocols.
[0280] The embodiments of the present invention further provide a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the above method are executed.
[0281] The embodiments of this document also provide a computer-readable instruction, wherein when a processor executes the instruction, the program therein causes the processor to execute the method shown in any of the aforementioned embodiments.
[0282] It should be understood that in the various embodiments of this document, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this document.
[0283] It should also be understood that in the embodiments herein, the term "and / or" merely describes an association between associated objects, indicating that three possible relationships exist. For example, "A and / or B" could represent: A alone, A and B simultaneously, or B alone. Furthermore, the character " / " in this document generally indicates an "or" relationship between the associated objects.
[0284] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the composition and steps of each example according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this document.
[0285] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0286] In the several embodiments provided herein, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices, or units, or can be an electrical, mechanical, or other form of connection.
[0287] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments herein.
[0288] In addition, the functional units in the various embodiments herein may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0289] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this article is essentially or the part that contributes to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of this article. The aforementioned storage medium includes: various media that can store program code, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0290] This article uses specific embodiments to illustrate the principles and implementation methods of this article. The description of the above embodiments is only used to help understand the methods and core ideas of this article. At the same time, for those skilled in the art, based on the ideas of this article, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation to this article.
Claims
1. A method for constructing a Steiner tree based on an undirected adjacent edge weighted connected graph, characterized in that: include: S1, obtain the undirected adjacent edge weighted connected graph and iteration starting point of the optimization target in the target business scenario; Initialize the shortest path information of the iteration starting point, the cumulative moving step length, the cumulative diffusion weight of the iteration starting point associated with itself and the iteration starting point associated with the iteration starting point, and the shortest path information of the node includes the predecessor node and the shortest path length, which is used to determine the shortest path; S2, for the adjacent edge on the currently determined subgraph and the shortest path, if the starting point of an iteration associated with its end node does not pass through the adjacent edge, determine the diffusion information; The diffusion information includes: a diffusion node, a diffused node, and an iterative starting point to be diffused, wherein the iterative starting point to be diffused belongs to an iterative starting point associated with the diffusion node but has not diffused to the diffused node through the adjacent edge; the subgraph contains multiple paths connecting different iterative starting points; According to the optimization target, the diffusion information and the cumulative diffusion weight of the iterative starting point to be diffused, the static diffusion weight of diffusing the iterative starting point to be diffused from the diffusion node to the diffused node is determined; S3, taking the node with unprocessed adjacent edges in the currently determined shortest path as the pathfinding node, and determining the static movement weight of the unprocessed adjacent edges of the pathfinding node according to the optimization target, the iteration starting point associated with the two end nodes of the unprocessed adjacent edges of the pathfinding node, and the shortest path length of the end node associated with the iteration starting point; S4, select the unprocessed adjacent edge with the minimum static movement weight as the target adjacent edge, and the diffusion node with the minimum static diffusion weight as the target diffusion node; determine whether the minimum static movement weight is less than the minimum static diffusion weight, if so, execute steps S5 and S7, if not, execute steps S6 and S7; S5, updating the cumulative moving step length to the minimum static moving weight, setting each target adjacent edge as processed in turn, updating the pathfinding node and its shortest path information and the static moving weight of the unprocessed adjacent edge according to each target adjacent edge, updating the diffusion information and the static diffusion weight, determining the path connecting different iteration starting points and adding it to the subgraph; S6, sequentially diffuse the to-be-diffused iteration starting point of the target diffusion node to the relevant diffused nodes. If the diffused node is not associated with the to-be-diffused iteration starting point, associate the to-be-diffused iteration starting point with it, determine the number of adjacent edge diffusion iteration starting points, update the cumulative diffusion weight of the newly associated iteration starting point of the relevant diffused node to the minimum static diffusion weight, and update the diffusion information, static diffusion weight and static movement weight; S7, determine whether all iteration starting points are connected together, if not, jump to step S4, if yes, repeat step S6 until the cumulative moving step length is less than the minimum static diffusion weight; S8, using the weights of the adjacent edges in the subgraph and the number of diffusion iteration starting points, determine the average weights of the adjacent edges, and generate a Steiner tree based on the average weights of the subgraph and the adjacent edges.
2. The method according to claim 1, characterized in that The undirected adjacent edge weighted connected graph of the optimization target in the target business scenario is directly obtained according to the optimization target in the target business scenario; or the undirected mixed weighted connected graph obtained by the optimization target in the target business scenario is converted in the following manner, wherein the undirected mixed weighted connected graph includes at least weighted nodes: When the weight of a weighted node is related to an adjacent edge, the number of adjacent edges of the weighted node is calculated, and the same number of interconnected nodes are inserted according to the calculated number, so that these inserted nodes are respectively connected to the adjacent edges of the weighted node; according to the weight of the weighted node, the weight of the adjacent edges between the inserted nodes is calculated; When the weight of a weighted node is independent of its adjacent edges, the weight of the weighted node is transferred to the adjacent edges of the weighted node.
3. The method according to claim 1, characterized in that After determining that all iteration starting points are connected together, step S7 includes, in addition to repeatedly executing step S6: The threshold is determined according to the current cumulative moving step length using the following formula: K0×current cumulative moving step length, where 2>=K0>=1; Return to step S4 and execute until there are no more pathfinding nodes and diffusion nodes, or until the accumulated moving step length is equal to the threshold.
4. The method according to claim 1, characterized in that When the optimization objective represents the minimum sum of weights of all adjacent edges in the Steiner tree, the process of determining the static movement weight and the static diffusion weight includes: Static movement weight = (the sum of the shortest path lengths of the path-finding nodes associated with the iteration starting point among the two end nodes of the unprocessed adjacent edge + the weight of the unprocessed adjacent edge) / the number of path-finding nodes associated with the iteration starting point among the two end nodes of the unprocessed adjacent edge; or When only one of the two end nodes of the unprocessed adjacent edge is a pathfinding node, the static movement weight = the shortest path length of the pathfinding node + the weight of the unprocessed adjacent edge / the number of iteration starting points associated with the pathfinding node; When both end nodes of the unprocessed adjacent edge are pathfinding nodes, the static movement weight = L2 + (Lx) / (K1 + K2), where x = (L2 - L1) × K1, L is the weight of the unprocessed adjacent edge; L1 is the shortest path length of one end node of the unprocessed adjacent edge, associated with K1 iteration starting points; L2 is the shortest path length of the other end node of the unprocessed adjacent edge, associated with K2 iteration starting points, L1 <= L2; Static diffusion weight = cumulative diffusion weight of the iterative starting point to be diffused + weight of the adjacent edge between the diffusion node and the diffused node / (number of iterative starting points to be diffused + number of iterative starting points that have been diffused); When the optimization goal indicates that the sum of the weights of the adjacent edges in the path from the preset iteration starting point to other iteration starting points is the largest and the smallest, the process of determining the static movement weight and the static diffusion weight includes: Static movement weight = (the sum of the shortest path lengths of the path-finding nodes associated with the iteration starting point among the two end nodes of the unprocessed adjacent edge + the weight of the unprocessed adjacent edge) / the number of path-finding nodes associated with the iteration starting point among the two end nodes of the unprocessed adjacent edge; Static diffusion weight = cumulative diffusion weight of the starting point of the diffusion iteration + weight of the adjacent edge between the diffusion node and the diffused node.
5. The method according to claim 1, characterized in that Step S5 updates the pathfinding nodes and their shortest path information and the static movement weights of the unprocessed adjacent edges according to each target adjacent edge, updates the diffusion information and the static diffusion weights, determines the paths connecting different iteration starting points and adds them to the subgraph, including: S51, if only one of the two end nodes of a target adjacent edge is a pathfinding node, determine the shortest path information containing the target adjacent edge for the other end node of the target adjacent edge, and judge whether the other end node of the target adjacent edge has an unprocessed adjacent edge. If so, use the other end node of the target adjacent edge as a pathfinding node, determine the static movement weight of the unprocessed adjacent edge of the newly added pathfinding node, and jump to S54; S52, if both end nodes of a target adjacent edge are pathfinding nodes, and if the static movement weight of the target adjacent edge is greater than the shortest path length of the end nodes of the target adjacent edge or the weight of the target adjacent edge is 0, then calculate the mutual difference of the iteration starting points associated with each end node of the target adjacent edge, if the mutual difference is not empty, then determine the path connecting different iteration starting points according to the shortest path information of the node and the target adjacent edge and add it to the subgraph, and jump to S54; S53: If both end nodes of the target adjacent edge are pathfinding nodes, and the static movement weight of the target adjacent edge is equal to the shortest path length of one end node of the target adjacent edge, then determine the shortest path information containing the target adjacent edge for the end node of the target adjacent edge, and set the adjacent node on the shortest path of the end node to be p. i and p j , the corresponding associated iteration starting point set is set i and set j , calculate the iteration starting point set set i With set j The mutual difference between them, if the mutual difference is not empty, then according to the shortest path information of the node and the target adjacent edge, determine the path connecting different iteration starting points and add it to the subgraph; S54, calling step S2 to update diffusion information and static diffusion weight.
6. The method according to claim 1, characterized in that Step S6 of updating diffusion information, static diffusion weight and static movement weight includes: If the diffused node is one of the pathfinding nodes, then calling step S3 to determine the static movement weight of the unprocessed adjacent edge of the diffused node; If the diffused node is associated with a new iteration starting point relative to the adjacent edge in its subgraph, then call step S2 to update the diffusion information and update the static diffusion weight of the diffused node to diffuse the new iteration starting point to its adjacent nodes; If the cumulative diffusion weight of the iteration starting point t that the diffusion node previously diffused to the diffused node is greater than the cumulative diffusion weight of the node to be diffused that the diffusion node diffused to the diffused node, then the cumulative diffusion weight of the iteration starting point t that the diffusion node previously diffused to the diffused node is updated to the cumulative diffusion weight of the node to be diffused.
7. The method according to claim 5, characterized in that In S8, a Steiner tree is generated based on the amortized weights of the subgraphs and adjacent edges, including: S81, delete the non-iteration starting point and the corresponding adjacent edge in the subgraph with only one adjacent edge, and determine whether there is a closed loop in the subgraph. If not, execute steps S82 and S84. If yes, execute steps S83 and S84; S82, subgraph as Steiner tree; S83, using the amortized weights of the adjacent edges in the subgraph to update the weights of the adjacent edges in the subgraph, and generating a Steiner tree according to the subgraph; S84, if the undirected adjacent edge weighted connected graph is obtained from the undirected mixed weighted connected graph and the node weights are related to the connected adjacent edges, then the relevant nodes and adjacent edges in the Steiner tree are restored to weighted nodes.
8. The method according to claim 7, characterized in that Generating a Steiner tree from a subgraph includes: Regenerate the subgraph, and make the following restrictions during the subgraph generation process: For any optimization target, the static moving weight of the unprocessed adjacent edge = (the sum of the shortest path lengths of the pathfinding nodes associated with the iteration starting point among the two end nodes of the unprocessed adjacent edge + the weight of the unprocessed adjacent edge) / the number of end nodes associated with the iteration starting point among the two end nodes of the unprocessed adjacent edge; For any optimization target, if the diffusion node and the diffused node are on the shortest path, the shortest path length of the diffusion node is less than or equal to the shortest path length of the diffused node, and the static diffusion weight = the cumulative diffusion weight of the starting point of the diffusion iteration + the weight of the adjacent edge between the diffusion node and the diffused node; In S52, the mutual difference of the iteration starting points associated with each end node of the target adjacent edge is calculated, and if the mutual difference is not empty, it is changed to: the iteration starting points associated with each end node of the target adjacent edge cannot be connected together through the path in the subgraph; S53 calculates the iteration starting point set set i With set j The difference between them, if the difference is not empty, is changed to: the iteration starting point set i With set j The iteration starting points in cannot be connected together through paths in the subgraph; Delete the non-iterative starting point and the corresponding adjacent edge with only one adjacent edge in the regenerated subgraph to obtain the Steiner tree.
9. The method according to claim 1, characterized in that During initialization, it is the merged set associated with the iteration starting point, and the merged set associated with the iteration starting point includes its own node; In S6, the iterative starting point to be diffused of the target diffusion node is diffused to the relevant diffused node and associated with it, and the cumulative diffusion weight of the newly associated iterative starting point of the relevant diffused node is updated to the minimum static diffusion weight, and then the following is further included: Merge the merged sets associated with the iteration starting point associated with the diffused node to obtain a new merged set, and associate all the iteration starting points in the new merged set with the new merged set; Determining whether all iteration starting points are connected together includes: determining whether the merged set associated with the iteration starting point includes all iteration starting points, and if so, determining that all iteration starting points are connected together.
10. The method according to claim 1, characterized in that When multiple optimization targets are included, the subgraphs for each optimization target are determined separately; According to the importance of each optimization target, the subgraphs of each optimization target are merged to obtain a comprehensive subgraph; Among them, the adjacent edges of the comprehensive subgraph are the union of the adjacent edges of each optimization target subgraph, and the nodes of the comprehensive subgraph are the union of the nodes of each optimization target subgraph; the weight of each adjacent edge in the comprehensive subgraph in each subgraph is determined as follows: if the adjacent edge belongs to the subgraph, then the weight of the adjacent edge in the subgraph is the average weight of the adjacent edge in the subgraph; if the adjacent edge does not belong to the subgraph, then the weight of the adjacent edge in the subgraph is the original weight of the adjacent edge in the undirected adjacent edge weighted connected graph; The weight of the adjacent edge in the comprehensive subgraph is the weight of the adjacent edge in the subgraph multiplied by the cumulative sum of the importance of the optimization target related to the subgraph; Generate a Steiner tree based on the comprehensive subgraph.
11. The method according to claim 1, characterized in that S6 also includes: recording the minimum cumulative moving step length corresponding to when any two iteration starting points t1 and t2 are first associated with the same node; S2 also includes: when the iteration starting point t2 can be along the adjacent edge<p1,p2> When spreading from node p2 to node p1, it is also necessary to determine whether the following conditions are met. If so, the iteration starting point t2 is determined along the adjacent edge<p1,p2> Diffusion information from node p2 to node p1: The iteration starting point t1 does not pass through the adjacent edge<p1,p2> ;or Iterate starting point t1 through adjacent edges<p1,p2> Diffusion from node p2 to node p1; or Iterate starting point t1 through adjacent edges<p1,p2> Diffusion from node p1 to node p2 and iteration starting point t2 along the adjacent edge<p1,p2> The static diffusion weight from the node p2 to the node p1 is less than or equal to K×the minimum cumulative moving step length, where K>=2.
12. The method according to claim 7, characterized in that Step S7 in the process of regenerating the subgraph is replaced by: Determine whether there are some iteration starting points connected together in the currently determined subgraph. If so, abstract the local connection graph consisting of the iteration starting points, nodes on the connection path, and adjacent edges that are connected together in the currently determined subgraph into an abstract node, and establish a mapping relationship between the abstract node and the local connection graph; Replace the current subgraph and undirected band with an abstract node The local connection graph in the weighted connected graph is obtained, and the abstract node is added as the iteration starting point, and the above steps of determining the subgraph, determining the amortized weights of adjacent edges, and generating the Steiner tree are re-executed on the undirected weighted connected graph; If not, determine whether all iteration starting points are connected together. If so and there are abstract nodes, replace the abstract nodes in the subgraph with their mapped local connection graphs.
13. The method according to claim 1, characterized in that S2 also includes: For example, a node p1 is connected to<p1,p2> If the iterative starting point of the diffusion to node p2 does not have the same iterative starting point as the iterative starting point of the diffusion to node p2 from other adjacent nodes, then node p2 is used as the diffusion node, node p1 is used as the diffused node, and node p2 is associated but not connected by adjacent edges.<p1,p2> The starting point of the iteration that diffuses to the node p1 is the node to be diffused.
14. A Steiner tree construction device based on an undirected adjacent edge weighted connected graph, characterized in that: include: An initialization unit, used to obtain an undirected weighted connected graph of adjacent edges and an iteration starting point of the optimization target in the target business scenario; Initialize the shortest path information of the iteration starting point, the cumulative moving step length, the cumulative diffusion weight of the iteration starting point associated with itself and the iteration starting point associated with the iteration starting point, and the shortest path information of the node includes the predecessor node and the shortest path length, which is used to determine the shortest path; A diffusion information determination unit, for determining diffusion information for an adjacent edge on a currently determined subgraph and a shortest path, if an iteration starting point associated with an end node thereof does not pass through the adjacent edge; The diffusion information includes: a diffusion node, a diffused node, and an iterative starting point to be diffused, wherein the iterative starting point to be diffused belongs to an iterative starting point associated with the diffusion node but has not diffused to the diffused node through the adjacent edge; the subgraph contains multiple paths connecting different iterative starting points; According to the optimization target, the diffusion information and the cumulative diffusion weight of the iterative starting point to be diffused, the static diffusion weight of diffusing the iterative starting point to be diffused from the diffusion node to the diffused node is determined; A pathfinding information determination unit, used to use a node with an unprocessed adjacent edge in the currently determined shortest path as a pathfinding node, and determine the static movement weight of the unprocessed adjacent edge of the pathfinding node according to the optimization target, the iteration starting point associated with the two end nodes of the unprocessed adjacent edge of the pathfinding node, and the shortest path length of the end node associated with the iteration starting point; The first judgment unit is used to select the unprocessed adjacent edge with the minimum static movement weight as the target adjacent edge and the diffusion node with the minimum static diffusion weight as the target diffusion node; judge whether the minimum static movement weight is less than the minimum static diffusion weight, if so, it is executed by the path optimization unit, if not, it is executed by the diffusion processing unit; The path optimization unit is used to update the cumulative moving step length to the minimum static moving weight, set each target adjacent edge as processed in turn, update the path finding node and its shortest path information and the static moving weight of the unprocessed adjacent edge according to each target adjacent edge, update the diffusion information and static diffusion weight, determine the path connecting different iteration starting points and add it to the subgraph; A diffusion processing unit is used to diffuse the to-be-diffused iteration starting point of the target diffusion node to the related diffused nodes in sequence. If the diffused node is not associated with the to-be-diffused iteration starting point, associate the to-be-diffused iteration starting point with it, determine the number of adjacent edge diffusion iteration starting points, update the cumulative diffusion weight of the iteration starting point newly associated with the related diffused node to the minimum static diffusion weight, and update the diffusion information, static diffusion weight and static movement weight; The second judgment unit is used to judge whether all the iteration starting points are connected together. If not, the first judgment unit continues to execute. If yes, the diffusion processing unit continues to execute until the cumulative moving step length is less than the minimum static diffusion weight; The Steiner tree generation unit is used to determine the average weight of the adjacent edges by using the weights of the adjacent edges in the subgraph and the number of diffusion iteration starting points thereof, and to generate a Steiner tree according to the average weights of the subgraph and the adjacent edges.
15. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 13 is implemented.
16. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor of a computer device, the method according to any one of claims 1 to 13 is implemented.
Citation Information
Patent Citations
Two-step X-structure Steiner minimum tree construction method
CN111582431A
Steiner tree construction method and device based on undirected adjacent edge weighted connected graph
CN116595229A
Cable network regional connectivity planning method and apparatus
US20230118359A1
