A network topology map path acquisition system and method

By using linked lists and adjacency lists, the intermediate nodes between the starting point and the ending point are first identified. The paths between the intermediate nodes and the starting point and the ending point are calculated respectively. All paths are obtained by permutation and combination. This solves the problems of large amount of computation and low efficiency in the existing technology and realizes efficient path calculation.

CN117240771BActive Publication Date: 2026-11-06NAT QUANTUM COMM (GUANGDONG) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211187408.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-27
Publication Date
2026-11-06
Estimated Expiration
2042-09-27

AI Technical Summary

Technical Problem

Existing technologies involve large computational loads and low efficiency when calculating the path between any two points in a network topology graph.

Method used

The linked list module and the adjacency list module are used to establish the connection relationship between nodes. The starting point and the ending point are marked by the identifier module. The filtering module selects the set of intermediate nodes. The traversal module traverses the path. Finally, all paths are obtained by permutation and combination.

Benefits of technology

It reduces the amount of path calculation, improves computational efficiency, and can quickly find all paths and determine the optimal path.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117240771B_ABST
    Figure CN117240771B_ABST
Patent Text Reader

Abstract

The application discloses a network topology graph path acquisition system and method, which comprises an import module, a linked list module, an adjacency list module, an identification module, a screening module and a traversal module. The import module imports a topology graph. The linked list module sequentially puts all nodes in the network topology graph into the linked list. The adjacency list module establishes an adjacency list for each node in the linked list. The identification module determines the start point and the end point of the topology graph and marks the adjacency list. The screening module is used for selecting the adjacency list set containing both mark 1 and mark 2, selecting the nodes corresponding to each adjacency list in the adjacency list set and forming an intermediate node set. The traversal module finds all paths from the start point to the intermediate point and from the intermediate point to the end point by using the traversal method. The method finds the intermediate node first, calculates the paths between the intermediate node and the start point and the end point respectively, reduces the number of nodes in the path, saves the calculation amount and improves the efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of quantum information and network communication, and specifically to a method for obtaining any path in a network topology graph. Background Technology

[0002] A topology diagram is a network structure diagram composed of network nodes and associated media. The topology diagram mentioned in this solution can be a network node topology diagram, a hub diagram of urban transportation, a route map involved in navigation software, or a topology diagram of a quantum-classical communication convergence network.

[0003] Quantum information networks represent a new generation of communication network development trends. In a network topology, there are multiple network nodes, and there is at most one edge (path) between any two nodes. Given any two nodes, there are multiple paths between them, and it is necessary to find all the paths and determine the optimal path.

[0004] In existing technologies, if we want to find all paths from node A to node B, we usually use a stack to store the paths and an array to store the marked nodes. By popping and pushing from the stack, we can complete the search for paths in the topology graph. However, this search method has a very large amount of computation and is inefficient.

[0005] Therefore, it is necessary to further improve the existing technology and provide a path selection method that reduces computational load and has high computational efficiency. Summary of the Invention

[0006] To address the aforementioned technical issues, a method is proposed that reduces computational load and increases computational efficiency to obtain all paths between any two points in the topology graph.

[0007] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0008] A network topology map path acquisition system includes an import module, a linked list module, an adjacency list module, an identification module, a filtering module, and a traversal module, wherein:

[0009] The import module is used to import a network topology diagram, which includes all nodes and the connection relationships between the nodes.

[0010] The linked list module contains a linked list, and all nodes in the network topology imported by the import module are sequentially placed into the linked list.

[0011] The adjacency list module is used to create an adjacency list for each node in the linked list in the order of the linked list. The adjacency list contains all the adjacent nodes that are directly connected to the node.

[0012] The identification module determines the starting node A and ending node B of the network topology graph, and marks the adjacency list as follows:

[0013] The first part of the adjacency list is marked as Y1. The first part of the adjacency list contains either the starting point A or any one of the nodes in the adjacency list of the starting point A.

[0014] The second part of the adjacency list is marked as Y2. The second part of the adjacency list contains any one of the nodes in the adjacency list of the endpoint B or the starting point B.

[0015] The filtering module is used to select a set D of adjacency lists that contains both label Y1 and label Y2, and to select the node corresponding to each adjacency list in the set D to form an intermediate node set C.

[0016] The traversal module uses a traversal method to traverse all adjacency lists marked B1 to find all paths from node C1 to the destination B.

[0017] A method for obtaining any path in a network topology map, which applies the aforementioned system for obtaining any path in a network topology map, includes the following steps:

[0018] Step 1: Import the topology graph, which includes all nodes and the connection relationships between them;

[0019] Step 2: Create a linked list and put all the nodes in the topology graph into the linked list in sequence;

[0020] Step 3: Create an adjacency list: Following the order of the linked list, create an adjacency list for each node in the linked list. The adjacency list contains all the adjacent nodes that are directly connected to that node.

[0021] Step 4: Determine the starting node A and the ending node B;

[0022] Step 5: Mark the first part of the adjacency list as Y1. The first part of the adjacency list contains the starting point A or any one of the nodes in the adjacency list of the starting point A.

[0023] Step 6: Mark the second part of the adjacency list as Y2. The second part of the adjacency list contains any one of the nodes in the adjacency list of the endpoint B or the starting point B.

[0024] Step 7: Select the set D of adjacency lists that contains both label Y1 and label Y2, and select the node corresponding to each adjacency list in the set D to form the set C of intermediate nodes;

[0025] Step 8: Use a traversal method to traverse all adjacency lists marked A1 to find all paths from the starting point A to any node C1 in the set of intermediate nodes C;

[0026] Step 9: Use a traversal method to traverse all adjacency lists marked B1 to find all paths from node C1 to the destination B;

[0027] Step 10: Repeat steps 8-9 to find the path X1 from the starting point A to all nodes in the intermediate node set C, and the path X2 from the endpoint B of all nodes in the intermediate node set C.

[0028] Step 11: Arrange and combine the paths X1 and X2 obtained in Step 8 and Step 9 to obtain all paths from starting point A to ending point B.

[0029] Preferably, step 8, which uses a traversal method to find all paths from the starting point A to the intermediate node C, is as follows:

[0030] Step 8-1: Starting point A selects any neighboring node A1 in its adjacency list;

[0031] Step 8-2: Find the adjacency list corresponding to A1, and determine whether there is an intermediate node C1 in the adjacency list of A1: If there is an intermediate node C1, the traversal ends and the path is exported;

[0032] Step 8-3: If there is no intermediate node C1, continue to select any node that has not been traversed in the adjacency list, find the adjacency list of the node, determine whether it contains an intermediate node C1, and then repeat steps 8-2 and 8-3 until all nodes have been traversed.

[0033] Step 8-4: Select the remaining untraversed nodes An in the adjacency list of starting point A, and repeat steps 8-2 and 8-3 to find all paths from starting point A to intermediate node C1.

[0034] The beneficial technical effects of this invention are as follows: This invention uses linked lists and adjacency lists to first find the intermediate nodes between the starting point and the ending point. Then, it searches for the paths between the starting point and the intermediate nodes, and between the intermediate nodes and the ending point, respectively. Finally, it obtains all paths through permutations and combinations. This method first finds the intermediate nodes and then calculates the paths between the intermediate nodes and the starting point and the ending point. Because the number of nodes in the path is reduced, the computational workload of finding paths is greatly reduced, thus improving work efficiency. Attached Figure Description

[0035] Figure 1 This is a block diagram of the overall structure of a network topology graph path acquisition system according to the present invention.

[0036] Figure 2 This is a network topology diagram according to one embodiment of a network topology diagram path acquisition method of the present invention;

[0037] Figure 3This is a flowchart illustrating the steps of a network topology map path acquisition method according to the present invention. Detailed Implementation

[0038] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the embodiments. However, the scope of protection of this invention is not limited to the specific embodiments described below.

[0039] like Figure 1 As shown, a network topology map path acquisition system includes an import module, a linked list module, an adjacency list module, an identification module, a filtering module, and a traversal module, wherein:

[0040] The import module is used to import a network topology diagram, which includes all nodes and the connection relationships between the nodes.

[0041] The linked list module contains a linked list, and all nodes in the network topology imported by the import module are sequentially placed into the linked list.

[0042] The adjacency list module is used to create an adjacency list for each node in the linked list in the order of the linked list. The adjacency list contains all the adjacent nodes that are directly connected to the node.

[0043] The identification module determines the starting node A and ending node B of the network topology graph, and marks the adjacency list as follows:

[0044] The first part of the adjacency list is marked as Y1. The first part of the adjacency list contains either the starting point A or any one of the nodes in the adjacency list of the starting point A.

[0045] The second part of the adjacency list is marked as Y2. The second part of the adjacency list contains any one of the nodes in the adjacency list of the endpoint B or the starting point B.

[0046] The filtering module is used to select a set D of adjacency lists that contains both label Y1 and label Y2, and to select the node corresponding to each adjacency list in the set D to form an intermediate node set C.

[0047] The traversal module uses a traversal method to traverse all adjacency lists marked B1 to find all paths from node C1 to the destination B.

[0048] like Figures 2-3 As shown, a method for obtaining any path in a network topology map is provided, which corresponds to the aforementioned system for obtaining any path in a network topology map. The method includes the following steps:

[0049] Step 1: Import the topology graph, which includes all nodes and the connection relationships between them;

[0050] Step 2: Create a linked list and put all the nodes in the topology graph into the linked list in sequence;

[0051] Step 3: Create an adjacency list: Following the order of the linked list, create an adjacency list for each node in the linked list. The adjacency list contains all the adjacent nodes that are directly connected to that node.

[0052] Step 4: Determine the starting node A and the ending node B;

[0053] Step 5: Mark the first part of the adjacency list as Y1. The first part of the adjacency list contains the starting point A or any one of the nodes in the adjacency list of the starting point A.

[0054] Step 6: Mark the second part of the adjacency list as Y2. The second part of the adjacency list contains any one of the nodes in the adjacency list of the endpoint B or the starting point B.

[0055] Step 7: Select the set D of adjacency lists that contains both label Y1 and label Y2, and select the node corresponding to each adjacency list in the set D to form the set C of intermediate nodes;

[0056] Step 8: Use a traversal method to traverse all adjacency lists marked A1 to find all paths from the starting point A to any node C1 in the set of intermediate nodes C;

[0057] Step 9: Use a traversal method to traverse all adjacency lists marked B1 to find all paths from node C1 to the destination B;

[0058] Step 10: Repeat steps 8-9 to find the path X1 from the starting point A to all nodes in the intermediate node set C, and the path X2 from the endpoint B of all nodes in the intermediate node set C.

[0059] Step 11: Arrange and combine the paths X1 and X2 obtained in Step 8 and Step 9 to obtain all paths from starting point A to ending point B.

[0060] After obtaining all paths, the optimal path is determined based on the weight of each path. The specific method is as follows:

[0061] Step 12-1: Assign a weight to the edge (path) between any two nodes based on its importance, distance, or priority. The weights are assigned according to the following principles: higher importance, higher weight; shorter distance, higher weight; higher priority, higher weight.

[0062] Step 12-2: Calculate the sum of the weights of all edges in any path to obtain the weight sum;

[0063] Step 12-3: Compare the sum of weights of all paths, select the path with the maximum sum of weights, and the path with the maximum sum of weights is the optimal path.

[0064] Specifically, the steps in step 8 to find all paths from the starting point A to any node C1 in the set of intermediate nodes C using a traversal method are as follows:

[0065] Step 8-1: Starting point A selects any neighboring node A1 in its adjacency list;

[0066] Step 8-2: Find the adjacency list corresponding to A1, and determine whether there is an intermediate node C1 in the adjacency list of A1: If there is an intermediate node C1, the traversal ends and the path is exported;

[0067] Step 8-3: If there is no intermediate node C1, continue to select any node that has not been traversed in the adjacency list, find the adjacency list of the node, determine whether it contains an intermediate node C1, and then repeat steps 8-2 and 8-3 until all nodes have been traversed.

[0068] Step 8-4: Select the remaining untraversed nodes An in the adjacency list of starting point A, and repeat steps 8-2 and 8-3 to find all paths from starting point A to any node C1 in the node set C. The traversal method used in step 9 is the same as that in step 8.

[0069] like Figure 1 For a real topology graph, node 3 is selected as the starting node and node 6 as the ending node. The specific operation steps according to the scheme of this embodiment are as follows:

[0070] Step 1: Import the topology graph and obtain all nodes 0, 1, 2, 3, 4, 5, 6, 7.

[0071] Step 2: Create a linked list and put all the nodes 0, 1, 2, 3, 4, 5, 6, 7 in the topology graph into the linked list in sequence, as shown in Table 1:

[0072] Table 1

[0073] 0 1 2 3 4 5 6 7

[0074] Step 3: Create an adjacency list: Following the order of the linked list, create an adjacency list for each node in the linked list. The adjacency list contains all the adjacent nodes that are directly connected to that node, as shown in Table 2:

[0075] Table 2

[0076]

[0077] Step 4: Determine the starting node 3 and the ending node 6;

[0078] Step 5: Mark the first part of the adjacency list as Y1. The first part of the adjacency list contains the starting point A or any one of the nodes in the adjacency list of the starting point A.

[0079] The critical list that contains the starting node 3 and the corresponding adjacency list containing either node 1 or 7 in the adjacency list (1, 7) is marked as Y1 as long as the adjacency list contains either node 3, 1, or 7.

[0080] Step 6: Mark the second part of the adjacency list as Y2. The second part of the adjacency list contains any one of the nodes in the adjacency list of the endpoint B or the starting point B.

[0081] That is, the adjacency list of any one of the nodes 2 and 5 that contains the endpoint node 6 and its corresponding adjacency list (2, 5) is marked as Y2;

[0082] Step 7: Select the adjacency list D that contains both Y1 and Y2, and determine the node corresponding to the adjacency list D as the intermediate node set C. As shown in Table 2, the adjacency list simultaneously labeled Y1 and Y2 is (1, 2), and node 0 is the corresponding intermediate node. In this case, only one adjacency list satisfies this condition. In practical applications, there may be multiple such adjacency lists, thus forming multiple intermediate node sets.

[0083] Step 8: Use a traversal method to traverse all adjacency lists marked A1 to find all paths from the starting point A to any node C1 in the set of intermediate nodes C; that is, use a traversal method to find all paths from the starting point 3 to 0.

[0084] Step 9: Use a traversal method to traverse all adjacency lists marked B1 to find all paths from intermediate node C1 to the endpoint B; that is, use a traversal method to find all paths from the starting point 0 to 6.

[0085] Step 10: Arrange and combine the paths obtained in Step 8 and Step 9 to obtain all paths from starting point A to ending point B.

[0086] In this case, step 8, which uses a traversal method to find all paths from the starting point 3 to the intermediate node 0, follows these steps:

[0087] Step 8-1: Starting point 3 selects any neighboring node 1 in its adjacency list (1, 7);

[0088] Step 8-2: Find the adjacency list of the corresponding node 1, and determine whether there is an intermediate node 0 in the adjacency list of node 1: if there is an intermediate node 0, the traversal ends and the path is exported.

[0089] Step 8-3: If there is no intermediate node C1, continue to select any node that has not been traversed in the adjacency list, find the adjacency list of the node, determine whether it contains an intermediate node C1, and then repeat steps 8-2 and 8-3 until all nodes have been traversed.

[0090] Step 8-4: Select the remaining untraversed nodes An in the adjacency list of starting point A, and repeat steps 8-2 and 8-3 to find all paths from starting point A to intermediate node C1.

[0091] The traversal method used in step 9 is the same as that used in step 8.

[0092] Based on the disclosure and teachings of the foregoing specification, those skilled in the art can make changes and modifications to the above embodiments. Therefore, the present invention is not limited to the specific embodiments disclosed and described above, and some modifications and changes to the invention should also fall within the protection scope of the claims of the present invention. Furthermore, although some specific terms are used in this specification, these terms are only for convenience of explanation and do not constitute any limitation on the invention.

Claims

1. A network topology map path acquisition system, characterized in that, It includes an import module, a linked list module, an adjacency list module, an identifier module, a filtering module, and a traversal module, among which: The import module is used to import a network topology diagram, which includes all nodes and the connection relationships between the nodes. The linked list module contains a linked list, and all nodes in the network topology imported by the import module are sequentially placed into the linked list. The adjacency list module is used to create an adjacency list for each node in the linked list in the order of the linked list. The adjacency list contains all the adjacent nodes that are directly connected to the node. The identification module determines the starting node A and ending node B of the network topology graph, and marks the adjacency list as follows: The first part of the adjacency list is marked as Y1. The first part of the adjacency list contains either the starting point A or any one of the nodes in the adjacency list of the starting point A. The second part of the adjacency list is marked as Y2. The second part of the adjacency list contains any one of the nodes in the adjacency list of the endpoint B or the starting point B. The filtering module is used to select a set D of adjacency lists that contains both label Y1 and label Y2, and to select the node corresponding to each adjacency list in the set D to form an intermediate node set C. The traversal module uses a traversal method to traverse all adjacency lists marked as B1 to find all paths from node C1 to the endpoint B. The steps to find all paths from the starting point B to the set of intermediate nodes C using a traversal method are as follows: Step 8-1: Start point B selects any neighboring node B1 from its adjacency list; Step 8-2: Find the adjacency list of B1, and determine whether B1's adjacency list contains any node C1 in the set of intermediate nodes C: If it contains an intermediate node C1, the traversal ends and the path is derived. Step 8-3: If there is no intermediate node C1, continue to select any node that has not been traversed in the adjacency list, find the adjacency list of the node, determine whether it contains an intermediate node C1, and then repeat steps 8-2 and 8-3 until all nodes have been traversed. Step 8-4: Select the remaining untraversed node An in the adjacency list of starting point B, and repeat steps 8-2 and 8-3 to find all paths from starting point B to intermediate node C1.

2. A method for obtaining any path in a network topology graph, employing the network topology graph arbitrary path acquisition system as described in claim 1, characterized in that, The method includes the following steps: Step 1: Import the topology graph, which includes all nodes and the connection relationships between them; Step 2: Create a linked list and put all the nodes in the topology graph into the linked list in sequence; Step 3: Create an adjacency list: Following the order of the linked list, create an adjacency list for each node in the linked list. The adjacency list contains all the adjacent nodes that are directly connected to that node. Step 4: Determine the starting node A and the ending node B; Step 5: Mark the first part of the adjacency list as Y1. The first part of the adjacency list contains the starting point A or any one of the nodes in the adjacency list of the starting point A. Step 6: Mark the second part of the adjacency list as Y2. The second part of the adjacency list contains any one of the nodes in the adjacency list of the endpoint B or the starting point B. Step 7: Select the set D of adjacency lists that contains both label Y1 and label Y2, and select the node corresponding to each adjacency list in the set D to form the set C of intermediate nodes; Step 8: Use a traversal method to traverse all adjacency lists marked A1 to find all paths from the starting point A to any node C1 in the set of intermediate nodes C; The steps to find all paths from starting point A to the set of intermediate nodes C using a traversal method are as follows: Step 8-1: Starting point A selects any neighboring node A1 in its adjacency list; Step 8-2: Find the adjacency list corresponding to A1, and determine whether the adjacency list of A1 contains any node C1 in the set of intermediate nodes C: if it contains an intermediate node C1, the traversal ends and the path is derived; Step 8-3: If there is no intermediate node C1, continue to select any node that has not been traversed in the adjacency list, find the adjacency list of the node, determine whether it contains an intermediate node C1, and then repeat steps 8-2 and 8-3 until all nodes have been traversed. Step 8-4: Select the remaining untraversed node An in the adjacency list of starting point A, and repeat steps 8-2 and 8-3 to find all paths from starting point A to intermediate node C1. Step 9: Use a traversal method to traverse all adjacency lists marked B1 to find all paths from node C1 to the destination B; Step 10: Repeat steps 8-9 to find the path X1 from the starting point A to all nodes in the intermediate node set C, and the path X2 from the endpoint B of all nodes in the intermediate node set C. Step 11: Arrange and combine the paths X1 and X2 obtained in Step 8 and Step 9 to obtain all paths from starting point A to ending point B.

3. The method for obtaining any path in a network topology graph as described in claim 2, characterized in that: The traversal method used in step 9 is the same as that used in step 8.

Citation Information

Patent Citations

  • Network topology path determination method and device and terminal equipment

    CN109768883A

  • Shortest path search method "Midway"

    US20040073702A1