Shortest path divide-and-conquer search method based on agglomerative hierarchy

By performing hierarchical partitioning and divide-and-conquer search on the edge computing network, the problem of low path search efficiency in large and complex networks is solved, and efficient shortest path search is achieved.

CN117251642BActive Publication Date: 2026-02-24XIAN UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311085242.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-25
Publication Date
2026-02-24
Estimated Expiration
2043-08-25

AI Technical Summary

Technical Problem

Traditional path search methods are computationally complex in large and complex networks, struggle to handle dynamically changing network environments, and are difficult to deal with complex weight situations, resulting in low efficiency.

Method used

A shortest path divide-and-conquer search method based on agglomerative hierarchy is adopted. The edge computing network is hierarchically divided by agglomerative hierarchical clustering, the search level is restricted, and the search process is divided into multiple sub-tasks. The Dijkstra and SPFA algorithms are used to perform path search at the specified levels.

Benefits of technology

It improves the efficiency of path search, reduces computational complexity, reduces invalid computation, and realizes efficient shortest path search in edge computing networks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117251642B_ABST
    Figure CN117251642B_ABST
Patent Text Reader

Abstract

The application discloses a shortest path divide-and-conquer search method based on a condensation level, improves the operation efficiency of an algorithm by introducing network layering, limiting a search level, divide-and-conquer search and the like, wherein the network layering is adopted to divide network nodes according to a condensation level clustering method, a plurality of level subgraphs are obtained, and the complexity of the search is reduced; the search range is limited within a certain level by limiting the search level, and invalid calculation in the search process is avoided; meanwhile, in order to further improve the search efficiency, the divide-and-conquer search is adopted to divide the whole search process into a plurality of subtasks and perform simultaneously, and the whole search method can accurately and efficiently perform the shortest path search in an edge computing network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of network path search technology, and relates to a shortest path divide-and-conquer search method based on agglomerative hierarchy. Background Technology

[0002] In large-scale networks, such as social networks, the Internet of Things (IoT), and transportation networks, path search is a fundamental and crucial task. Its main objective is to find the shortest or optimal path between two nodes in the network. However, due to the scale and complexity of these networks, traditional path search methods such as Dijkstra's algorithm and Floyd's algorithm are inefficient in large-scale networks and struggle to handle dynamically changing network environments.

[0003] To address this issue, researchers have proposed numerous path search methods based on graph theory and complex network theory. First, computational complexity must be considered. For massive networks, such as global social networks or the internet, traditional path search methods like Dijkstra's and Floyd's algorithms have extremely high computational complexity. The number of nodes and edges they handle can reach billions, leading to excessively long computation times and failing to meet real-time or near-real-time requirements. Second, traditional algorithms struggle with dynamically complex networks. Network structures are often not static; for example, in traffic networks, road conditions may constantly change due to traffic congestion or road construction. In such cases, traditional methods need to recalculate the entire network, requiring significant computational resources and time. Traditional path search methods often make decisions based on local information, which leads to a lack of global optimization, and the algorithm's return value often fails to find the globally optimal solution. For example, Dijkstra's algorithm selects the shortest edge at each step, but this may result in a path that is not globally shortest. Finally, in real-world networks, edge weights may not be singular but may incorporate multiple factors such as distance, time, and cost. Traditional path search methods often struggle to handle such complex weighting situations. Summary of the Invention

[0004] The purpose of this invention is to provide a shortest path divide-and-conquer search method based on agglomerative hierarchy, which solves the problem of low efficiency and long running time of existing shortest path search methods for large and complex networks.

[0005] The technical solution adopted in this invention is a shortest path divide-and-conquer search method based on agglomerative hierarchical clustering, which includes using agglomerative hierarchical clustering to divide the edge computing network into hierarchical levels, presenting the edge computing network in a hierarchical manner and establishing directed connections between layers, restricting the search level so that each path search is completed within a specified level, and simultaneously using divide-and-conquer search to divide the entire search process into multiple sub-tasks and perform them simultaneously to complete the shortest path search.

[0006] The invention is further characterized in that,

[0007] The specific steps are as follows:

[0008] Step 1: Perform data preprocessing on the node data and edge relationship data of the network. Nodes are connected to IoT devices in the network, and edge relationships represent the transmission direction of data flow between devices. Finally, a complete edge computing network is constructed.

[0009] Step 2: Convert the edge computing network into a degree matrix, use agglomerative hierarchical clustering to divide the network into levels, add the level information to the node attributes, and finally merge the duplicate relationships between the levels and establish a level index.

[0010] Step 3: Input the source node (starting device name) and target node (target device name) into the edge computing network with established hierarchical index, and check the existence of the nodes. If the input source node or target node name is incorrect or does not exist, prompt for re-entry or exit. If it exists, extract the hierarchical relationship based on the hierarchical information data in the node attributes, judge the extracted hierarchical relationship, and finally return the hierarchical relationship type and hierarchical relationship chain.

[0011] Step 4: Determine the hierarchical relationship type and hierarchical relationship chain. If the hierarchical relationship type is single-level, use Dijkstra's single-source shortest path algorithm to perform a single-level search and directly output the search results.

[0012] If the hierarchical relationship type is multi-level, the search level range is restricted. Specifically, the range is the level involved in the hierarchical relationship chain. The SPFA algorithm is used to search for paths at each adjacent level in the hierarchical relationship chain. If a path exists, it is concatenated and output. If the hierarchical relationship does not exist, the path does not exist, and the operation ends.

[0013] Step 1 is implemented in the following steps:

[0014] Step 1.1: Parse the network node data and edge relationship data from the raw data, clean up redundant data, unify the data format of node and edge relationships, provide reliable input for subsequent steps, and store the processing results in a CSV file;

[0015] Step 1.2: Use the read_csv function to extract the names of IoT devices and create a unique index for each IoT device; while extracting the device names, obtain the transmission direction information of the data flow between devices, thereby obtaining the directed edge relationship between nodes;

[0016] The extracted node index values ​​and edge connections are imported into the database to create nodes and directed edges in a complex network. Attribute information is added to the nodes, including device name, device type, device runtime, etc., and finally a complete edge computing network is constructed.

[0017] Step 2 is implemented in the following steps:

[0018] Step 2.1: Vectorize the edge computing network constructed in Step 1;

[0019] Step 2.2: Use agglomerative hierarchical clustering to divide the network into layers;

[0020] Step 2.3: Write the hierarchy information into the node attributes;

[0021] Step 2.4: Merge duplicate variable relationships between different levels and create a hierarchical index.

[0022] Step 2.1 specifically involves:

[0023] Step 2.1.1: Construct the adjacency matrix A: Represent the connection relationships between nodes in the edge computing network as an n×n matrix, where n is the number of nodes in the network. If there is a connection between node i and node j, and i and j are not equal, then A... ij =1, otherwise A ij =0;

[0024] Step 2.1.2: Construct the degree matrix D: Represent the degree of each node, i.e., the number of edges connected to that node, as a diagonal matrix, i.e., D. ii The degree of node i is represented using the `diag` function from the NumPy library, as shown below.

[0025]

[0026] Step 2.1.3: Combine the degree matrix and the adjacency matrix to construct a symmetric normalized Laplacian matrix L, where I represents the identity matrix, as shown below;

[0027]

[0028] Step 2.1.4: Perform eigenvalue decomposition on the Laplace matrix L: Perform eigenvalue decomposition on the Laplace matrix L to obtain the eigenvector matrix V and the diagonal eigenvalue matrix Λ, where each column of V is an eigenvector, and the elements on the diagonal of Λ are eigenvalues.

[0029] LV = VΛ;

[0030] Step 2.1.5: Take the first k eigenvectors: Use the first k columns of the eigenvector matrix V as the vectorized representation of the network, where... The eigenvector matrix V represents the first... In the column, k is a user-defined hyperparameter.

[0031] X = [v1, v2, ..., v k ].

[0032] Step 2.2 specifically involves,

[0033] Step 2.2.1: Expand the degree matrix of each node into a vector row by row, and calculate the Pearson correlation coefficient S for each pair of nodes i and j using the following formula. ij ,

[0034]

[0035] In equation (1), m is the dimension of the vector, and X ik and X jk Vectors x representing nodes i and j respectively i and x j The kth element, and They represent x respectively i and x j The average value;

[0036] Pearson correlation coefficient S between all nodes ij Form a similarity matrix S, where S is an n×n matrix and n is the number of nodes in the network. ij This represents the similarity between node i and node j;

[0037] Step 2.2.2: Select nodes with high similarity and merge them to cluster the similarity matrix. Specifically, calculate the similarity matrix, initialize the clusters, compare the similarity between clusters, merge the clusters with the highest similarity, update the similarity matrix, and repeat the merging steps until the stopping condition is met. Finally, output the clustering results.

[0038] The two clusters C are calculated using the following formula. i and C j The similarity between sim(C) i C j ), where C i and C j The cluster represents the group of nodes, while x and y represent the vector representations of two distinct nodes.

[0039]

[0040] Step 2.2.3: Calculate the simple connectivity between the two clusters using the following formula.

[0041]

[0042] In equation (3), |C i |and|C j | represent clustering C respectively i and C j The number of nodes in T(C); i C j Clustering C i and clustering C j The simple connectivity between two clusters, i.e., the average similarity between all nodes in two clusters;

[0043] Step 2.2.4: After clustering the similarity matrix, output the clustering result L. i The clustering result is the cluster label, i.e., the hierarchical information.

[0044] L i =j|S ij >θ (4)

[0045] In equation (4), L i S represents the list of nodes in the i-th cluster. ij θ represents the similarity between node i and node j in the similarity matrix S, and θ is the clustering threshold used to control the granularity of clustering.

[0046] Step 2.4 specifically involves,

[0047] For each cluster, an empty list is created to store the source cluster numbers of the directed edges pointing to that cluster. All directed edges are traversed, and the source cluster numbers are added to the list of target clusters. For each cluster, the source cluster numbers that appear repeatedly in the list are merged to obtain all the source cluster numbers pointed to by that cluster. The directed edges between the clusters corresponding to the source cluster numbers and the target clusters are merged into one directed edge. Finally, a dictionary is created, with the number of each cluster as the key and the list of all source cluster numbers pointed to by that cluster as the value. This dictionary is the index of the cluster information.

[0048] Step 3 specifically involves:

[0049] Step 3.1, Node Existence Check: Input the source node and the target node. The database established in Step 1.2 will be used to query the unique index of the node. If the index of any node does not exist, it means that the input node name is incorrect or does not exist. You will be prompted to re-enter or exit.

[0050] Step 3.2: Extract the hierarchy information from the node attributes using the input node name. If the hierarchy information of two nodes is the same, that is, the two nodes are in the same level, the hierarchy relationship chain is classified as a single level; if the hierarchy relationship between two nodes is not in the same level, the BiDFS path search method is used to obtain the hierarchy relationship chain.

[0051] Step 4 specifically involves:

[0052] Step 4.1: Use the subgraph extraction function provided by igraph to limit the search level of the constructed edge computing network. Specifically, use the subgraph() function to extract subgraphs in the complete network and filter nodes using conditional filtering methods.

[0053] Step 4.2: Identify the type of the hierarchical relationship chain finally obtained in Step 3. If the type is single-layer, use Dijkstra's single-source shortest path algorithm to search for the shortest path in the single-layer network.

[0054] If the hierarchical relationship chain type is multi-level, the divide-and-conquer method is used to extract all hierarchical information in the hierarchical relationship chain. The subgraph is filtered using the method in step 4.1, that is, the search area is limited to the levels involved in the hierarchical relationship chain. The SPFA algorithm is used to perform shortest path search in each adjacent level, and the path search of adjacent levels is performed simultaneously.

[0055] The beneficial effects of this invention are:

[0056] This invention presents a shortest path divide-and-conquer search method based on agglomerative hierarchical clustering. Compared to traditional shortest path search methods, which suffer from excessive computational load and long computation time, this invention improves the algorithm's efficiency by introducing network layering, limiting the search level, and employing divide-and-conquer search. Specifically, network layering is used to divide network nodes according to agglomerative hierarchical clustering, resulting in multiple levels of subgraphs, thereby reducing the complexity of the search. Furthermore, limiting the search level restricts the search scope to a certain level, avoiding invalid computations during the search process. To further improve search efficiency, divide-and-conquer search is used to divide the entire search process into multiple subtasks and perform them simultaneously. The entire search method can accurately and efficiently perform shortest path search in edge computing networks. Attached Figure Description

[0057] Figure 1 This is a flowchart of the shortest path divide-and-conquer search method based on agglomerative hierarchy according to the present invention. Detailed Implementation

[0058] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments.

[0059] Example 1

[0060] This embodiment provides a shortest path divide-and-conquer search method based on agglomerative hierarchy, which includes using agglomerative hierarchical clustering to divide the edge computing network into hierarchical levels, presenting the edge computing network in a hierarchical manner and establishing directed connections between layers, restricting the search level so that each path search is completed within a specified level, and using divide-and-conquer search to divide the entire search process into multiple sub-tasks and perform them simultaneously to complete the shortest path search.

[0061] Example 2

[0062] This embodiment provides a shortest path divide-and-conquer search method based on agglomerative hierarchy, which is implemented according to the following steps based on Embodiment 1:

[0063] Step 1: Perform data preprocessing on the node data and edge relationship data of the network. Nodes are connected to IoT devices in the network, and edge relationships are the transmission directions of data flow between devices. Finally, a complete edge computing network is constructed.

[0064] Step 2: Convert the edge computing network into a degree matrix, use agglomerative hierarchical clustering to divide the network into levels, add the level information to the node attributes, and finally merge the duplicate relationships between the levels and establish a level index.

[0065] Step 2.1: Vectorize the edge computing network constructed in Step 1;

[0066] Step 2.2: Use agglomerative hierarchical clustering to divide the network into layers;

[0067] Step 2.3: Write the hierarchy information into the node attributes;

[0068] Step 2.4: Merge duplicate variable relationships between levels and create a hierarchical index;

[0069] Step 3: Input the source node (starting device name) and target node (target device name) into the edge computing network with established hierarchical index, and check the existence of the nodes. If the input source node or target node name is incorrect or does not exist, prompt for re-entry or exit. If it exists, extract the hierarchical relationship based on the hierarchical information data in the node attributes, judge the extracted hierarchical relationship, and finally return the hierarchical relationship type and hierarchical relationship chain.

[0070] Step 4: Determine the hierarchical relationship type and hierarchical relationship chain. If the hierarchical relationship type is single-level, use Dijkstra's single-source shortest path algorithm to perform a single-level search and directly output the search results.

[0071] If the hierarchical relationship type is multi-level, the search level range is restricted. Specifically, the range is the level involved in the hierarchical relationship chain. The SPFA algorithm is used to search for paths at each adjacent level in the hierarchical relationship chain. If a path exists, it is concatenated and output. If the hierarchical relationship does not exist, the path does not exist, and the operation ends.

[0072] Example 3

[0073] This embodiment provides a shortest path divide-and-conquer search method based on agglomerative hierarchy, building upon Embodiments 1 and 2, such as... Figure 1 As shown, please follow these steps:

[0074] Step 1: Perform data preprocessing on the node data and edge relationship data of the network. Nodes are connected to IoT devices in the network, and edge relationships represent the transmission direction of data flow between devices. Finally, a complete edge computing network is constructed.

[0075] Step 1.1: Parse the network node data and edge relationship data from the raw data, clean up redundant data, unify the data format of node and edge relationships, provide reliable input for subsequent steps, and store the processing results in a CSV file;

[0076] Step 1.2: Use the read_csv function provided by the Pandas package to extract the names of IoT devices and create a unique index for each IoT device; while extracting the device names, obtain the transmission direction information of the data flow between devices, thereby obtaining the directed edge relationship between nodes;

[0077] The extracted node index values ​​and edge connections are imported into the database to create nodes and directed edges in a complex network. Attribute information is added to the nodes, including device name, device type, device runtime, etc., and finally a complete edge computing network is constructed.

[0078] Step 2.1: Vectorize the edge computing network constructed in Step 1;

[0079] Step 2.1.1: Construct the adjacency matrix A: Represent the connection relationships between nodes in the edge computing network as an n×n matrix, where n is the number of nodes in the network. If there is a connection between node i and node j, and i and j are not equal, then A... ij =1, otherwise A ij =0;

[0080] Step 2.1.2: Construct the degree matrix D: Represent the degree of each node, i.e., the number of edges connected to that node, as a diagonal matrix, i.e., D. ii The degree of node i is represented using the `diag` function from the NumPy library, as shown below.

[0081]

[0082] Step 2.1.3: Combine the degree matrix and the adjacency matrix to construct a symmetric normalized Laplacian matrix L, where I represents the identity matrix, as shown below;

[0083]

[0084] Step 2.1.4: Perform eigenvalue decomposition on the Laplace matrix L: Perform eigenvalue decomposition on the Laplace matrix L to obtain the eigenvector matrix V and the diagonal eigenvalue matrix Λ, where each column of V is an eigenvector, and the elements on the diagonal of Λ are eigenvalues.

[0085] LV = VΛ;

[0086] Step 2.1.5: Take the first k eigenvectors: Use the first k columns of the eigenvector matrix V as the vectorized representation of the network, where... The eigenvector matrix V represents the first... In the column, k is a user-defined hyperparameter.

[0087] X = [v1, v2, ..., v k ].

[0088] Step 2.2: Use agglomerative hierarchical clustering to divide the network into layers;

[0089] Step 2.2.1: Expand the degree matrix of each node into a vector row by row, and calculate the Pearson correlation coefficient S for each pair of nodes i and j using the following formula. ij ,

[0090]

[0091] In equation (1), m is the dimension of the vector, and X ik and X jk Vectors x representing nodes i and j respectively i and x j The kth element, and They represent x respectively i and x j The average value;

[0092] Pearson correlation coefficient S between all nodes ij Form a similarity matrix S, where S is an n×n matrix and n is the number of nodes in the network. ij This represents the similarity between node i and node j;

[0093] Step 2.2.2: Select nodes with high similarity to merge and cluster the similarity matrix. Specifically, calculate the similarity matrix, initialize the clusters, compare the similarity between clusters, merge the clusters with the highest similarity, update the similarity matrix, and repeat the merging steps until the stopping condition is met. Finally, output the clustering results.

[0094] The two clusters C are calculated using the following formula. i and C j The similarity between sim(C) i Cj ), where C i and C j The cluster represents the group of nodes, while x and y represent the vector representations of two distinct nodes.

[0095]

[0096] Step 2.2.3: Calculate the simple connectivity between the two clusters using the following formula.

[0097]

[0098] In equation (3), |C i |and|C j | represent clustering C respectively i and C j The number of nodes in T(C); i C j Clustering C i and clustering C j The simple connectivity between two clusters, i.e., the average similarity between all nodes in two clusters;

[0099] Step 2.2.4: After clustering the similarity matrix, output the clustering result L. i The clustering result is the cluster label, i.e., the hierarchical information.

[0100] L i =j|S ij >θ (4)

[0101] In equation (4), L i S represents the list of nodes in the i-th cluster. ij θ represents the similarity between node i and node j in the similarity matrix S, and θ is the clustering threshold used to control the granularity of clustering.

[0102] Step 2.3: Write the hierarchy information into the node attributes;

[0103] Add the layer attribute to the node attributes. For example, the attributes of node number 13268 are: Device Name: Motor Controller, Device Type: Intelligent Controller, Device Running Time: 4,316 min, Layer Information: 46 layers.

[0104] Step 2.4: Merge duplicate variable relationships between levels and create a hierarchical index;

[0105] For each cluster, an empty list is created to store the source cluster numbers of the directed edges pointing to that cluster. All directed edges are traversed, and the source cluster numbers are added to the list of target clusters. For each cluster, the source cluster numbers that appear repeatedly in the list are merged to obtain all the source cluster numbers pointed to by that cluster. The directed edges between the clusters corresponding to the source cluster numbers and the target clusters are merged into one directed edge. Finally, a dictionary is created, with the number of each cluster as the key and the list of all source cluster numbers pointed to by that cluster as the value. This dictionary is the index of the cluster information.

[0106] Step 3: Input the source node (starting device name) and target node (target device name) into the edge computing network with established hierarchical index, and check the existence of the nodes. If the input source node or target node name is incorrect or does not exist, prompt for re-entry or exit. If it exists, extract the hierarchical relationship based on the hierarchical information data in the node attributes, judge the extracted hierarchical relationship, and finally return the hierarchical relationship type and hierarchical relationship chain.

[0107] Step 3.1, Node Existence Check: Input the source node and the target node. The database established in Step 1.2 will be used to query the unique index of the node. If the index of any node does not exist, it means that the input node name is incorrect or does not exist. You will be prompted to re-enter or exit.

[0108] Step 3.2: Extract the hierarchical information from the node attributes using the input node name. If the hierarchical information of two nodes is the same, the two nodes are in the same layer, and the hierarchical relationship chain is classified as a single layer. If the hierarchical relationship between two nodes is not in the same layer, the hierarchical relationship chain is obtained by using the path search method Bi-Directional Depth-First Search (BiDFS).

[0109] Step 4: Determine the hierarchical relationship type and hierarchical relationship chain. If the hierarchical relationship type is single-level, use Dijkstra's single-source shortest path algorithm to perform a single-level search and directly output the search results.

[0110] If the hierarchical relationship type is multi-level, the search level range is limited. Specifically, the range is the levels involved in the hierarchical relationship chain. The Shortest Path Faster Algorithm (SPFA) is used to search for paths at each adjacent level in the hierarchical relationship chain. If a path exists, it is concatenated and output. If the hierarchical relationship does not exist, the path does not exist, and the operation ends.

[0111] Step 4.1: Use the subgraph extraction function provided by igraph to limit the search level of the constructed edge computing network. Specifically, use the subgraph() function to extract subgraphs in the complete network and filter nodes using conditional filtering methods.

[0112] Step 4.2: Identify the type of the hierarchical relationship chain finally obtained in Step 3. If the type is single-layer, use Dijkstra's single-source shortest path algorithm to search for the shortest path in the single-layer network.

[0113] If the hierarchical relationship chain type is multi-level, the divide-and-conquer method is used to extract all hierarchical information in the hierarchical relationship chain, and the subgraph is filtered using the method in step 4.1, that is, the search area is limited to the levels involved in the hierarchical relationship chain. The SPFA algorithm is used to perform shortest path search in each adjacent level, and the path search of adjacent levels is performed simultaneously.

[0114] The SPFA algorithm is an optimized version of the Bellman-Ford algorithm. By avoiding redundant calculations and using queues for optimization, it can find the shortest path in a shorter time. For example, if the hierarchical relationship chain is 32→29→12→47→60, it can be divided into four segments [32→29][29→12][12→47][47→60] for simultaneous search. The shortest path is found through the level entry and exit nodes. This process returns a 3D array.

[0115] Therefore, if the divide-and-conquer search of the SPFA algorithm is used in step 4.2, the connectivity of the path needs to be determined in the 3D array. Each 2D array in the 3D array is extracted, and the presence of discontinuities is checked within the 2D array. Discontinuities are represented by empty arrays "[]" in the algorithm. If an empty array appears in a 2D array, it indicates a broken path, and the 2D array is discarded. After the connectivity determination, the array is reduced in dimensionality. Specifically, a path concatenation method is used. List operations are used to integrate the elements in each 2D array, reducing it to 1D. After the operation, the original 3D array becomes 2D, the concatenation is complete, and the final result is output.

[0116] Comparative Example

[0117] An edge computing network consists of many nodes, which can be edge devices, servers, routers, switches, etc. These nodes are distributed across different geographical locations, forming a distributed network. Edge devices typically have smaller computing and storage resources, but are located close to the data source, enabling them to quickly process data and transmit it to other nodes. Servers and routers, on the other hand, typically have larger computing and storage resources, allowing them to handle more complex tasks and store larger amounts of data.

[0118] Directed edges in edge computing networks typically consist of network connections that transmit data from one node to another. These connections can be wired or wireless, transmitting data via the Internet, local area networks (LANs), or cellular networks. Directed edges in edge computing networks can also include other types of connections, such as sensor data and smart device communication. This particular network has 32,407 nodes, representing 32,407 IoT devices; and 37,626 directed edges, representing the directions of data transmission between IoT devices. Edge computing networks are characterized by their complex structure; therefore, the complex network formed by this dataset contains loops, meeting the network complexity requirements for general complex network datasets.

[0119] Since edge computing networks frequently require calculating the shortest information transmission path between two devices, to verify the practical application value of the search method of this invention on this dataset, four general and special case tests were conducted: Case 1, the two nodes are located at adjacent levels; Case 2, the two nodes span multiple levels; Case 3, the two nodes are at the same level; Case 4, no shortest path exists. To verify the accuracy of path detection, the paths searched by this invention were compared with Dijkstra's single-source shortest path algorithm for the above four test cases. The comparison results are shown in Table 1.

[0120] Table 1. Time Comparison Results for Four General and Special Cases

[0121] Test cases This method Dijkstra's algorithm Path accuracy Case 1 use case 6.41s 12.33s precise Case 2 use case 14.36s 30.25s precise Case 3 use case 4.27s 3.76s precise Case 4 use case 1.31s 2.23s precise

[0122] As shown in Table 1, this method outperforms Dijkstra's algorithm when nodes are in adjacent levels, cross levels, or when the shortest path does not exist. This is because the present invention limits the search range based on the shortest path divide-and-conquer search method of agglomerative levels and adopts the divide-and-conquer approach. However, when two nodes are in the same level, the present invention is slower because it calls Dijkstra's algorithm and requires preprocessing such as level type determination.

[0123] As can be seen from the above, the shortest path divide-and-conquer search method based on agglomerative hierarchy of this invention uses agglomerative hierarchical clustering method to divide the edge computing network into hierarchical levels, presents the complex network in a hierarchical manner and establishes directed connections between layers. Then, by restricting the search level, each path search is completed within a specified level, avoiding the problem of blindly searching in the overall network and greatly reducing the overhead of computing resources. In edge computing networks, it can be applied to optimize path search and schedule the utilization of computing resources.

Claims

1. A shortest path divide-and-conquer search method based on agglomerative hierarchy, characterized in that, This includes using agglomerative hierarchical clustering to partition the edge computing network into hierarchical levels, presenting the edge computing network in a hierarchical manner and establishing directed connections between layers, restricting the search level so that each path search is completed within a specified level, and employing divide-and-conquer search to divide the entire search process into multiple subtasks and perform them simultaneously to complete the shortest path search. The specific implementation follows these steps: Step 1: Preprocess the node data and edge relationship data of the network. Nodes connect to IoT devices in the network, and edge relationships indicate the transmission direction of data flow between devices. Finally, a complete edge computing network is constructed. The process is as follows: Step 1.1: Parse the network node data and edge relationship data from the raw data, clean up redundant data, unify the data format of node and edge relationships, provide reliable input for subsequent steps, and store the processing results in a CSV file; Step 1.2: Use the read_csv function to extract the names of IoT devices and create a unique index for each IoT device; while extracting the device names, obtain the transmission direction information of the data flow between devices, thereby obtaining the directed edge relationship between nodes; The extracted node index values ​​and edge connection relationships are imported into the database to create nodes and directed edges in the complex network. Attribute information is added to the nodes, including device name, device type, and device runtime information, and finally a complete edge computing network is constructed. Step 2: Convert the edge computing network into a degree matrix form, use agglomerative hierarchical clustering to divide the network into layers, add the layer information to the node attributes, and finally merge the duplicate relationships between layers and establish a layer index. The specific process is as follows: Step 2.1: Vectorize the edge computing network constructed in Step 1; Step 2.2: Use agglomerative hierarchical clustering to divide the network into layers; Step 2.3: Write the hierarchy information into the node attributes; Step 2.4: Merge duplicate variable relationships between levels and create a hierarchical index; Step 3: Input the source node (starting device name) and target node (target device name) into the edge computing network with the established hierarchical index. Perform a node existence check. If the input source node or target node name is incorrect or does not exist, prompt for re-entry or exit. If it exists, extract the hierarchical relationship based on the hierarchical information data in the node attributes, judge the extracted hierarchical relationship, and finally return the hierarchical relationship type and hierarchical relationship chain. The specific process is as follows: Step 3.1, Node Existence Check: Input the source node and the target node. The database established in Step 1.2 will be used to query the unique index of the node. If the index of any node does not exist, it means that the input node name is incorrect or does not exist. You will be prompted to re-enter or exit. Step 3.2: Extract the hierarchy information from the node attributes using the input node name. If the hierarchy information of two nodes is the same, that is, the two nodes are in the same level, the hierarchy relationship chain is classified as a single level; if the hierarchy relationship between two nodes is not in the same level, the BiDFS path search method is used to obtain the hierarchy relationship chain. Step 4: Determine the hierarchical relationship type and hierarchical relationship chain. If the hierarchical relationship type is single-level, use Dijkstra's single-source shortest path algorithm to perform a single-level search and directly output the search results. If the hierarchical relationship type is multi-level, the search level range is limited to the levels involved in the hierarchical relationship chain. The SPFA algorithm is used simultaneously on each adjacent level in the hierarchical relationship chain to perform path searching. If a path exists, it is concatenated and output; otherwise, if the hierarchical relationship does not exist, the path does not exist, and the process ends. The specific process is as follows: Step 4.1: Use the subgraph extraction function provided by igraph to limit the search level of the constructed edge computing network. Specifically, use the subgraph() function to extract subgraphs in the complete network and filter nodes using conditional filtering methods. Step 4.2: Identify the type of the hierarchical relationship chain finally obtained in Step 3. If the type is single-layer, use Dijkstra's single-source shortest path algorithm to search for the shortest path in the single-layer network. If the hierarchical relationship chain type is multi-level, the divide-and-conquer method is used to extract all hierarchical information in the hierarchical relationship chain. The subgraph is filtered using the method in step 4.1, that is, the search area is limited to the levels involved in the hierarchical relationship chain. The SPFA algorithm is used to perform shortest path search in each adjacent level, and the path search of adjacent levels is performed simultaneously.

2. The shortest path divide-and-conquer search method based on agglomerative hierarchy according to claim 1, characterized in that, Step 2.1 specifically involves: Step 2.1.1: Construct the adjacency matrix Representing the connections between nodes in an edge computing network as a single... The matrix, where It is the number of nodes in the network. If the number of nodes... and nodes There are connections between them. i , j If they are not equal, then ,otherwise ; Step 2.1.2: Construct the degree matrix Represent the degree of each node, i.e., the number of edges connected to that node, as a diagonal matrix. Represents a node The degree is expressed using the `diag` function in the NumPy library as follows. ; Step 2.1.3: Combine the degree matrix and the adjacency matrix to construct a symmetric normalized Laplace matrix. ,in The identity matrix is ​​represented as follows; ; Step 2.1.4: Apply the Laplace matrix Perform eigenvalue decomposition: transform the Laplacian matrix Perform eigenvalue decomposition to obtain the eigenvector matrix. and diagonal eigenvalue matrix ,in, Each column is a feature vector. The elements on the diagonal are eigenvalues. ; Step 2.1.5, Take the previous one Eigenvectors: the eigenvector matrix The former Columns serve as a vectorized representation of the network, where Represents the eigenvector matrix The List, These are hyperparameters that I set myself. 。 3. The shortest path divide-and-conquer search method based on agglomerative hierarchy according to claim 1, characterized in that, Step 2.2 specifically involves: Step 2.2.1: Expand the degree matrix of each node into a vector row-wise, and use the following formula for each pair of nodes. and Calculate their Pearson correlation coefficient , (1) In equation (1), It is the dimension of the vector. and Representing nodes respectively and nodes vector and The One element, and They represent and The average value; Pearson correlation coefficients between all nodes Form a similarity matrix , It is The matrix, It is the number of nodes in the network. Represents a node and nodes The similarity between them; Step 2.2.2: Select nodes with high similarity and merge them to cluster the similarity matrix. Specifically, calculate the similarity matrix, initialize the clusters, compare the similarity between clusters, merge the clusters with the highest similarity, update the similarity matrix, and repeat the merging steps until the stopping condition is met. Finally, output the clustering results. The two clusters are calculated using the following formula. and similarity between ,in and Clusters representing clustering, and and A vector representation of two distinct nodes. (2); Step 2.2.3: Calculate the simple connectivity between the two clusters using the following formula. (3) In equation (3), and Representing clustering and The number of nodes in the middle; Clustering and clustering The simple connectivity between two clusters, i.e., the average similarity between all nodes in two clusters; Step 2.2.4: After clustering the similarity matrix, output the clustering results. The clustering result is the cluster labels, i.e., the hierarchical information. (4) In equation (4), Indicates the first List of nodes in each cluster Representing the similarity matrix Middle node and nodes Similarity between them It is the clustering threshold, used to control the granularity of clustering.

4. The shortest path divide-and-conquer search method based on agglomerative hierarchy according to claim 1, characterized in that, Step 2.4 specifically involves: For each cluster, an empty list is created to store the source cluster numbers of the directed edges pointing to that cluster. All directed edges are traversed, and the source cluster numbers are added to the list of target clusters. For each cluster, the source cluster numbers that appear repeatedly in the list are merged to obtain all the source cluster numbers pointed to by that cluster. The directed edges between the clusters corresponding to the source cluster numbers and the target clusters are merged into one directed edge. Finally, a dictionary is created, with the number of each cluster as the key and the list of all source cluster numbers pointed to by that cluster as the value. This dictionary is the index of the cluster information.

Citation Information

Patent Citations

  • Method and device for searching shortest path of road network

    CN104266656A

  • Louvain-based complex network simple path discovery method

    CN115878609A