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

Search method, search program and search device Download PDF

Info

Publication number
JP2017062710A
JP2017062710A JP2015188352A JP2015188352A JP2017062710A JP 2017062710 A JP2017062710 A JP 2017062710A JP 2015188352 A JP2015188352 A JP 2015188352A JP 2015188352 A JP2015188352 A JP 2015188352A JP 2017062710 A JP2017062710 A JP 2017062710A
Authority
JP
Japan
Prior art keywords
search
route
methods
node
unit
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.)
Granted
Application number
JP2015188352A
Other languages
Japanese (ja)
Other versions
JP6512050B2 (en
Inventor
晃治 山本
Koji Yamamoto
晃治 山本
貴英 松塚
Takahide Matsuzuka
貴英 松塚
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2015188352A priority Critical patent/JP6512050B2/en
Publication of JP2017062710A publication Critical patent/JP2017062710A/en
Application granted granted Critical
Publication of JP6512050B2 publication Critical patent/JP6512050B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

PROBLEM TO BE SOLVED: To shorten the time for extracting a path connecting methods to be an origin of a path search from among a plurality of methods in a calling relation.SOLUTION: The present invention relates to a search method for a computer to execute processing for performing, regarding a path connecting a plurality of methods to be an origin of a path search from among a plurality of methods in a calling relation, the path search in parallel for each method of the origin. The search method includes: if there is a plurality of paths subjected to the path search in an n-th hop from the plurality of methods to be the origin, referring to a storage part in which classes corresponding to the methods are stored, and calculating path priorities corresponding to two methods connected by the path; based on the path priorities, identifying a path to perform the path search thereon from among a plurality of paths subjected to the path search; and based on the identified path, performing the path search of the plurality of methods to be the origin of the path search.SELECTED DRAWING: Figure 8

Description

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

プログラムソースコードの解析において、プログラムソースコードに含まれる複数のメソッド間における呼出し関係の経路を抽出する方法が知られている(例えば、特許文献1参照)。これによれば、ソースコードを解析するとグラフ構造の形でメソッドの呼出し関係を抽出することができる。   In the analysis of program source code, a method of extracting a call-related path between a plurality of methods included in the program source code is known (for example, see Patent Document 1). According to this, when the source code is analyzed, the method calling relationship can be extracted in the form of a graph structure.

メソッド間における呼出し関係の経路の抽出は、例えば、オープンソースソフトウェア(OSS)に独自の機能を追加し顧客に提供する開発者が利用することが考えられる。開発者は、OSSのバージョンアップ時に変更内容の把握や必要なテスト範囲の特定などのために、抽出したグラフ構造の経路上のメソッドを調査起点にする。特に、OSSのバージョンアップの対応等で、複数のメソッド間に呼出し関係の経路があることは確実であるが、その経路が以前と変わっていないかを精査する際に上記呼出し関係の経路の抽出方法が重要になる。   The extraction of the call relationship path between methods may be used by, for example, a developer who adds a unique function to open source software (OSS) and provides it to a customer. The developer uses a method on the path of the extracted graph structure as an investigation starting point in order to grasp the contents of change and specify the necessary test range when upgrading the OSS. In particular, it is certain that there is a call-related route between a plurality of methods due to OSS version upgrades, etc., but when examining whether the route has changed from before, the above-mentioned call-related route is extracted. The method becomes important.

特開2012−3752号公報JP 2012-3752 A

しかしながら、ソースコードの規模が大きくなると、経路抽出対象の2メソッド間の呼出し関係の経路抽出のための探索範囲が指数関数的に増加してしまい、上記の方法では、実用的な時間で経路の抽出が完了しないという課題がある。   However, when the size of the source code increases, the search range for the path extraction of the call relation between the two methods to be extracted increases exponentially. There is a problem that extraction is not completed.

そこで、一側面では、本発明は、呼出し関係にある複数のメソッドのうち経路探索の起点となるメソッドを結ぶ経路の抽出時間を短縮することを目的とする。   Therefore, in one aspect, an object of the present invention is to shorten the extraction time of a route connecting a method that is a starting point of a route search among a plurality of methods having a calling relationship.

一つの案では、呼出し関係にある複数のメソッドのうち経路探索の起点となる複数のメソッドを結ぶ経路を前記起点のメソッド毎に並行して経路探索を行う処理をコンピュータが実行する探索方法であって、前記起点となる前記複数のメソッドからnホップ目の経路探索対象となる経路が複数ある場合、メソッドに対応するクラスを記憶する記憶部を参照して、前記経路で接続された2つのメソッドに対応する経路優先度を算出し、前記経路優先度に基づき、前記経路探索対象となる複数の経路のうちから経路探索を行う経路を特定し、特定した前記経路に基づき前記経路探索の起点となる複数のメソッドの経路探索を行う、探索方法が提供される。   One proposal is a search method in which a computer executes a process of performing a route search in parallel for each method of the starting point, connecting a plurality of methods that are starting points of route searching among a plurality of methods having a calling relationship. When there are a plurality of routes to be searched for the n-th hop from the plurality of methods that are the starting points, two methods connected by the route are referred to by referring to a storage unit that stores a class corresponding to the method A route priority corresponding to the route search is determined, a route for route search is identified from among the plurality of routes to be route searched based on the route priority, and the origin of the route search is determined based on the specified route. There is provided a search method for performing a route search for a plurality of methods.

一側面によれば、呼出し関係にある複数のメソッドのうち経路探索の起点となるメソッドを結ぶ経路の抽出時間を短縮することができる。   According to one aspect, it is possible to shorten the extraction time of a route connecting a method that is a starting point of a route search among a plurality of methods having a calling relationship.

ソースコードと呼出し関係のグラフ構造との一例を示す図。The figure which shows an example of the graph structure of a source code and a call relationship. ソースコードとメソッド保持関係のグラフ構造との一例を示す図。The figure which shows an example of the graph structure of a source code and method holding | maintenance relationship. 呼出し関係経路の抽出のための探索範囲が指数関数的に増加する一例を示す図。The figure which shows an example in which the search range for extraction of a call related path | route increases exponentially. 一実施形態にかかる探索装置の機能構成の一例を示す図。The figure which shows an example of a function structure of the search device concerning one Embodiment. 一実施形態にかかる呼出し関係グラフデータ格納部の一例を示す図。The figure which shows an example of the call relation graph data storage part concerning one Embodiment. 一実施形態にかかるメソッド保持関係グラフデータ格納部の一例を示す図。The figure which shows an example of the method holding | maintenance relationship graph data storage part concerning one Embodiment. 呼出し関係及びメソッド保持関係のグラフ構造の一例を示す図。The figure which shows an example of the graph structure of a calling relationship and a method holding | maintenance relationship. 一実施形態にかかる経路抽出処理の一例を示すフローチャート。The flowchart which shows an example of the path | route extraction process concerning one Embodiment. 一実施形態にかかる辺探索指示処理の一例を示すフローチャート。The flowchart which shows an example of the edge search instruction | indication process concerning one Embodiment. 一実施形態にかかる経路探索進行の一例を示す図。The figure which shows an example of the route search progress concerning one Embodiment. 一実施形態にかかるグラフ辺探索処理の一例を示すフローチャート。The flowchart which shows an example of the graph edge search process concerning one Embodiment. 一実施形態にかかる経路出力処理の一例を示すフローチャート。The flowchart which shows an example of the path | route output process concerning one Embodiment. 一実施形態にかかる中間地点選出処理の一例を示すフローチャート。The flowchart which shows an example of the waypoint selection process concerning one Embodiment. 一実施形態にかかるクラス類似度の算出処理の一例を示すフローチャート。The flowchart which shows an example of the calculation process of the class similarity concerning one Embodiment. 一実施形態にかかる経路探索進行の一例を示す図。The figure which shows an example of the route search progress concerning one Embodiment. 一実施形態にかかる優先探索節点選出処理の一例を示すフローチャート。The flowchart which shows an example of the priority search node selection process concerning one Embodiment. 一実施形態にかかる経路探索の結果の一例を示す図。The figure which shows an example of the result of the route search concerning one Embodiment. 一実施形態にかかる経路探索の効果の一例を示す図。The figure which shows an example of the effect of the route search concerning one Embodiment. 一実施形態にかかる探索装置のハードウェア構成例を示す図。The figure which shows the hardware structural example of the search device concerning one Embodiment.

以下、本発明の実施形態について添付の図面を参照しながら説明する。なお、本明細書及び図面において、実質的に同一の機能構成を有する構成要素については、同一の符号を付することにより重複した説明を省く。
(はじめに)
はじめに、呼出し関係のグラフ構造のデータ化の一例について、図1を参照して説明する。図1に示すソースコードを解析すると、TranceiverのクラスのTranceiver.transmit()のメソッドが、Transformer.encode()のメソッド、Protocol.makeHeader()のメソッド、Tranceiver.send()のメソッドの3つのメソッドを呼び出している。そのうちTranceiver.send()のメソッドは、Tranceiver.transmit()と同じクラス(Tranceiver)のメソッドである。Transformer.encode()のメソッド及びProtocol.makeHeader()のメソッドは、Tranceiver.transmit()と異なるクラスのメソッドである。
Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. In addition, in this specification and drawing, about the component which has the substantially same function structure, the duplicate description is abbreviate | omitted by attaching | subjecting the same code | symbol.
(Introduction)
First, an example of data conversion of a call-related graph structure will be described with reference to FIG. When the source code shown in Fig. 1 is analyzed, the Tranceiver.transmit () method of the Tranceiver class has three methods: the Transformer.encode () method, the Protocol.makeHeader () method, and the Tranceiver.send () method. Is calling. Among them, the method of Tranceiver.send () is a method of the same class (Tranceiver) as Tranceiver.transmit (). The method of Transformer.encode () and the method of Protocol.makeHeader () are methods of classes different from Tranceiver.transmit ().

このようにしてソースコードを解析すると、メソッドの呼出し関係を示すグラフ構造を作成できる。ここで、グラフの「節点」はメソッドを表し、グラフの「辺」はメソッドからメソッドへの呼出し関係を表す。これによれば、どのクラスがどのメソッドを保持しているかの関係も、グラフ構造でデータ化できる。   By analyzing the source code in this way, it is possible to create a graph structure indicating the method calling relationship. Here, the “node” of the graph represents a method, and the “edge” of the graph represents a call relationship from the method to the method. According to this, the relationship between which class holds which method can be converted into data in a graph structure.

図2は、ソースコードとメソッド保持関係のグラフ構造との一例を示す。図2で示すソースコードは、図1で示したソースコードと同じである。ソースコードを解析すると、どのクラスがどのメソッドを保持するかのメソッド保持関係を示すグラフ構造を作成できる。例えば、図2では、グラフの節点はクラスまたはメソッドを表し、グラフの辺はクラスがメソッドを保持する関係(アノテーションが<has>の場合)、または実装の関係(アノテーションが<impl>の場合)を表す。つまり、図2では、アノテーション<has>はTranceiverのクラスがsendのメソッド及びtransmit()のメソッドを持っていることを示す。<impl>はクラス間の関係を示す。   FIG. 2 shows an example of the source code and the graph structure of the method holding relationship. The source code shown in FIG. 2 is the same as the source code shown in FIG. By analyzing the source code, it is possible to create a graph structure indicating the method holding relationship of which class holds which method. For example, in Fig. 2, the nodes of the graph represent classes or methods, and the edges of the graph represent relationships where the class holds methods (when annotation is <has>) or implementation relationships (when annotation is <impl>) Represents. That is, in FIG. 2, the annotation <has> indicates that the Tranceiver class has a send method and a transmit () method. <Impl> indicates the relationship between classes.

図3は、メソッドb(節点b)を経路探索の起点となる節点(以下、「起点節点」ともいう。)を中心に外側に出る辺を探索する範囲を示す。各円は、内側から順に1ホップ(1回目の辺探索)、2ホップ(2回目の辺探索)、3ホップ(3回目の辺探索)を示す。1ホップの時刻では節点bからの距離≦1となり、2ホップの時刻では節点bからの距離≦2となり、3ホップの時刻では節点bからの距離≦3となる。   FIG. 3 shows a range in which the edge of the method b (node b) is searched for an outside edge centered on a node (hereinafter also referred to as “starting node”) that is the starting point of the route search. Each circle indicates 1 hop (first edge search), 2 hops (second edge search), and 3 hops (third edge search) in order from the inside. The distance from node b ≦ 1 at the time of 1 hop, the distance from node b ≦ 2 at the time of 2 hops, and the distance from node b ≦ 3 at the time of 3 hops.

1ホップ目にはd個のメソッドがあり、2ホップ目にはd個のメソッドがあり、3ホップ目にはd個のメソッドがある。よって、距離rまでを探索した時点での探索済み節点の総数はおおよそd個のメソッドがある。 The first hop has one of the methods d, the 2-th hop There are d 2 pieces of the method, the 3-th hop there is a d 3 pieces of method. Therefore, the distance the total number of search already node at the time that was searched until r is the approximate d r number of methods.

上記の探索は、メソッドbを起点節点に外側に出る辺を探索したが、探索方向は逆方向(つまり、節点から内側に入る辺)もあるのでおおよそ2d個のメソッドがある。ホップ数が多くなればメソッド数が指数関数的に増加する。つまり、ソースコードの規模が大きくなると、離れた経路抽出対象の2つのメソッド(以下では、「起点節点s」ともいう。)間の呼出し関係経路の抽出のための探索範囲が指数関数的に増加してしまい、実用的な時間でメソッド間の呼出し関係の経路を抽出を完了することは困難になる。 Searching the above has been exploring the edges leaving outwardly method b as the starting point node, the search direction is the reverse direction (i.e., the side to enter the inside from the node) may also approximate 2d r pieces of method because there. As the number of hops increases, the number of methods increases exponentially. In other words, as the source code size increases, the search range for extracting call-related paths between two methods (hereinafter also referred to as “origin node s”) that are separated from the path extraction target exponentially increases. Thus, it becomes difficult to complete the extraction of the call relationship path between methods in a practical time.

これに対して、Dijkstra法では、辺の重みによって優先度付けを行い、経路抽出対象の2つのメソッド間の経路を探索する。しかしながら、呼出し関係のグラフ構造では辺重みがすべて同一のため、Dijkstra法での優先度付けが機能しない。よって、Dijkstra法では、ソースコードの規模が大きくなると実用的な時間で経路の抽出を完了することは困難になる。   On the other hand, in the Dijkstra method, priorities are assigned based on edge weights, and a route between two methods to be extracted is searched. However, since the edge weights are all the same in the call-related graph structure, prioritization by the Dijkstra method does not work. Therefore, in the Dijkstra method, it becomes difficult to complete route extraction in a practical time when the size of the source code increases.

また、Aスター法は、ゴール設定までの距離が小さい経路を探索する。呼出し関係のグラフ構造では、Aスター法が求める予測値の算出方法を新たに追加しない限り、予測値を求められない。このため、呼出し関係のグラフ構造では、Aスター法での優先度付けが機能しない。よって、Aスター法によっても、ソースコードの規模が大きくなると実用的な時間で経路の抽出を完了することは困難になる。   The A star method searches for a route having a short distance to the goal setting. In a call-related graph structure, a predicted value cannot be obtained unless a new method for calculating a predicted value obtained by the A star method is added. For this reason, prioritization by the A star method does not function in a call-related graph structure. Therefore, even with the A-star method, it becomes difficult to complete the extraction of the path in a practical time when the source code becomes large.

さらに、呼出し関係のグラフ構造では、グラフ構造上の一般の経路探索と異なり、経路抽出対象の2つの起点節点のうち、どちらが始点(呼出し元)であるか一般に判別できない。そのため両方の起点を起点に経路探索する必要がある。   Furthermore, unlike the general route search on the graph structure, the call-related graph structure generally cannot determine which is the starting point (calling source) of the two starting point nodes to be extracted. Therefore, it is necessary to search for a route from both starting points.

そこで、以下に説明する本実施形態では、呼出し関係にある複数のメソッドのうち起点となるメソッドを結ぶ経路の抽出時間を短縮する探索方法を提案する。   Therefore, in the present embodiment described below, a search method is proposed that shortens the extraction time of a route connecting a starting method among a plurality of methods having a calling relationship.

[探索装置の機能構成]
まず、本実施形態に係る探索方法を実行する探索装置1の構成の一例について、図4を参照しながら説明する。図4は、一実施形態にかかる探索装置1の機能構成の一例を示す。本実施形態に係る探索装置1は、呼出し関係にある複数の節点のうち経路探索の複数の起点節点を結ぶ経路を節点毎に並行して経路探索を行う。探索装置1は、記録装置とCPU(プロセッサ)を含むコンピュータや他のデジタル処理装置であり得る。ただし、探索装置1の構成は、これに限らず、例えば、CPUを含み、インターネットやLAN(Local Area Network)等を介して記録装置へのアクセスが可能な装置であってもよい。
[Functional configuration of search device]
First, an example of the configuration of the search device 1 that executes the search method according to the present embodiment will be described with reference to FIG. FIG. 4 shows an example of a functional configuration of the search device 1 according to the embodiment. The search device 1 according to the present embodiment performs a route search in parallel for each node on a route connecting a plurality of origin nodes of the route search among a plurality of nodes having a calling relationship. The search device 1 can be a computer including a recording device and a CPU (processor) or another digital processing device. However, the configuration of the search device 1 is not limited to this. For example, the search device 1 may include a CPU and may be a device that can access the recording device via the Internet, a LAN (Local Area Network), or the like.

探索装置1は、探索指示部10、グラフ探索部11、起点集合(Z)格納部12、記憶部13、クラス類似度計算部14、中間地点節点選出部15及び優先探索節点選出部16を有する。探索指示部10は、呼出し関係にある複数の節点のうち経路探索の複数の起点節点を結ぶ経路の探索を指示する。   The search device 1 includes a search instruction unit 10, a graph search unit 11, a starting point set (Z) storage unit 12, a storage unit 13, a class similarity calculation unit 14, an intermediate point node selection unit 15, and a priority search node selection unit 16. . The search instructing unit 10 instructs to search for a route connecting a plurality of origin nodes of the route search among a plurality of nodes having a calling relationship.

グラフ探索部11は、グラフ辺探索部111、要訪問節点集合(open)格納部112、訪問済節点集合(close)格納部113及び先行及び後続節点(prev・next)格納部114を有する。   The graph search unit 11 includes a graph edge search unit 111, a visited node set (open) storage unit 112, a visited node set (close) storage unit 113, and a preceding and subsequent node (prev · next) storage unit 114.

グラフ探索部11は、呼出し関係のグラフ構造において、2つ以上の起点節点の探索経路を探索する。グラフ探索部11は、各起点節点から前方方向(以下、「fwd」ともいう。)への探索及び各起点節点から後方方向(以下、「bwd」ともいう。)への探索を並列して別々に行う。例えば、起点節点が3つ存在する場合、グラフ探索部11は、3つの起点節点からそれぞれfwd及びbwd方向に6つの探索を並行して行う。このとき、グラフ探索部11は、並行して行う複数の探索(前記例では6つの探索)をbulk synchronous parallel方式等により1ホップずつ同期させる。ただし、グラフ探索部11は、非同期で複数の探索を行うこともできる。   The graph search unit 11 searches for a search path for two or more origin nodes in the call-related graph structure. The graph search unit 11 separately performs a search in the forward direction (hereinafter also referred to as “fwd”) from each starting node and a search in the backward direction (hereinafter also referred to as “bwd”) from each starting node. To do. For example, when there are three starting nodes, the graph search unit 11 performs six searches in parallel in the fwd and bwd directions from the three starting nodes, respectively. At this time, the graph search unit 11 synchronizes a plurality of searches performed in parallel (six searches in the above example) one hop at a time using a bulk synchronous parallel method or the like. However, the graph search unit 11 can also perform a plurality of searches asynchronously.

要訪問節点集合(open)格納部112は、これから訪問(探索)する必要がある節点を格納する。訪問済節点集合(close)格納部113は、訪問済(探索済)の節点を格納する。先行及び後続節点(prev・next)格納部114は、先行メソッド(先行節点)との関係情報を先行節点辞書prevに格納し、後続メソッド(後続節点)の関係情報を後続節点辞書nextに格納する。グラフ辺探索部は、要訪問節点集合格納部112、訪問済節点集合格納部113及び先行及び後続節点格納部114に格納された各情報に基づき経路を探索する。   The visiting node set (open) storage unit 112 stores nodes that need to be visited (searched) from now on. The visited node set (close) storage unit 113 stores visited (searched) nodes. The preceding and succeeding node (prev · next) storage unit 114 stores the relationship information with the preceding method (previous node) in the preceding node dictionary prev, and stores the relationship information with the succeeding method (following node) in the succeeding node dictionary next. . The graph edge search unit searches for a route based on the information stored in the visited node set storage unit 112, the visited node set storage unit 113, and the preceding and subsequent node storage units 114.

起点集合格納部12は、起点節点を格納する。起点集合格納部12の起点集合Zには、経路抽出対象の2つ起点節点と、中間地点節点が選択されている場合には特定の中間地点の節点とが格納される。   The starting point set storage unit 12 stores starting point nodes. The starting point set Z of the starting point set storage unit 12 stores two starting point nodes to be extracted from the route, and, when an intermediate point node is selected, a specific intermediate point node.

記憶部13は、呼出し関係グラフデータ格納部131及びメソッド保持関係グラフデータ格納部132を有する。ソースコードを解析した結果、呼出し関係グラフデータ格納部131及びメソッド保持関係グラフデータ格納部132に以下の各データが保存される。   The storage unit 13 includes a call relationship graph data storage unit 131 and a method holding relationship graph data storage unit 132. As a result of analyzing the source code, the following data is stored in the call relationship graph data storage unit 131 and the method holding relationship graph data storage unit 132.

呼出し関係グラフデータ格納部131は、メソッドの呼出し関係情報を格納する。図5は、一実施形態にかかる呼出し関係グラフデータ格納部131の一例を示す。ソースコード解析結果求められる呼出し関係のグラフ構造のうち、リレーションタイプが「call」の情報を有する。呼出し関係グラフデータ格納部131は、ソース名(呼出し元メソッド)131a、ソースタイプ131b、ディスティネーション名(呼び出し先メソッド)131c、ディスティネーションタイプ131d及びリレーションタイプ131eの各データ項目を有する。   The call relationship graph data storage unit 131 stores method call relationship information. FIG. 5 shows an example of the call relation graph data storage unit 131 according to the embodiment. Among the call-related graph structures obtained as a result of the source code analysis, information having a relation type “call” is included. The call relation graph data storage unit 131 includes data items of a source name (calling source method) 131a, a source type 131b, a destination name (calling destination method) 131c, a destination type 131d, and a relation type 131e.

メソッド保持関係グラフデータ格納部132は、クラスとメソッドとの関係及びクラスとクラスとの関係情報を格納する。ソースコード解析結果求められる呼出し関係のグラフ構造を格納するテーブルのうち、リレーションタイプが「has」と「impl」との情報を有する。図6は、一実施形態にかかるメソッド保持関係グラフデータ格納部132の一例を示す。ソースコード解析結果求められる呼出し関係のグラフ構造を格納するテーブルのうち、リレーションタイプが「has」と「impl」との情報を有する。メソッド保持関係グラフデータ格納部132は、ソース名132a、ソースタイプ132b、ディスティネーション名132c、ディスティネーションタイプ132d及びリレーションタイプ132eの各データ項目を有する。   The method holding relationship graph data storage unit 132 stores the relationship between the class and the method and the relationship information between the class and the class. Of the table storing the call-related graph structure obtained as a result of the source code analysis, the relation type has information of “has” and “impl”. FIG. 6 shows an example of the method holding relationship graph data storage unit 132 according to the embodiment. Of the table storing the call-related graph structure obtained as a result of the source code analysis, the relation type has information of “has” and “impl”. The method holding relationship graph data storage unit 132 includes data items of a source name 132a, a source type 132b, a destination name 132c, a destination type 132d, and a relation type 132e.

クラス類似度計算部は、複数の起点節点からnホップ目の経路探索対象となる経路が複数ある場合、複数に対応するクラスを記憶する記憶部13を参照して、前記経路で接続された2つの複数に対応するクラス類似度を算出する。   When there are a plurality of routes to be searched for the n-th hop from a plurality of origin nodes, the class similarity calculation unit refers to the storage unit 13 that stores the classes corresponding to the plurality of routes, and the two connected by the route Class similarity corresponding to two or more is calculated.

中間地点節点選出部15は、路探索の起点となる中間地点のメソッド(以下、中間地点節点)ともいう。)を特定する。中間地点節点選出部15は、複数の中間地点の節点されている場合、クラス類似度に基づき、複数の中間地点のうちから経路探索を行う中間地点の優先度を特定する。   The midpoint node selection unit 15 is also referred to as a midpoint method (hereinafter referred to as a midpoint node) serving as a starting point for a road search. ). When a plurality of waypoints are noded, the waypoint node selection unit 15 specifies the priority of the waypoint for performing a route search from among the plurality of waypoints based on the class similarity.

優先探索節点選出部16は、起点節点からnホップ目の経路探索対象となる経路が複数ある場合、メソッドに対応するクラスを記憶する記憶部を参照して、前記経路で接続された2つの節点(メソッド)に対応する経路優先度を算出する。   The priority search node selection unit 16 refers to a storage unit that stores a class corresponding to a method when there are a plurality of routes to be searched for an n-hop route from the origin node, and the two nodes connected by the route The route priority corresponding to (method) is calculated.

グラフ探索部11は、経路優先度に基づき、経路探索対象となる複数の経路のうちから経路探索を行う経路を特定し、特定した前記経路に基づき複数の起点節点の経路探索を行う。   Based on the route priority, the graph search unit 11 specifies a route to be searched from among a plurality of routes to be searched for a route, and performs a route search for a plurality of starting nodes based on the specified route.

例えば、図7に一例を示すように、ソースコード群に基づき呼出し関係グラフデータ格納部131が保持するメソッドの呼出し関係のグラフ構造が作成される。また、ソースコード群に基づきメソッド保持関係グラフデータ格納部132が保持するメソッド保持関係のグラフ構造が作成される。   For example, as shown in FIG. 7, a graph structure of the method call relationship held by the call relationship graph data storage unit 131 is created based on the source code group. Also, a method holding relationship graph structure held by the method holding relationship graph data storage unit 132 is created based on the source code group.

本実施形態にかかる探索装置1は、図7のメソッドの呼出し関係のグラフ構造において特定した経路抽出対象の2つの起点節点(図7ではメソッドQ.bとメソッドV.i)とをつなぐ最短の探索経路を抽出する。   The search device 1 according to the present embodiment is the shortest connecting the two origin nodes (method Q.b and method Vi in FIG. 7) identified in the graph structure of the method call relationship of FIG. Extract the search route.

[経路抽出処理]
以下では、本実施形態にかかる探索装置1が実行する探索処理のうちの経路抽出処理について図8を参照して説明する。その後、探索装置1が実行する探索処理のうちの辺探索指示処理(図9)、グラフ辺探索処理(図11)、経路出力処理(図12)、中間地点選出処理(図13)、クラス類似度の算出処理(図14)、優先探索節点選出処理(図16)の各処理が説明される。
[Route extraction process]
Below, the route extraction process among the search processes performed by the search device 1 according to the present embodiment will be described with reference to FIG. Thereafter, the edge search instruction process (FIG. 9), the graph edge search process (FIG. 11), the route output process (FIG. 12), the intermediate point selection process (FIG. 13), and the class similarity among the search processes executed by the search device 1 Each of the degree calculation process (FIG. 14) and the priority search node selection process (FIG. 16) will be described.

図8の経路抽出処理が開始されると、探索指示部10は、カウンタ(count)に0を設定する。カウンタには、探索のホップ数がカウントされる。探索指示部10は、経路a→bの探索を指示する。経路a→bにて示される「a」及び「b」は経路抽出対象の起点節点を含む。「a」及び「b」は中間地点節点であってもよい。   When the route extraction process of FIG. 8 is started, the search instruction unit 10 sets 0 to a counter (count). The counter counts the number of search hops. The search instruction unit 10 instructs to search for a route a → b. “A” and “b” indicated by the route a → b include the starting node of the route extraction target. “A” and “b” may be intermediate point nodes.

次に、探索指示部10は、各経路a→bに対して{“fwd”,”bwd”}の冪集合の要素を返すように設定する(ステップS101)。また、探索指示部10は、検知結果辞書pを、全経路に対して空集合{}を返すように設定する(ステップS101)。検知結果辞書pは、求めている経路があったか否かの結果を保持する辞書であり、求めている経路が見つかっていない初期状態では、検知結果辞書pは空集合{}になっている。   Next, the search instruction unit 10 sets so as to return elements of a set of {“fwd”, “bwd”} for each route a → b (step S101). In addition, the search instruction unit 10 sets the detection result dictionary p to return an empty set {} for all routes (step S101). The detection result dictionary p is a dictionary that holds the result of whether or not there is a desired route. In an initial state where the desired route is not found, the detection result dictionary p is an empty set {}.

検知結果辞書pは、求めている経路が見つかった時点で、前に進んだ方向(以下、「fwd」ともいう。)に経路が見つかったとき(例えば、起点節点から他の起点節点又は中間地点節点に辿りついたとき)、探索指示部10は、該当経路(例えば経路a→b)に“fwd”の要素を記憶する。検知結果辞書pには、後ろに進んだ方向(以下、「bwd」ともいう。)に経路が見つかったとき、該当経路(例えば経路a→b)に“bwd”の要素を記憶する。   The detection result dictionary p is used when a path is found in the forward direction (hereinafter also referred to as “fwd”) when the desired path is found (for example, from the starting node to another starting node or intermediate point). When the node reaches the node, the search instruction unit 10 stores the element “fwd” in the corresponding route (for example, route a → b). In the detection result dictionary p, when a path is found in a backward direction (hereinafter also referred to as “bwd”), an element “bwd” is stored in the corresponding path (for example, path a → b).

次に、探索指示部10は、起点節点s1を指定して図9の辺探索指示処理の実行をグラフ探索部11に指示する(ステップS102)。また、探索指示部10は、起点節点s2を指定して辺探索指示処理の実行をグラフ探索部11に指示する(ステップS102)。   Next, the search instruction unit 10 specifies the starting node s1 and instructs the graph search unit 11 to execute the edge search instruction process of FIG. 9 (step S102). In addition, the search instruction unit 10 specifies the starting node s2 and instructs the graph search unit 11 to execute the edge search instruction process (step S102).

(辺探索処理)
図9の辺探索指示処理が開始され、グラフ辺探索部111は、指定された起点節点sを起点集合Zに要素として追加する(ステップS201)。起点集合Zには、その時点で起点となっている節点が格納される。この時点では、起点集合Zには起点節点s1,s2が格納されていてもよい。例えば、図10に示す呼出し関係のグラフ構造の経路抽出対象Q.b及びV.iのメソッドが起点節点s1,s2の一例である。後述する中間地点の節点(例えば、図10のV.i、U.fのメソッド)が選定された場合、起点集合Zには起点節点s1,s2とともに、これらの中間地点の節点が格納される。起点集合Zに格納された中間地点は起点節点の一つとして経路探索の起点となる。
(Edge search process)
The edge search instruction process of FIG. 9 is started, and the graph edge search unit 111 adds the specified starting node s as an element to the starting point set Z (step S201). The starting point set Z stores the node that is the starting point at that time. At this time, the starting point set Z may store starting point nodes s1 and s2. For example, the route extraction target Q.D. b and V. The method i is an example of the starting nodes s1 and s2. When a node at an intermediate point described later (for example, the method of Vi, Uf in FIG. 10) is selected, the starting point set Z stores the nodes at these intermediate points together with the starting point nodes s1 and s2. . The intermediate point stored in the starting point set Z becomes the starting point of the route search as one of the starting point nodes.

次に、グラフ探索部11は、インスタンスプロセスi1を作成し、インスタンスプロセスi1に、入力としてグラフ=G、起点節点=s、方向指示=“fwd”を与えて、後述される図11のグラフ辺探索処理の非同期実行を指示する(ステップS202)。また、グラフ探索部のインスタンスプロセスi1を作成し,インスタンスプロセスi1に、グラフ=G,起点節点=S、方向指示=“bwd”を与えて、グラフ辺探索の非同期実行を指示する(ステップS203)。これにより本処理を終了する。   Next, the graph search unit 11 creates an instance process i1, gives graph = G, starting node = s, direction indication = “fwd” as inputs to the instance process i1, and the graph edge of FIG. The asynchronous execution of the search process is instructed (step S202). Also, an instance process i1 of the graph search unit is created, and the instance process i1 is given graph = G, starting node = S, direction instruction = “bwd” to instruct asynchronous execution of the graph edge search (step S203). . This is the end of this process.

なお、ステップS202の探索方向がfwd方向の場合の辺探索と、ステップS203の探索方向がbwd方向の場合の辺探索とは、別プロセスのインスタンスプロセスil毎に並行して行われる。   The edge search when the search direction in step S202 is the fwd direction and the edge search when the search direction in step S203 is the bwd direction are performed in parallel for each instance process il of another process.

図9の辺探索指示処理が終了すると、図8のステップ103に戻り、探索指示部10は、カウンタを一加算する(ステップS103)。ステップS104〜S110では、インスタンスプロセスi1のそれぞれの経路探索状況が確認される。グラフ探索部11は、図9の辺探索指示処理において各起点節点及び中間地点節点のそれぞれに対応した探索を並列して行い、その探索報告を通知する。探索指示部10は、グラフ探索部11からの探索報告を受け付ける。   When the edge search instruction process in FIG. 9 ends, the process returns to step 103 in FIG. 8, and the search instruction unit 10 increments the counter by one (step S103). In steps S104 to S110, the route search status of each instance process i1 is confirmed. The graph search unit 11 performs a search corresponding to each starting point node and intermediate point node in parallel in the edge search instruction process of FIG. 9 and notifies the search report. The search instruction unit 10 receives a search report from the graph search unit 11.

具体的には、探索指示部10は、起点集合Zの全節点から“fwd”、“bwd”の両方の完了報告を受けたかを判定する(ステップS104)。探索指示部10は、起点節点から進める方向がない場合にグラフ探索部11から完了報告を受ける。探索指示部10は、完了報告を受けたと判定した場合、ステップS118に進み、「経路なし」の通知を出力し、本処理を終了する(ステップS119)。   Specifically, the search instruction unit 10 determines whether or not the completion reports of both “fwd” and “bwd” have been received from all nodes of the starting point set Z (step S104). The search instruction unit 10 receives a completion report from the graph search unit 11 when there is no direction to advance from the starting node. If it is determined that the completion report has been received, the search instruction unit 10 proceeds to step S118, outputs a “no route” notification, and ends this process (step S119).

他方、探索指示部10は、起点集合Zの全節点のうち完了報告を受けていない節点があると判定した場合、起点集合Zの各要素s(各s∈Z)のすべてから方向指示“fwd”及び“bwd”両方の「指示待ち」が通知されたかを判定する(ステップS105)。グラフ探索部11は、例えば図3の各円で示す1ホップの“fwd”及び“bwd”のそれぞれの探索が終了したら「指示待ち」を通知する。グラフ探索部11は、探索指示部10から探索再開の指示を受けるまで、次ホップの経路探索に進まずに待ちの状態になる。   On the other hand, when the search instruction unit 10 determines that there is a node that has not received the completion report among all the nodes of the starting point set Z, the direction instruction “fwd” is obtained from all the elements s (each s∈Z) of the starting point set Z. It is determined whether “waiting for instructions” for both “” and “bwd” has been notified (step S105). For example, the graph search unit 11 notifies “waiting for instruction” when the search of “fwd” and “bwd” of one hop indicated by each circle in FIG. The graph search unit 11 does not proceed to route search for the next hop until it receives a search restart instruction from the search instruction unit 10 and enters a waiting state.

探索指示部10は、起点集合Zの各要素sの少なくともいずれかから“fwd”又は“bwd”の「指示待ち」が通知されていないと判定した場合、前進経路a→bの検知の報告を受けたかを判定する(ステップS106)。起点節点から例えば図10のグラフの矢印で示す経路(辺)が見つかった場合、探索指示部10は、前進経路a→b(fwd)の報告を受ける。この場合、検知結果辞書pのa→bの経路にfwdの要素を加え(ステップS107)、ステップS108に進む。これにより、検知結果辞書pはaの節点からbの節点までを繋ぐ辺がfwd方向にあったという検知結果を記憶する。一方、起点節点から前進経路の辺が見つからなかった場合、探索指示部10は、後進経路a→bの検知の報告を受けたかを判定する(ステップS108)。   When the search instruction unit 10 determines that “waiting for instruction” of “fwd” or “bwd” is not notified from at least one of the elements s of the starting point set Z, the search instruction unit 10 reports the detection of the forward route a → b. It is determined whether it has been received (step S106). For example, when a path (side) indicated by an arrow in the graph of FIG. 10 is found from the starting node, the search instruction unit 10 receives a report of the forward path a → b (fwd). In this case, an element of fwd is added to the path a → b of the detection result dictionary p (step S107), and the process proceeds to step S108. As a result, the detection result dictionary p stores the detection result that the side connecting the node a to the node b is in the fwd direction. On the other hand, when the side of the forward path is not found from the starting node, the search instruction unit 10 determines whether a report of detection of the backward path a → b has been received (step S108).

ステップS108において探索指示部10は、後進経路a→b(bwd)の報告を受けた場合、検知結果辞書pのa→bの経路にbwdの要素を加え(ステップS109)、ステップS104に戻る。これにより、検知結果辞書pはaの節点からbの節点までを繋ぐ辺がbwd方向にあったという検知結果を記憶する。   In step S108, when the search instruction unit 10 receives the report of the backward route a → b (bwd), the search instruction unit 10 adds the element bwd to the route a → b of the detection result dictionary p (step S109), and returns to step S104. As a result, the detection result dictionary p stores the detection result that the side connecting the node a to the node b is in the bwd direction.

ステップS108において探索指示部10は、後進経路a→b(bwd)の報告を受けなかった場合、直ちにステップS104に戻る。   In step S108, when the search instruction unit 10 does not receive the report of the backward route a → b (bwd), the search instruction unit 10 immediately returns to step S104.

ステップS104〜S109を繰り返し、探索指示部10は、起点集合Zの各要素sのすべてから“fwd”及び“bwd”両方の「指示待ち」が通知されたと判定した場合、ステップS110に進む。   When steps S104 to S109 are repeated and the search instruction unit 10 determines that “waiting for instructions” for both “fwd” and “bwd” is notified from all the elements s of the starting point set Z, the process proceeds to step S110.

ステップS110では、グラフ探索部11は、検知結果辞書pに記憶された検知結果を組み合わせることで、起点節点s1、s2間が到達可能かを判定する。また、グラフ探索部11は、到達経路を構成する経路群の集合Tを作成する。   In step S110, the graph search unit 11 determines whether or not the origin nodes s1 and s2 are reachable by combining the detection results stored in the detection result dictionary p. In addition, the graph search unit 11 creates a set T of route groups constituting the arrival route.

起点節点s1、s2間が到達可能でない判定された場合(ステップS111)、探索指示部10は、カウンタが既定値以上であるかを判定する(ステップS120)。また、S105にてYesと判定されステップS110に続くステップS111にてNoと判定された場合、探索指示部10は、ステップS112にてカウンタが既定値以上であるかを判定する(ステップS120)。カウンタが既定値よりも小さいと判定された場合、ステップS103に戻り、カウンタの値に1を加算し、ステップS104〜S109を繰り返す。   When it is determined that the starting node s1, s2 is not reachable (step S111), the search instruction unit 10 determines whether the counter is equal to or greater than a predetermined value (step S120). If it is determined Yes in step S105 and No in step S111 following step S110, the search instruction unit 10 determines whether the counter is equal to or greater than a predetermined value in step S112 (step S120). If it is determined that the counter is smaller than the predetermined value, the process returns to step S103, 1 is added to the value of the counter, and steps S104 to S109 are repeated.

カウンタが既定値以上であると判定された場合、探索指示部10は、ステップS121にて、中間地点節点選出部15に図13に示す中間地点選出処理の実行を指示し、グラフ辺探索部111に起点節点にiを指定して図9に示す辺探索指示処理の非同期実行を指示する。図13に示す中間地点選出処理については後述する。例えば、図10の呼出し関係のグラフ構造には、図13の中間地点選出処理にてV.gのメソッドが中間地点節点に選出された一例が示されている。   When it is determined that the counter is equal to or greater than the predetermined value, the search instruction unit 10 instructs the intermediate point node selection unit 15 to execute the intermediate point selection process shown in FIG. I is designated as the starting node and the asynchronous execution of the edge search instruction process shown in FIG. 9 is instructed. The waypoint selection process shown in FIG. 13 will be described later. For example, in the call-related graph structure of FIG. An example is shown in which the method of g is selected as an intermediate node.

図8に戻り、ステップS122にてカウンタに0を設定し、ステップS103にてカウンタに1を加算し、ステップS104〜S109を繰り返し、ステップS110に進む。ここでは、起点集合Zには、中間地点が含まれるとする。図10の例では、メソッドQ.b、メソッドV.i、メソッドV.gのすべてが起点節点となる。メソッドQ.b、メソッドV.i、メソッドV.gの起点節点に対してステップS104〜S109の処理が行われる。その結果、図10の例では、検知結果辞書pに、P(Q.b→V.g)={“fwd”}が保存される。しかしながら、この時点では、起点節点メソッドQ.b、メソッドV.i間が到達可能でない。よって、ステップS111にてNoと判定され、ステップS120にてNoと判定されて、再びステップS104〜S109を繰り返し、ステップS110に進む。この時点で、図10の例では、検知結果辞書pに、P(Q.b→V.g)={“fwd”}に加えて、P(V.g→V.i)={“bwd”}が追加して保存されている。よって、集合Tには、{Q.b→V.g,V.g→V.i}が記憶される。この時点では、図10に示すように、起点節点メソッドQ.b、メソッドV.i間が到達可能である。よって、探索指示部10は、ステップS111にてYesと判定し、集合Tが空集合かを判定する(ステップS112)。   Returning to FIG. 8, the counter is set to 0 in step S122, 1 is added to the counter in step S103, steps S104 to S109 are repeated, and the process proceeds to step S110. Here, it is assumed that the starting point set Z includes intermediate points. In the example of FIG. b, Method V. i, method V. All of g are starting nodes. Method Q. b, Method V. i, method V. Steps S104 to S109 are performed on the starting node of g. As a result, in the example of FIG. 10, P (Q.b → V.g) = {“fwd”} is stored in the detection result dictionary p. However, at this point, the origin node method Q. b, Method V. i is not reachable. Therefore, it determines with No in step S111, determines with No in step S120, repeats step S104-S109 again, and progresses to step S110. At this time, in the example of FIG. 10, in addition to P (Q.b → V.g) = {“fwd”}, P (V.g → V.i) = {“bwd” is added to the detection result dictionary p. "} Is added and saved. Therefore, the set T includes {Q. b → V. g, V.D. g → V. i} is stored. At this time, as shown in FIG. b, Method V. i can be reached. Therefore, the search instruction | indication part 10 determines with Yes in step S111, and determines whether the set T is an empty set (step S112).

ステップS112において集合Tが空集合でないと判定された場合、探索指示部10は、集合Tの1要素tを取り出し、集合Tからtを削除し、tをa→bの辺と定義する(ステップS113)。次に、探索指示部10は、検知結果辞書pのa→bの経路にfwdの要素があるかを判定する(ステップS114)。   When it is determined in step S112 that the set T is not an empty set, the search instruction unit 10 extracts one element t of the set T, deletes t from the set T, and defines t as an edge of a → b (step S113). Next, the search instruction unit 10 determines whether there is an element of fwd in the path a → b of the detection result dictionary p (step S114).

検知結果辞書pのa→bの経路にfwdの要素があると判定された場合、探索指示部10は、グラフ探索部11が作成する起点節点aを担当するインスタンスプロセスに到着節点b、探索方向“fwd”を入力して図12の経路出力処理の実行を指示する(ステップS115)。   When it is determined that there is an element of fwd in the path a → b of the detection result dictionary p, the search instruction unit 10 sends the arrival node b and the search direction to the instance process responsible for the starting node a created by the graph search unit 11. “Fwd” is input to instruct execution of the route output process of FIG. 12 (step S115).

検知結果辞書pのa→bの経路にfwdの要素がないと判定された場合、探索指示部10は、グラフ探索部11が作成する起点節点aを担当するインスタンスプロセスに到着節点b、探索方向“bwd”を入力して図12の経路出力処理の実行を指示する(ステップS116)。   When it is determined that there is no fwd element in the path a → b of the detection result dictionary p, the search instruction unit 10 sends the arrival node b and the search direction to the instance process in charge of the starting node a created by the graph search unit 11. “Bwd” is input to instruct execution of the route output process of FIG. 12 (step S116).

(経路出力処理)
ステップS115、S116にて実行される経路出力処理について図12を参照して説明する。本出力処理の開始に当たって経路出力したい到着節点(ゴールとする節点)をgとし、方向“fwd”、“bwd”の一要素に探索方向dがあるとする。ここで、ゴールの節点gからの最良の戻り道は先行及び後続節点(prev・next)格納部114に格納されている。
(Route output processing)
The route output process executed in steps S115 and S116 will be described with reference to FIG. Assume that the arrival node (node to be a goal) to be route output at the start of this output process is g, and that the search direction d is one element of the directions “fwd” and “bwd”. Here, the best return path from the goal node g is stored in the preceding and succeeding node (prev · next) storage unit 114.

本処理が開始されると、グラフ辺探索部111は、ゴールの節点gをtに設定し、空のリストを辺のリストPに設定する(ステップS401)。リストPは、起点節点から到着節点に至るまでの辺のリストである。   When this process is started, the graph edge search unit 111 sets the node g of the goal to t and sets an empty list to the edge list P (step S401). The list P is a list of edges from the origin node to the arrival node.

次に、グラフ辺探索部111は、この時点で探索のターゲットとしているtのprev(t)がnullでないかを判定する(ステップS402)。   Next, the graph edge search unit 111 determines whether or not prev (t) of t that is the target of the search at this time is null (step S402).

グラフ辺探索部111は、prev(t)がnullでないと判定した場合、prev(t)→tの辺をリストPに追加し(ステップS403)、prev(t)をTに設定する(ステップS404)。例えば、図10の呼出し関係のグラフ構造の場合、ゴールgをメソッドV.gとしたとき、一つ前の節点はメソッドS.eである。この場合、リストPにはメソッドS.e→メソッドV.gの辺が要素として加えられ、tにメソッドS.eが設定される。   When the graph edge search unit 111 determines that prev (t) is not null, the edge of prev (t) → t is added to the list P (step S403), and prev (t) is set to T (step S404). ). For example, in the case of the call-related graph structure of FIG. where g is the previous node. e. In this case, the method P. e → Method V. The edge of g is added as an element, and the method S.G. e is set.

ステップS402に戻り、ステップS402〜S404を繰り返すと、図10の例では、メソッドN.b、メソッドQ.bと辿ることができる。tがN.bのときリストPにはS.e→V.g,N.b→S.eの辺が要素として加えられた状態となる。更にステップS402〜S404が繰り返され、tがQ.bのときリストPにはS.e→V.g,N.b→S.e,Q.b→N.bの辺が要素として加えられた状態となる。   Returning to step S402 and repeating steps S402 to S404, in the example of FIG. b, Method Q. b can be traced. t is N.N. In the case of b, S. e → V. g, N.I. b → S. The side of e is added as an element. Further, steps S402 to S404 are repeated, and t becomes Q.Q. In the case of b, S. e → V. g, N.I. b → S. e, Q. b → N. The side of b is added as an element.

次に実行されるステップS402において、グラフ辺探索部111は、prev(t)がnullであると判定し、リストPを探索指示部10に報告し(ステップS405)、本処理を終了する。   In step S402 to be executed next, the graph edge search unit 111 determines that prev (t) is null, reports the list P to the search instruction unit 10 (step S405), and ends this process.

なお、上記説明では、方向dが“fwd”の場合においてステップS402にてprev(t)がnullでないかが判定され、探索結果の経路を後方に向かって辿った。方向dが“bwd”の場合においても同様の処理を行うが、ステップS402ではnext(t)がnullか否かが判定され、先行及び後続節点(prev・next)格納部114に基づき、探索結果の経路を前方に向かって辿る。   In the above description, when the direction d is “fwd”, it is determined in step S402 whether prev (t) is null, and the search result path is traced backward. The same processing is performed when the direction d is “bwd”. In step S402, it is determined whether next (t) is null, and the search result is based on the preceding and succeeding node (prev · next) storage unit 114. Follow the path forward.

図8に戻り、ステップS112〜S116の処理が繰り返され、集合Tから要素tが一つずつ削除され、最終的に集合Tからすべての要素が取り出されると、ステップS112において探索指示部10は、集合Tが空集合であると判定し、ステップS117に進む。探索指示部10は、出力された経路群を接続してa→b(起点節点s1→s2、図10では、メソッドQ.b→V.i)の経路として出力し(ステップS117)、本処理を終了する。   Returning to FIG. 8, the processes in steps S112 to S116 are repeated, and the element t is deleted one by one from the set T. Finally, when all the elements are extracted from the set T, in step S112, the search instruction unit 10 It is determined that the set T is an empty set, and the process proceeds to step S117. The search instruction unit 10 connects the output route group and outputs it as a route of a → b (starting node s1 → s2, method Q.b → Vi in FIG. 10) (step S117). Exit.

なお、ステップS104において、探索指示部10は、起点集合Zの全節点から“fwd”、“bwd”の両方の完了報告を受けた場合、「経路なし」の通知を出力し(ステップS118)、本処理を終了する。   In step S104, when the search instruction unit 10 receives completion reports of both “fwd” and “bwd” from all nodes of the starting point set Z, it outputs a “no route” notification (step S118). This process ends.

[中間地点選出処理/クラス類似度の算出処理]
(中間地点選出処理)
次に、中間地点選出処理について図13を参照して説明する。図13の中間地点選出処理では、中間地点節点選出部15が、呼出し関係のグラフ構造に含まれる起点節点間の中間地点の節点となるメソッドを選出する。
[Intermediate point selection process / class similarity calculation process]
(Intermediate point selection process)
Next, the waypoint selection process will be described with reference to FIG. In the intermediate point selection process of FIG. 13, the intermediate point node selection unit 15 selects a method that becomes a node of the intermediate point between the starting point nodes included in the call-related graph structure.

本処理は、図8のステップS121にて実行される。中間地点節点選出部15は、メソッド保持関係グラフデータ格納部132を参照して、リレーションタイプ132eが“impl”、かつディスティネーションタイプ132dが“interface”、かつソースタイプ132bが“class”のソース名132aを集合Cに格納する(ステップS501)。これにより、集合Cには、implという関係でインタフェースとつながっているメソッドが格納される。例えば、図6の例では、集合CにはクラスU,V,Wが格納される。   This process is executed in step S121 of FIG. The intermediate point node selection unit 15 refers to the method holding relationship graph data storage unit 132, and refers to the source name whose relation type 132e is “impl”, destination type 132d is “interface”, and source type 132b is “class”. 132a is stored in set C (step S501). As a result, the set C stores a method connected to the interface in the relationship of “impl”. For example, in the example of FIG. 6, classes U, V, and W are stored in the set C.

次に、中間地点節点選出部15は、K−Means法を用い集合Cの要素をクラスタリングする(ステップS502)。このとき、中間地点節点選出部15は、距離の近い要素を同一グループに分ける。要素間の距離は図14に示すクラス類似度の算出処理において算出可能である。よって、中間地点節点選出部15は、クラス類似度計算部14にクラス類似度の算出処理の実行を指示し、その結果得られたクラス類似度に基づき、集合Cの要素をクラスタリングする(ステップS502)。   Next, the midpoint node selection unit 15 clusters the elements of the set C using the K-Means method (step S502). At this time, the intermediate point node selection unit 15 divides elements having a short distance into the same group. The distance between elements can be calculated in the class similarity calculation process shown in FIG. Therefore, the waypoint node selection unit 15 instructs the class similarity calculation unit 14 to execute the class similarity calculation process, and clusters the elements of the set C based on the class similarity obtained as a result (step S502). ).

次に、中間地点節点選出部15は、より多くの要素を持つクラスタLを選ぶ。中間地点節点選出部15は、選んだクラスタLからメソッド数の多いクラスDを選び、そのクラスDのメソッドのうちクラスタL内の他のクラスに最も少なく現れるメソッドMを選び(ステップS503)、本処理を終了する。ただし、ステップS503では、中間地点節点選出部15は、選んだクラスタLからメソッド数の少ないクラスDを選んでもよい。また、中間地点節点選出部15は、そのクラスDのメソッドのうちクラスタL内の他のクラスに最も多く現れるメソッドMを選んでもよい。   Next, the intermediate point node selection unit 15 selects a cluster L having more elements. The intermediate point node selection unit 15 selects a class D having a large number of methods from the selected cluster L, selects a method M that appears least in other classes in the cluster L from the methods of the class D (step S503), The process ends. However, in step S503, the intermediate point node selection unit 15 may select a class D having a small number of methods from the selected cluster L. Further, the intermediate point node selection unit 15 may select a method M that appears most frequently in other classes in the cluster L among the methods of the class D.

これによれば、中間地点節点は、ディスティネーションタイプがインタフェースのクラスに応じたメソッドであって、起点節点からなるべく遠いメソッドが決定される。   According to this, the intermediate point node is a method whose destination type corresponds to the class of the interface, and a method as far as possible from the starting point node is determined.

(クラス類似度の算出処理)
ステップS502にて実行されるクラス類似度の算出処理について図14を参照して説明する。まず、クラス類似度計算部14は、メソッド保持関係グラフデータ格納部132を参照して、リレーションタイプ132eが“has”、かつソースタイプ132bが“class”、かつソース名132aが“C”である行のディスティネーション名132cを集合Mに格納する(ステップS701)。本処理の入力値として集合CにクラスVが設定されている場合、図6に示すメソッド保持関係グラフデータ格納部132を参照すると、集合Mにはメソッドg、h、i、j、k、lが格納される。
(Class similarity calculation process)
The class similarity calculation process executed in step S502 will be described with reference to FIG. First, the class similarity calculation unit 14 refers to the method holding relationship graph data storage unit 132, the relation type 132e is “has”, the source type 132b is “class”, and the source name 132a is “C”. The destination name 132c of the row is stored in the set M (step S701). When the class V is set to the set C as an input value of this processing, referring to the method holding relationship graph data storage unit 132 shown in FIG. 6, the set M includes methods g, h, i, j, k, and l. Is stored.

クラス類似度計算部14は、メソッド保持関係グラフデータ格納部132からリレーションタイプ132eが“has”、かつソースタイプ132bが“class”、かつソース名132aが“D”のディスティネーション名132cを集合Nに格納する(ステップS702)。   The class similarity calculation unit 14 collects from the method holding relationship graph data storage unit 132 a destination name 132c whose relation type 132e is “has”, source type 132b is “class”, and source name 132a is “D”. (Step S702).

図6では、クラスUのメソッド数は1、クラスVのメソッド数は6、クラスWのメソッド数は5である。よって、本処理の入力値として集合DにクラスWが設定されている場合、図6に示すメソッド保持関係グラフデータ格納部132を参照すると、集合Nにはメソッドh、i、j、k、lが格納される。   In FIG. 6, the number of methods of class U is 1, the number of methods of class V is 6, and the number of methods of class W is 5. Therefore, when the class W is set in the set D as an input value of this process, referring to the method holding relationship graph data storage unit 132 shown in FIG. 6, the set N includes methods h, i, j, k, and l. Is stored.

次に、クラス類似度計算部14は、集合Mのみに現れる名前の個数と集合Nのみに現れる名前の個数とを出力する。集合M={g、h、i、j、k、l}、集合N={h、i、j、k、l}の場合、集合Mのみに現れる名前は「g」であり、その個数は1である。集合Nのみに現れる名前の個数は0である。この場合、クラス類似度計算部14は、C(クラスV)とD(クラスW)とのクラス類似度に「1」を出力する。クラス類似度が示す数値は、クラスが持つメソッドがどれだけ類似しているかを示す。換言すれば、クラス類似度が示す数値は、クラス同士の距離を示す。   Next, the class similarity calculation unit 14 outputs the number of names that appear only in the set M and the number of names that appear only in the set N. When the set M = {g, h, i, j, k, l} and the set N = {h, i, j, k, l}, the name that appears only in the set M is “g”, and the number thereof is 1. The number of names that appear only in set N is zero. In this case, the class similarity calculation unit 14 outputs “1” as the class similarity between C (class V) and D (class W). The numerical value indicated by the class similarity indicates how similar the methods of the class are. In other words, the numerical value indicated by the class similarity indicates the distance between classes.

なお、クラス類似度の算出処理における名前の同一性の判定方法は、完全一致したら同一と判定する、全て小文字化して完全一致したら同一と判定する、文字列同士の編集距離が規定値以内なら同一と判定する等の方法を用いることができる。   Note that the name similarity determination method in the class similarity calculation processing is determined to be the same if it is completely matched, or is determined to be the same if it is completely lowercased and completely matched, and is the same if the edit distance between the character strings is within the specified value. Or the like can be used.

図14のステップ703にて、クラス類似度(U,V)が7、クラス類似度(U,W)が6、クラス類似度(V,W)が1と算出されたとする。このとき、図13のステップ502で2つのクラスタに分類する場合、各クラス類似度に基づき、集合C={U,V,W}の要素は、{U}、{V,W}に分類される。図13のステップ503では、より多くの要素を持つクラスタL={V,W}が選ばれる。そして、クラスDには、クラスタLのクラスV及びクラスWからメソッド数が多いクラスVが選ばれる。そして、メソッドMには、クラスDに選ばれたクラスVのメソッドのうちクラスタ内の他のクラスWに最も少なく現れるメソッドV.gが選ばれる。   14, it is assumed that the class similarity (U, V) is calculated as 7, the class similarity (U, W) as 6, and the class similarity (V, W) as 1. At this time, when classifying into two clusters in step 502 of FIG. 13, the elements of the set C = {U, V, W} are classified into {U} and {V, W} based on the class similarity. The In step 503 of FIG. 13, a cluster L = {V, W} having more elements is selected. As the class D, the class V having a larger number of methods is selected from the class V and the class W of the cluster L. In the method M, among the methods of the class V selected for the class D, the method V. which appears the least in the other class W in the cluster. g is selected.

これによれば、クラスタ毎に一つ中間地点のメソッドを選ぶことで、クラス類似度の低いメソッドが中間地点の節点に選ばれることになる。これにより、図10に示すように、クラス類似度が低いメソッドV.gを選ぶことで既に起点節点となっているメソッドから経路探索上離れたメソッドを中間地点節点に選定することができる。これにより、起点節点との距離が近すぎない位置に中間地点節点を設定することができ、経路探索の効率を向上させることができる。   According to this, by selecting one waypoint method for each cluster, a method having a low class similarity is selected as a node of the waypoint. As a result, as shown in FIG. By selecting g, it is possible to select a method that is separated from the method that is already the starting node in the route search as the intermediate node. Thereby, an intermediate point node can be set at a position where the distance from the starting point node is not too close, and the efficiency of route search can be improved.

なお、中間地点節点は、Java(登録商標)のソースコードの場合、インタフェースを実装したクラスのメソッドから選出され、C++のソースコードの場合、純粋仮想クラスを実装したクラスとimplで繋がっているメソッドから選ばれる。   In the case of Java (registered trademark) source code, the intermediate point node is selected from a method of a class that implements an interface. In the case of C ++ source code, a method that is connected to a class that implements a pure virtual class by impl Chosen from.

図8の経路抽出処理のステップS121において、中間地点設定が選出された後、図10に示すように、起点節点のメソッドQ.bと起点節点のメソッドV.iと中間地点節点V.gを起点として経路探索が行われる。   After the midpoint setting is selected in step S121 of the route extraction process of FIG. 8, as shown in FIG. b and the method of the starting node V. i and waypoint node V. A route search is performed starting from g.

本実施形態では、各起点が1ホップ目の探索を終了してから,各起点が次の2ホップ目の探索を開始するように、各起点同士の経路探索を同期させる。これにより、中間地点を選出するタイミングを適正にとることができる。ただし、各起点の経路探索を同期させずに進行させてもよい。   In the present embodiment, the route search between the starting points is synchronized so that each starting point starts the search for the next second hop after each starting point ends the search for the first hop. Thereby, the timing which elects an intermediate point can be taken appropriately. However, the route search for each starting point may proceed without being synchronized.

[グラフ辺探索処理/優先探索節点選出処理]
(グラフ辺探索処理)
次に、グラフ辺探索処理について図11を参照して説明する。本処理は、図9の辺探索指示処理のステップS202、S203にて実行される。なお、“fwd”又は“bwd”のいずれかの方向が方向指示変数dirに予め保存されている。また、以下では呼出し関係のグラフ構造の節点の集合を節点集合Vとする。
[Graph edge search processing / Priority search node selection processing]
(Graph edge search processing)
Next, the graph edge search process will be described with reference to FIG. This process is executed in steps S202 and S203 of the edge search instruction process in FIG. Note that one of the directions “fwd” and “bwd” is stored in the direction indication variable dir in advance. In the following, a set of nodes in the call-related graph structure is referred to as a node set V.

グラフ辺探索部111は、呼出し関係のグラフ構造の各節点に対して、起点節点s(例えばs1,s2、中間地点節点等)からの距離を返す辞書dを、全節点に対して∞を返すよう設定する(ステップS301)。起点節点sからの距離は、起点節点と探索する節点との間の辺の数である。辞書dは、起点節点sから中間地点の節点又は他の起点節点sに辿りつくことができるのかできないのか、辿りつくことができるとしたら距離(辺の数)はいくつかの情報を示す。辞書dは、辿りつくことができない又は不明な場合、∞を返すよう設定される。   The graph edge search unit 111 returns a dictionary d that returns the distance from the starting node s (for example, s1, s2, intermediate point nodes, etc.) for each node of the call-related graph structure, and ∞ for all nodes. (Step S301). The distance from the starting node s is the number of sides between the starting node and the node to be searched. In the dictionary d, whether or not it is possible to reach the intermediate node or another starting node s from the starting node s, or the distance (number of sides) indicates some information. The dictionary d is set to return ∞ if it cannot be reached or is unknown.

次に、グラフ辺探索部111は、節点集合Vの各節点vに対してvが起点節点(中間地点節点を含む)に対する経路上の節点なら入力辺u→vの端点uを返し、そうでなければnullを返す。グラフ辺探索部111は、先行節点辞書prevを、全節点に対してnullを返すように設定する。先行節点辞書prevは、現在の探索位置の一つ前の節点の情報を保持する辞書である。この時点では、先行節点辞書prevには、現在の探索位置の一つ前の節点が見つかっていないことを示すnullが設定される。   Next, the graph edge search unit 111 returns the end point u of the input edge u → v if v is a node on the path with respect to the starting node (including the intermediate node) for each node v of the node set V, and so on. Otherwise return null. The graph edge search unit 111 sets the preceding node dictionary prev to return null for all nodes. The preceding node dictionary prev is a dictionary that holds information on the node immediately before the current search position. At this time, null is set in the preceding node dictionary prev indicating that the node immediately before the current search position has not been found.

なお、上記は、方向指示変数dirが“fwd”の場合の説明である。方向指示変数dirが“bwd”の場合、ステップS302において、グラフ辺探索部111は、出力辺v→uの端点vを返し、そうでなければnullを返す。グラフ辺探索部111は、後続節点辞書nextを、全節点に対してnullを返すように設定する。   The above description is for the case where the direction indicating variable dir is “fwd”. If the direction indication variable dir is “bwd”, in step S302, the graph edge search unit 111 returns the end point v of the output edge v → u, otherwise returns null. The graph edge search unit 111 sets the subsequent node dictionary next so as to return null for all nodes.

次に、グラフ辺探索部111は、要訪問節点集合openに起点節点s(例えば、図15の経路抽出対象のメソッドQ.b及びメソッドV.i、中間地点節点等)を設定する(ステップS303)。以下では、起点節点のうち、経路抽出対象の2点のメソッドを起点節点s1、S2ともいう。   Next, the graph edge search unit 111 sets the origin node s (for example, the method Q.b and the method Vi, the intermediate point node, etc. of the route extraction target in FIG. 15) to the visited node set open (step S303). ). Hereinafter, of the starting nodes, the two methods for route extraction are also referred to as starting nodes s1 and S2.

また、グラフ辺探索部111は、距離を返す辞書d(s)に0(つまり、自分自身からの距離が0である)を設定する(ステップS303)。例えば、起点節点がS1,S2のみの場合(つまり、起点節点に中間地点を含まない場合)、起点節点s1の“fwd”及び“bwd”、起点節点s2の“fwd”及び“bwd”の4つの経路探索が並列的に処理されていることになる。例えば、n個の中間地点節点が選択されている場合、2(2+n)の経路探索が並列的に処理されていることになる。   In addition, the graph edge search unit 111 sets 0 (that is, the distance from itself is 0) to the dictionary d (s) that returns the distance (step S303). For example, when the starting nodes are only S1 and S2 (that is, when the starting node does not include an intermediate point), “fwd” and “bwd” of the starting node s1, 4 of “fwd” and “bwd” of the starting node s2 One route search is processed in parallel. For example, when n waypoint nodes are selected, 2 (2 + n) route searches are processed in parallel.

次に、グラフ辺探索部111は、訪問済節点集合closeを空集合にする(ステップS304)。次に、グラフ辺探索部111は、次の訪問先の節点集合newopenを空集合にする(ステップS305)。次の訪問先の節点集合newopenは次の訪問先の節点が記憶される。また、グラフ辺探索部111は、起点集合格納部12に格納された起点節点をZLに転記する(ステップS305)。一例として、起点節点sがメソッドQ.bであり、方向指示変数dirが“fwd”である場合、ステップS305において要訪問節点集合openに{Q.b}が設定され、距離を返す辞書d(s)にd(Q.b)=0が追加される。また、訪問済節点集合close及び次の訪問先の節点集合newopenは空集合の状態となる。   Next, the graph edge search unit 111 sets the visited node set close to an empty set (step S304). Next, the graph edge search unit 111 sets the next visited node set newopen to an empty set (step S305). In the next visited node set newopen, the next visited node is stored. In addition, the graph edge searching unit 111 transfers the starting point node stored in the starting point set storage unit 12 to ZL (step S305). As an example, if the starting node s is the method Q. b and the direction indicating variable dir is “fwd”, the {N. b} is set, and d (Q.b) = 0 is added to the dictionary d (s) that returns the distance. The visited node set “close” and the next visited node set “newopen” are in an empty set state.

次に、グラフ辺探索部111は、要訪問節点集合openが空集合でないかを判定する(ステップS306)。ここでは、要訪問節点集合openには起点節点s1、S2が格納されている。この時点では、グラフ辺探索部111は、要訪問節点集合openが空集合でない(Yes)と判定し、要訪問節点集合openに含まれる要素cのうち距離d(c)が最小であるcを1つ選び、その節点(メソッド)cを訪問するtとする(ステップS307)。また、グラフ辺探索部111は、除外節点集合X(優先度が高い節点S309にて選出済みの節点の集合)を空集合にする。除外節点集合Xには、優先度が高い節点を選出する際の除外節点が保持される。   Next, the graph edge search unit 111 determines whether or not the visited node set open is not an empty set (step S306). Here, the starting node s1 and S2 are stored in the visiting node set open required. At this time, the graph edge search unit 111 determines that the visited node set open is not an empty set (Yes), and sets c having the smallest distance d (c) among the elements c included in the visited node set open required. One is selected, and the node (method) c is visited t (step S307). Further, the graph edge search unit 111 sets the excluded node set X (the set of nodes selected in the node S309 having a high priority) to an empty set. In the excluded node set X, excluded nodes at the time of selecting nodes with high priority are held.

次に、グラフ辺探索部111は、探索のターゲットt(現在訪問しているメソッドm)を要訪問節点集合openから除き、訪問済節点集合closeに加える(ステップS308)。この時点で、要訪問節点集合openの要素はない(以下、集合名={}とも表記する)。また、訪問済節点集合close={Q.b}、次の訪問先の節点集合newopen={}、除外節点集合X={}、t=Q.b、prev(N.b)=Q.bとなる。   Next, the graph edge search unit 111 removes the search target t (currently visited method m) from the visited node set open and adds it to the visited node set close (step S308). At this time, there is no element in the visiting node set open required (hereinafter also referred to as “set name = {}”). Also, visited node set close = {Q. b}, next visited node set newopen = {}, excluded node set X = {}, t = Q. b, prev (N.b) = Q. b.

次に、探索のターゲットt=メソッドm、方向指示変数dir∈{“fwd”、“bwd”}、除外節点集合X={}を入力して、優先探索節点選出処理の実行を指示する(ステップS309)。   Next, a search target t = method m, a direction indicating variable dirε {“fwd”, “bwd”}, and an excluded node set X = {} are input to instruct execution of a priority search node selection process (step S309).

(優先探索節点選出処理)
優先探索節点選出処理について、図16を参照しながら説明する。優先探索節点選出部16は、図5に一例を示す呼出し関係グラフデータ格納部131を参照する。優先探索節点選出部16は、呼出し関係グラフデータ格納部131からリレーションタイプ131e=“call”、かつソースタイプ131b=“method”、かつディスティネーションタイプ=“method”、かつソース名131a=mである行のディスティネーション名131cを集合Nに格納する(ステップS601)。
(Priority search node selection processing)
The priority search node selection process will be described with reference to FIG. The priority search node selection unit 16 refers to the call relation graph data storage unit 131 shown as an example in FIG. The priority search node selection unit 16 has the relation type 131e = “call”, the source type 131b = “method”, the destination type = “method”, and the source name 131a = m from the call relation graph data storage unit 131. The destination name 131c of the row is stored in the set N (step S601).

なお、上記は方向指示変数dirが“fwd”の場合について示した。方向指示変数dirが“bwd”の場合、呼出し関係グラフデータ格納部131からリレーションタイプ131e=“call”、かつソースタイプ131b=“method”、かつディスティネーションタイプ=“method”、かつディスティネーション名131c=mである行のソース名131aを集合Nに格納する。   The above shows the case where the direction indicating variable dir is “fwd”. When the direction indication variable dir is “bwd”, the relation type 131e = “call”, the source type 131b = “method”, the destination type = “method”, and the destination name 131c from the call relation graph data storage unit 131. The source name 131a of the row where = m is stored in the set N.

次に、優先探索節点選出部16は、除外節点集合Xの要素を集合Nから除く(ステップS602)。次に、優先探索節点選出部16は、図6に一例を示すメソッド保持関係グラフデータ格納部132を参照して、リレーションタイプ132e=“has”、かつディスティネーション名132c=mである行のソース名132aをcに格納する(ステップS603)。   Next, the priority search node selection unit 16 removes the elements of the excluded node set X from the set N (step S602). Next, the priority search node selection unit 16 refers to the method holding relationship graph data storage unit 132 shown in FIG. 6 as an example, and the source of the row with the relation type 132e = “has” and the destination name 132c = m The name 132a is stored in c (step S603).

次に、優先探索節点選出部16は、集合N内の各要素nに対し,メソッド保持関係グラフデータ格納部132からリレーションタイプ132e=“has”、かつディスティネーション名132c=nである行のソース名132aをdに代入する(ステップS604)。   Next, the priority search node selection unit 16 for each element n in the set N, from the method holding relationship graph data storage unit 132, the source of the row with the relation type 132e = “has” and the destination name 132c = n The name 132a is substituted for d (step S604).

次に、クラス類似度計算部14は、図14のクラス類似度の算出処理を実行し、dとcの類似度を算出する。優先探索節点選出部16は、この結果、最も類似度が高い(つまり、最も類似度の数値の低い)クラスd’のメソッドm’を探索対象節点に選出し(ステップS604)、本処理を終了する。   Next, the class similarity calculation unit 14 executes the class similarity calculation process of FIG. 14 to calculate the similarity between d and c. As a result, the priority search node selection unit 16 selects the method m ′ of the class d ′ having the highest similarity (that is, the lowest similarity numerical value) as a search target node (step S604), and ends this processing. To do.

これにより、メソッドに対応するクラスを記憶する記憶部13を参照して、前記経路で接続された2つのメソッドに対応する経路優先度が算出される。   Thereby, the path priority corresponding to the two methods connected by the path is calculated with reference to the storage unit 13 that stores the class corresponding to the method.

例えば、本処理の入力値として、メソッドmがV.i、方向指示変数dirが“bwd”の場合、ステップS601において図5に一例を示す呼出し関係グラフデータ格納部131を参照して、集合N={X.i、Wd.i}となる。次のステップS602においても集合N={X.i、Wd.i}の状態は変わらない。次のステップS603においてc=V(クラス)となる。次のステップS604において集合N内の各要素n(=X.i,Wd.i)に対してd=X,Wdとなる。そして、c(=V)とd(=X,Wd)との類似度は、類似度(X,V)=5、類似度(Wd,V)=1となる。これにより、最も類似度が高い(つまり、最も類似度の数値の低い)クラスd’は「Wd」となり、そのメソッドm’は「Wd.i」となる。これにより、例えば、図15では、メソッドWd.iが、メソッドX.iよりも優先して経路探索されることになる。なお、優先探索節点選出処理において算出された類似度は、経路優先度の一例である。   For example, as an input value of this process, the method m is V.V. i, when the direction indication variable dir is “bwd”, the call relationship graph data storage unit 131 shown as an example in FIG. 5 is referred to in step S601, and the set N = {X. i, Wd. i}. Also in the next step S602, the set N = {X. i, Wd. The state of i} does not change. In the next step S603, c = V (class). In the next step S604, d = X, Wd for each element n (= X.i, Wd.i) in the set N. The similarity between c (= V) and d (= X, Wd) is similarity (X, V) = 5 and similarity (Wd, V) = 1. As a result, the class d ′ having the highest similarity (that is, the lowest similarity value) is “Wd”, and the method m ′ is “Wd.i”. Thereby, for example, in FIG. i is a method X. The route search is prioritized over i. Note that the similarity calculated in the priority search node selection process is an example of a route priority.

図11に戻り、グラフ辺探索部111は、ステップS310において探索対象節点が選出されたかを判定する。グラフ辺探索部111は、探索対象節点が選出されなかったと判定した場合、ステップS306に戻り、ステップS306〜S310を繰り返す。グラフ辺探索部111は、探索対象節点が選出されたと判定した場合、ステップS311に進み、優先探索節点選出部16が選出した優先度が最も高い節点nをXに要素として追加する(ステップS311)。   Returning to FIG. 11, the graph edge search unit 111 determines whether a search target node is selected in step S <b> 310. When the graph edge search unit 111 determines that the search target node has not been selected, the graph edge search unit 111 returns to step S306 and repeats steps S306 to S310. When the graph edge search unit 111 determines that the search target node has been selected, the graph edge search unit 111 proceeds to step S311 and adds the node n having the highest priority selected by the priority search node selection unit 16 to X as an element (step S311). .

次に、グラフ辺探索部111は、節点nが訪問済節点集合closeの要素に含まれない、かつd(n)>d(t)+1を満たすかを判定する(ステップS312)。グラフ辺探索部111は、節点nが訪問済節点集合closeの要素に含まれると判定した場合、ステップS314に進む。また、グラフ辺探索部111は、d(n)≦d(t)+1であると判定した場合、つまり、節点nの距離d(n)が、起点から最も短い距離であると判定した場合、ステップS314に進む。これに対して、グラフ辺探索部111は、節点nが訪問済節点でなく、かつ距離d(n)が起点から最も短い距離でないと判定した場合、ステップS313にてd(t)+1を距離d(n)に代入することで距離d(n)を書き替える。これにより、より短い経路で起点節点間を辿りつけるようにする。   Next, the graph edge search unit 111 determines whether the node n is not included in the elements of the visited node set close and satisfies d (n)> d (t) +1 (step S312). If the graph edge searching unit 111 determines that the node n is included in the elements of the visited node set close, the process proceeds to step S314. When the graph edge searching unit 111 determines that d (n) ≦ d (t) +1, that is, when the distance d (n) of the node n is determined to be the shortest distance from the starting point, The process proceeds to step S314. On the other hand, if the graph edge searching unit 111 determines that the node n is not a visited node and the distance d (n) is not the shortest distance from the starting point, the graph edge searching unit 111 sets d (t) +1 to the distance in step S313. The distance d (n) is rewritten by substituting for d (n). As a result, the origin node can be traced with a shorter route.

また、グラフ辺探索部111は、先行及び後続節点(prev・next)格納部114の先行節点prev(n)にtの値を設定することで、節点nの一つ前が節点tであると書き替える。更に、グラフ辺探索部111は、次の訪問先の節点集合newopenに次の訪問先の節点nを追加する。この時点では、例えば図15のグラフの例ではprev(N.b)=Q.bが追加され、次の訪問先の節点集合newopenにはN.bが設定される。   Further, the graph edge searching unit 111 sets the value of t to the preceding node prev (n) of the preceding and succeeding node (prev · next) storage unit 114, so that the node t immediately before the node n is the node t. Rewrite. Further, the graph edge search unit 111 adds the node n of the next visit destination to the node set newopen of the next visit destination. At this time, for example, prev (N.b) = Q. b is added, and the node set newopen at the next visit destination is N.P. b is set.

ステップS314にて、グラフ辺探索部111は、nがZL(ZL:起点又は中間地点の節点)であるかを判定する。S305において起点集合格納部Zの内容をZLに転記している。よって、グラフ探索部11は、nがZLであると判定した場合、探索指示部10にs→nの前進経路を検知したことを報告し(ステップS315)、ステップS309に戻る。これにより、ある起点又は中間地点から他の起点又は中間地点に辿りついたということが探索指示部10に報告される。   In step S314, the graph edge search unit 111 determines whether n is ZL (ZL: a starting point or a node at an intermediate point). In S305, the contents of the starting point set storage unit Z are transferred to ZL. Therefore, if the graph search unit 11 determines that n is ZL, the graph search unit 11 reports to the search instruction unit 10 that a forward path of s → n has been detected (step S315), and returns to step S309. Thereby, it is reported to the search instructing unit 10 that a certain starting point or intermediate point has reached another starting point or intermediate point.

他方、グラフ辺探索部111は、nがZLでないと判定した場合、直ちにステップS309に戻る。なお、ステップS315において、方向指示変数dirが“bwd”の場合、探索指示部10にn→sの前進経路を検知したことが報告される。   On the other hand, if the graph edge searching unit 111 determines that n is not ZL, the graph edge searching unit 111 immediately returns to step S309. In step S315, when the direction indicating variable dir is “bwd”, the search instructing unit 10 is notified that the n → s forward path has been detected.

S309に戻ると、除外節点集合Xに要素が蓄積されて、S310にて節点が選出できないと判定されると、グラフ辺探索部111は、要訪問先集合openに要素があるかを判定する(ステップS306)。要訪問先集合openに要素があると判定された場合、グラフ辺探索部111は、ステップS307以降の処理を行う。要訪問先集合openに要素がないと判定された場合、グラフ辺探索部111は、ステップS316へ進み、探索指示部10に「実行再開の指示待ち」の通知を行う。グラフ辺探索部111は、探索指示部10から実行再開の指示を待つ(ステップS317)。   Returning to S309, if the elements are accumulated in the excluded node set X and it is determined in S310 that no node can be selected, the graph edge search unit 111 determines whether there is an element in the visited set “open” (required) Step S306). When it is determined that there is an element in the visited destination set open, the graph edge search unit 111 performs the processing after step S307. When it is determined that there is no element in the visited destination set open, the graph edge search unit 111 proceeds to step S316 and notifies the search instruction unit 10 of “wait for instruction to resume execution”. The graph edge search unit 111 waits for an instruction to resume execution from the search instruction unit 10 (step S317).

グラフ辺探索部111は、探索指示部10から実行再開の指示を受けたかを判定し(ステップS318)、実行再開の指示を受けるまで待つ。グラフ辺探索部111は、実行再開の指示を受けたと判定した場合、次の訪問先の節点集合newopenに要素がないかを判定する(ステップS319)。次の訪問先の節点集合newopenに要素がないと判定された場合、グラフ辺探索部111は、次の訪問先の節点集合newopenに次の訪問先の節点nがないため、ステップS321へ進み、探索指示部10に完了を報告する。次の訪問先の節点集合newopenに要素があると判定された場合、グラフ辺探索部111は、次の訪問先の節点集合newopenの値をopenに設定し(ステップS320)、ステップS305に戻る。   The graph edge search unit 111 determines whether or not an instruction to resume execution has been received from the search instruction unit 10 (step S318), and waits until an instruction to resume execution is received. If the graph edge search unit 111 determines that an instruction to resume execution has been received, the graph edge search unit 111 determines whether there is no element in the node set newopen for the next visited site (step S319). When it is determined that there is no element in the next visited node set newopen, the graph edge searching unit 111 proceeds to step S321 because the next visited node set newopen does not include the next visited node n. Report completion to the search instruction unit 10. When it is determined that there is an element in the next visited node set newopen, the graph edge searching unit 111 sets the value of the next visited node set newopen to “open” (step S320), and the process returns to step S305.

これにより、グラフ辺探索部111は、すべて起点節点の1ホップ目が終了し、次の2ホップ目の探索を開始することになる。要訪問先集合openには、2ホップ目の探索では、前回の経路探索で見つかった節点が入っている。図15の例では、1ホップ目ではopen={Q.b}、2ホップ目ではopen={N.b、Y.m}となる。   As a result, the graph edge search unit 111 ends the first hop of the starting node and starts the next second hop search. The visited destination set open contains the nodes found in the previous route search in the second hop search. In the example of FIG. 15, open = {Q. b} In the second hop, open = {N. b, Y. m}.

この状態で、グラフ辺探索部111は、ステップS305〜S316の処理を実行する。この時点では、図15のグラフの例ではprev(S.e)=N.bが追加され、次の訪問先の節点集合newopenにはS.eが追加される。   In this state, the graph edge search unit 111 executes the processes of steps S305 to S316. At this point, prev (Se) = N. b is added, and the node set newopen at the next visit destination is S.B. e is added.

グラフ辺探索部111は、ステップS317にて探索指示部10から「実行再開」の指示を待ち、ステップS318にて指示を受けたと判定した場合、ステップS319にて次の訪問先の節点集合newopenが空でないかを判定する。この時点では、次の訪問先の節点集合newopenにS.eの要素がある。このため、グラフ辺探索部111は、newopenの値を訪問節点集合openに代入し、ステップS305〜S316の処理を繰り返す。この繰り返し処理により、図15のグラフの例ではprev(U.f)=S.eが追加され、次の訪問先の節点集合newopenにはU.fが追加される。次の繰り返しにおいてprev(V.g)=S.eが追加され、次の訪問先の節点集合newopenにはU.f、V.gが追加された状態となる。   In step S317, the graph edge search unit 111 waits for an “execution restart” instruction from the search instruction unit 10 and determines that the instruction is received in step S318. In step S319, the next visited node set newopen is determined. Determine if it is not empty. At this time, S.P is included in the next visited node set newopen. There are elements of e. For this reason, the graph edge search unit 111 substitutes the value of newopen into the visited node set open, and repeats the processing of steps S305 to S316. By this repeated processing, prev (U.f) = S. e is added, and the next visited node set newopen is U.P. f is added. In the next iteration, prev (V.g) = S. e is added, and the next visited node set newopen is U.P. f, V. g is added.

ここで、図15のグラフの例では、次の訪問先の節点集合newopenのメソッドV.gは、中間地点節点であるため、前進経路Q.b→V.gの前進経路が見つかった状態となる。よって、グラフ辺探索部111は、ステップS315において探索指示部10にこの前進経路を検知したことを報告する。この結果、先行及び後続節点(prev・next)格納部114に、辺探索で得られた前進経路及び更新経路が蓄積される。これにより、例えば、図17の太線にて示す経路抽出対象である起点節点のメソッドQ.b及びメソッドV.i間の経路が抽出される。   Here, in the example of the graph of FIG. 15, the method V. Since g is an intermediate node, the forward path Q.g. b → V. The forward path of g is found. Therefore, the graph edge search unit 111 reports that the forward path has been detected to the search instruction unit 10 in step S315. As a result, the forward route and the updated route obtained by the edge search are accumulated in the preceding and succeeding node (prev · next) storage unit 114. Thereby, for example, the method Q. of the starting node which is the path extraction target indicated by the thick line in FIG. b and method V. The path between i is extracted.

以上に説明したように、一実施形態に係る探索方法によれば、以下の1〜4を行う。
1.経路抽出対象の起点節点となる2つのメソッドのほかに中間地点節点のメソッドを複数個(P個)用意し、P+2個のメソッド(に対応するグラフの節点)を起点に経路探索を並列に行う。有向辺を順方向(呼出し先に向かう方向fwd)に経路探索するだけでなく、逆方向(呼出し元に向かう方向bwd)にも経路探索する。起点以外の節点にたどり着くまで探索し、最後に経路探索の結果を結合する。
2.1において小さな数のP個の中間地点節点に絞って探索を始め、数ステップ実行後も対象2メソッド(節点)が経路でつながらなければ徐々に中間地点節点を増やして経路探索を行う。
3.2において探索を始める中間地点節点の優先順位付けに、節点に対応する(メソッドを保持する)クラスの(メソッド名リストに関する)類似度が低いことを用いる。
4.1において経路探索を進める辺が複数ある場合に先に調査する辺を決める優先順位付けとして、経路優先度を算出する。経路優先度の算出は、節点に対応するクラス類似度が高いことを用いる。経路優先度に基づき先に調査する辺を決めることで、呼出し関係にある複数のメソッドのうち経路探索の起点となる離れた2メソッド間の呼出し関係の経路抽出に要する時間を削減できる。
As explained above, according to the search method which concerns on one Embodiment, the following 1-4 are performed.
1. In addition to the two methods that are the origin nodes of the route extraction target, a plurality of intermediate node methods (P) are prepared, and the route search is performed in parallel starting from P + 2 methods (corresponding graph nodes). . The route search is performed not only in the forward direction (direction fwd toward the call destination) but also in the reverse direction (direction bwd toward the call source). Search until a node other than the starting point is reached, and finally combine the results of the route search.
In 2.1, the search is started by narrowing down to a small number of P intermediate point nodes, and after the execution of several steps, if the target two methods (nodes) are not connected by the route, the route search is performed by gradually increasing the intermediate point nodes.
In order to prioritize the waypoint nodes starting the search in 3.2, use the low similarity (with respect to the method name list) of the class (holding the method) corresponding to the node.
In 4.1, when there are a plurality of sides for which the route search is advanced, the route priority is calculated as the prioritization for determining the side to be investigated first. The calculation of the route priority uses that the class similarity corresponding to the node is high. By determining the side to be investigated first based on the route priority, it is possible to reduce the time required to extract the call relationship route between two distant methods that are the starting point of the route search among a plurality of methods having a call relationship.

更に、(a)1.において中間地点メソッドは、経路上のメソッドである可能性の高いメソッドを次のように選ぶ。ソースコードを解析したメソッド保持関係を有する格納部に基づき、プログラム言語仕様で関心の分離・疎結合化に使われているクラスを選ぶ。例えばJavaならインタフェースを実装したクラス、C++なら純粋仮想クラスを実装したクラスを選ぶ。別法として、dependency injectionで指定されたクラスを選んでもよい。   Further, (a) 1. In the intermediate point method, a method that is likely to be a method on the route is selected as follows. Based on the storage section that has the method retention relationship analyzed from the source code, select the class that is used for the separation and loose coupling of interest in the programming language specification. For example, in Java, a class that implements an interface is selected, and in C ++, a class that implements a pure virtual class is selected. Alternatively, the class specified by dependency injection may be selected.

(b)1.において並列に行う経路探索は、例えば1ホップ毎に各起点地点からの経路探索を同期させるbulk synchronous parallel方式で行うことが好ましい。   (B) 1. It is preferable that the route search performed in parallel is performed by a bulk synchronous parallel method that synchronizes the route search from each starting point for each hop, for example.

(c)2.において絞り込みは次のように行う。1.で選んだ中間地点メソッドを保持するクラスを、類似度でクラスタリングする。その際、K−Means法などを用いることができる。できたクラスタから1つクラスを選び、そのクラスの保持するメソッド群を中間地点節点に選ぶ。   (C) 2. Narrowing is performed as follows. 1. Cluster the class that holds the waypoint method selected in step 1 by similarity. At that time, a K-Means method or the like can be used. Select one class from the resulting cluster, and select the method group held by that class as the midpoint node.

(d)3.において優先順位付けは次のように行う。2.で絞り込んだ各クラスと経路抽出対象2メソッドがそれぞれ属するクラス類似度を比較し、いずれの経路抽出対象とも似ていない(つまり類似度が低い)クラスを順次選択する。そのクラスの保持するメソッド群を中間地点節点に選ぶ。   (D) 3. The prioritization is performed as follows. 2. Each class narrowed down in step 2 is compared with the class similarity to which the route extraction target two methods belong, and the class that is not similar to any of the route extraction targets (that is, the similarity is low) is sequentially selected. Select the method group held by the class as the intermediate node.

(e)4.において調査する辺の優先順位付けは次のように行う。現在訪問している節点をv、経路探索を進める辺をv→w、vとwをそれぞれ保持するクラスをcとdとする。cとdの類似度が高い順に、辺v→wを選ぶ。   (E) 4. Prioritization of the sides to be investigated is performed as follows. Assume that the currently visited node is v, the side where the route search is advanced is v → w, and the classes holding v and w are c and d, respectively. The sides v → w are selected in descending order of similarity between c and d.

3.、4.及び上記(c)、(d)、(e)でのクラス類似度は次のように計算する。クラス毎にクラスが持つメソッドの名前(文字列)のソート済みリストを作る。このリストの編集距離(Levenshtein 距離)をクラス類似度とする(小さい値ほど類似度が高いとする)。   3. 4. The class similarity in the above (c), (d), and (e) is calculated as follows. For each class, create a sorted list of method names (strings) that the class has. The edit distance (Levenshtein distance) of this list is the class similarity (assuming that the smaller the value, the higher the similarity).

以上、本実施形態にかかる探索装置1によれば、呼出し関係にある複数のメソッドのうち起点となるメソッドを結ぶ経路の抽出時間を短縮することができる。   As described above, according to the search device 1 according to the present embodiment, it is possible to shorten the extraction time of a route connecting a starting method among a plurality of methods having a calling relationship.

図18に示すように、経路探索対象メソッド間の距離をrとし、経路上に中間地点メソッドがP個あるとする。各起点メソッドから隣の起点メソッドまでの距離fはr/(1+1P)となる。   As shown in FIG. 18, it is assumed that the distance between route search target methods is r, and there are P intermediate point methods on the route. The distance f from each starting point method to the adjacent starting point method is r / (1 + 1P).

各起点メソッドから隣の起点メソッドに至るまでに訪れる呼出し先(または元)側のメソッドの総数n(P)は最良で式(1)で算出される。   The total number n (P) of the callee (or original) methods that visit from each starting method to the adjacent starting method is best calculated by equation (1).

Figure 2017062710
Figure 2017062710

全体で訪れるメソッドの総数N(P)は最良で式(2)で算出される。   The total number of methods N (P) visited as a whole is the best and is calculated by equation (2).

Figure 2017062710
Figure 2017062710

例えば以下の公知の手法であるDijkstra法[1]、およびA*法[2]で訪れるメソッドの総数NOMは、式(3)で算出される。
Dijkstra法[1] Dijkstra, E.W.(1959).A note on two problems in connexion with graphs. In Numerische Mathematik, 1 (1959), S. 269 〜 271.
A*法[2] Peter E. Hart; Nils J. Nilsson; Bertram Raphael(July 1968). "A Formal Basis for the Heuristic Determination of Minimal Cost Paths". IEEE Transactions on Systems Science and Cybernetics 4 (2): 100‐107. doi:10.1109/TSSC.1968.300136. ISSN0536-1567.
For example, the total number NOM of methods visited by the following well-known methods Dijkstra method [1] and A * method [2] is calculated by equation (3).
Dijkstra method [1] Dijkstra, EW (1959) .A note on two problems in connexion with graphs. In Numerische Mathematik, 1 (1959), S. 269-271.
A * method [2] Peter E. Hart; Nils J. Nilsson; Bertram Raphael (July 1968). "A Formal Basis for the Heuristic Determination of Minimal Cost Paths". IEEE Transactions on Systems Science and Cybernetics 4 (2): 100 -107.doi: 10.1109 / TSSC.1968.300136.ISSN0536-1567.

Figure 2017062710
Figure 2017062710

よって、訪れるメソッドの総数比N(P)/NOMは、式(4)を用いて近似値1/dで算出される。つまり、本実施形態にかかる探索方法によれば、呼出し関係にある複数のメソッドのうち経路探索の起点となるメソッドを結ぶ経路の抽出時間を短縮できる。 Therefore, the total number ratio N (P) / N OM methods visit is calculated by approximation 1 / d r using equation (4). In other words, according to the search method according to the present embodiment, it is possible to shorten the extraction time of a route connecting a method that is a starting point of route search among a plurality of methods having a calling relationship.

Figure 2017062710
Figure 2017062710

(ハードウェア構成例)
最後に、本実施形態に係る探索装置1のハードウェア構成について、図19を参照して説明する。図19は、本実施形態に係る探索装置1のハードウェア構成の一例を示す。探索装置1は、入力装置101、表示装置102、外部I/F103、RAM(Random Access Memory)104、ROM(Read Only
Memory)105、CPU(Central Processing Unit)106、通信I/F107、及びHDD(Hard Disk Drive)108などを備え、それぞれがバスBで相互に接続されている。
(Hardware configuration example)
Finally, the hardware configuration of the search device 1 according to the present embodiment will be described with reference to FIG. FIG. 19 shows an example of the hardware configuration of the search device 1 according to this embodiment. The search device 1 includes an input device 101, a display device 102, an external I / F 103, a RAM (Random Access Memory) 104, and a ROM (Read Only).
Memory (105), CPU (Central Processing Unit) 106, Communication I / F 107, HDD (Hard Disk Drive) 108, etc. are connected to each other via bus B.

入力装置101は、キーボードやマウスなどを含み、探索装置1に各操作信号を入力するために用いられる。表示装置102は、ディスプレイなどを含み、各種の処理結果を表示する。通信I/F107は、探索装置1をネットワークに接続するインタフェースである。これにより、探索装置1は、通信I/F107を介して、他の機器とデータ通信を行うことができる。   The input device 101 includes a keyboard and a mouse, and is used to input each operation signal to the search device 1. The display device 102 includes a display and displays various processing results. The communication I / F 107 is an interface that connects the search device 1 to a network. As a result, the search device 1 can perform data communication with other devices via the communication I / F 107.

HDD108は、プログラムやデータを格納している不揮発性の記録装置である。格納されるプログラムやデータには、探索装置1の全体を制御する基本ソフトウェア及びアプリケーションソフトウェアがある。例えば、HDD108には、各種のデータベースやプログラム等が格納されてもよい。   The HDD 108 is a non-volatile recording device that stores programs and data. The stored programs and data include basic software and application software that control the entire search device 1. For example, the HDD 108 may store various databases and programs.

外部I/F103は、外部装置とのインタフェースである。外部装置には、記憶媒体103aなどがある。これにより、探索装置1は、外部I/F103を介して記憶媒体103aの読み取り及び/又は書き込みを行うことができる。記憶媒体103aには、CD(Compact Disk)、及びDVD(Digital Versatile Disk)、ならびに、SDメモリカード(SD Memory card)やUSBメモリ(Universal Serial Bus
memory)等がある。
The external I / F 103 is an interface with an external device. The external device includes a storage medium 103a. Accordingly, the search device 1 can read and / or write to the storage medium 103a via the external I / F 103. The storage medium 103a includes a CD (Compact Disk), a DVD (Digital Versatile Disk), an SD memory card (SD Memory card), and a USB memory (Universal Serial Bus).
memory).

ROM105は、電源を切っても内部データを保持することができる不揮発性の半導体メモリ(記録装置)である。ROM105には、ネットワーク設定等のプログラム及びデータが格納されている。RAM104は、プログラムやデータを一時保持する揮発性の半導体メモリ(記録装置)である。CPU106は、上記記録装置(例えば「HDD108」や「ROM105」など)から、プログラムやデータをRAM104上に読み出し、処理を実行することで、装置全体の制御や搭載機能を実現する演算装置である。   The ROM 105 is a nonvolatile semiconductor memory (recording device) that can retain internal data even when the power is turned off. The ROM 105 stores programs and data such as network settings. The RAM 104 is a volatile semiconductor memory (recording device) that temporarily stores programs and data. The CPU 106 is an arithmetic unit that realizes control of the entire apparatus and mounting functions by reading a program and data from the recording device (for example, “HDD 108” and “ROM 105”) onto the RAM 104 and executing processing.

かかる構成により、本実施形態に係る探索装置1では、CPU106が、ROM105やHDD108内に格納されたデータ及びプログラムを用いてグラフ辺探索処理、経路出力処理、中間地点選出処理、クラス類似度の算出処理及優先探索節点選出処理を実行する。なお、メソッド保持関係グラフデータ格納部のに記憶された情報は、RAM104、HDD108、又はネットワークを介して探索装置1に接続されるクラウド上のサーバ等に格納され得る。   With this configuration, in the search device 1 according to the present embodiment, the CPU 106 uses the data and programs stored in the ROM 105 and the HDD 108 to perform graph edge search processing, route output processing, intermediate point selection processing, and class similarity calculation. Processing and priority search node selection processing are executed. The information stored in the method holding relationship graph data storage unit can be stored in the RAM 104, the HDD 108, or a server on the cloud connected to the search device 1 via the network.

以上、探索方法、探索プログラム及び探索装置を上記実施形態により説明したが、本発明にかかる探索方法、探索プログラム及び探索装置は上記実施形態に限定されるものではなく、本発明の範囲内で種々の変形及び改良が可能である。また、上記実施形態及び変形例が複数存在する場合、矛盾しない範囲で組み合わせることができる。   The search method, the search program, and the search device have been described in the above embodiment. However, the search method, the search program, and the search device according to the present invention are not limited to the above-described embodiment, and are various within the scope of the present invention. Modifications and improvements are possible. In addition, when there are a plurality of the above-described embodiments and modifications, they can be combined within a consistent range.

以上の説明に関し、更に以下の項を開示する。
(付記1)
呼出し関係にある複数のメソッドのうち経路探索の起点となる複数のメソッドを結ぶ経路を前記起点となるメソッド毎に並行して経路探索を行う処理をコンピュータが実行する探索方法であって、
前記起点となる前記複数のメソッドからnホップ目の経路探索対象となる経路が複数ある場合、メソッドに対応するクラスを記憶する記憶部を参照して、前記経路で接続された2つのメソッドに対応する経路優先度を算出し、
前記経路優先度に基づき、前記経路探索対象となる複数の経路のうちから経路探索を行う経路を特定し、
特定した前記経路に基づき前記経路探索の起点となる複数のメソッドの経路探索を行う、
探索方法。
(付記2)
経路探索の起点となる中間地点のメソッドを特定し、前記複数のメソッド及び前記中間地点のメソッドを結ぶ経路を、前記中間地点のメソッドを含む前記経路探索の起点となる複数のメソッドのそれぞれから並行して経路探索を行う、
付記1に記載の探索方法。
(付記3)
前記複数のメソッド及び前記中間地点のメソッドに対応するクラス類似度に基づき、経路探索の起点となる前記中間地点のメソッドを増やす、
付記2に記載の探索方法。
(付記4)
複数の前記中間地点のメソッドが特定される場合、前記クラス類似度に基づき、前記複数の中間地点のメソッドの優先度を特定し、
特定した前記複数の中間地点のメソッドの優先度に従い、特定した前記複数の中間地点のメソッドのうちから前記経路探索の起点となる中間地点のメソッドを特定し、
特定した前記中間地点のメソッドを含む前記経路探索の起点となる複数のメソッドのそれぞれから並行して経路探索を行う、
付記3に記載の探索方法。
(付記5)
呼出し関係にある複数のメソッドのうち経路探索の起点となる複数のメソッドを結ぶ経路を前記起点のメソッド毎に並行して経路探索を行う処理をコンピュータに実行させる探索プログラムであって、
前記起点となる前記複数のメソッドからnホップ目の経路探索対象となる経路が複数ある場合、メソッドに対応するクラスを記憶する記憶部を参照して、前記経路で接続された2つのメソッドに対応する経路優先度を算出し、
前記経路優先度に基づき、前記経路探索対象となる複数の経路のうちから経路探索を行う経路を特定し、
特定した前記経路に基づき前記経路探索の起点となる複数のメソッドの経路探索を行う、
探索プログラム。
(付記6)
経路探索の起点となる中間地点のメソッドを特定し、前記複数のメソッド及び前記中間地点のメソッドを結ぶ経路を、前記中間地点のメソッドを含む前記経路探索の起点となる複数のメソッドのそれぞれから並行して経路探索を行う、
付記5に記載の探索プログラム。
(付記7)
前記複数のメソッド及び前記中間地点のメソッドに対応するクラス類似度に基づき、経路探索の起点となる前記中間地点のメソッドを増やす、
付記6に記載の探索プログラム。
(付記8)
複数の前記中間地点のメソッドが特定される場合、前記クラス類似度に基づき、前記複数の中間地点のメソッドの優先度を特定し、
特定した前記複数の中間地点のメソッドの優先度に従い、特定した前記複数の中間地点のメソッドのうちから前記経路探索の起点となる中間地点のメソッドを特定し、
特定した前記中間地点のメソッドを含む前記経路探索の起点となる複数のメソッドのそれぞれから並行して経路探索を行う、
付記7に記載の探索プログラム。
(付記9)
呼出し関係にある複数のメソッドのうち経路探索の起点となる複数のメソッドを結ぶ経路を前記起点のメソッド毎に並行して経路探索を行う探索装置であって、
前記起点となる前記複数のメソッドからnホップ目の経路探索対象となる経路が複数ある場合、メソッドに対応するクラスを記憶する記憶部を参照して、前記経路で接続された2つのメソッドに対応する経路優先度を算出する優先探索節点選出部と、
前記経路優先度に基づき、前記経路探索対象となる複数の経路のうちから経路探索を行う経路を特定し、特定した前記経路に基づき前記経路探索の起点となる複数のメソッドの経路探索を行う探索部と、
を有する探索装置。
(付記10)
経路探索の起点となる中間地点のメソッドを特定する中間地点節点選出部を有し、
前記探索部は、前記複数のメソッド及び前記中間地点のメソッドを結ぶ経路を、前記中間地点のメソッドを含む前記経路探索の起点となる複数のメソッドのそれぞれから並行して経路探索を行う、
付記9に記載の探索装置。
(付記11)
前記中間地点節点選出部は、前記複数のメソッド及び前記中間地点のメソッドに対応するクラス類似度に基づき、経路探索の起点となる前記中間地点のメソッドを増やす、
付記10に記載の探索装置。
(付記12)
前記中間地点節点選出部は、複数の前記中間地点のメソッドが特定される場合、前記クラス類似度に基づき、前記複数の中間地点のメソッドの優先度を特定し、特定した前記複数の中間地点のメソッドの優先度に従い、特定した前記複数の中間地点のメソッドのうちから前記経路探索の起点となる中間地点のメソッドを特定し、
前記探索部は、特定した前記中間地点のメソッドを含む前記経路探索の起点となる複数のメソッドのそれぞれから並行して経路探索を行う、
付記11に記載の探索装置。
Regarding the above description, the following items are further disclosed.
(Appendix 1)
A search method in which a computer executes a process of performing a route search in parallel for each method that is a starting point of a route that connects a plurality of methods that are starting points of a route search among a plurality of methods that are in a calling relationship,
When there are a plurality of routes to be searched for the n-th hop from the plurality of methods that are the starting points, the storage unit that stores a class corresponding to the method is referred to, and two methods connected by the route are supported. Calculate the route priority to
Based on the route priority, specify a route to be searched from among a plurality of routes to be searched,
Based on the identified route, a route search of a plurality of methods that are the starting point of the route search is performed.
Search method.
(Appendix 2)
The method of the intermediate point that is the starting point of the route search is specified, and the route that connects the plurality of methods and the method of the intermediate point is parallel from each of the plurality of methods that are the starting points of the route search including the method of the intermediate point To search for a route,
The search method according to attachment 1.
(Appendix 3)
Based on the class similarity corresponding to the plurality of methods and the method of the intermediate point, increase the method of the intermediate point that is the starting point of the route search,
The search method according to attachment 2.
(Appendix 4)
When a plurality of intermediate point methods are specified, the priority of the plurality of intermediate point methods is specified based on the class similarity,
According to the priority of the method of the plurality of intermediate points that have been identified, the method of the intermediate point that is the starting point of the route search from among the methods of the plurality of intermediate points that have been identified,
A route search is performed in parallel from each of a plurality of methods that are the starting points of the route search including the method of the specified intermediate point.
The search method according to attachment 3.
(Appendix 5)
A search program that causes a computer to execute a process of performing a path search in parallel for each method of the starting point, connecting a plurality of methods that are a starting point of path searching among a plurality of methods having a calling relationship,
When there are a plurality of routes to be searched for the n-th hop from the plurality of methods that are the starting points, the storage unit that stores a class corresponding to the method is referred to, and two methods connected by the route are supported. Calculate the route priority to
Based on the route priority, specify a route to be searched from among a plurality of routes to be searched,
Based on the identified route, a route search of a plurality of methods that are the starting point of the route search is performed.
Search program.
(Appendix 6)
The method of the intermediate point that is the starting point of the route search is specified, and the route that connects the plurality of methods and the method of the intermediate point is parallel from each of the plurality of methods that are the starting points of the route search including the method of the intermediate point To search for a route,
The search program according to attachment 5.
(Appendix 7)
Based on the class similarity corresponding to the plurality of methods and the method of the intermediate point, increase the method of the intermediate point that is the starting point of the route search,
The search program according to attachment 6.
(Appendix 8)
When a plurality of intermediate point methods are specified, the priority of the plurality of intermediate point methods is specified based on the class similarity,
According to the priority of the method of the plurality of intermediate points that have been identified, the method of the intermediate point that is the starting point of the route search from among the methods of the plurality of intermediate points that have been identified,
A route search is performed in parallel from each of a plurality of methods that are the starting points of the route search including the method of the specified intermediate point.
The search program according to attachment 7.
(Appendix 9)
A search device that performs a route search in parallel for each method of the starting point, connecting a plurality of methods that become a starting point of a route search among a plurality of methods having a calling relationship,
When there are a plurality of routes to be searched for the n-th hop from the plurality of methods that are the starting points, the storage unit that stores a class corresponding to the method is referred to, and two methods connected by the route are supported. A priority search node selection unit for calculating a route priority to be
Based on the route priority, a route for performing a route search from a plurality of routes to be searched for the route is specified, and a search for performing a route search for a plurality of methods serving as a starting point of the route search based on the specified route. And
A search device having:
(Appendix 10)
It has an intermediate point node selection part that identifies the method of the intermediate point that is the starting point of the route search,
The search unit performs a route search in parallel with each of a plurality of methods serving as a starting point of the route search including the method of the intermediate point, a route connecting the plurality of methods and the method of the intermediate point.
The searching device according to attachment 9.
(Appendix 11)
The intermediate point node selection unit increases the method of the intermediate point that is the starting point of the route search based on the class similarity corresponding to the plurality of methods and the method of the intermediate point,
The search device according to attachment 10.
(Appendix 12)
The intermediate point node selection unit, when a plurality of intermediate point methods are specified, specifies the priority of the plurality of intermediate point methods based on the class similarity, and According to the priority of the method, identify the method of the intermediate point that is the starting point of the route search from among the methods of the plurality of intermediate points that are identified,
The search unit performs a route search in parallel from each of a plurality of methods that are the starting point of the route search including the method of the specified intermediate point.
The search device according to attachment 11.

1:探索装置
10:探索指示部
11:グラフ探索部
12:起点集合格納部
13:記憶部
14:クラス類似度計算部
15:中間地点節点選出部
16:優先探索節点選出部
111:グラフ辺探索部
112:要訪問節点集合格納部
113:訪問済節点集合格納部
114:先行及び後続節点格納部
131:呼出し関係グラフデータ格納部
132:メソッド保持関係グラフデータ格納部
1: Search device 10: Search instruction unit 11: Graph search unit 12: Origin set storage unit 13: Storage unit 14: Class similarity calculation unit 15: Intermediate point node selection unit 16: Priority search node selection unit 111: Graph edge search Unit 112: Visited node set storage unit required 113: Visited node set storage unit 114: Predecessor and subsequent node storage unit 131: Call relationship graph data storage unit 132: Method holding relationship graph data storage unit

Claims (6)

呼出し関係にある複数のメソッドのうち経路探索の起点となる複数のメソッドを結ぶ経路を前記起点となるメソッド毎に並行して経路探索を行う処理をコンピュータが実行する探索方法であって、
前記起点となる前記複数のメソッドからnホップ目の経路探索対象となる経路が複数ある場合、メソッドに対応するクラスを記憶する記憶部を参照して、前記経路で接続された2つのメソッドに対応する経路優先度を算出し、
前記経路優先度に基づき、前記経路探索対象となる複数の経路のうちから経路探索を行う経路を特定し、
特定した前記経路に基づき前記経路探索の起点となる複数のメソッドの経路探索を行う、
探索方法。
A search method in which a computer executes a process of performing a route search in parallel for each method that is a starting point of a route that connects a plurality of methods that are starting points of a route search among a plurality of methods that are in a calling relationship,
When there are a plurality of routes to be searched for the n-th hop from the plurality of methods that are the starting points, the storage unit that stores a class corresponding to the method is referred to, and two methods connected by the route are supported. Calculate the route priority to
Based on the route priority, specify a route to be searched from among a plurality of routes to be searched,
Based on the identified route, a route search of a plurality of methods that are the starting point of the route search is performed.
Search method.
経路探索の起点となる中間地点のメソッドを特定し、前記複数のメソッド及び前記中間地点のメソッドを結ぶ経路を、前記中間地点のメソッドを含む前記経路探索の起点となる複数のメソッドのそれぞれから並行して経路探索を行う、
請求項1に記載の探索方法。
The method of the intermediate point that is the starting point of the route search is specified, and the route that connects the plurality of methods and the method of the intermediate point is parallel from each of the plurality of methods that are the starting points of the route search including the method of the intermediate point To search for a route,
The search method according to claim 1.
前記複数のメソッド及び前記中間地点のメソッドに対応するクラス類似度に基づき、経路探索の起点となる前記中間地点のメソッドを増やす、
請求項2に記載の探索方法。
Based on the class similarity corresponding to the plurality of methods and the method of the intermediate point, increase the method of the intermediate point that is the starting point of the route search,
The search method according to claim 2.
複数の前記中間地点のメソッドが特定される場合、前記クラス類似度に基づき、前記複数の中間地点のメソッドの優先度を特定し、
特定した前記複数の中間地点のメソッドの優先度に従い、特定した前記複数の中間地点のメソッドのうちから前記経路探索の起点となる中間地点のメソッドを特定し、
特定した前記中間地点のメソッドを含む前記経路探索の起点となる複数のメソッドのそれぞれから並行して経路探索を行う、
請求項3に記載の探索方法。
When a plurality of intermediate point methods are specified, the priority of the plurality of intermediate point methods is specified based on the class similarity,
According to the priority of the method of the plurality of intermediate points that have been identified, the method of the intermediate point that is the starting point of the route search from among the methods of the plurality of intermediate points that have been identified,
A route search is performed in parallel from each of a plurality of methods that are the starting points of the route search including the method of the specified intermediate point.
The search method according to claim 3.
呼出し関係にある複数のメソッドのうち経路探索の起点となる複数のメソッドを結ぶ経路を前記起点のメソッド毎に並行して経路探索を行う処理をコンピュータに実行させる探索プログラムであって、
前記起点となる前記複数のメソッドからnホップ目の経路探索対象となる経路が複数ある場合、メソッドに対応するクラスを記憶する記憶部を参照して、前記経路で接続された2つのメソッドに対応する経路優先度を算出し、
前記経路優先度に基づき、前記経路探索対象となる複数の経路のうちから経路探索を行う経路を特定し、
特定した前記経路に基づき前記経路探索の起点となる複数のメソッドの経路探索を行う、
探索プログラム。
A search program that causes a computer to execute a process of performing a path search in parallel for each method of the starting point, connecting a plurality of methods that are a starting point of path searching among a plurality of methods having a calling relationship,
When there are a plurality of routes to be searched for the n-th hop from the plurality of methods that are the starting points, the storage unit that stores a class corresponding to the method is referred to, and two methods connected by the route are supported. Calculate the route priority to
Based on the route priority, specify a route to be searched from among a plurality of routes to be searched,
Based on the identified route, a route search of a plurality of methods that are the starting point of the route search is performed.
Search program.
呼出し関係にある複数のメソッドのうち経路探索の起点となる複数のメソッドを結ぶ経路を前記起点のメソッド毎に並行して経路探索を行う探索装置であって、
前記起点となる前記複数のメソッドからnホップ目の経路探索対象となる経路が複数ある場合、メソッドに対応するクラスを記憶する記憶部を参照して、前記経路で接続された2つのメソッドに対応する経路優先度を算出する優先探索節点選出部と、
前記経路優先度に基づき、前記経路探索対象となる複数の経路のうちから経路探索を行う経路を特定し、特定した前記経路に基づき前記経路探索の起点となる複数のメソッドの経路探索を行う探索部と、
を有する探索装置。
A search device that performs a route search in parallel for each method of the starting point, connecting a plurality of methods that become a starting point of a route search among a plurality of methods having a calling relationship,
When there are a plurality of routes to be searched for the n-th hop from the plurality of methods that are the starting points, the storage unit that stores a class corresponding to the method is referred to, and two methods connected by the route are supported. A priority search node selection unit for calculating a route priority to be
Based on the route priority, a route for performing a route search from a plurality of routes to be searched for the route is specified, and a search for performing a route search for a plurality of methods serving as a starting point of the route search based on the specified route. And
A search device having:
JP2015188352A 2015-09-25 2015-09-25 Search method, search program and search device Expired - Fee Related JP6512050B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2015188352A JP6512050B2 (en) 2015-09-25 2015-09-25 Search method, search program and search device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015188352A JP6512050B2 (en) 2015-09-25 2015-09-25 Search method, search program and search device

Publications (2)

Publication Number Publication Date
JP2017062710A true JP2017062710A (en) 2017-03-30
JP6512050B2 JP6512050B2 (en) 2019-05-15

Family

ID=58428931

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015188352A Expired - Fee Related JP6512050B2 (en) 2015-09-25 2015-09-25 Search method, search program and search device

Country Status (1)

Country Link
JP (1) JP6512050B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230222010A1 (en) * 2022-01-10 2023-07-13 Nvidia Corporation Application programming interface to indicate execution of graph nodes

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003233768A (en) * 2002-02-12 2003-08-22 Univ Tokyo Dual dijkstra's algorithm for searching a plurality of routes
JP2013218637A (en) * 2012-04-12 2013-10-24 Nippon Telegr & Teleph Corp <Ntt> Search range limiting device, method, and program

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003233768A (en) * 2002-02-12 2003-08-22 Univ Tokyo Dual dijkstra's algorithm for searching a plurality of routes
JP2013218637A (en) * 2012-04-12 2013-10-24 Nippon Telegr & Teleph Corp <Ntt> Search range limiting device, method, and program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230222010A1 (en) * 2022-01-10 2023-07-13 Nvidia Corporation Application programming interface to indicate execution of graph nodes

Also Published As

Publication number Publication date
JP6512050B2 (en) 2019-05-15

Similar Documents

Publication Publication Date Title
Lattanzi et al. Online scheduling via learned weights
CN110390396B (en) Method, device and system for estimating causal relationship between observed variables
CN105745647B (en) Call path finder
Quick et al. Using pregel-like large scale graph processing frameworks for social network analysis
US9581454B2 (en) Route information processing apparatus and route information processing method
CN111460311A (en) Search processing method, device and equipment based on dictionary tree and storage medium
US11222088B2 (en) Determining feasible itinerary solutions
JP6613475B2 (en) Route inquiry method, apparatus, device, and non-volatile computer storage medium
US20100332436A1 (en) Multi-pairs shortest path finding method and system
US9262213B1 (en) Dynamic suggestion of next task based on task navigation information
CN113015970A (en) Partitioning knowledge graph
CN111723933B (en) Training method of neural network model and related products
JP2018531379A6 (en) Route inquiry method, apparatus, device, and non-volatile computer storage medium
JP2020135207A (en) Route search method, route search program, route search device and route search data structure
JP2015161557A5 (en)
EP4052261A1 (en) Designing a molecule and determining a route to its synthesis
JP2017134582A (en) Graphic index search device and operation method for graphic index search device
JPWO2010058785A1 (en) Route calculation order determination method, program, and calculation apparatus
JP6512050B2 (en) Search method, search program and search device
Pavelski et al. Meta-learning for optimization: A case study on the flowshop problem using decision trees
CN102999558A (en) Processing search queries using a data structure
KR20190050575A (en) Flying path searching method for unmanned aerial vehicle
US20120310944A1 (en) Dictionary creation device
JP6672711B2 (en) Path graph generation method, apparatus, and program
JP7112003B2 (en) Search control program, search control method and search control device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20180608

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20190228

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: 20190312

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20190325

R150 Certificate of patent or registration of utility model

Ref document number: 6512050

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees