Subgraph numeration method, subgraph numeration device and program

The use of a zero-suppressed binary decision graph and frontier method addresses the inefficiencies in subgraph enumeration by constructing a data structure that handles connectivity constraints, enabling fast enumeration of subgraphs for each vertex, thus improving computational efficiency.

JP2024162516APending Publication Date: 2024-11-21NIPPON TELEGRAPH & TELEPHONE CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2023078081
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-05-10
Publication Date
2024-11-21

AI Technical Summary

Technical Problem

Existing methods for solving the subgraph enumeration problem, particularly in network reliability evaluation, face challenges in computational efficiency, especially when repeatedly solving the problem for each vertex in large graphs, leading to impractical calculation times.

Method used

A method utilizing a zero-suppressed binary decision graph (ZDD) and the frontier method to construct a data structure that efficiently handles connectivity constraints, including wildcards, allowing simultaneous enumeration of subgraphs for each vertex, using dynamic programming to calculate weighted count values.

Benefits of technology

The proposed method significantly reduces computational time, enabling fast solutions for subgraph enumeration problems across multiple vertices, improving efficiency by orders of magnitude compared to existing methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2024162516000001_ABST
    Figure 2024162516000001_ABST
Patent Text Reader

Abstract

To provide a method, device and program, capable of solving a subgraph numeration problem to each peak at high speed.SOLUTION: A method comprises: an input procedure for inputting a connective non-directed graph, a connective restriction including a wild card, the weight of each side and a subgraph set used as a base; a procedure for constructing a zero suppression type binary decision graph ZDD constituted of a node having information on connectivity between the specific peak sets of the non-directed graph; and a calculation procedure for calculating a count value with weight using the weight of sides included in a subgraph included in the subgraph set to each peak and satisfying the connective restriction replacing the wild card included in the connective restriction with the peak and the weight of sides not included in the subgraph by dynamic programming using the information on the connectivity between the specific peak sets on the basis of the constructed zero suppression type binary decision graph and the weight of each side.SELECTED DRAWING: Figure 8
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present disclosure relates to a subgraph enumeration method, a subgraph enumeration device, and a program. [Background technology]

[0002] One problem in graph theory is called the subgraph counting problem, which is a problem of calculating the number or weighted count value of subgraphs that satisfy a certain constraint when a graph is given.

[0003] The subgraph counting problem is a basic problem that can be applied to, for example, network reliability evaluation, etc. Network reliability evaluation is equivalent to solving the subgraph counting problem under connectivity constraints between two vertices, and a fast solution method using, for example, a binary decision diagram (BDD) is known (Non-Patent Document 1). [Prior art documents] [Non-patent literature]

[0004] [Non-Patent Document 1] Gary Hardy, Corinne Lucet, and Nikolaos Limnios. K-terminal network reliability measures with binary decision diagrams. IEEE Transactions on Reliability, Vol. 56, pp. 506-515, 2007. Summary of the Invention [Problem to be solved by the invention]

[0005] However, solving the subgraph counting problem for each vertex can be difficult in terms of computation time. For example, when evaluating the network reliability for each vertex, it is necessary to repeatedly solve the subgraph counting problem as many times as the number of vertices, and depending on the scale of the graph, it can be difficult to solve the problem in a realistic computation time even if the solution method described in Non-Patent Document 1 is used.

[0006] The present disclosure has been made in consideration of the above points, and provides a technique that can quickly solve the subgraph counting problem for each vertex. [Means for solving the problem]

[0007] The subgraph enumeration method according to one aspect of the present disclosure is a method for enumerating subgraphs by using a connected undirected graph G=(V,E) and a connectivity constraint P * and the weight w of each edge e∈E e + ,w e - ∈R and the underlying set of subgraphs F ⊆ 2 E and an input procedure for inputting the undirected graph G and the connectivity constraint P * and the subgraph set F ⊆ 2 E A construction procedure for constructing a zero-suppressed binary decision diagram Z composed of nodes having information on connectivity between a set of specific vertices v∈V of the undirected graph G based on the above, and a ... e + ,w e - ∈R, for each vertex v∈V, a subgraph E′ included in the subgraph set F and the connectivity constraint P * A connectivity constraint P with the wildcard * in * The weight w of an edge e∈E' in a subgraph E' that satisfies [v] e + and the weight w of the edge e∈E\E' that is not included in the subgraph E' e- and a calculation procedure for calculating a weighted count value count(v) using Effect of the Invention

[0008] A technique is provided that can quickly solve the subgraph counting problem for each vertex. [Brief description of the drawings]

[0009] [Figure 1] A diagram showing an example of a ZDD. [Diagram 2] FIG. 13 is a diagram illustrating an example of a graph. [Diagram 3] FIG. 2 is a diagram illustrating an example of a binary decision tree. [Figure 4] FIG. 1 is a diagram illustrating an example of an algorithm of the frontier method. [Diagram 5] FIG. 13 is a diagram showing an example of a ZDD obtained as a result of the frontier method. [Figure 6] FIG. 2 is a diagram illustrating an example of a hardware configuration of the subgraph enumeration device according to the present embodiment. [Figure 7] 1 is a diagram illustrating an example of a functional configuration of a subgraph counting device according to an embodiment of the present invention. [Figure 8] 11 is a flowchart showing an example of the flow of a subgraph counting process according to the present embodiment. [Figure 9] FIG. 11 is a diagram showing an example of an algorithm of a process executed by a construction unit according to the present embodiment. [Figure 10] FIG. 4 is a diagram showing an example of an algorithm of a process executed by a calculation unit according to the present embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0010] Hereinafter, one embodiment of the present invention will be described.

[0011] <Subgraph counting problem> In graph theory, a graph is defined as G=(V,E), where V is the set of vertices and E is the set of edges.

[0012] Given a graph G, the subgraph counting problem is to calculate the number or weighted count of subgraphs that satisfy certain constraints, such as constraints on the degree of each vertex, constraints on the presence or absence of a cycle, etc.

[0013] More precisely, for each edge e ∈ E, there are two weights w e + ,w e - This is the problem of calculating the value shown in the following equation (1) when ∈R (where R is the set of all real numbers) is given.

[0014]

number

[0015]

number

[0016] The subgraph counting problem has long been treated as a fundamental problem in computer science, and is also widely used in applications, particularly in network reliability evaluation. A fundamental problem in network reliability evaluation is to find the probability that connectivity between vertices of interest is maintained when each edge of a network modeled as a graph structure fails independently with a given probability. This problem is equivalent to solving the subgraph counting problem under connectivity constraints. Here, connectivity constraints are topological constraints that require some pairs of vertices to be connected, and some other pairs of vertices to be disconnected.

[0017] Connectivity constraints are also essential constraints for specifying various graph structures (hereafter referred to as graph substructures) of subgraphs, such as paths, Steiner trees (trees that connect vertices of interest), spanning trees, rooted spanning forests, etc. Enumerating these graph substructures is important, especially when evaluating the importance of vertices in network infrastructure.

[0018] For example, a path in a communication network corresponds to a communication route between two points, and similarly, a Steiner tree in a communication network corresponds to a communication route between many points. Therefore, the number of paths or Steiner trees passing through a certain vertex v corresponds to the number of communication routes that will be lost when the vertex v fails, and this number can be regarded as the importance of the vertex v in the communication network. In addition, a closed loop passing through a certain vertex s and another vertex v can be regarded as a set of two paths connecting the vertex s and the vertex v, so counting the number of such closed loops corresponds to counting the number of sets of nonblocking communication routes from the vertex s to the vertex v. Furthermore, if the root is r1,...,r k The rooted forest in is a set of substations r1, , r k Therefore, when we consider placing a new substation at vertex v, the roots are r1, , r k By counting the number of rooted global forests in ,v, we can obtain an index of the flexibility of the power distribution network.

[0019] To calculate the importance (including the flexibility of the power distribution network) for each vertex as in the above example, it is generally necessary to solve the subgraph counting problem for each vertex v. However, the basic problem of network reliability evaluation and the problem of counting paths mentioned above are known to be computationally difficult problems called #P-complete, and even with practically fast algorithms, it can take several minutes or more to solve one subgraph counting problem for a graph with several hundred edges. For this reason, solving the subgraph counting problem for each vertex v becomes an even more computationally difficult problem.

[0020] <Subgraph counting problem for each vertex> Define the subgraph enumeration problem for each vertex.

[0021] First, we express connectivity constraints by a subpartition of vertex set V of an undirected graph G = (V, E). A subpartition is a set of disjoint vertex subsets. Here, a vertex subset is a subset of vertex set V.

[0022] A subpartition P imposes the constraints that (i) any two vertices v, v' in the same vertex subset of P are connected, and (ii) any two vertices v, v' in different vertex subsets of P are disjoint. For example, P={{v1,v2},{v3}} expresses the constraints that vertices v1 and v2 are connected, and vertices v1 and v3, and vertices v2 and v3 are disjoint.

[0023] In this embodiment, a wildcard * is introduced into the subdivision, and various connectivity constraints are expressed by replacing this wildcard * with a specific vertex. In the following, a subdivision of V∪{*} that always includes one wildcard * is called P * Also, for a vertex v∈V, P * Let P be a partial partition (connectivity constraint) obtained by replacing the wildcard * in * [v]. Furthermore, P * The connectivity constraint obtained by deleting the wildcard * in P * []. Note that if a vertex v∈V is P * If vertex v already exists in P, then (i) * If it is included in the same set as the set containing the wildcard *, then P * [v] to P * (ii) otherwise, we denote the constraint as [], i.e., there is no subgraph that satisfies it. For example, P * For ={{v1,v2,*},{v3}}, P * [v4] = {{v1,v2,v4},{v3}}, P * [v2]=P * []={{v1,v2},{v3}}, and P* [v3] is a contradictory constraint.

[0024] Using subdivision with the wildcard *, the subgraph counting problem for each vertex can be defined as follows:

[0025] A connected undirected graph G = (V,E) with a connectivity constraint P containing one wildcard * * and a set of subgraphs (i.e., subsets of edges) F ⊆ 2 E and the weight w for each edge e∈E e + ,w e - ∈R. In this case, the subgraph counting problem for each vertex is the problem of calculating the value shown in the following formula (2) for each vertex v∈V.

[0026]

number

[0027] The problem of calculating the importance of each vertex (hereinafter also referred to as the vertex importance calculation problem) can be formulated within the framework of the problem of calculating the value shown in the above formula (2).

[0028] · Path: Given s, v∈V, P * = {{s,t,*}}, and F ⊆ 2 E Let v be the set of subgraphs such that (i) s and t have degree 1 and the other vertices have degree 0 or 1, and (ii) there are no cycles. Then count(v) is the number of s,t-simple paths that pass through vertex v.

[0029] Cycle: Given s∈V, P * = {{s,*}}, and F ⊆ 2 ELet v be the set of subgraphs such that (i) each vertex has degree 0 or 2, and (ii) there is exactly one connected component. Then count(v) is the number of cycles that start at vertex s and pass through vertex v.

[0030] Steiner tree: Given T ⊆ V, P * = {T ∪ {*}}, and F ⊆ 2 E Let be the set of subgraphs with no cycles and exactly one connected component. Then count(v) is the number of T-Steiner trees that pass through vertex v, i.e., trees that connect all the vertices in T.

[0031] Rooted global forest: T = {r1, ,r k} ⊆ V, P * ={{r1},...,{r k},{*}}, F ⊆ 2 E Let v be the set of subgraphs such that (i) each vertex has degree 1 or greater, (ii) there are no cycles, and (iii) there are exactly (k+1) connected components. Then count(v) is a set of r1,...,r k , the number of rooted spanning forests with v as the root.

[0032] <Conventional Technology Related to the Present Embodiment> For network reliability evaluation, a method using binary decision diagrams (BDD) is currently the fastest practical method (Non-Patent Document 1), and this method has been successful in evaluating the network reliability of a real network topology with around 200 edges. Here, BDDs are used as a means of compactly expressing a subgraph in which vertices of interest are connected, and once a BDD is constructed, the subgraph counting problem is reduced to dynamic programming (DP) on the BDD.

[0033] There are many techniques for counting the number of graph substructures, such as paths, by adding other constraints in addition to the connectivity constraint. The simplest technique is to enumerate all of the graph substructures, such as paths and spanning trees, one by one. In particular, by enumerating the spanning trees described in Reference 1, it is possible to calculate a polynomial called the Tutte polynomial, which can be used for some subgraph counting problems. On the other hand, since there are generally many subgraphs that satisfy the constraints exponentially relative to the size of the graph, such enumeration quickly becomes computationally impossible when the size of the graph becomes large. As a practically fast counting technique, there is a technique for indexing subgraphs that satisfy the constraints as a data structure such as a BDD, similar to the technique described in Non-Patent Document 1, and the culmination of these techniques is the Frontier method (Reference 2). By using the Frontier method, various subgraph structures can be expressed as a subspecies of BDDs, called Zero-suppressed Binary Decision Diagrams (ZDDs), described in Reference 3. Since ZDDs can be constructed once and counting can be performed using simple DP, the frontier method is a practical and fast method for solving subgraph counting problems.

[0034] All of the above are methods for solving one subgraph counting problem, and in order to solve the subgraph counting problem for each vertex, it is necessary to apply the method for solving one subgraph counting problem independently to each vertex.

[0035] Reference 4 describes a method for simultaneously and quickly calculating the probability that each client will connect to a server on a client-server model network for all clients. This method can be considered as simultaneously solving the subgraph counting problem for each vertex under only the connectivity constraint. However, this connectivity constraint is of the type "all vertices of interest are connected" and does not include, for example, the type of constraint that "a certain pair of vertices is disconnected."

[0036] <The problem of counting subgraphs for each vertex and its solution> As mentioned above, even practically fast BDD / ZDD-based counting methods can take several minutes or even longer to solve one subgraph counting problem. Therefore, in order to solve the subgraph counting problem for each vertex, it is necessary to repeatedly execute the subgraph counting problem for one vertex as many times as the number of vertices, which is not realistic in terms of computation time.

[0037] On the other hand, the method described in Reference 4 can simultaneously solve the subgraph counting problem for each vertex under only the connectivity constraint, but cannot be used in situations where other constraints (e.g., constraints on the degree of each vertex) also exist. Therefore, the method described in Reference 4 cannot simultaneously count subgraphs such as the above-mentioned paths, cycles, Steiner trees, and rooted spanning forests.

[0038] Therefore, in this embodiment, in order to simultaneously solve the general "subgraph counting problem for each vertex," we propose a method of constructing only one ZDD using the frontier method and then calculating all the values ​​of count(v) using dynamic programming on the ZDD.

[0039] The method described in Reference 4 could only handle connectivity constraints of the type "all vertices of interest are connected." On the other hand, our proposed method can also handle connectivity constraints of the type "a certain pair of vertices is disconnected," constraints on the degree of each vertex, and constraints on the presence or absence of a cycle, making it possible to simultaneously count subgraphs such as paths, cycles, Steiner trees, and rooted spanning forests.

[0040] The method described in Reference 4 also builds a data structure and performs all counts simultaneously using dynamic programming on that data structure, similar to the proposed method. However, technically it differs in the following ways, which allow the proposed method to handle various constraints other than connectivity constraints. First, the method described in Reference 4 builds a data structure that is similar to a BDD but is not a BDD, and performs dynamic programming on it. On the other hand, the proposed method builds a valid ZDD by utilizing the frontier method. The frontier method can also take into account non-connectivity constraints, which makes it possible to handle connectivity constraints of the type "a certain pair of vertices is non-connected." In addition, since the proposed method builds a valid ZDD, it can also handle constraints other than connectivity constraints by using algorithms and operations related to ZDDs.

[0041] Below, we will explain the subgraph counting device 10 that can simultaneously solve the subgraph counting problem for each vertex using the above proposed method, after preparing for ZDD and the frontier method.

[0042] <Preparation> ≪ZDD≫ The structure of the ZDD described in Reference 3 will be described. The ZDD Z=(N,A) is a data structure in the form of a rooted directed acyclic graph (DAG) and can represent a set of subsets of edge set E of graph G=(V,E), i.e., a set of subgraphs. Note that while a ZDD can essentially represent a set of subsets of any set, for simplicity's sake, this embodiment will describe it as a data structure representing a set of subgraphs. In addition, to distinguish ZDD from the vertices and edges of graph G, the terms "node" and "edge" are used for ZDD.

[0043] Let us write the root node of ZDD Z as follows.

[0044]

number

[0045] The node set N consists of two special nodes called terminal nodes and other intermediate nodes. We call the above two special nodes "terminal nodes" and write them as follows.

[0046]

number

[0047] Each intermediate node ^n has two branches, called the 0-edge and the 1-edge, and also has a label, an integer lb(^n) between 1 and m, where m is the number of edges in the original graph G.

[0048] The nodes at the ends of the 0- and 1-branches coming out of the intermediate node^n are called 0-child nodes^n, respectively. - and 1-child node^n + Here, the labels must be ordered from the root down, i.e., lb(^n) <lb(^n - ) and lb(^n) <lb(^n + ) must be true for each intermediate node ^n. For terminal nodes, we define the label value to be m+1.

[0049] A ZDD is normalized if, for any intermediate node^n, there are 0-child nodes^n - is a node whose label is lb(^n)+1 or a terminal node ⊥, and is 1-child node ^n + indicates that the node whose label is lb(^n)+1 or the terminal node ⊥. The size of ZDD Z, |Z|, is defined as the number of nodes in Z.

[0050] For a set of nodes in the ZDD, ^n,^n'∈N, let R be the set of paths from node ^n to node ^n'. Z (^n,^n'). In this case, the order of the edges e1,...,e m For ZDD Z, the set of subgraphs S(Z) ⊆ 2 E is defined as follows: For a path R in Z, let E(R) ⊆ E be e if and only if the path R passes through a 1-edge going out from a node whose label is i. i Let S(Z) be a subset of edge set E such that ∈E(R). Then, S(Z)={E(R)|R∈R Z (^r,T)}, that is, the set of E(R) for each path from the root node ^r to the terminal node T. For example, in the ZDD shown in Figure 1, the path from the root node to the terminal node T by following the 1-edge, 0-edge, 0-edge, 1-edge, 1-edge in order corresponds to the subgraph {e1,e4,e5} being included in S(Z). Note that in the ZDD shown in Figure 1, the dashed lines represent 0-edges and the solid lines represent 1-edges, and the integers in the nodes represent labels.

[0051] Using the normalized ZDD Z, we can easily calculate the counting value W(S(Z)) for the set of subgraphs S(Z) represented by Z. Let ^n,^n'∈N be the set of nodes in Z, and R∈R. Z Let (^n,^n') be any path between node ^n and node ^n'. Then, the path product W of the path R p (R) is defined by the following formula (3).

[0052]

number

[0053]

number

[0054] A ZDD can be constructed by merging equivalent subtrees of the binary decision tree above, i.e., trees with the same patterns of T and ⊥ at the bottom. For example, in the binary decision tree shown in Figure 3, all nodes marked with a dagger symbol † have the same pattern of ⊥, T, T, T, so these nodes can be merged.

[0055] However, since the number of subgraphs is exponentially larger than the size of the graph, constructing a binary decision tree once is computationally inefficient. Therefore, in the frontier method, instead of holding the subgraph itself at each node as in the binary decision tree shown in Figure 3, each node holds information about the connectivity between the vertices of the graph, and this allows the above-mentioned equivalent subtrees to be found without building the binary decision tree all the way to the bottom, and the amount of calculations is reduced by merging nodes.

[0056] Now, E <i ={e1,...,e i-1}, E ≧i ={e i ,···,e m} and E <i and E ≧i The set of vertices that appear in both i For a connectivity constraint P, let V be the set of vertices that appear in P (i.e., the set of vertices that appear in the subdivision that represents this connectivity constraint). P Then, e i-1 It can be shown that subtrees of a binary decision tree are equivalent when the following conditions are satisfied for multiple subgraphs that have been determined to be included or not included:

[0057] Condition: F i ∪V P The connectivity between the vertices in is equal, i.e., for any two vertices v, v'∈F i ∪V P For each subgraph, it is consistent whether vertex v and vertex v' are connected under that subgraph.

[0058] Therefore, instead of storing the subgraph itself at each node of the binary decision tree, F i ∪V P Node merging can be performed by maintaining information representing the connectivity between the vertices in

[0059] Frontier Method Algorithm An example of the algorithm of the frontier method will be described below with reference to FIG.

[0060] F i ∪V P The connectivity between vertices in is expressed by two subdivisions of vertices, comp and vset. In addition, the subdivision of vertices can be implemented by managing it as an array of integers, as in Reference 4.

[0061] comp is the frontier set F i A partition of v,v'∈F i are connected if and only if they belong to the same set. That is, F i Each set in is a connected component. vset is a set of i Each set, i.e., connected component, of V p In addition, the comps held by the root node ^r and node ^n are represented as ^r.comp and ^n.comp, respectively. Similarly, the vsets held by the root node ^r and node ^n are represented as ^r.vset and ^n.vset, respectively. Furthermore, the set of nodes with label i (the set of nodes in the i-th layer) is represented as L i This is represented as follows.

[0062] In this case, the frontier algorithm first sets ^r.comp={}, ^r.vset=P, L1={^r}, L i =φ(i=2, ,m+1) (line 1), and then repeatedly update comp and vset according to whether the edge is not included (f=-) or is included (f=+) (lines 2-4). Lines 8-13 and 18 are the procedures for updating comp and vset. Lines 8-9 newly create a frontier set F iFor each vertex u in e, add a set consisting of only u (connected component) to comp. Next, i and e i If the sets (connected components) to which the two end points v,v' belong in comp are different (line 10), the two sets are merged (line 11). In this case, if one vertex is in ^n.vset and the other is not, the vertices of the set in comp that contains the non-existent vertex are added to the vertices of vset that contains the existing vertex (lines 12-13). In line 18, the next frontier set F i+1 For vertex u that is no longer included in comp and vset, it is deleted from comp and vset. Finally, in line 24, the 0-child node (f=-) or 1-child node (f=+) is set to the node with the updated comp and vset. Here, if a node with the same comp and vset has already been generated, the child node is set to that already generated node (lines 21-22). On the other hand, if such a node has not yet been generated, a new node is generated (line 23). Also, if either (I) or (II) below occurs, the child node is set to ⊥. This is called pruning. (I) Two vertices that exist in different sets in vset are connected to an edge e i (lines 6-7). This is because it violates the constraints of vset. (II) If all vertices of comp[v] are in the next frontier set F i+1 If v is no longer included in P, but vset[v] has a different vertex v' from v (lines 16-17), v and v' are no longer connected, which violates the constraints of vset. Finally, if the last level (layer) has been reached and no pruning has been performed, the child node is set to T (line 20). This means that all constraints expressed by P are satisfied.

[0063] Given the graph shown in Figure 2 and the connectivity constraint P = {{1,4}}, the ZDD obtained as a result of the frontier method is shown in Figure 5. In Figure 5, the sets included in comp and the sets included in vset are written in each node in the format of "sets included in comp / sets included in vset." For example, the root node has " / {1,4}" written, which means that ^r.comp = {}, ^r.vset = {{1,4}}.

[0064] For example, in the ZDD shown in FIG. 5, pay attention to the node with "{1}{2} / {1,4}" written in the layer i=2. From comp={{1}{2}}, it can be seen that there are connected components including vertex 1 and connected components including vertex 2. In addition, vset={{1,4}} expresses the constraint that vertex 1 and vertex 3 are connected. Here, if edge e2={1,3} is not included, the next frontier set F3={2,3} does not include vertex 1, so the connected component including vertex 1 disappears from the frontier set F3. This contradicts the constraint of vset that vertex 1 and vertex 4 are connected, so the 0-child node becomes ⊥ (i.e., it is pruned). On the other hand, if edge e2={1,3} is included, the connected component including vertex 1 is rephrased as a connected component including vertex 3 in the next layer. Furthermore, the constraint that vertex 1 and vertex 4 are connected is rephrased as the constraint that vertex 3 and vertex 4 are connected. Therefore, the 1-child node is an intermediate node with comp={{2}{3}} and vset={3,4}. The frontier method repeats this process to build a ZDD. Note that the four nodes marked with a dagger symbol † in the binary decision tree shown in Figure 3 are treated as one node marked with a dagger symbol † in the ZDD shown in Figure 5.

[0065] <Hardware configuration example of the subgraph enumeration device 10> An example of a hardware configuration of the subgraph enumeration device 10 according to this embodiment is shown in Fig. 6. As shown in Fig. 6, the subgraph enumeration device 10 according to this embodiment includes an input device 101, a display device 102, an external I / F 103, a communication I / F 104, a RAM (Random Access Memory) 105, a ROM (Read Only Memory) 106, an auxiliary storage device 107, and a processor 108. Each of these pieces of hardware is connected to each other via a bus 109 so as to be able to communicate with each other.

[0066] The input device 101 is, for example, a keyboard, a mouse, a touch panel, a physical button, etc. The display device 102 is, for example, a display, a display panel, etc. Note that the subgraph enumeration device 10 does not necessarily have to include at least one of the input device 101 and the display device 102.

[0067] The external I / F 103 is an interface with an external device such as a recording medium 103a. Examples of the recording medium 103a include a CD (Compact Disc), a DVD (Digital Versatile Disk), an SD memory card (Secure Digital memory card), and a USB (Universal Serial Bus) memory card.

[0068] The communication I / F 104 is an interface for connecting the subgraph enumeration device 10 to a communication network. The RAM 105 is a volatile semiconductor memory (storage device) that temporarily stores programs and data. The ROM 106 is a non-volatile semiconductor memory (storage device) that can store programs and data even when the power is turned off. The auxiliary storage device 107 is a non-volatile storage device such as a hard disk drive (HDD), a solid state drive (SSD), or a flash memory. The processor 108 is various types of arithmetic devices such as a central processing unit (CPU).

[0069] 6 is just an example, and the hardware configuration of the subgraph enumeration device 10 is not limited to this. For example, the subgraph enumeration device 10 may have multiple auxiliary storage devices 107 and multiple processors 108, may not have some of the hardware shown in the figure, or may have various hardware other than the hardware shown in the figure.

[0070] <Example of functional configuration of the subgraph enumeration device 10> An example of the functional configuration of the subgraph enumeration device 10 according to this embodiment is shown in Fig. 7. As shown in Fig. 7, the subgraph enumeration device 10 according to this embodiment has an input unit 201, a construction unit 202, a calculation unit 203, and an output unit 204. Each of these units is realized, for example, by a process in which one or more programs installed in the subgraph enumeration device 10 are executed by the processor 108 or the like.

[0071] The input unit 201 receives given information (connected undirected graph G=(V,E), connectivity constraints P * , the weight w of each edge e∈E e + ,w e - ∈R, the underlying subgraph set F⊆2 E ) where F ⊆ 2 is the set of subgraphs. E For example, the subgraphs may be given one by one, or the set of subgraphs F ⊆ 2 may be given. E It may be given in the form of a constraint that the subgraphs contained in F ⊆ 2 must satisfy (e.g., "a subgraph whose vertices have degree 0 or 2"). Or, for example, a set of subgraphs F ⊆ 2 E Instead, this set of subgraphs F ⊆ 2 E Expressing ZDD Z F may be given.

[0072] The construction unit 202 constructs a connected undirected graph G=(V,E) input by the input unit 201 and a connectivity constraint P * and the set of subgraphs F ⊆ 2 EBased on this, we use a modified frontier method to construct a ZDD Z consisting of nodes that have information about the connectivity between specific vertices.

[0073] The calculation unit 203 calculates the weight w of each edge e ∈ E input by the input unit 201. e + ,w e - Based on ∈R and the ZDD Z constructed by the construction unit 202, a count value count(v) for each vertex v∈V is calculated by dynamic programming using information on connectivity between specific vertices. The count value count(v) for each vertex v∈V is a solution to the subgraph counting problem for each vertex.

[0074] The output unit 204 outputs the count value count(v) for each vertex v∈V calculated by the calculation unit 203 to a predetermined output destination. Note that examples of the predetermined output destination include the auxiliary storage device 107, the display device 102, and terminals and devices connected via a communication network.

[0075] <Subgraph counting process flow> The flow of the subgraph counting process according to this embodiment will be described with reference to FIG.

[0076] First, the input unit 201 receives given information (connected undirected graph G=(V,E), connectivity constraints P * , the weight w of each edge e∈E e + ,w e - ∈R, the underlying subgraph set F⊆2 E ) (Step S101).

[0077] Next, the construction unit 202 constructs the connected undirected graph G=(V,E) input in step S101 and the connectivity constraint P * and the set of subgraphs F ⊆ 2 EBased on this, a ZDD Z composed of nodes with information regarding the connectivity between specific vertex groups is constructed by a method that partially modifies the frontier method (step S102). Details of the method for constructing the ZDD Z will be described later.

[0078] Next, the calculation unit 203 calculates the count value count(v) for each vertex v ∈ V by a dynamic programming method that utilizes information regarding the connectivity between specific vertex groups, based on the weight w e + , w e - ∈ R of each edge e ∈ E input in step S101 above and the ZDD Z constructed in step S102 above (step S103). Details of the method for calculating the count value count(v) for each vertex v ∈ V will be described later.

[0079] Then, the output unit 204 outputs the count value count(v) for each vertex v ∈ V calculated in step S103 above to a predetermined output destination (step S104).

[0080] <Details of the method for constructing the ZDD Z> Hereinafter, details of the method for constructing the ZDD Z in step S102 of FIG. 8 will be described.

[0081] In order for the construction unit 202 to construct the ZDD Z such that the calculation unit 203 calculates the count value count(v) for all vertices v ∈ V, the ZDD Z needs to satisfy the following three conditions.

[0082] Condition 1: Z represents the subgraph set F ∩ C(P * []).

[0083] Condition 2: Each node of Z has information regarding the connectivity of F i ∪ V P* as comp and vset. Here, V P* is the set of vertices (excluding *) included in P * .

[0084] Condition 3: vset of each node in Z is a set of P * It keeps track of whether it corresponds to a set that contains *.

[0085] First, F=2 E In other words, when only connectivity constraints exist, the algorithm of the frontier method is modified so that the wildcard * is also treated as one of the special vertices. Specifically, in the first line of the algorithm of the frontier method shown in Figure 4, P is added to ^r.vset. * In addition, we add the condition "{u,*} is not included in ^u.vset" as an and condition to the if in line 16. Then, among the conditions for pruning mentioned above, (II) will simply ignore the wildcard * even if it is included in the set in vset. Therefore, Z will finally be the subgraph set under the constraint ignoring the wildcard *, that is, C(P * Here, the frontier method proceeds while including the wildcard * in vset, so condition 3 is also satisfied.

[0086] Next, F ≠ 2 E First, we consider the case where F is expressed by a ZDD Z F For this purpose, for example, the Frontier method described in Reference 2 or the Apply operation described in Reference 3 may be used. Next, an existing framework capable of finding the common part between ZDDs is combined with the partially modified Frontier method described above to construct a ZDD Z that satisfies all of Conditions 1 to 3. As an existing framework capable of finding the common part between ZDDs, for example, the Apply operation described in Reference 3 or subsetting described in Reference 5 may be used. Below, as an example, a case where subsetting is used as an existing framework capable of finding the common part between ZDDs will be described.

[0087] Processing algorithm executed by the construction unit 202 An example of the algorithm of the process executed by the construction unit 202 will be described below with reference to FIG. 9. The differences from the algorithm of the frontier method shown in FIG. 4 are lines 1, 6 to 11, 22, and 27 in FIG. 9. Lines 2 to 5 in FIG. 9 are the same as lines 2 to 5 in FIG. 4, lines 12 to 21 in FIG. 9 are the same as lines 6 to 15 in FIG. 4, lines 23 to 26 in FIG. 9 are the same as lines 17 to 20 in FIG. 4, and lines 28 to 31 in FIG. 9 are the same as lines 22 to 24 in FIG. 4. The differences from the algorithm of the frontier method in FIG. 9 will be mainly described below. Note that the underlined part of line 1 and line 22 are changes to consider the wildcard * as a special vertex as explained above, and the other differences are changes derived from subsetting. In subsetting, the edge e in the frontier method is i Depending on whether or not Z is included F If Z F In addition to comp and vset, we create an entry called base, and in base, we store the corresponding Z F Stores the nodes.

[0088] First, the construction unit 202 sets ^r.comp={}, ^r.vset=P * , ^r.base=^r F , L1={^r}, L i =φ(i=2,···,m+1) (first line). Here, ^r F is Z F In the sixth and seventh lines, the construction unit 202 constructs the edge e i If (f=+) is included and i is smaller than the label of ^n.base, pruning is performed. On the other hand, if i and the label of ^n.base match (line 8), the construction unit 202 sets ^n.base to the corresponding child node (line 9). If the child node is ⊥, the construction unit 202 performs pruning (lines 10 and 11). On line 27, if a node that matches not only comp and vset but also base has already been generated, the construction unit 202 sets the child node to that already generated node.

[0089] <Details on how to calculate the count value count(v) for each vertex v∈V> Hereinafter, a method for calculating the count value count(v) for each vertex v∈V in step S103 of FIG. 8 will be described in detail.

[0090] The calculation unit 203 calculates three types of values ​​p, q, and r for each node by dynamic programming on the ZDD Z constructed by the construction unit 202 (i.e., ZDD Z composed of nodes having at least information of comp and vset). Then, the calculation unit 203 calculates count(v) for each vertex v∈V using these three types of values ​​p, q, and r. In the following, the definitions of the three types of values ​​p, q, and r and the calculation method of count(v) using these three types of values ​​p, q, and r are explained, followed by the formulas for obtaining the values ​​of p, q, and r, and finally the algorithm of the process executed by the calculation unit 203. Note that p, q, and r for node ^n are expressed as ^np, ^nq, and ^nr, respectively.

[0091] For each node of the ZDD Z constructed by the construction unit 202, ̂np is, as described above, Z The sum of the path products of all paths in (^r,^n), where ^nr is the sum of the path products of all paths in R. Z Let us define the sum of the path products of all paths in (^n,T). On the other hand, ^nq is a value determined for each set, i.e., each connected component, contained in ^n.comp. The set R of paths from all root nodes to T Z Consider what passes through node ^n in (^r,T). Then, for one set (connected component) B in ^n.comp, take one vertex v contained in B. Then, among the paths that pass through node ^n mentioned above, the subgraph corresponding to that path satisfies constraint P * [v] is satisfied by a path R (i.e., E(R)∈C(P * The set of paths R such that [v] is the set of paths R determined by node ^n and connected component B. ^n,B ⊆R ZIt can be mathematically shown that using (^n,T) and a Cartesian product, it can be expressed in the following form:

[0092]

number

[0093]

number

[0094] Using the above values, we can show that the value of count(v) can be calculated using the following formula. First, if the degree of vertex v in graph G is 2 or more, then v∈F i Since there exists an i such that v=v, the value of count(v) can be calculated using the following equation (5).

[0095]

number

[0096]

number

[0097] On the other hand, if v' is F i If not included in v, the value of count(v) can be calculated using the following formula (6).

[0098]

number

[0099]

number

[0100]

number

[0101] Relationship between connected components of adjacent nodes: Let a node in the ZDD with label i be ^n∈L. i Let f be + or -. ^n f≠⊥, then for connected component B∈^n.comp, B f Let us define as follows: (i) if B is F i+1 If it contains a vertex v that also exists in B f :=^n f (ii) Otherwise, define B - =φ, i.e., there is no corresponding connected component. Also, for f=+, the edge e i Let v and v' be the two endpoints of F. i and v∈B, then B + :=^n + .comp[v'], if v∈F i and v'∈B, then B + :=^n + Define .comp[v], and if neither is true, then ^n + =φ.

[0102] By the above definition, B f represents the same connected component as B in ^n.comp.

[0103] Below, ^nq - Let us explain the calculation of [B]. First, if ^n=⊥, then ^nq - [B]=0. Next, ^n≠⊥ and B - If ≠φ, it can be shown that

[0104]

number

[0105]

number

[0106]

number

[0107]

number

[0108] The above is the formula for calculating the values ​​of p, q, and r.

[0109] Algorithm of processing executed by the calculation unit 203 An example of the algorithm of the process executed by the calculation unit 203 will be described below with reference to FIG.

[0110] First, in the first line, the calculation unit 203 initializes ^rp to 1 and the other p's to 0, and also initializes T.r to 1, ⊥.r to 0, and all q's to 0. Lines 2 to 5 are for calculating p, and the calculation unit 203 calculates the value of p by equation (4) in ascending order of label i. More specifically, the calculation unit 203 calculates the value of p for each node ^n∈L i For ^n - If ≠⊥ then ^n - Add the following to .p (line 4).

[0111]

number

[0112]

number

[0113] Lines 6 to 14 are the calculations of r and q, and the calculation unit 203 calculates the values ​​of r and q in descending order of label i. In line 8, ^np is calculated by equation (8). ^nq is calculated as - and^nq + The 11th line corresponds to the first case of equation (10), and the 12th and 13th lines correspond to the second case of equation (10). The 14th line corresponds to the above-mentioned ^nq + Perform exception handling for.

[0114] The 15th line onwards is the calculation of count(v), and the value of count(v) is stored in res[v]. First, if vertex v is V P*', then by definition C(P * [v])=C(P * Since V is a vector of V, the calculation unit 203 assigns T.p to res[v] (line 16). P* '' to P * Let v be the set of vertices in V that does not contain the wildcard *. P* If it is included in '', P * Since [v] is a contradictory constraint, the calculation unit 203 assigns 0 to res[v] (line 17). i If there exists an i such that v=v, calculation unit 203 calculates the value of res[v] using equation (5) (lines 18-19). If neither of these conditions holds, vertex v is a vertex of degree 1, so calculation unit 203 calculates the value of res[v] using equations (6) and (7) (lines 21-23). ​​Line 21 corresponds to the calculation of the first term of equation (6), line 22 corresponds to the calculation of the first term of equation (7), and line 23 corresponds to the calculation of the second term common to equations (6) and (7).

[0115] <Summary> As described above, the subgraph counting device 10 according to the present embodiment can simultaneously solve subgraph counting problems for each vertex under constraints including at least connectivity constraints. This allows for high-speed solution of vertex importance calculation problems for paths, cycles, Steiner trees, rooted spanning forests, and the like. The proposed method executed by the subgraph counting device 10 according to the present embodiment has also been subjected to computational analysis, and it has been shown to be faster by an order of magnitude of the number of vertices n than the July method, which executes the frontier method for each constraint. Computer experiments have also shown that the above vertex importance calculation problems can be solved about 10 to 20 times faster in a graph with about 100 vertices.

[0116] The present invention is not limited to the above-described embodiments specifically disclosed, and various modifications, changes, combinations with known technologies, etc. are possible without departing from the scope of the claims.

[0117] [Reference 1] Reference 1: Akiyoshi Shioura, Akihisa Tamura, and Takeaki Uno. An optimal algorithm for scanning all spanning trees of undirected graphs. SIAM Journal on Computing, Vol. 26, No. 3, pp. 678-692, 1997. Reference 2: Jun Kawahara, Takeru Inoue, Hiroaki Iwashita, and Shin-ichi Minato. Frontier-based search for enumerating all constrained subgraphs with compressed representation. IEICE Transactions on Fundamentals of Electronics, Communications and Computer Sciences, Vol. E100.A, No.9, pp. 1773-1784, 2017. Reference 3: Shin-ichi Minato. Zero-suppressed BDDs for set manipulation in combinatorial problems. In Proceedings of the 30th ACM / IEEE Design Automation Conference (DAC), pp. 272-277, 1993. Reference 4: Kengo Nakamura, Takeru Inoue, Masaaki Nishino, and Norihito Yasuda. Efficient network reliability evaluation for client-server model. In Proceedings of 2021 IEEE Global Communications Conference (GLOBECOM 2021), pp. 1-6, 2021. Reference 5: Hiroaki Iwashita and Shin-ichi Minato. Efficient top-down ZDD construction techniques using recursive specifications. Technical Report TCS-TR-A-13-69, Division of Computer Science, Hokkaido University, 2013. [Explanation of symbols]

[0118] 10 Subgraph Enumeration Device 101 Input Device 102 Display device 103 External I / F 103a Recording media 104 Communication I / F 105 RAM 106 ROM 107 Auxiliary storage 108 processors 109 Bus 201 Input section 202 Construction Department 203 Calculation Department 204 Output section

Claims

1. A connected undirected graph G = (V, E) and a connectivity constraint P that includes a wildcard * * and the weight w of each edge e∈E e + , w e - ∈R and the underlying subgraph set F ⊆ 2 E and an input procedure for inputting The undirected graph G and the connectivity constraint P * and the subgraph set F ⊆ 2 E A construction procedure for constructing a zero-suppressed binary decision diagram Z composed of nodes having information about connectivity between a set of specific vertices v∈V of the undirected graph G based on the above. The zero-suppressed binary decision diagram Z constructed by the above construction procedure and the weight w of each edge e∈E e + , w e - ∈R, for each vertex v∈V, a subgraph E′ included in the subgraph set F and the connectivity constraint P * The connectivity constraint P * The weight w of the edge e ∈ E' included in the subgraph E' that satisfies [v] e + and the weight w of the edge e∈E\E′ that is not included in the subgraph E′. e - A calculation procedure for calculating a weighted count value count(v) using A computer-implemented subgraph enumeration method.

2. The subgraph set F ⊆ 2 E is a subgraph of the undirected graph G that does not have the connectivity constraint P * 2. The method for counting subgraphs according to claim 1, wherein the set of subgraphs satisfies a predetermined constraint other than

3. The construction procedure is as follows: The subgraph set F is F=2 E If so, the wildcard * is treated as one of the vertices of the undirected graph G by the frontier method, and the subgraph set F=2 E The method of claim 1 , further comprising constructing the zero-suppressed binary decision diagram Z that represents

4. The construction procedure is as follows: The subgraph set F is F≠2 E If so, the wildcard * is treated as one of the vertices of the undirected graph G by the frontier method, and the subgraph set 2 E A zero-suppressed binary decision diagram Z 1 Build A zero-suppressed binary decision diagram Z representing the subgraph set F is obtained by the frontier method. 2 Build The zero-suppressed binary decision diagram Z 1 and the zero-suppressed binary decision diagram Z 2 3. The method of claim 2, wherein an intersection of the zero-suppressed binary decision diagram Z with the zero-suppressed binary decision diagram Z is constructed.

5. A connected undirected graph G = (V, E) and a connectivity constraint P that includes a wildcard * * and the weight w of each edge e∈E e + , w e - ∈R and the underlying subgraph set F ⊆ 2 E An input unit for inputting The undirected graph G and the connectivity constraint P * and the subgraph set F ⊆ 2 E A construction unit that constructs a zero-suppressed binary decision diagram Z composed of nodes having information about connectivity between a set of specific vertices v∈V of the undirected graph G based on the above. A zero-suppressed binary decision diagram Z constructed by the construction unit and a weight w of each edge e∈E e + , w e - ∈R, for each vertex v∈V, a subgraph E′ included in the subgraph set F and the connectivity constraint P * The connectivity constraint P * The weight w of the edge e ∈ E' included in the subgraph E' that satisfies [v] e + and the weight w of the edge e∈E\E′ that is not included in the subgraph E′. e - A calculation unit that calculates a weighted count value count(v) using A subgraph enumeration apparatus having

6. A connected undirected graph G = (V, E) and a connectivity constraint P that includes a wildcard * * and the weight w of each edge e∈E e + , w e - ∈R and the underlying subgraph set F ⊆ 2 E and an input procedure for inputting The undirected graph G and the connectivity constraint P * and the subgraph set F ⊆ 2 E A construction procedure for constructing a zero-suppressed binary decision diagram Z composed of nodes having information about connectivity between a set of specific vertices v∈V of the undirected graph G based on the above. The zero-suppressed binary decision diagram Z constructed by the above construction procedure and the weight w of each edge e∈E e + , w e - ∈R, for each vertex v∈V, a subgraph E′ included in the subgraph set F and the connectivity constraint P * The connectivity constraint P * The weight w of the edge e ∈ E' included in the subgraph E' that satisfies [v] e + and the weight w of the edge e∈E\E′ that is not included in the subgraph E′. e - A calculation procedure for calculating a weighted count value count(v) using A program that causes a computer to execute the following.