Undirected graph reachable matrix calculation method based on vertex set
Through the vertex set algorithm and the subgraph boundary equivalent algorithm, the problem of slow calculation speed of large-scale network graph reachable matrix is solved, and efficient topological analysis is realized, suitable for large-scale graph data scenarios.
Patent Information
- Application Number
- CN202411653941.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-03-14
AI Technical Summary
The existing technology cannot effectively solve the problem of slow calculation speed of reachable matrix for large network graphs, especially when the number of vertices exceeds 1,000, the analysis speed is significantly reduced and cannot meet the actual engineering needs.
The undirected graph reachable matrix calculation method based on vertex set is adopted, and the vertex set algorithm and subgraph boundary equivalent algorithm are used to streamline the reachable matrix calculation, reduce the calculation amount, and improve the analysis speed.
It significantly improves the speed of topological analysis, is suitable for large-scale graph data analysis, reduces memory requirements and data transfer requirements, and avoids memory usage and data transmission bottlenecks in traditional methods.
Smart Images

Figure CN119621798A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data mining, and in particular to a method for calculating an undirected graph reachable matrix based on a vertex set. Background Art
[0002] In the context of the rapid development of artificial intelligence, it is necessary to perform ultra-high-speed analysis and calculation of the reachable matrix of large networks to realize intelligent functional applications. In the analysis of undirected graphs, the conventional reachable matrix calculation method is slow. When there are more than 1,000 vertices, the analysis speed is significantly reduced; for large network graphs with more than 5,000 vertices, the analysis speed often cannot meet the actual needs of the project. In short, the current reachable matrix calculation method cannot meet the needs of fast iterative analysis of large network models, and new algorithms need to be studied and developed.
[0003] Among the existing graph-reachable matrix calculation technologies, the binary relation transitive closure WarShall algorithm is a relatively fast method. However, when faced with undirected graph analysis tasks such as electrical network graph topology analysis with a huge number of vertices, the computing speed of the WarShall algorithm still cannot meet actual work requirements, and it is impossible to develop more advanced business applications based on this algorithm.
[0004] Considering that most of the graphs used in actual engineering are undirected graphs, we can make full use of the reflexive, symmetric, and transitive properties of the adjacency matrix of undirected graphs to improve the calculation speed of the reachability matrix of the graph, thereby developing new, more efficient and faster calculation methods.
[0005] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not form the prior art that is already known to one of ordinary skill in the art. Summary of the invention
[0006] The purpose of the present invention is to provide a method for calculating the reachable matrix of an undirected graph based on a vertex set. Through the vertex set algorithm and the subgraph boundary equivalence algorithm of the undirected graph, the reachable matrix calculation is simplified, and the topological analysis speed is greatly reduced and improved, which is particularly suitable for the analysis needs of large-scale graph data. At the same time, the present invention not only improves the degree of data reuse in the calculation process through methods such as adjacency matrix expansion and data labeling, but also is suitable for the bit operation function of the CPU or GPU, thereby effectively reducing the storage requirements and data transfer requirements of the calculation process, avoiding the memory usage and data transmission bottlenecks in the traditional method, so that ultra-high-speed topological analysis of complex graphs can be performed under limited computing resources, thereby solving the problems in the above-mentioned background technology.
[0007] In order to achieve the above-mentioned purpose, the present invention provides the following technical solution: a method for calculating an undirected graph reachability matrix based on a vertex set, comprising the following steps.
[0008] Use the vertex set algorithm to calculate the reachability matrix P of the graph G = <V, E>. The steps are as follows:
[0009] Step 1-1 Generate the adjacency matrix A of graph G, where the element a is in row i and column j. ij The definition is as follows:
[0010]
[0011] Step 1-2 transforms the adjacency matrix A, A=I∨A;
[0012] Step 1-3: Expand the adjacency matrix A by one column and let a i(n+1) =1, and the extended adjacency matrix B[n,n+1] is obtained;
[0013] Steps 1-4 transform the extended adjacency matrix B;
[0014] Steps 1-5 calculate the reachable vertex set of the undirected graph;
[0015] If a reachable matrix needs to be obtained in step 1-6, perform matrix transformation based on step 1-5 and delete the expanded columns;
[0016] The boundary equivalence algorithm is used to calculate the graph G k On the graph G, the reachable matrix P k , the steps are as follows:
[0017] Step 2-1: Calculate subgraph G k The complement of G kb The reachability matrix of graph G is obtained k The boundary equivalent matrix P kr ;
[0018] Step 2-2, use P kr Correction G k The adjacency matrix A k =A k ∪P kr ;
[0019] Step 2-3: Use the reachable vertex set calculation method to calculate graph G k The reachability matrix P on the graph G k .
[0020] Preferably, in steps 1-3, the adjacency matrix A is expanded by one column, and a i(n+1) =1, thus obtaining the extended adjacency matrix B[n,n+1]. Afterwards, B[n,n+1] is used to express the vertex set of graph G, and based on this, a vertex set matrix transformation method is constructed.
[0021] Preferably, in steps 1-4, the extended adjacency matrix B is transformed, and the transformation method is as follows:
[0022] Step 1-4-1: Initialize i=1;
[0023] Step 1-4-2: Initialize j=i+1; flag=0;
[0024] Step 1-4-3 If Do the following:
[0025]
[0026] Step 1-4-4 adds 1 to the loop variable j; if j ≤ n, go to step 1-4-3, otherwise continue;
[0027] Step 1-4-5: If flag = 1, go to step 1-4-2, otherwise continue;
[0028] Step 1-4-6 adds 1 to the loop variable i. If i < n, go to step 1-4-2; otherwise, end.
[0029] Preferably, in step 1-4-3, the judgment condition adopts
[0030]
[0031] Preferably, in steps 1-5, the method for calculating the reachable vertex set is as follows:
[0032] In the calculation result B of step 1-4, row i is a valid row if and only if b(i, n+1) = 1|i = 1, 2, ... n, and the set of vertices corresponding to the column where the 1 element in the valid row is located is a reachable vertex subset of graph G, that is: P i ={j|b (i,j) =1,j=1,2,…n}, the matrix B is a form of expression of the vertex set of graph G, P i It is another expression of the vertex set of graph G, and the two are equivalent.
[0033] Preferably, in steps 1-6, the reachable matrix P of the graph G is calculated based on the vertex set of the graph G, indicating that the reachable vertex set is equivalent to the reachable matrix.
[0034] Preferably, in step 2-1, by computing graph G k The complement of G kb The reachability matrix of graph G is obtained k The boundary equivalent matrix P kr , the calculation steps are as follows:
[0035] Step 2-1-1 Use the reachable vertex set calculation method to calculate the complement graph G kb The reachability matrix Pkb ;
[0036] Step 2-1-2 Calculate V rb =V kb ∩V k ;
[0037] Step 2-1-3 Calculate P kr =(P kb |V kb =V rb ), and get G kb In G k The boundary equivalent matrix P on kr .
[0038] Preferably, in step 2-2, P kr Correction G k The adjacency matrix A k =A k ∪P kr In step 2-3, the reachable vertex set calculation method is used to calculate the graph G k The reachability matrix P on the graph G k .
[0039] Preferably, a boundary equivalence algorithm is used to calculate the graph G k On the graph G, the reachable matrix P k When G k The adjacency matrix A k When changes occur, if the complement graph G kb If it is unchanged, skip step 2-1 and directly use the boundary equivalent matrix P kr Start the calculation from step 2-2.
[0040] In the above technical solution, the technical effects and advantages provided by the present invention are:
[0041] The present invention simplifies the reachable matrix calculation through the vertex set algorithm and subgraph boundary equivalent algorithm of the undirected graph, and greatly reduces and improves the speed of topological analysis. The traditional global matrix calculation method consumes a lot of computing resources when facing large graph structures, and the processing time is long. The present invention reduces the amount of topological analysis calculation in the undirected graph through a fully optimized vertex set algorithm and a new subgraph boundary equivalent algorithm, thereby shortening the overall calculation time. This method is not only suitable for general-scale undirected graph topological analysis, but also more suitable for reachability analysis in large-scale data scenarios, and can meet the application needs of expanding data volume.
[0042] Another beneficial effect of the present invention is its efficient use of memory resources. Through methods such as adjacency matrix expansion and data labeling, the degree of data reuse in the calculation process is improved, which is suitable for the bit operation function of the CPU or GPU, and effectively reduces the storage demand and data transfer demand of the calculation process. After adopting the vertex set algorithm and subgraph boundary equivalent algorithm of the present invention, the memory occupation and data transmission bottlenecks in the traditional method can be avoided, the memory demand is greatly reduced, and ultra-high-speed topological analysis of complex graphs can be performed on limited computing resources. This not only improves the availability of the system, but also provides an algorithmic tool with excellent performance for complex graph structure analysis on limited computing resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0044] Figure 1 This is an electrical network diagram of Example 1 of the present invention.
[0045] Figure 2 It is an equivalent diagram of Example 1 of the present invention.
[0046] Figure 3 This is the extended adjacency matrix B and its transformation in embodiment 1 of the present invention.
[0047] Figure 4 is the reachable matrix P of embodiment 1 of the present invention.
[0048] Figure 5 The subgraph G of the electrical network graph G of Embodiment 2 of the present invention is k and complement graph G kb .
[0049] Figure 6 is the subgraph G of Embodiment 2 of the present invention k and complement graph G kb The adjacency matrix of .
[0050] Figure 7 The subgraph G after correction in Embodiment 2 of the present invention k The adjacency matrix of .
[0051] Figure 8 It is the reachable matrix of embodiment 2 of the present invention. DETAILED DESCRIPTION
[0052] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these example embodiments are provided so that the description of the present disclosure will be more comprehensive and complete, and the concept of the example embodiments will be fully conveyed to those skilled in the art.
[0053] The present invention provides a method for calculating a reachable matrix of an undirected graph based on a vertex set, comprising a reachable vertex set algorithm of a graph (hereinafter referred to as "vertex set algorithm") and a boundary equivalence algorithm of a subgraph (hereinafter referred to as "boundary equivalence algorithm"), comprising the following steps:
[0054] The first part, the vertex set algorithm, is used to calculate the reachability matrix P of the graph G = <V, E>. The steps are as follows:
[0055] Step 1-1 Generate the adjacency matrix A of graph G, where the element a is in row i and column j. ij The definition is as follows:
[0056]
[0057] Step 1-2 calculates the adjacency matrix A as follows: A=I∨A, where I is the n-order unit matrix. At this point, the matrix A is a square matrix with n rows and n columns, which is reflexive, symmetric, and transitive, and is referred to as the adjacency matrix below.
[0058] Step 1-3: Expand the adjacency matrix A by one column and let a i(n+1) =1, and we get the extended adjacency matrix B[n,n+1].
[0059] Steps 1-4 transform the extended adjacency matrix as follows:
[0060] Step 1-4-1: Initialize i=1;
[0061] Step 1-4-2: Initialize j=i+1; flag=0;
[0062] Step 1-4-3 If Then do the following:
[0063]
[0064] Step 1-4-4 adds 1 to the loop variable j; if j ≤ n, go to step 1-4-3, otherwise continue;
[0065] Step 1-4-5: If flag = 1, go to step 1-4-2, otherwise continue;
[0066] Step 1-4-6 adds 1 to the loop variable i. If i < n, go to step 1-4-2; otherwise, end.
[0067] Steps 1-5 calculate the reachable vertex set of the undirected graph
[0068] In the above calculation result B, row i is a valid row if and only if b(i, n+1) = 1|i = 1, 2, ... n, and the set of vertices corresponding to the column where the 1 element in the valid row is located is a reachable vertex subset of graph G, that is: P i ={j|b (i,j) =1,j=1,2,…n}, the set of reachable vertex subsets corresponding to all valid rows is the reachable vertex set of graph G. The reachable vertex set is equivalent to the reachable matrix.
[0069] If you need to obtain the reachability matrix in steps 1-6, perform the following calculations:
[0070] Step 1-6-1 If b(i,n+1)=1, b(i,j)=1, where i=1,2,…n, j=1,2,…n, j≠i, then perform the following operations:
[0071] b(j,k3)=b(i,k3)|k3=1,2,…n;
[0072] Step 1-6-2 deletes b(i,n+1)|i=1,2…n. Now the B matrix becomes a square matrix with n rows and n columns, which is the reachable matrix P.
[0073] In steps 1-5, the reachable vertex set and the reachable vertex set subset meet the following definitions:
[0074] Suppose that graph G = <V, E> is an n-order undirected graph, and the vertex set V is a subset of make and
[0075]
[0076] Definition 1: If V k The vertices in V are interconnected, then k is a connected vertex subset of graph G. The set of connected vertex subsets A = {V k |k=1,2,…m} is the connected vertex set of graph G.
[0077] Definition 2: For a connected vertex subset V k ,make '
[0078] If V k In range (a i a k Unreachable|a i ∈V, a k ∈V k ), then Vk is the reachable vertex subset of graph G, denoted by P k . Set P = {P k |k=1,2,…m} is the set of reachable vertices of graph G.
[0079] The second part is the boundary equivalence algorithm, which is used to calculate the graph G k On the graph G, the reachable matrix P k The steps are as follows:
[0080] Step 2-1 Calculate graph G k The complement of G kb The reachability matrix of graph G is obtained k The boundary equivalent matrix P kr ;
[0081] Step 2-1-1 Use the reachable vertex set calculation method to calculate the complement graph G kb The reachability matrix P kb ;
[0082] Step 2-1-2 Calculate V rb =V kb ∩V k ;
[0083] Step 2-1-3 Calculate P kr =(P kb |V kb =V rb ), and get G kb In G k The boundary equivalent matrix P on kr ;
[0084] Step 2-2 Use P kr Correction G k The adjacency matrix A k =A k ∪P kr ;
[0085] Step 2-3 uses the reachable vertex set calculation method to calculate the graph G k The reachability matrix P on the graph G k .
[0086] So far, G k ∈G’s reachability matrix P k When Figure G k The adjacency matrix A k When changes occur, just fill in the graph G kb If it does not change, step 2-1 can be omitted and the boundary equivalent matrix P can be used directly. kr Start the calculation from step 2-2. When G k Adjacency Matrix A kchanges and requires multiple accessibility matrix P k This algorithm can greatly improve the calculation speed when calculating.
[0087] In step 2-1, the boundary equivalent matrix complies with the following theorem:
[0088] Theorem 1: Let graph G kb (V kb ,E kb ) is Figure G k (V k ,E k ) is the complement of graph G(V,E), let G kb Boundary point set V rb =V kb ∩V k , then the vertex V rb In G kb The reachability matrix on the computation graph G k The boundary equivalent matrix when the matrix is reachable, referred to as graph G k The boundary equivalent matrix of kr .
[0089] Example 1: Figure 1 As shown in FIG. 1 , it is an electrical network diagram used in Example 1, in which switches S3, S5, S7, and S8 are in an open state, and the remaining switches are in a closed state; Figure 2 As shown in FIG. 1 , it is an equivalent diagram of the electrical network diagram of Example 1. The diagram has 9 vertices in total. The solid lines between the vertices represent that the two vertices are adjacent to each other; the dotted lines between the vertices represent that the two vertices are not adjacent but are connected to switches in the open state. Figure 3 As shown in the figure, the B matrix on the left is the extended adjacency matrix of the electrical network graph; using the vertex set method to transform it, we can get the B matrix on the right. The B matrix on the right means that the electrical network graph has two reachable vertex sets, where: P1 = {1, 4, 7, 8, 9}; P2 = {2, 3, 5, 6}. Figure 4 As shown, this is the reachability matrix P of the electrical network graph.
[0090] Example 2: Figure 5 As shown, it is the electrical network diagram G used in Example 2, and the diagram on the left side of the dotted line is sub-diagram G k , the figure on the right side of the dotted line is the complementary figure G kb The switches S1-3, S1-5, S1-7, S1-8, S2-5, S2-7, and S2-8 are in the open state, and the remaining switches are in the closed state.
[0091] The boundary of the subgraph has two vertices, V6∈Vr, V8∈Vr. Figure 6 As shown, it is a subgraph G k and complement graph G kb The adjacency matrix of . Figure 7 As shown, the right side is the complementary figure G kb The reachability matrix of the graph G is shown on the left after considering the topological relationship between the two boundary vertices in the complement graph. k The adjacency matrix of k The adjacency matrix of . Figure 8 As shown, the figure on the left is subgraph G k The reachability matrix P on the graph G k .
[0092] The above embodiments are examples of implementation methods of the present invention, but the implementation methods of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, simplifications that do not deviate from the spirit and principles of the present invention, including vectorizing matrices, marking matrix elements, etc., should be regarded as equivalent replacement methods of the present invention and are included in the protection scope of the present invention.
[0093] The present invention simplifies the reachable matrix calculation and significantly improves the topological analysis speed through the vertex set algorithm and subgraph boundary equivalent algorithm of undirected graphs. The traditional global matrix calculation method consumes a lot of computing resources and takes a long time to process when facing large graph structures. The present invention reduces the amount of topological analysis calculation in undirected graphs through a fully optimized vertex set algorithm and a new subgraph boundary equivalent algorithm, thereby shortening the overall calculation time. This method is not only suitable for general-scale graph structure analysis, but also more suitable for reachability analysis of undirected graphs in large-scale data scenarios, and can meet the application needs of expanding data volume.
[0094] Another beneficial effect of the present invention is its efficient use of memory resources. By using methods such as adjacency matrix expansion and data labeling, the degree of data reuse in the calculation process is improved, which is suitable for the bit operation function of the CPU or GPU, and effectively reduces the storage demand and data transfer demand. After adopting the vertex set algorithm and subgraph boundary equivalent algorithm of the present invention, the memory occupation and data transmission bottlenecks in the traditional method can be avoided, and the memory demand is greatly reduced, so that ultra-high-speed topological analysis of complex graphs can be performed on limited computing resources. This not only improves the availability of the system, but also provides an algorithmic tool with excellent performance for performing complex graph topological analysis on limited computing resources.
[0095] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.
[0096] Those of ordinary skill 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, or a combination of computer software and electronic hardware. 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 to be beyond the scope of this application.
[0097] Those skilled in the art can 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.
[0098] In the several embodiments provided in the present application, 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 only schematic, for example, the division of the units is only one, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0099] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0100] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0101] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks or optical disks.
[0102] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0103] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for calculating the reachability matrix of an undirected graph based on vertex sets, characterized in that: The following steps are included. Use the vertex set algorithm to calculate the reachability matrix P of the graph G = <V, E>. The steps are as follows: Step 1-1 Generate the adjacency matrix A of graph G, where the element a is in row i and column j. ij The definition is as follows: Step 1-2 transforms the adjacency matrix A, A = I∨A; Step 1-3: Expand the adjacency matrix A by one column and let a i(n+1) =1, and the extended adjacency matrix B[n,n+1] is obtained; Steps 1-4 transform the extended adjacency matrix B; Steps 1-5 calculate the reachable vertex set of the undirected graph; If a reachable matrix needs to be obtained in step 1-6, perform matrix transformation based on step 1-5 and delete the expanded columns; The boundary equivalence algorithm is used to calculate the graph G k On the graph G, the reachable matrix P k , the steps are as follows: Step 2-1 Calculate subgraph G k The complement of G kb The reachability matrix of graph G is obtained k The boundary equivalent matrix P kr ; Step 2-2 Use P kr Modified G k The adjacency matrix A k =A k ∪P kr ; Step 2-3 uses the reachable vertex set calculation method to calculate the graph G k The reachability matrix P on the graph G k .
2. The method for calculating a reachable matrix of an undirected graph based on a vertex set according to claim 1, characterized in that: In steps 1-3, the adjacency matrix A is expanded by one column, and a i(n+1) =1, thus obtaining the extended adjacency matrix B[n,n+1]. Afterwards, B[n,n+1] is used to express the vertex set of graph G, and based on this, a vertex set matrix transformation method is constructed.
3. The method for calculating an undirected graph reachability matrix based on a vertex set according to claim 1, characterized in that: In steps 1-4, the extended adjacency matrix B is transformed as follows: Step 1-4-1: Initialize i=1; Step 1-4-2: Initialize j=i+1; flag=0; Step 1-4-3 If Do the following: b(i,k2)=b(i,k2)∨b(j,k2)|k2=1,2,…n b(j,n+1)=0 flag=1; Step 1-4-4 adds 1 to the loop variable j; if j ≤ n, go to step 1-4-3, otherwise continue; Step 1-4-5: If flag = 1, go to step 1-4-2, otherwise continue; Step 1-4-6 adds 1 to the loop variable i. If i < n, go to step 1-4-2; otherwise, end.
4. The method for calculating a reachable matrix of an undirected graph based on a vertex set according to claim 1, characterized in that: In step 1-4-3, the judgment condition uses 5. The method for calculating an undirected graph reachability matrix based on a vertex set according to claim 1, characterized in that: In steps 1-5, the method for calculating the reachable vertex set is as follows: In the calculation result B of step 1-4, row i is a valid row if and only if b(i, n+1) = 1|i = 1, 2, ... n, and the set of vertices corresponding to the column where the 1 element in the valid row is located is a reachable vertex subset of graph G, that is: P i ={j|b (i,j) =1,j=1,2,…n}, the matrix B is a form of expression of the vertex set of graph G, P i It is another expression of the vertex set of graph G, and the two are equivalent.
6. The method for calculating a reachable matrix of an undirected graph based on a vertex set according to claim 1, characterized in that: In steps 1-6, the reachable matrix P of graph G is calculated based on the vertex set of graph G, pointing out that the reachable vertex set is equivalent to the reachable matrix.
7. The method for calculating an undirected graph reachability matrix based on a vertex set according to claim 1, characterized in that: In step 2-1, by computing graph G k The complement of G kb The reachability matrix of graph G is obtained k The boundary equivalent matrix P kr , the calculation steps are as follows: Step 2-1-1 Use the reachable vertex set calculation method to calculate the complement graph G kb The reachability matrix P kb ; Step 2-1-2 Calculate V rb =V kb ∩V k ; Step 2-1-3 Calculate P kr =(P kb |V kb =V rb ), and get G kb In G k The boundary equivalent matrix P on kr .
8. The method for calculating an undirected graph reachability matrix based on a vertex set according to claim 1, characterized in that: In step 2-2, use P kr Modified G k The adjacency matrix A k =A k ∪P kr In step 2-3, the reachable vertex set calculation method is used to calculate the graph G k The reachability matrix P on the graph G k .
9. The method for calculating a reachable matrix of an undirected graph based on a vertex set according to claim 1, characterized in that: The boundary equivalence algorithm is used to calculate the graph G k On the graph G, the reachable matrix P k When G k The adjacency matrix A k When changes occur, if the complement graph G kb If the boundary equivalent matrix P is unchanged, step 2-1 can be omitted and the boundary equivalent matrix P can be used directly. kr Start the calculation from step 2-2 to reduce the amount of calculation.