JP6777903B2 - Search device, search method and search program - Google Patents

Search device, search method and search program Download PDF

Info

Publication number
JP6777903B2
JP6777903B2 JP2017230089A JP2017230089A JP6777903B2 JP 6777903 B2 JP6777903 B2 JP 6777903B2 JP 2017230089 A JP2017230089 A JP 2017230089A JP 2017230089 A JP2017230089 A JP 2017230089A JP 6777903 B2 JP6777903 B2 JP 6777903B2
Authority
JP
Japan
Prior art keywords
search
graph
vertices
failure
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2017230089A
Other languages
Japanese (ja)
Other versions
JP2019101610A (en
Inventor
淳也 新井
淳也 新井
靖宏 藤原
靖宏 藤原
鬼塚 真
真 鬼塚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nippon Telegraph and Telephone Corp
Osaka University NUC
Original Assignee
Nippon Telegraph and Telephone Corp
Osaka University NUC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nippon Telegraph and Telephone Corp, Osaka University NUC filed Critical Nippon Telegraph and Telephone Corp
Priority to JP2017230089A priority Critical patent/JP6777903B2/en
Publication of JP2019101610A publication Critical patent/JP2019101610A/en
Application granted granted Critical
Publication of JP6777903B2 publication Critical patent/JP6777903B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、探索装置、探索方法および探索プログラムに関する。 The present invention relates to a search device, a search method, and a search program.

グラフ構造の中からクエリとして与えられた特定の部分構造すなわちサブグラフを発見する問題は、サブグラフマッチングと呼ばれる。従来、サブグラフマッチングでは、バックトラッキングと呼ばれる探索アルゴリズムに基づいて探索されていた(非特許文献1,2参照)。バックトラッキングでは、クエリグラフQおよびデータグラフGを入力として、データグラフGに含まれる全てのクエリグラフQの埋め込みが報告される。その際、クエリグラフQの頂点の割り当て先となり得るデータグラフGの候補頂点が抽出され、クエリグラフQの頂点の割り当て先を候補頂点の中から変更しながら選択して埋め込みを探索することにより、埋め込みが列挙される。 The problem of finding a specific subgraph, or subgraph, given as a query in a graph structure is called subgraph matching. Conventionally, in subgraph matching, a search algorithm called backtracking has been used for searching (see Non-Patent Documents 1 and 2). In backtracking, the query graph Q and the data graph G are input, and the embedding of all the query graph Q included in the data graph G is reported. At that time, the candidate vertices of the data graph G that can be the allocation destination of the vertices of the query graph Q are extracted, and the allocation destination of the vertices of the query graph Q is selected from the candidate vertices while being selected to search for embedding. Embeddings are listed.

Huahai He,Ambuj K. Singh,“Graphs-at-a-time: Query Language and Access Methods for Graph Databases”,Proceedings of the 2008 ACM SIGMOD International Conference on Management of Data,SIG-MOD '08,2008年,pp.405-418Huahai He, Ambuj K. Singh, “Graphs-at-a-time: Query Language and Access Methods for Graph Databases”, Proceedings of the 2008 ACM SIGMOD International Conference on Management of Data, SIG-MOD '08, 2008, pp .405-418 Jinsoo Lee,Wook-Shin Han,Romans Kasperovics,Jeong-Hoon Lee,“An In-depth Comparison of Subgraph Isomorphism Algorithms in Graph Databases”,Proceedings of the 39th international conference on Very Large Data Bases,2012年,pp.133-144Jinsoo Lee, Wook-Shin Han, Romans Kasperovics, Jeong-Hoon Lee, “An In-depth Comparison of Subgraph Isomorphism Algorithms in Graph Databases”, Proceedings of the 39th international conference on Very Large Data Bases, 2012, pp.133- 144

しかしながら、従来のバックトラッキングによれば、探索対象であるデータグラフG中の埋め込みが存在しない部分に対しても、網羅的に探索を行うために、長い処理時間を要していた。そのため、例えば、グラフデータ向けに設計されたデータベースであるグラフデータベースに対する、サブグラフマッチングとして記述されるクエリを用いた対話的な作業や、グラフデータベースに依存するサービスの提供が困難な場合があった。また、グラフに対してサブグラフマッチングを用いて、例えば、特定のサブグラフの出現回数をグラフの特徴量として利用するデータマイニングを行う際に、現実的な時間で完了できない場合があった。 However, according to the conventional backtracking, a long processing time is required to comprehensively search even a portion of the data graph G to be searched where there is no embedding. Therefore, for example, it may be difficult to perform interactive work using a query described as subgraph matching for a graph database, which is a database designed for graph data, or to provide a service that depends on the graph database. Further, when subgraph matching is used for a graph, for example, data mining using the number of appearances of a specific subgraph as a feature amount of the graph is performed, it may not be completed in a realistic time.

本発明は、上記に鑑みてなされたものであって、データグラフの中からクエリグラフと同型な部分を探索するサブグラフマッチング処理を高速化することを目的とする。 The present invention has been made in view of the above, and an object of the present invention is to speed up a subgraph matching process for searching a part of a data graph having the same type as a query graph.

上述した課題を解決し、目的を達成するために、本発明に係る探索装置は、ラベルが付与された頂点と、隣接する頂点間を接続するエッジとで構成されるグラフのうち、検索対象のデータのグラフであるデータグラフから、検索に使用されるクエリのグラフであるクエリグラフと同型な部分を探索する際に、該探索の過程において発生する探索の失敗に基づいて、クエリグラフの頂点とデータグラフの頂点との組み合わせの集合を、探索の失敗の要因を表す失敗パターンとして抽出するパターン抽出部と、前記パターン抽出部により抽出された前記失敗パターンと合致する探索の状態を枝刈りして、前記データグラフから前記クエリグラフと同型な部分を探索する探索部と、を備えることを特徴とする。 In order to solve the above-mentioned problems and achieve the object, the search device according to the present invention is a search target among graphs composed of labeled vertices and edges connecting adjacent vertices. When searching for a part of the data graph that is a graph of data that is similar to the query graph that is the graph of the query used for the search, the top of the query graph and the top of the query graph are based on the search failure that occurs in the process of the search. A pattern extraction unit that extracts a set of combinations with the vertices of the data graph as a failure pattern representing the cause of the search failure, and a search state that matches the failure pattern extracted by the pattern extraction unit are pruned. , A search unit for searching a portion having the same type as the query graph from the data graph.

本発明によれば、データグラフの中からクエリグラフと同型な部分を探索するサブグラフマッチング処理を高速化することができる。 According to the present invention, it is possible to speed up the subgraph matching process for searching a part of the data graph having the same type as the query graph.

図1は、サブグラフマッチングに関する定義を示す図である。FIG. 1 is a diagram showing a definition regarding subgraph matching. 図2は、再帰関数の処理手順を示すフローチャートである。FIG. 2 is a flowchart showing a processing procedure of the recursive function. 図3は、サブグラフマッチング処理を説明するための説明図である。FIG. 3 is an explanatory diagram for explaining the subgraph matching process. 図4は、サブグラフマッチング処理を説明するための説明図である。FIG. 4 is an explanatory diagram for explaining the subgraph matching process. 図5は、本実施形態の探索装置の処理概要を説明するための説明図である。FIG. 5 is an explanatory diagram for explaining a processing outline of the search device of the present embodiment. 図6は、本実施形態の探索装置の処理概要を説明するための説明図である。FIG. 6 is an explanatory diagram for explaining a processing outline of the search device of the present embodiment. 図7は、本実施形態の探索装置の概略構成を示す模式図である。FIG. 7 is a schematic diagram showing a schematic configuration of the search device of the present embodiment. 図8は、本実施形態の探索装置による探索処理に関する定義および定理を示す図である。FIG. 8 is a diagram showing a definition and a theorem regarding the search process by the search device of the present embodiment. 図9は、本実施形態の探索装置による探索処理に関する定理を示す図である。FIG. 9 is a diagram showing a theorem regarding the search process by the search device of the present embodiment. 図10は、本実施形態の探索装置による探索処理に関する定理を示す図である。FIG. 10 is a diagram showing a theorem regarding a search process by the search device of the present embodiment. 図11は、本実施形態の探索装置による探索処理に関する定理を示す図である。FIG. 11 is a diagram showing a theorem regarding the search process by the search device of the present embodiment. 図12は、本実施形態の探索処理手順を示すフローチャートである。FIG. 12 is a flowchart showing the search processing procedure of the present embodiment. 図13は、他の実施形態の探索処理を説明するための説明図である。FIG. 13 is an explanatory diagram for explaining the search process of another embodiment. 図14は、探索プログラムを実行するコンピュータを例示する図である。FIG. 14 is a diagram illustrating a computer that executes a search program.

以下、図面を参照して、本発明の一実施形態を詳細に説明する。なお、この実施形態により本発明が限定されるものではない。また、図面の記載において、同一部分には同一の符号を付して示している。 Hereinafter, an embodiment of the present invention will be described in detail with reference to the drawings. The present invention is not limited to this embodiment. Further, in the description of the drawings, the same parts are indicated by the same reference numerals.

[従来のサブグラフマッチング処理]
まず、従来のサブグラフマッチング処理について説明する。以下の説明において、頂点がラベルを持つ無向グラフG=(V,E,Σ,l)を処理の対象とする。以下、Gをデータグラフと記す。ここで、Vは頂点の集合、E⊆V×Vはエッジの集合、Σはラベルの集合、lは頂点とラベルとを対応させる関数を示す。同様に、クエリグラフQ=(V,E,Σ,l)を処理の対象とする。クエリグラフの頂点は、u,u,…,u|VQ|というように、番号付けされているものとする。
[Conventional subgraph matching process]
First, the conventional subgraph matching process will be described. In the following description, undirected graph G = the vertex has a label (V G, E G, Σ , l) is the target of processing. Hereinafter, G is referred to as a data graph. Here, V G represents a set of vertices, a set of E G ⊆V G × V G edge, sigma is a set of labels, l is a function for associating the vertex and labels. Similarly, the query graph Q = (V Q , EQ , Σ, l) is the target of processing. It is assumed that the vertices of the query graph are numbered such as u 1 , u 2 , ..., U | VQ | .

また、サブグラフマッチングとは、データグラフGとクエリグラフQとが与えられたときに、サブグラフ同型である部分への埋め込みMを列挙する問題と定義する。 Further, subgraph matching is defined as a problem of enumerating embedded Ms in parts having the same subgraph type when a data graph G and a query graph Q are given.

ここで、図1を参照して、サブグラフマッチングについて説明する。図1は、サブグラフマッチングに関する定義を示す図である。以下の説明において、図1の定義1に示すように、埋め込みを集合として表現する。サブグラフマッチングでは、クエリグラフの頂点(以下、クエリ頂点と記す。)から、データグラフの頂点(以下、データ頂点と記す。)への埋め込みM∈V×Vを探索する。 Here, subgraph matching will be described with reference to FIG. FIG. 1 is a diagram showing a definition regarding subgraph matching. In the following description, embedding is represented as a set, as shown in Definition 1 of FIG. The sub graph matching, the vertices of the query graph (hereinafter, referred to as query vertex.), The vertex of the data graph (hereinafter, referred to as data apex.) Searches the embedded M∈V Q × V G to.

また、探索の過程において、図1の定義2に示す部分埋め込み、すなわち、一部のクエリ頂点についてのみ、データ頂点が割り当てられた埋め込みを考える必要がある。なお、本実施形態において、定義域がV全体であるような埋め込みを完全な埋め込みと記す場合がある。 Further, in the process of search, it is necessary to consider the partial embedding shown in the definition 2 of FIG. 1, that is, the embedding in which the data vertices are assigned only to some query vertices. In the present embodiment, there is a case where domain is referred to as implantable complete embedded as a whole V Q.

また、次式(1)〜(3)に示す3つの制約を満たす埋め込みM:V→Vを定義できるときに、QはGに対してサブグラフ同型であるものする。 Also, embedding meet three constraints shown in equation (1) ~ (3) M : when you can define V Q → V G, Q are those which are subgraph isomorphism against G.

Figure 0006777903
Figure 0006777903

Figure 0006777903
Figure 0006777903

Figure 0006777903
Figure 0006777903

従来のサブグラフマッチング処理の主流は、バックトラッキングに基づく探索アルゴリズムである。上記したとおり、バックトラッキングは、主に、候補頂点の抽出と、埋め込みの列挙との2つの処理を含む。 The mainstream of conventional subgraph matching processing is a search algorithm based on backtracking. As mentioned above, backtracking mainly involves two processes: extraction of candidate vertices and enumeration of embeddings.

まず、候補頂点の抽出において、候補頂点すなわち各クエリ頂点の割り当て先となり得るデータ頂点の集合C[u]⊆Vが抽出される。uがデータ頂点vに割り当て可能か否かは、例えば、次式(4)〜(6)を用いて判定される(非特許文献1参照)。つまり、次式(4)〜(6)の全てを満たす場合に、uがvに割り当て可能と判定される。 First, in the extraction of candidate vertices, the set of data vertex can be the candidate vertex or each query vertex is assigned C [u i] ⊆V G are extracted. u i whether assignable to data vertex v, for example, be determined using the following equation (4) to (6) (see Non-Patent Document 1). That is, if they meet all of the following formulas (4) ~ (6), u it is determined to be assigned to v.

Figure 0006777903
Figure 0006777903

Figure 0006777903
Figure 0006777903

Figure 0006777903
Figure 0006777903

上記式(4)では、まず、ラベルの一致が確認される。従って、C[u]に含まれるデータ頂点は、ラベル制約を満たす。また、上記式(5)にて次数が比較され、上記式(6)にて隣接頂点のラベルごとに隣接頂点数が比較される。これらの条件では、vにu以上の数の隣接頂点がなければ、uの隣接頂点をvの隣接頂点に割り当てることができないことが利用されている。このように、確認が容易な条件により、割り当て不可能なクエリ頂点とデータ頂点との組み合わせを除外して、以降の探索を高速化している。 In the above formula (4), first, label matching is confirmed. Therefore, data vertexes included in the C [u i] satisfies a label constraints. Further, the degree is compared by the above formula (5), and the number of adjacent vertices is compared for each label of the adjacent vertex by the above formula (6). In these conditions, if there is no adjacent vertices in the number of more than u i to v, can not be assigned to adjacent vertices of u i to the adjacent vertex of v is used. In this way, the combination of unassignable query vertices and data vertices is excluded under the condition that it is easy to confirm, and the subsequent search is speeded up.

次に、図2を参照して、埋め込みの列挙について説明する。埋め込みの列挙では、再帰関数Searchが呼び出され実行される。図2は、再帰関数の処理手順を示すフローチャートである。図2に示すフローチャートでは、まず、Search(φ)が呼び出される。ただし、φは空集合を表す。再帰関数Search(P)は、部分埋め込みPを引数として受け取り、まず、Pが完全な埋め込みであるか否かが確認される(ステップS100)。すなわち、k=|P|として、k=|V|であるか否かが確認される。Pが完全な埋め込みである場合(ステップS100,Yes)、Pは埋め込みとして報告され(ステップS180)、処理は関数の呼び出し元に戻る。 Next, the embedding enumeration will be described with reference to FIG. In the embedded enumeration, the recursive function Search is called and executed. FIG. 2 is a flowchart showing a processing procedure of the recursive function. In the flowchart shown in FIG. 2, First, Search (φ) is called. However, φ represents an empty set. The recursive function Search (P) receives the partially embedded P as an argument, and first, it is confirmed whether or not P is completely embedded (step S100). That is, it is confirmed whether or not k = | V Q | with k = | P |. If P is a complete embedding (step S100, Yes), then P is reported as an embedding (step S180) and the process returns to the caller of the function.

一方、Pが完全な埋め込みではない場合(ステップS100,No)、ステップS110に処理が進む。ステップS110の処理では、クエリ頂点uk+1がデータ頂点vに割り当てられる。その際、vをC[u]から選択することによりラベル制約が満たされることになる。同時に、vは、既にPに含まれるクエリ頂点と、データ頂点に関してエッジ制約が満たされなければならない。具体的には、次式(7)に示すエッジ制約を満たすv∈C[u]が選択される。 On the other hand, when P is not completely embedded (steps S100 and No), the process proceeds to step S110. In the process of step S110, the query vertex uk + 1 is assigned to the data vertex v. At that time, v so that the label constraint is satisfied by the selected from C [u i]. At the same time, v must satisfy the edge constraints for the query vertices already contained in P and the data vertices. Specifically, V∈C satisfying edge constraints shown in equation (7) [u i] is selected.

Figure 0006777903
Figure 0006777903

次に、Pに(uk+1,v)の割り当てが追加された部分埋め込みPが作成され、Pについて単射制約が確認される(ステップS120)。Pが単射であれば(ステップS120,Yes)、Pを引数として再帰関数Search(P)が再帰呼び出しされる(ステップS140)。一方、Pが単射でなければ(ステップS120,No)、再帰関数Search(P)は再帰呼び出しされず、呼び出し元に戻る(ステップS150)。 Next, a partially embedded P + with the assignment of (uk + 1 , v) added to P is created, and the injective constraint is confirmed for P + (step S120). If P + is injective (step S120, Yes), the recursive function Search (P + ) is recursively called with P + as an argument (step S140). On the other hand, if P + is not injective (step S120, No), the recursive function Search (P + ) is not recursively called and returns to the caller (step S150).

次に、図3および図4を参照して、従来のサブグラフマッチング処理を具体的に説明する。図3および図4は、サブグラフマッチング処理について説明するための説明図である。従来のサブグラフマッチング処理では、まず、上記式(4)〜(6)を用いて、候補頂点集合が抽出される。図3に示す例では、C[u1]={v},C[u]={v,…,v},C[u]={v,…,v},C[u]={v,v10}が抽出される。 Next, the conventional subgraph matching process will be specifically described with reference to FIGS. 3 and 4. 3 and 4 are explanatory views for explaining the subgraph matching process. In the conventional subgraph matching process, first, a set of candidate vertices is extracted using the above equations (4) to (6). In the example shown in FIG. 3, C [u 1 ] = {v 1 }, C [u 2 ] = {v 2 , ..., v 5 }, C [u 3 ] = {v 6 , ..., v 9 }, C [u 4 ] = {v 1 , v 10 } is extracted.

この場合に、図4に示すバックトラッキングの探索木に従って、C[u1]={v}であることから、最初にuがvに割り当てられる。またここでは、u以降については、頂点番号の昇順に探索する場合について考える。すなわち、C[u]からvが選択され、C[u]からvが選択され、C[u]からv10が選択される。この場合に、全てのクエリ頂点がデータ頂点に割り当てられるので、{(u,v),(u、v),(u,v),(u,v10)}が埋め込みとして報告される。 In this case, according to the backtracking search tree shown in FIG. 4, since C [u 1 ] = {v 1 }, u 1 is first assigned to v 1 . Further, here, for u 2 and later, a case of searching in ascending order of vertex numbers will be considered. That is, v 2 is selected from C [u 2 ], v 6 is selected from C [u 3 ], and v 10 is selected from C [u 4 ]. In this case, all query vertices are assigned to the data vertices, so {(u 1 , v 1 ), (u 2 , v 2 ), (u 3 , v 6 ), (u 4 , v 10 )} Reported as an embedding.

さらに、他の埋め込みが探索される。uの割り当て先の選択に戻り、uがvに割り当てられ、uがvに割り当てられる。この場合に、vに隣接するuの候補頂点vには、既にuが割り当てられており、単射制約の違反となるため、uをvに割り当てることができない。vの隣接頂点には、他にuの候補頂点が存在しないため、探索失敗となる。 In addition, other embeddings are searched. Returning to its assigned selection u 2, assigned to u 2 is v 3, u 3 is assigned to v 7. In this case, the candidate vertices v 1 of u 4 adjacent to v 7, already assigned u 1, to become a violation of injection constraints, can not be assigned to u 4 to v 1. The adjacent vertex of v 7, since the other there is no candidate vertices of u 4, the search fails.

の残りの候補頂点v、vについても、同様に、uをvに割り当てることができず、探索失敗となる。また、uの割り当て先の選択に戻り、uがvに割り当てられた場合、およびuがvに割り当てられた場合にも、同様に、探索失敗となる。以上の処理により、全ての候補頂点について探索が行われたことになり、探索が終了する。 for the remaining candidate vertices v 8, v 9 of u 3, likewise, can not be assigned to u 4 to v 1, the search fails. Further, return to its assigned selection u 2, if u 2 is assigned to v 4, and even when u 2 is assigned to v 5, similarly, the search fails. By the above processing, the search has been performed for all the candidate vertices, and the search ends.

このように、従来のサブグラフマッチング処理は、クエリ頂点の割り当て先を変更しながら再帰呼び出しを繰り返すバックトラッキングに基づいて実行されている。 In this way, the conventional subgraph matching process is executed based on backtracking in which recursive calls are repeated while changing the allocation destination of query vertices.

[探索装置の処理概要]
次に、図5および図6を参照して、本実施形態に係る探索装置の処理概要を説明する。本実施形態の探索装置は、図3に示した例において、上記の従来のサブグラフマッチング処理と同様に、まず、{(u,v),(u、v),(u,v),(u,v10)}を埋め込みとして報告する。
[Outline of search device processing]
Next, a processing outline of the search device according to the present embodiment will be described with reference to FIGS. 5 and 6. In the example shown in FIG. 3, the search device of the present embodiment first, in the same manner as the above-mentioned conventional subgraph matching process, first, {(u 1 , v 1 ), (u 2 , v 2 ), (u 3 , Report v 6 ), (u 4 , v 10 )} as embedding.

次に、探索装置は、バックトラッキングによってuをvに割り当て、uをvに割り当てて探索失敗となった場合に、失敗パターンとして記録する。すなわち、「uのvへの割り当てと、uのvへの割り当てとを同時に行うと、探索に失敗する」ということを失敗パターンとして抽出して記録しておく。同様に、uをvまたはvに割り当てて探索失敗となった場合にも、「uのv1への割り当てと、uのv(またはv)への割り当てとを同時に行うと、探索に失敗する」ということを失敗パターンとして抽出して記録しておく。 Next, the search device assigns u 2 to v 3 by backtracking and assigns u 3 to v 7 , and when the search fails, records it as a failure pattern. That is, "if u 1 is assigned to v 1 and u 3 is assigned to v 7 at the same time, the search fails" is extracted and recorded as a failure pattern. Similarly, when u 3 is assigned to v 8 or v 9 and the search fails, "assigning u 1 to v 1 and assigning u 3 to v 8 (or v 9 ) are performed at the same time. And, "the search fails" is extracted and recorded as a failure pattern.

また、探索装置が、uの割り当て先をvに変更した場合に、uを隣接頂点v,v,vに割り当てた部分埋め込みは、いずれも記録済みの失敗パターンに合致する。従って、uを候補頂点に割り当てた部分埋め込みを作成することなく、探索失敗になることがわかる。uの割り当て先をvに変更した場合についても、同様に、探索失敗になることがわかる。 Further, when the search device changes the allocation destination of u 2 to v 4 , the partial embedding in which u 3 is assigned to the adjacent vertices v 7 , v 8 , and v 9 all match the recorded failure pattern. .. Therefore, without creating an embedded portion assigned to u 3 in candidate vertices, it is understood to be a search failure. Similarly, it can be seen that the search fails when the allocation destination of u 2 is changed to v 5 .

このように、本実施形態の探索装置によれば、図5に示す探索木のように、図4に示した従来のサブグラフマッチングの探索木と比較して、探索空間が減少する。すなわち、従来は、図4に示したように、uをv,v,vのいずれかに割り当てるような埋め込みが存在しないにもかかわらず、それぞれuをv,v,vに割り当てて探索していた。つまり、従来は、ある部分埋め込みPについて、P⊂Mであるような完全な埋め込みMが存在しない場合にも、バックトラッキングによる探索を行っていた。本実施形態の探索装置は、このような埋め込みの発見に至らない探索の枝刈りを行う。したがって、本実施形態の探索装置によれば、高速なサブグラフマッチングが可能となる。 As described above, according to the search device of the present embodiment, the search space is reduced as compared with the conventional subgraph matching search tree shown in FIG. 4, as in the search tree shown in FIG. That is, conventionally, as shown in FIG. 4, although there is no embedding that assigns u 2 to any of v 3 , v 4 , and v 5 , u 3 is assigned to v 7 , v 8 , and so on, respectively. v had been searching assigned to the 9. That is, conventionally, for a certain partially embedded P, a search by backtracking is performed even when there is no completely embedded M such as P⊂M. The search device of the present embodiment prunes the search that does not lead to the discovery of such an embedding. Therefore, according to the search device of the present embodiment, high-speed subgraph matching is possible.

また、図6のフローチャートに示すように、本実施形態の探索装置による埋め込みの列挙の処理は、図2に示した従来のサブグラフマッチング処理における再帰関数の処理手順と、ステップS130、S160〜S170が異なる。すなわち、図6に示すように、本実施形態の探索装置においては、失敗パターンが抽出されて記録される(ステップS160〜S170)。具体的には、再帰関数Search(P)の再帰呼び出しにおいて埋め込みが一つも報告されなかった場合に(ステップS160,Yes)、Pから失敗パターンが抽出され記録される(ステップS170)。埋め込みが報告された場合には(ステップS160,No)、処理は関数の呼び出し元に戻る。 Further, as shown in the flowchart of FIG. 6, the process of enumerating the embedding by the search device of the present embodiment includes the processing procedure of the recursive function in the conventional subgraph matching process shown in FIG. 2, and steps S130 and S160 to S170. different. That is, as shown in FIG. 6, in the search device of the present embodiment, the failure pattern is extracted and recorded (steps S160 to S170). Specifically, when no embedding is reported in the recursive call of the recursive function Search (P + ) (step S160, Yes), the failure pattern is extracted from P and recorded (step S170). If the embedding is reported (step S160, No), the process returns to the caller of the function.

また、抽出された失敗パターンと照合される(ステップS130)。具体的には、作成された部分埋め込みPが記録されている失敗パターンのいずれにも合致しない場合に(ステップS130,Yes)、再帰関数Search(P)が再帰呼び出しされる(ステップS140)。Pがいずれかの失敗パターンに合致した場合には(ステップS130,No)、ステップS150に処理が進む。その他の処理は図2に示した従来のサブグラフマッチング処理と同様であるので、説明を省略する。 In addition, it is collated with the extracted failure pattern (step S130). Specifically, when the created partially embedded P + does not match any of the recorded failure patterns (step S130, Yes), the recursive function Search (P + ) is recursively called (step S140). .. If P + matches any of the failure patterns (steps S130, No), the process proceeds to step S150. Since the other processes are the same as the conventional subgraph matching process shown in FIG. 2, the description thereof will be omitted.

[探索装置の構成]
次に、図7を参照して、本実施形態に係る探索装置の概略構成を説明する。図7に示すように、本実施形態に係る探索装置1は、ワークステーションやパソコン等の汎用コンピュータで実現され、入力部11と出力部12と制御部13と記憶部14とを備える。探索装置1は、後述する探索処理を実行して、失敗パターンの枝刈りを行いながら、サブグラフマッチング処理を行う。
[Search device configuration]
Next, a schematic configuration of the search device according to the present embodiment will be described with reference to FIG. 7. As shown in FIG. 7, the search device 1 according to the present embodiment is realized by a general-purpose computer such as a workstation or a personal computer, and includes an input unit 11, an output unit 12, a control unit 13, and a storage unit 14. The search device 1 executes a search process described later, and performs a subgraph matching process while pruning a failure pattern.

入力部11は、キーボードやマウス等の入力デバイスを用いて実現され、操作者による入力操作に対応して、制御部13に対して各種指示情報を入力する。また、本実施形態において、入力部11は、後述する探索処理の対象のデータグラフGおよびクエリグラフQを含むグラフデータを受け付けて制御部13に入力する。 The input unit 11 is realized by using an input device such as a keyboard or a mouse, and inputs various instruction information to the control unit 13 in response to an input operation by the operator. Further, in the present embodiment, the input unit 11 receives the graph data including the data graph G and the query graph Q, which are the targets of the search process described later, and inputs the graph data to the control unit 13.

出力部12は、液晶ディスプレイなどの表示装置、プリンター等の印刷装置、情報通信装置等によって実現され、例えば、後述する探索処理の処理結果であるサブグラフマッチング結果等を操作者に対して出力する。 The output unit 12 is realized by a display device such as a liquid crystal display, a printing device such as a printer, an information communication device, and the like, and outputs, for example, a subgraph matching result which is a processing result of a search process described later to an operator.

また、探索装置1は、図示しない通信制御部を備える。通信制御部は、NIC(Network Interface Card)等で実現され、LAN(Local Area Network)やインターネットなどの電気通信回線を介したサーバ等の外部の装置と制御部13との通信を制御する。例えば、上記のグラフデータは、通信制御部を介して外部の装置から受け付けてもよい。また、サブグラフマッチング結果は、通信制御部を介して外部の装置に出力されてもよい。 Further, the search device 1 includes a communication control unit (not shown). The communication control unit is realized by a NIC (Network Interface Card) or the like, and controls communication between an external device such as a server via a telecommunication line such as a LAN (Local Area Network) or the Internet and the control unit 13. For example, the above graph data may be received from an external device via the communication control unit. Further, the subgraph matching result may be output to an external device via the communication control unit.

記憶部14は、RAM(Random Access Memory)、フラッシュメモリ(Flash Memory)等の半導体メモリ素子、または、ハードディスク、光ディスク等の記憶装置によって実現される。記憶部には、探索装置1を動作させる処理プログラムや、処理プログラムの実行中に使用されるデータなどが予め記憶され、あるいは処理の都度一時的に記憶される。例えば、後述する探索処理において、抽出された失敗パターンが記録される。この記憶部14は、通信制御部を介して制御部13と通信する構成でもよい。 The storage unit 14 is realized by a semiconductor memory element such as a RAM (Random Access Memory) or a flash memory (Flash Memory), or a storage device such as a hard disk or an optical disk. The processing program that operates the search device 1, data used during execution of the processing program, and the like are stored in advance in the storage unit, or are temporarily stored each time the processing is performed. For example, in the search process described later, the extracted failure pattern is recorded. The storage unit 14 may be configured to communicate with the control unit 13 via the communication control unit.

制御部13は、CPU(Central Processing Unit)等の演算処理装置がメモリに記憶された処理プログラムを実行することにより、図3に例示するように、頂点抽出部13a、パターン抽出部13b、および探索部13cとして機能する。なお、制御部13は、後述する探索処理が実現されるならば、これらの機能部とは異なる機能単位で構成されていてもよい。 As illustrated in FIG. 3, the control unit 13 executes a processing program stored in a memory by an arithmetic processing unit such as a CPU (Central Processing Unit), thereby performing a vertex extraction unit 13a, a pattern extraction unit 13b, and a search. It functions as a unit 13c. The control unit 13 may be configured in a functional unit different from these functional units as long as the search process described later is realized.

また、本実施形態において、制御部13は複数CPUコアで実現されてもよい。これにより、バックトラッキングの各枝に対応する処理や、後述する探索処理における各データグラフの頂点に関する処理を、複数のCPUによる並行処理で行うことが可能となる。 Further, in the present embodiment, the control unit 13 may be realized by a plurality of CPU cores. As a result, it is possible to perform processing corresponding to each branch of backtracking and processing related to the vertices of each data graph in the search processing described later by parallel processing by a plurality of CPUs.

具体的には、制御部13は、ラベルが付与された頂点と、隣接する頂点間を接続するエッジとで構成されるグラフのうち、検索対象のデータのグラフであるデータグラフから、検索に使用されるクエリのグラフであるクエリグラフと一致する部分を探索する際に、以下の探索処理を実行する。 Specifically, the control unit 13 is used for searching from a data graph which is a graph of data to be searched among graphs composed of labeled vertices and edges connecting adjacent vertices. The following search process is executed when searching for a part that matches the query graph, which is the graph of the query to be performed.

すなわち、頂点抽出部13aは、データグラフの各頂点と隣接する頂点とのラベルの組み合わせに基づいて、クエリグラフの頂点と一致し得るデータグラフの頂点に隣接する頂点のうち、クエリグラフの頂点に隣接する頂点と一致し得る該データグラフの頂点を、データグラフの各頂点に対応する候補頂点として抽出する。具体的には、頂点抽出部13aは、従来のバックトラッキング処理と同様に、上記式(4)〜(6)を満たす候補頂点を抽出する。 That is, the vertex extraction unit 13a selects the vertices of the query graph among the vertices adjacent to the vertices of the data graph that can match the vertices of the query graph based on the combination of the labels of each vertex of the data graph and the adjacent vertices. The vertices of the data graph that can match the adjacent vertices are extracted as candidate vertices corresponding to each vertex of the data graph. Specifically, the vertex extraction unit 13a extracts candidate vertices satisfying the above equations (4) to (6) as in the conventional backtracking process.

また、パターン抽出部13bは、探索の過程において発生する探索の失敗に基づいて、クエリグラフの頂点とデータグラフの頂点との組み合わせの集合を、探索の失敗の要因を表す失敗パターンとして抽出する。具体的には、パターン抽出部13bは、以下に説明するように、抽出された候補頂点を用いて失敗パターンを抽出する。 Further, the pattern extraction unit 13b extracts a set of combinations of the vertices of the query graph and the vertices of the data graph as a failure pattern representing the cause of the search failure, based on the search failure that occurs in the search process. Specifically, the pattern extraction unit 13b extracts a failure pattern using the extracted candidate vertices as described below.

また、探索部13cは、パターン抽出部13bにより抽出された失敗パターンと合致する探索の状態を枝刈りして、データグラフからクエリグラフと同型な部分を探索する。 Further, the search unit 13c prunes the search state that matches the failure pattern extracted by the pattern extraction unit 13b, and searches the data graph for a portion having the same type as the query graph.

ここで、図8は、本実施形態の探索装置による探索処理に関する定義および定理を示す図である。以下に説明する探索処理において、図8に示す定義および定理が適用される。すなわち、図8の定義3に示すように、失敗パターンが定義される。また、図8の定義4に示すように、パターンの合致が定義される。また、図8の定理1に示すように、失敗パターンの判定が定義される。 Here, FIG. 8 is a diagram showing a definition and a theorem regarding the search process by the search device of the present embodiment. The definitions and theorems shown in FIG. 8 are applied in the search process described below. That is, as shown in Definition 3 of FIG. 8, a failure pattern is defined. Further, as shown in Definition 4 of FIG. 8, pattern matching is defined. Further, as shown in Theorem 1 of FIG. 8, the determination of the failure pattern is defined.

パターン抽出部13bは、図6に示したように、探索が失敗した場合に部分埋め込みから失敗パターンを抽出する(ステップS170)。パターン抽出部13bは、より多くの部分埋め込みに合致してより効果的に探索の枝刈りを行うため、より一般化された失敗パターンを抽出することが望ましい。すなわち、失敗パターンDに含まれる、クエリ頂点とデータ頂点との組み合わせの数|D|が小さいことが望ましい。そこで、パターン抽出部13bは、探索失敗であることがわかった部分埋め込みPから、クエリ頂点とデータ頂点との組み合わせの一部を抽出して失敗パターンDを作成する。したがって、作成される失敗パターンDは、抽出元の部分埋め込みをPとしたときにその部分集合となるため、次式(8)を満たす。 As shown in FIG. 6, the pattern extraction unit 13b extracts a failure pattern from the partial embedding when the search fails (step S170). It is desirable for the pattern extraction unit 13b to extract a more generalized failure pattern in order to match more partial embeddings and perform search pruning more effectively. That is, it is desirable that the number of combinations of query vertices and data vertices | D | included in the failure pattern D is small. Therefore, the pattern extraction unit 13b creates a failure pattern D by extracting a part of the combination of the query vertex and the data vertex from the partially embedded P found to be the search failure. Therefore, the created failure pattern D becomes a subset when the partial embedding of the extraction source is P, and therefore satisfies the following equation (8).

Figure 0006777903
Figure 0006777903

失敗パターンは、探索失敗の原因に基づいて作成される。探索失敗の原因は、図6に示したように、エッジ制約を満たす候補頂点がないこと(ステップS110)、Pに新しい割り当てを追加して作成したPがいずれも失敗であること(ステップS120〜S140)の2つに大別される。 The failure pattern is created based on the cause of the search failure. As shown in FIG. 6, the cause of the search failure is that there is no candidate vertex that satisfies the edge constraint (step S110), and that P + created by adding a new allocation to P is a failure (step S120). It is roughly divided into two (~ S140).

まず、エッジ制約を満たす候補頂点がない場合の失敗パターンの抽出方法について説明する。図6のステップS110の処理対象である上記式(7)を満たす候補頂点vの集合をC[u]とすると、次式(9)が成立する。 First, a method of extracting a failure pattern when there is no candidate vertex that satisfies the edge constraint will be described. Process is the object above formula in step S110 in FIG. 6 a set of candidate vertices v satisfying (7) When C P [u i], the following equation (9) holds.

Figure 0006777903
Figure 0006777903

ここで、図9は、本実施形態の探索装置による探索処理に関する定理を示す図である。クエリ頂点uに対応する候補頂点がない状態は、空集合であるようなC[u]によって表される。また、まだデータ頂点が割り当てられていないクエリ頂点の候補頂点がなくなった場合に、探索失敗となる。換言すると、図9の定理2に示すように、式(10)が成立する。 Here, FIG. 9 is a diagram showing a theorem regarding the search process by the search device of the present embodiment. The absence candidate vertices corresponding to the query vertex u 1 is represented by C P [u i] such that empty set. Also, if there are no candidate vertices for query vertices to which data vertices have not been assigned, the search will fail. In other words, as shown in Theorem 2 of FIG. 9, equation (10) holds.

さらに、C[u]が空集合である場合について、図9に示す定理3が成立する。 Furthermore, C P [u i] is for the case where an empty set, the theorem 3 shown in FIG. 9 is established.

つまり、エッジ制約により候補頂点がなくなった場合に、C[u]が空集合となるuが存在する。その場合のiについて、D⊆PかつDead(D)であるようなDが存在し、上記式(8)を満たす。そこで、パターン抽出部13bは、C[u]が空集合であるような任意のDを失敗パターンとして登録する。 That is, when there are no more candidate vertices by the edge constraint, C P [u i] exists u i as the empty set. For that case i, there are D i as a D i ⊆P and Dead (D i), satisfies the equation (8). Therefore, the pattern extracting unit 13b, C P [u i] registers as a failure pattern any D i such that empty set.

次に、Pがいずれも失敗である場合の失敗パターンの抽出方法について説明する。ここで、図10は、本実施形態の探索装置による探索処理に関する定理を示す図である。Pがいずれも失敗である場合に、図10に示す定理4および定理5が成立する。すなわち、Pがいずれも失敗である場合について、定理4の式(13)が成立することから、式(15)に示す失敗パターンの集合を定義できる。この場合の失敗パターンについて、定理5の式(16)が成立する。したがって、パターン抽出部13bは、式(16)を用いて作成した失敗パターンを登録する。 Next, a method of extracting a failure pattern when both P + are failures will be described. Here, FIG. 10 is a diagram showing a theorem regarding the search process by the search device of the present embodiment. When both P + are unsuccessful, Theorem 4 and Theorem 5 shown in FIG. 10 hold. That is, since the equation (13) of Theorem 4 holds in the case where all P + are failures, the set of failure patterns shown in the equation (15) can be defined. For the failure pattern in this case, the equation (16) of Theorem 5 holds. Therefore, the pattern extraction unit 13b registers the failure pattern created by using the equation (16).

次に、定理4の式(15)に示した失敗パターンの集合を得るために、PからDを抽出する方法について説明する。Pが失敗となる原因は、図6に示したように、Pが単射でないこと(ステップS120)、Pがいずれかの失敗パターンに合致すること(ステップS130)、再帰呼び出しした再帰関数が探索失敗となること(ステップS140)の3つである。このうち、Pがいずれかの失敗パターンに合致する場合については、失敗パターンが既に抽出され記録されている。また、再帰呼び出しした再帰関数が探索失敗となる場合は、再帰関数内で失敗パターンの抽出と記録とが行われる。したがって、パターン抽出部13bは、Pが単射でない場合にのみ、新たに失敗パターンの抽出を行う。 Next, a method of extracting D + from P + will be described in order to obtain a set of failure patterns shown in the equation (15) of Theorem 4. The reasons why P + fails are that P + is not injective (step S120), P + matches one of the failure patterns (step S130), and recursive recursion is called, as shown in FIG. There are three cases where the function fails to search (step S140). Of these, when P + matches any of the failure patterns, the failure pattern has already been extracted and recorded. If the recursive function called recursively fails in the search, the failure pattern is extracted and recorded in the recursive function. Therefore, the pattern extraction unit 13b newly extracts the failure pattern only when P + is not injective.

部分埋め込みPが単射でないこと、すなわち、同じデータ頂点に複数のクエリ頂点が割り当てられることによる失敗は、図11に示す定理6および定理7のように表される。すなわち、Pが単射でない場合について、定理6の式(18)が成立する。また、式(19)のD は、定理7の式(20)に示すように、それ自体が失敗パターンとなっている。 Failure due to the partial embedding P + not being injective, that is, the assignment of multiple query vertices to the same data vertices, is represented by Theorem 6 and Theorem 7 shown in FIG. That is, the equation (18) of Theorem 6 holds when P + is not injective. Further, Di + of the equation (19) itself is a failure pattern as shown in the equation (20) of Theorem 7.

なお、この探索アルゴリズムでは、再帰関数Searchには単射であることが確認された部分埋め込みが引き渡されている(ステップS120)。そのため、Pが単射でないことは、最後に追加されたuと、もう一つの他のクエリ頂点とが同じデータ頂点に割り当てられたことに起因する。したがって、Pが単射でないならば、|D |=2である。この場合に、パターン抽出部13bは、D をPから抽出した失敗パターンとする。 In this search algorithm, a partial embedding confirmed to be injective is passed to the recursive function Search (step S120). Therefore, the fact that P + is not injective is due to the fact that the last added uk and another query vertex are assigned to the same data vertex. Therefore, if P + is not injective, then | D k + | = 2. In this case, the pattern extraction unit 13b sets D k + as a failure pattern extracted from P + .

[探索処理]
次に、図12を参照して、探索装置1の探索処理について説明する。図12は、本実施形態の探索処理手順を示すフローチャートである。図12のフローチャートは、図6に示したフローチャートに、失敗パターンを抽出するための処理が追加されたものである。ただし、失敗パターンの集合は、関数Searchのスコープ外で定義された大域変数であり、空集合で初期化されているものとする。
[Search processing]
Next, the search process of the search device 1 will be described with reference to FIG. FIG. 12 is a flowchart showing the search processing procedure of the present embodiment. The flowchart of FIG. 12 is obtained by adding a process for extracting a failure pattern to the flowchart shown in FIG. However, it is assumed that the set of failure patterns is a global variable defined outside the scope of the function Search and is initialized with an empty set.

この探索処理では、パターン抽出部13bが、上記の定理3,5,7に基づいて失敗パターンDを作成し、作成したDを失敗パターン集合へ追加する。また、パターン抽出部13bは、関数Searchの戻り値としてPから抽出された失敗パターンを返す。ただし、パターン抽出部13bは、引数Pを含む埋め込みが発見された場合には空集合を返す。 In this search process, the pattern extraction unit 13b creates a failure pattern D based on the above theorems 3, 5 and 7, and adds the created D to the failure pattern set. Further, the pattern extraction unit 13b returns the failure pattern extracted from P as the return value of the function Search. However, the pattern extraction unit 13b returns an empty set when an embedding including the argument P is found.

まず、図2に示した従来のサブグラフマッチング処理と同様に、探索部13cは、Pが完全な埋め込みであるか否かを確認する(ステップS100)。完全な埋め込みである場合には(ステップS100,Yes)、探索部13cは、Pを埋め込みとして報告する(ステップS180)。また、Pは失敗ではないので、探索部13cは、Pから抽出された失敗パターンDを空集合とする(ステップS161)。 First, similarly to the conventional subgraph matching process shown in FIG. 2, the search unit 13c confirms whether or not P is completely embedded (step S100). In the case of complete embedding (step S100, Yes), the search unit 13c reports P as embedding (step S180). Further, since P is not a failure, the search unit 13c sets the failure pattern D extracted from P as an empty set (step S161).

完全な埋め込みでなかった場合には(ステップS100,No)、探索部13cは、Pが図9に示した定理2に基づく失敗であるか否かを確認する(ステップS163)。失敗の場合には(ステップS163,Yes)、パターン抽出部13bは、図9に示した定理3に基づいて失敗パターンを抽出する(ステップS164)。失敗でない場合には(ステップS163,No)、探索部13cが、Pに新しい割り当てを追加したPについて処理を進める。 If it is not completely embedded (step S100, No), the search unit 13c confirms whether P is a failure based on Theorem 2 shown in FIG. 9 (step S163). In the case of failure (step S163, Yes), the pattern extraction unit 13b extracts a failure pattern based on Theorem 3 shown in FIG. 9 (step S164). If it is not a failure (step S163, No), the search unit 13c proceeds with processing for P + in which a new allocation is added to P.

すなわち、探索部13cは、まず、Pのそれぞれから抽出された失敗パターンDの集合を空集合で初期化する(ステップS165)。次に、探索部13cは、エッジ制約を満たす頂点v∈C[uk+1]について、ループを実行する(ステップS110)。すなわち、探索部13cは、Pを作成し(ステップS121)、それが単射であるか否かを確認する(ステップS122)。ここで、Pは単射であるので、Pが単射でないことは、v∈val(P)であるか否かによって確認できる。 That is, the search unit 13c first initializes the set of failure patterns D + extracted from each of P + with an empty set (step S165). Then, the search section 13c, the apex meeting the edge constraints v∈C P [u k + 1] , it executes the loop (step S110). That is, the search unit 13c creates P + (step S121) and confirms whether or not it is injective (step S122). Here, since P is injective, it can be confirmed that P + is not injective by whether or not v ∈ val (P).

単射でない場合に(ステップS122,Yes)、パターン抽出部13bが、図11に示した定理7に基づいて失敗パターンを失敗パターンの集合に追加する(ステップS131)。単射である場合に(ステップS122,No)、探索部13cは、Pが失敗パターンの集合に記録された失敗パターンに合致するか否かを確認する(ステップS132)。 When it is not injective (step S122, Yes), the pattern extraction unit 13b adds the failure pattern to the set of failure patterns based on Theorem 7 shown in FIG. 11 (step S131). In the case of injective function (step S122, No), the search unit 13c confirms whether or not P + matches the failure pattern recorded in the set of failure patterns (step S132).

合致する失敗パターンDが存在する場合には(ステップS132,Yes)、このDはPから抽出された失敗パターンであるので、パターン抽出部13bは、このDを失敗パターンの集合に追加する(ステップS133)。合致する失敗パターンがなければ(ステップS132,No)、探索部13cは、Search(P)を再帰呼び出しし、戻り値をDに代入する(ステップS141)。また、探索部13cは、戻り値Dを失敗パターンの集合に追加する(ステップS142)。 If a matching failure pattern D + exists (step S132, Yes), since this D + is a failure pattern extracted from P, the pattern extraction unit 13b adds this D + to the set of failure patterns. (Step S133). If there is no matching failure pattern (step S132, No), the search unit 13c recursively calls Search (P + ) and substitutes the return value into D + (step S141). Further, the search unit 13c adds the return value D + to the set of failure patterns (step S142).

以上の処理を、全てのv∈C[uk+1]について実行したら、探索部13cは、Pの中に成功したものが存在したか否かを確認する。関数Searchは、探索に成功した場合に空集合を返すので、成功したものがあればステップS142の処理で空集合が追加されている。したがって、探索部13cは、失敗パターンの集合が空集合を含むか否かを確認する(ステップS166)。 The above process, if executed for all the v∈C P [u k + 1] , the search unit 13c confirms whether or not there are those successfully in the P +. Since the function Search returns an empty set when the search is successful, the empty set is added in the process of step S142 if there is a successful one. Therefore, the search unit 13c confirms whether or not the set of failure patterns includes an empty set (step S166).

失敗パターンの集合が空集合を含む場合に(ステップS166,Yes)、Pを含む完全な埋め込みが存在することを意味するので、探索部13cは、失敗パターンDを空集合とする(ステップS167)。失敗パターンの集合が空集合を含まない場合には(ステップS166,No)、Pは探索失敗であるので、パターン抽出部13bは、図10に示した定理5に基づいて抽出した失敗パターンをDに代入する(ステップS168)。 When the set of failure patterns includes an empty set (step S166, Yes), it means that there is a complete embedding including P, so the search unit 13c sets the failure pattern D as an empty set (step S167). .. If the set of failure patterns does not include the empty set (steps S166, No), P is a search failure, so the pattern extraction unit 13b D extracts the failure patterns extracted based on Theorem 5 shown in FIG. Substitute in (step S168).

以上の処理の後に、Dが空集合でない場合、すなわち、Pが失敗であった場合に(ステップS169,Yes)、パターン抽出部13bは、Dを失敗パターンの集合に追加する(ステップS170)。これにより、またはDが空集合であった場合に(ステップS169,No)、関数Searchは、Dを返却して呼び出し元へ戻る。 After the above processing, when D is not an empty set, that is, when P is a failure (step S169, Yes), the pattern extraction unit 13b adds D to the set of failure patterns (step S170). As a result, or when D is an empty set (step S169, No), the function Search returns D and returns to the caller.

以上、説明したように、本実施形態の探索装置1は、ラベルが付与された頂点と、隣接する頂点間を接続するエッジとで構成されるグラフのうち、検索対象のデータのグラフであるデータグラフから、検索に使用されるクエリのグラフであるクエリグラフと同型な部分を探索する。その際に、パターン抽出部13bが、探索の過程において発生する探索の失敗に基づいて、クエリグラフの頂点とデータグラフの頂点との組み合わせの集合を、探索の失敗の要因を表す失敗パターンとして抽出する。また、探索部13cが、パターン抽出部13bにより抽出された失敗パターンと合致する探索の状態を枝刈りして、データグラフからクエリグラフと同型な部分を探索する。 As described above, the search device 1 of the present embodiment is a graph of data to be searched among graphs composed of labeled vertices and edges connecting adjacent vertices. From the graph, search for a part that is similar to the query graph, which is the graph of the query used for the search. At that time, the pattern extraction unit 13b extracts a set of combinations of the vertices of the query graph and the vertices of the data graph as a failure pattern representing the cause of the search failure, based on the search failure that occurs in the search process. To do. Further, the search unit 13c prunes the search state that matches the failure pattern extracted by the pattern extraction unit 13b, and searches the data graph for a portion having the same type as the query graph.

これにより、データグラフの中からクエリグラフを含むものを探索するサブグラフマッチング処理を高速化することが可能となる。したがって、例えば、グラフデータ向けに設計されたデータベースであるグラフデータベースに対する、サブグラフマッチングとして記述されるクエリを用いた対話的な作業や、グラフデータベースに依存するサービスを容易に提供できる。また、グラフに対してサブグラフマッチングを用いて、例えば、特定のサブグラフの出現回数をグラフの特徴量として利用するデータマイニングを行う場合に、現実的な時間で完了できる。 As a result, it is possible to speed up the subgraph matching process for searching the data graph including the query graph. Therefore, for example, it is possible to easily provide an interactive work using a query described as subgraph matching for a graph database, which is a database designed for graph data, and a service that depends on the graph database. Further, when subgraph matching is used for a graph, for example, data mining using the number of appearances of a specific subgraph as a feature amount of the graph is performed, it can be completed in a realistic time.

なお、ラベルがエッジに付与された場合にも適用できる。すなわち、探索装置1は、頂点と、隣接する頂点間を接続するラベルが付与されたエッジとで構成されるグラフのうち、検索対象のデータのグラフであるデータグラフから、検索に使用されるクエリのグラフであるクエリグラフと同型な部分を探索してもよい。この場合に、パターン抽出部13bは、探索の過程において発生する探索の失敗に基づいて、クエリグラフの頂点とデータグラフの頂点との組み合わせの集合を、探索の失敗の要因を表す失敗パターンとして抽出する。これにより、探索処理を適用できる範囲が拡大する。 It can also be applied when a label is attached to an edge. That is, the search device 1 is a query used for a search from a data graph which is a graph of data to be searched among graphs composed of vertices and edges with labels connecting adjacent vertices. You may search for a part having the same type as the query graph which is the graph of. In this case, the pattern extraction unit 13b extracts a set of combinations of the vertices of the query graph and the vertices of the data graph as a failure pattern representing the cause of the search failure, based on the search failure that occurs in the search process. To do. As a result, the range to which the search process can be applied is expanded.

[他の実施形態]
上記実施形態において、探索装置1は、失敗パターンの集合の中から部分埋め込みに合致する失敗パターンを探索している(図12のステップS132)が、これに限定されない。図13は、他の実施形態の探索処理を説明するための説明図である。集合の中から特定の条件を満たす要素を探索する作業は、一つ一つの要素を確認する方法では要素の数に比例した処理時間を要し、処理時間が増大する。また、集合に追加される失敗パターンが膨大な数になり得るため、記憶装置に全ての情報を記録できないおそれがある。
[Other Embodiments]
In the above embodiment, the search device 1 searches for a failure pattern that matches the partial embedding from the set of failure patterns (step S132 in FIG. 12), but is not limited to this. FIG. 13 is an explanatory diagram for explaining the search process of another embodiment. The work of searching for an element satisfying a specific condition from a set requires a processing time proportional to the number of elements in the method of confirming each element, and the processing time increases. In addition, since the number of failure patterns added to the set can be enormous, there is a possibility that all the information cannot be recorded in the storage device.

そこで、図13に示すように、失敗パターンをハッシュテーブルによって保持してもよい。この場合に、探索装置1は、部分埋め込みPに最後に追加した割り当て(u,P[u])と、Pから抽出された失敗パターンとを対応付けて記憶部14に保持する。 Therefore, as shown in FIG. 13, the failure pattern may be held by the hash table. In this case, the search device 1 allocates added to the last portion embedded P and (u k, P [u k ]), it is held in the storage unit 14 in association with the failure pattern extracted from P.

これにより、図12のステップS132の処理で確認される失敗パターンが一つになるため、処理時間が短縮される。また、ステップS170の処理において、ハッシュテーブルの値が上書きされ、古い値は保持されないため、記録される失敗パターンの数が減少する。存在し得るクエリ頂点とデータ頂点との組み合わせは、最大でも|V||V|通りである。保持される失敗パターンの数はこれ以下の数となるため、抽出された失敗パターンの全てを保持した場合と比較して、圧倒的に少なくなる。したがって、限られた記憶装置を用いても探索処理を実行することが可能となる。 As a result, the failure patterns confirmed in the process of step S132 in FIG. 12 become one, so that the process time is shortened. Further, in the process of step S170, the value of the hash table is overwritten and the old value is not retained, so that the number of failed patterns recorded is reduced. The maximum number of combinations of query vertices and data vertices that can exist is | V Q | | V G |. Since the number of failed patterns to be retained is less than this, it is overwhelmingly smaller than the case where all of the extracted failure patterns are retained. Therefore, it is possible to execute the search process even if a limited storage device is used.

[プログラム]
上記実施形態に係る探索装置1が実行する処理をコンピュータが実行可能な言語で記述したプログラムを作成することもできる。一実施形態として、探索装置1は、パッケージソフトウェアやオンラインソフトウェアとして上記の探索処理を実行する探索プログラムを所望のコンピュータにインストールさせることによって実装できる。例えば、上記の探索プログラムを情報処理装置に実行させることにより、情報処理装置を探索装置1として機能させることができる。ここで言う情報処理装置には、デスクトップ型またはノート型のパーソナルコンピュータが含まれる。また、その他にも、情報処理装置にはスマートフォン、携帯電話機やPHS(Personal Handyphone System)などの移動体通信端末、さらには、PDA(Personal Digital Assistants)などのスレート端末などがその範疇に含まれる。また、ユーザが使用する端末装置をクライアントとし、当該クライアントに上記の探索処理に関するサービスを提供するサーバ装置として実装することもできる。例えば、探索装置1は、グラフデータを入力とし、サブグラフマッチング結果を出力する探索処理サービスを提供するサーバ装置として実装される。この場合、探索装置1は、Webサーバとして実装することとしてもよいし、アウトソーシングによって上記の探索処理に関するサービスを提供するクラウドとして実装することとしてもかまわない。以下に、探索装置1と同様の機能を実現する探索プログラムを実行するコンピュータの一例を説明する。
[program]
It is also possible to create a program in which the processing executed by the search device 1 according to the above embodiment is described in a language that can be executed by a computer. As one embodiment, the search device 1 can be implemented by installing a search program that executes the above search process as package software or online software on a desired computer. For example, by causing the information processing device to execute the above search program, the information processing device can function as the search device 1. The information processing device referred to here includes a desktop type or notebook type personal computer. In addition, the information processing device includes smartphones, mobile communication terminals such as mobile phones and PHS (Personal Handyphone System), and slate terminals such as PDAs (Personal Digital Assistants). Further, the terminal device used by the user may be used as a client, and the terminal device may be implemented as a server device that provides the service related to the search process to the client. For example, the search device 1 is implemented as a server device that provides a search processing service that inputs graph data and outputs a subgraph matching result. In this case, the search device 1 may be implemented as a Web server, or may be implemented as a cloud that provides the service related to the search process by outsourcing. An example of a computer that executes a search program that realizes the same functions as the search device 1 will be described below.

図14は、探索プログラムを実行するコンピュータの一例を示す図である。コンピュータ1000は、例えば、メモリ1010と、CPU1020と、ハードディスクドライブインタフェース1030と、ディスクドライブインタフェース1040と、シリアルポートインタフェース1050と、ビデオアダプタ1060と、ネットワークインタフェース1070とを有する。これらの各部は、バス1080によって接続される。 FIG. 14 is a diagram showing an example of a computer that executes a search program. The computer 1000 has, for example, a memory 1010, a CPU 1020, a hard disk drive interface 1030, a disk drive interface 1040, a serial port interface 1050, a video adapter 1060, and a network interface 1070. Each of these parts is connected by a bus 1080.

メモリ1010は、ROM(Read Only Memory)1011およびRAM1012を含む。ROM1011は、例えば、BIOS(Basic Input Output System)等のブートプログラムを記憶する。ハードディスクドライブインタフェース1030は、ハードディスクドライブ1031に接続される。ディスクドライブインタフェース1040は、ディスクドライブ1041に接続される。ディスクドライブ1041には、例えば、磁気ディスクや光ディスク等の着脱可能な記憶媒体が挿入される。シリアルポートインタフェース1050には、例えば、マウス1051およびキーボード1052が接続される。ビデオアダプタ1060には、例えば、ディスプレイ1061が接続される。 The memory 1010 includes a ROM (Read Only Memory) 1011 and a RAM 1012. The ROM 1011 stores, for example, a boot program such as a BIOS (Basic Input Output System). The hard disk drive interface 1030 is connected to the hard disk drive 1031. The disk drive interface 1040 is connected to the disk drive 1041. A removable storage medium such as a magnetic disk or an optical disk is inserted into the disk drive 1041. For example, a mouse 1051 and a keyboard 1052 are connected to the serial port interface 1050. For example, a display 1061 is connected to the video adapter 1060.

ここで、ハードディスクドライブ1031は、例えば、OS1091、アプリケーションプログラム1092、プログラムモジュール1093およびプログラムデータ1094を記憶する。上記実施形態で説明した各テーブルは、例えばハードディスクドライブ1031やメモリ1010に記憶される。 Here, the hard disk drive 1031 stores, for example, the OS 1091, the application program 1092, the program module 1093, and the program data 1094. Each table described in the above embodiment is stored in, for example, the hard disk drive 1031 or the memory 1010.

また、探索プログラムは、例えば、コンピュータ1000によって実行される指令が記述されたプログラムモジュール1093として、ハードディスクドライブ1031に記憶される。具体的には、上記実施形態で説明した探索装置1が実行する各処理が記述されたプログラムモジュール1093が、ハードディスクドライブ1031に記憶される。 Further, the search program is stored in the hard disk drive 1031 as, for example, a program module 1093 in which a command executed by the computer 1000 is described. Specifically, the program module 1093 in which each process executed by the search device 1 described in the above embodiment is described is stored in the hard disk drive 1031.

また、探索プログラムによる情報処理に用いられるデータは、プログラムデータ1094として、例えば、ハードディスクドライブ1031に記憶される。そして、CPU1020が、ハードディスクドライブ1031に記憶されたプログラムモジュール1093やプログラムデータ1094を必要に応じてRAM1012に読み出して、上述した各手順を実行する。 Further, the data used for information processing by the search program is stored as program data 1094 in, for example, the hard disk drive 1031. Then, the CPU 1020 reads the program module 1093 and the program data 1094 stored in the hard disk drive 1031 into the RAM 1012 as needed, and executes each of the above-described procedures.

なお、探索プログラムに係るプログラムモジュール1093やプログラムデータ1094は、ハードディスクドライブ1031に記憶される場合に限られず、例えば、着脱可能な記憶媒体に記憶されて、ディスクドライブ1041等を介してCPU1020によって読み出されてもよい。あるいは、探索プログラムに係るプログラムモジュール1093やプログラムデータ1094は、LANやWAN(Wide Area Network)等のネットワークを介して接続された他のコンピュータに記憶され、ネットワークインタフェース1070を介してCPU1020によって読み出されてもよい。 The program module 1093 and program data 1094 related to the search program are not limited to the case where they are stored in the hard disk drive 1031. For example, they are stored in a removable storage medium and read by the CPU 1020 via the disk drive 1041 or the like. May be done. Alternatively, the program module 1093 and the program data 1094 related to the search program are stored in another computer connected via a network such as a LAN or WAN (Wide Area Network), and read by the CPU 1020 via the network interface 1070. You may.

以上、本発明者によってなされた発明を適用した実施形態について説明したが、本実施形態による本発明の開示の一部をなす記述および図面により本発明は限定されることはない。すなわち、本実施形態に基づいて当業者等によりなされる他の実施形態、実施例および運用技術等は全て本発明の範疇に含まれる。 Although the embodiment to which the invention made by the present inventor is applied has been described above, the present invention is not limited by the description and the drawings which form a part of the disclosure of the present invention according to the present embodiment. That is, all other embodiments, examples, operational techniques, and the like made by those skilled in the art based on the present embodiment are included in the scope of the present invention.

1 探索装置
11 入力部
12 出力部
13 制御部
13a 頂点抽出部
13b パターン抽出部
13c 探索部
14 記憶部
1 Search device 11 Input unit 12 Output unit 13 Control unit 13a Vertex extraction unit 13b Pattern extraction unit 13c Search unit 14 Storage unit

Claims (6)

ラベルが付与された頂点と、隣接する頂点間を接続するエッジとで構成されるグラフのうち、検索対象のデータのグラフであるデータグラフから、検索に使用されるクエリのグラフであるクエリグラフと同型な部分を探索する際に、該探索の過程において発生する探索の失敗に基づいて、クエリグラフの頂点とデータグラフの頂点との組み合わせの集合を、探索の失敗の要因を表す失敗パターンとして抽出するパターン抽出部と、
前記パターン抽出部により抽出された前記失敗パターンと合致する探索の状態を枝刈りして、前記データグラフから前記クエリグラフと同型な部分を探索する探索部と、
を備えることを特徴とする探索装置。
Among the graphs composed of labeled vertices and edges connecting adjacent vertices, from the data graph which is the graph of the data to be searched to the query graph which is the graph of the query used for the search. When searching for the same type of part, a set of combinations of query graph vertices and data graph vertices is extracted as a failure pattern representing the cause of the search failure based on the search failure that occurs in the search process. Pattern extraction section and
A search unit that prunes the search state that matches the failure pattern extracted by the pattern extraction unit and searches the data graph for a portion having the same type as the query graph.
A search device characterized by comprising.
前記データグラフの各頂点と隣接する頂点とのラベルの組み合わせに基づいて、前記クエリグラフの頂点と一致し得る前記データグラフの頂点に隣接する頂点のうち、前記クエリグラフの頂点に隣接する頂点と一致し得る該データグラフの頂点を、前記データグラフの各頂点に対応する候補頂点として抽出する頂点抽出部をさらに備え、
前記パターン抽出部は、抽出された前記候補頂点を用いて前記失敗パターンを抽出することを特徴とする請求項1に記載の探索装置。
Based on the combination of labels of each vertex of the data graph and adjacent vertices, among the vertices adjacent to the vertices of the data graph that can match the vertices of the query graph, the vertices adjacent to the vertices of the query graph A vertex extraction unit that extracts matching vertices of the data graph as candidate vertices corresponding to each vertex of the data graph is further provided.
The search device according to claim 1, wherein the pattern extraction unit extracts the failure pattern using the extracted candidate vertices.
頂点と、隣接する頂点間を接続するラベルが付与されたエッジとで構成されるグラフのうち、検索対象のデータのグラフであるデータグラフから、検索に使用されるクエリのグラフであるクエリグラフと同型な部分を探索する際に、該探索の過程において発生する探索の失敗に基づいて、クエリグラフの頂点とデータグラフの頂点との組み合わせの集合を、探索の失敗の要因を表す失敗パターンとして抽出するパターン抽出部と、
前記パターン抽出部により抽出された前記失敗パターンと合致する探索の状態を枝刈りして、前記データグラフから前記クエリグラフと同型な部分を探索する探索部と、
を備えることを特徴とする探索装置。
Among the graphs composed of vertices and edges with labels connecting adjacent vertices, from the data graph which is the graph of the data to be searched to the query graph which is the graph of the query used for the search. When searching for the same type of part, a set of combinations of query graph vertices and data graph vertices is extracted as a failure pattern representing the cause of the search failure based on the search failure that occurs in the search process. Pattern extraction section and
A search unit that prunes the search state that matches the failure pattern extracted by the pattern extraction unit and searches the data graph for a portion having the same type as the query graph.
A search device characterized by comprising.
前記パターン抽出部は、前記失敗パターンをハッシュテーブルとして記憶部に記録し、
前記探索部は、該記憶部を参照して前記失敗パターンと合致する探索の状態を枝刈りして、前記データグラフから前記クエリグラフと同型な部分を探索することを特徴とする請求項1〜3のいずれか1項に記載の探索装置。
The pattern extraction unit records the failure pattern as a hash table in the storage unit, and records the failure pattern in the storage unit.
Claims 1 to 1, wherein the search unit prunes a search state that matches the failure pattern with reference to the storage unit, and searches the data graph for a portion having the same type as the query graph. The search device according to any one of 3.
探索装置で実行される探索方法であって、
ラベルが付与された頂点と、隣接する頂点間を接続するエッジとで構成されるグラフのうち、検索対象のデータのグラフであるデータグラフから、検索に使用されるクエリのグラフであるクエリグラフと同型な部分を探索する際に、該探索の過程において発生する探索の失敗に基づいて、クエリグラフの頂点とデータグラフの頂点との組み合わせの集合を、探索の失敗の要因を表す失敗パターンとして抽出するパターン抽出工程と、
前記パターン抽出工程において抽出された前記失敗パターンと合致する探索の状態を枝刈りして、前記データグラフから前記クエリグラフと同型な部分を探索する探索工程と、
を含むことを特徴とする探索方法。
A search method executed by a search device,
Among the graphs composed of labeled vertices and edges connecting adjacent vertices, from the data graph which is the graph of the data to be searched to the query graph which is the graph of the query used for the search. When searching for the same type of part, a set of combinations of query graph vertices and data graph vertices is extracted as a failure pattern representing the cause of the search failure based on the search failure that occurs in the search process. Pattern extraction process and
A search step of pruning a search state that matches the failure pattern extracted in the pattern extraction step and searching for a portion having the same type as the query graph from the data graph.
A search method characterized by including.
ラベルが付与された頂点と、隣接する頂点間を接続するエッジとで構成されるグラフのうち、検索対象のデータのグラフであるデータグラフから、検索に使用されるクエリのグラフであるクエリグラフと同型な部分を探索する際に、該探索の過程において発生する探索の失敗に基づいて、クエリグラフの頂点とデータグラフの頂点との組み合わせの集合を、探索の失敗の要因を表す失敗パターンとして抽出するパターン抽出ステップと、
前記パターン抽出ステップにおいて抽出された前記失敗パターンと合致する探索の状態を枝刈りして、前記データグラフから前記クエリグラフと同型な部分を探索する探索ステップと、
をコンピュータに実行させることを特徴とする探索プログラム。
Among the graphs composed of labeled vertices and edges connecting adjacent vertices, from the data graph which is the graph of the data to be searched to the query graph which is the graph of the query used for the search. When searching for the same type of part, a set of combinations of query graph vertices and data graph vertices is extracted as a failure pattern representing the cause of the search failure based on the search failure that occurs in the search process. Pattern extraction steps to be performed and
A search step of pruning a search state that matches the failure pattern extracted in the pattern extraction step and searching for a portion having the same type as the query graph from the data graph.
A search program characterized by having a computer execute.
JP2017230089A 2017-11-30 2017-11-30 Search device, search method and search program Active JP6777903B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2017230089A JP6777903B2 (en) 2017-11-30 2017-11-30 Search device, search method and search program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017230089A JP6777903B2 (en) 2017-11-30 2017-11-30 Search device, search method and search program

Publications (2)

Publication Number Publication Date
JP2019101610A JP2019101610A (en) 2019-06-24
JP6777903B2 true JP6777903B2 (en) 2020-10-28

Family

ID=66973656

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017230089A Active JP6777903B2 (en) 2017-11-30 2017-11-30 Search device, search method and search program

Country Status (1)

Country Link
JP (1) JP6777903B2 (en)

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9529833B2 (en) * 2014-02-19 2016-12-27 Palo Alto Research Center Incorporated Graph pruning in hipergraph

Also Published As

Publication number Publication date
JP2019101610A (en) 2019-06-24

Similar Documents

Publication Publication Date Title
US10860339B2 (en) Autonomous creation of new microservices and modification of existing microservices
US10169347B2 (en) Layer identification and dependency analysis for management of images
US9135289B2 (en) Matching transactions in multi-level records
US8572607B2 (en) System and method for performing designated service image processing functions in a service image warehouse
US20160364473A1 (en) Source code search engine
US20140298321A1 (en) Installation control method and installation control apparatus
CN107615240B (en) Biological sequence based scheme for analyzing binary files
JP6689283B2 (en) Method and apparatus for assigning device fingerprints to internet devices
KR101535813B1 (en) System and method for dynamic updating of event composition rule for complex event processing
US20160098390A1 (en) Command history analysis apparatus and command history analysis method
US11409631B2 (en) Verification automation apparatus, verification automation method, and computer-readable recording medium
CN111026433A (en) Method, system and medium for automatically repairing software code quality problem based on code change history
CN115470191A (en) Database updating system, method and corresponding computer equipment and storage medium
CN110688305A (en) Test environment synchronization method, device, medium and electronic equipment
CN112068812B (en) Micro-service generation method and device, computer equipment and storage medium
CN110633084B (en) Transcoding derivation method and device based on single sample
JP6777903B2 (en) Search device, search method and search program
JP6623380B2 (en) Search device, search method, and search program
CN111786808A (en) Cloud system migration method and device and mixed cloud system
WO2018179065A1 (en) Data analysis device and data analysis method
JP7246301B2 (en) Program development support system and program development support method
Schlie et al. Reengineering variants of matlab/simulink software systems
CN114564228A (en) Application program updating method and device, computer equipment and storage medium
JP6705482B2 (en) System construction parameter management device, system construction parameter management system, system construction parameter management method, and system construction parameter management program
US11947958B2 (en) Method, device, and program product for managing object in software development project

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A821

Effective date: 20171204

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20191118

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20200907

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20200929

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20200930

R150 Certificate of patent or registration of utility model

Ref document number: 6777903

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250