JP2015075960A - Graph generating device, graph generating method, and graph generating program - Google Patents

Graph generating device, graph generating method, and graph generating program Download PDF

Info

Publication number
JP2015075960A
JP2015075960A JP2013212281A JP2013212281A JP2015075960A JP 2015075960 A JP2015075960 A JP 2015075960A JP 2013212281 A JP2013212281 A JP 2013212281A JP 2013212281 A JP2013212281 A JP 2013212281A JP 2015075960 A JP2015075960 A JP 2015075960A
Authority
JP
Japan
Prior art keywords
node
graph
data
layout
layout position
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
JP2013212281A
Other languages
Japanese (ja)
Other versions
JP6028703B2 (en
Inventor
瑶平 岩崎
Yohei Iwasaki
瑶平 岩崎
博昭 木村
Hiroaki Kimura
博昭 木村
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.)
NS Solutions Corp
Original Assignee
NS Solutions Corp
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 NS Solutions Corp filed Critical NS Solutions Corp
Priority to JP2013212281A priority Critical patent/JP6028703B2/en
Publication of JP2015075960A publication Critical patent/JP2015075960A/en
Application granted granted Critical
Publication of JP6028703B2 publication Critical patent/JP6028703B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Processing Or Creating Images (AREA)
  • Image Generation (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a graph generating device, a graph generating method, and a graph generating program that are capable of easily generating a graph of a layout intended by a user.SOLUTION: Area determination means 532 determines a shape and size of an area required for laying out an entire selection node selected by using an input device 10. Second layout-position calculation means 533 replaces the entire selection node with one tentative node having the shape and size of the determined area, and calculates a layout position for the tentative node and nodes other than the selection node. Third layout-position calculation means 534 executes processing according to the Sugiyama algorithm on the basis of graph structure data, under the condition that a relative positional relationship are maintained for the tentative node and the nodes other than the selection node defined in accordance with the result calculated by the second layout-position calculation means 533, and under the condition that the entire selection node is laid out in place of the tentative node.

Description

本発明は、複数のノードとノード間を接続する複数のエッジとを含むグラフを生成して表示装置の画面に表示するグラフ生成装置、グラフ生成方法及びグラフ生成プログラムに関するものである。   The present invention relates to a graph generation device, a graph generation method, and a graph generation program for generating a graph including a plurality of nodes and a plurality of edges connecting the nodes and displaying the graph on a screen of a display device.

従来、複雑なデータを目視で確認し易くするためにチャートや表やグラフが用いられている。ここでいうグラフとは、データ同士の関連を可視化するための図のことであり、統計データを表示するための図、例えば、データの時間変化を示すための折れ線グラフ、各データの大小関係や各データが全体に対して占める割合を表すための円グラフや棒グラフとは区別される。また、システム開発においては、例えば、システムの設計情報や構造を可視化するためにクラス図が用いられ、システムプログラムのサブルーチン同士の呼び出し関係を示すためにコールグラフが用いられるが、これらのクラス図やコールグラフもここでいうグラフの一種である。   Conventionally, charts, tables, and graphs are used to make it easy to visually confirm complicated data. A graph here is a figure for visualizing the relation between data, a figure for displaying statistical data, for example, a line graph for showing a time change of data, a magnitude relation of each data, It is distinguished from a pie chart or a bar chart for representing the ratio of each data to the whole. In system development, for example, class diagrams are used to visualize system design information and structures, and call graphs are used to show the calling relationships between subroutines in system programs. The call graph is also a kind of graph here.

一般に、グラフは複数のノードと複数のエッジとによって構成される。ノードとはデータを表す点のことであるが、グラフ上では、大抵、大きさを有する図形で表現される。エッジはノード間を繋ぐ辺であり、グラフ上では直線又は折れ線等で表現される。グラフを生成する際には、ユーザがグラフ構造を把握しやすいように複数のノード及び複数のエッジをレイアウトすることが望まれる。このため、例えばエッジが向きを持つ有向グラフを生成する場合には、「エッジの単一方向性」、「エッジの長さの最短性」、「エッジの交差数の最小性」、「エッジの垂直性」、「ノードの一貫性」といった条件を可能な限り満たすように複数のノード及び複数のエッジをレイアウトする必要がある。ここで、「エッジの単一方向性」とは、各エッジが同じ方向を向いていることであり、「エッジの長さの最短性」とは、各エッジをその長さができるだけ短くなるように表現することであり、「エッジの交差数の最小性」とは、交差しているエッジの数ができるだけ少なくすることであり、「エッジの垂直性」とは、各エッジを折れ線ではなく直線で表現することであり、そして、「ノードの一貫性」とは、グラフ内において同一のノードが複数箇所に現れず、一箇所だけに現れるようにすることである。   In general, a graph is composed of a plurality of nodes and a plurality of edges. A node is a point representing data, but is usually represented by a graphic having a size on a graph. An edge is an edge connecting nodes, and is represented by a straight line or a broken line on the graph. When generating a graph, it is desirable to lay out a plurality of nodes and a plurality of edges so that the user can easily grasp the graph structure. For this reason, for example, when generating a directed graph in which the edges are oriented, the “edge unidirectionality”, “edge length shortest”, “edge crossing minimum”, “edge vertical” It is necessary to lay out a plurality of nodes and a plurality of edges so as to satisfy the conditions such as “ness” and “node consistency” as much as possible. Here, “edge unidirectionality” means that each edge points in the same direction, and “edge length shortest” means that each edge is as short as possible. "Minimum number of intersecting edges" means that the number of intersecting edges is as small as possible. "Edge perpendicularity" means that each edge is a straight line instead of a broken line. The “node consistency” means that the same node does not appear in a plurality of places in the graph but appears only in one place.

小規模なグラフに対しては、上記の各条件を満たすように複数のノード及び複数のエッジを手作業でレイアウトすることは可能であるが、大多数のノード及び大多数のエッジを含む大規模なグラフに対しては、複数のノード及び複数のエッジを手作業でレイアウトするのは困難である。このため、現在では、コンピュータを利用して、上記の各条件をできるだけ満たすようにグラフのレイアウトを自動で行うことが提案されている(例えば、特許文献1,2参照。)。この場合、グラフのレイアウトは、グラフレイアウトアルゴリズムに従って行われる。このようなグラフレイアウトアルゴリズムとしては様々なものがあるが、特に、有向グラフの階層レイアウトの分野においては、Sugiyamaアルゴリズムが有名である(例えば、非特許文献1,2参照。)。以下、Sugiyamaアルゴリズムの概要について説明する。   For small graphs, it is possible to manually lay out multiple nodes and multiple edges to satisfy each of the above conditions, but a large scale that includes the majority of nodes and the majority of edges. For a simple graph, it is difficult to manually lay out a plurality of nodes and a plurality of edges. Therefore, at present, it has been proposed to automatically perform graph layout so as to satisfy each of the above conditions as much as possible using a computer (see, for example, Patent Documents 1 and 2). In this case, the layout of the graph is performed according to a graph layout algorithm. There are various types of such graph layout algorithms. In particular, the Sugiyama algorithm is well-known in the field of hierarchical layout of directed graphs (see, for example, Non-Patent Documents 1 and 2). Hereinafter, an overview of the Sugiyama algorithm will be described.

Sugiyamaアルゴリズムは、有向グラフの階層レイアウトを行うためのアルゴリズムである。このSugiyamaアルゴリズムでは、有向グラフとして有向非循環グラフを想定している。図18はSugiyamaアルゴリズムを説明するための図である。図18に示すように、Sugiyamaアルゴリズムは、階層割当てを行う第一ステップ(階層割当てステップ)、ノード順序付けを行う第二ステップ(順序付けステップ)、位置座標付与を行う第三ステップ(座標付与ステップ)という三つのステップから構成される。   The Sugiyama algorithm is an algorithm for performing a hierarchical layout of a directed graph. This Sugiyama algorithm assumes a directed acyclic graph as a directed graph. FIG. 18 is a diagram for explaining the Sugiyama algorithm. As shown in FIG. 18, the Sugiyama algorithm is referred to as a first step (tier assignment step) for assigning layers, a second step (ordering step) for ordering nodes, and a third step (coordinate assigning step) for assigning position coordinates. It consists of three steps.

まず、第一ステップでは、グラフ構造データに基づいて、エッジの長さの最短性やノードの一貫性等の条件をできる限り満たすように、各ノードに対してそれを配置すべき階層を割り当てる。ここで、グラフ構造データには、各ノードについてその形状及び大きさを示すデータ(ノードデータ)と、各エッジについてノードとの接続関係を示すデータ(エッジデータ)とが含まれている。かかるグラフ構造データは予めコンピュータに入力されている。次に、第二ステップでは、各階層において、エッジの交差数の最小性の条件をできる限り満たすように、当該階層が割り当てられた各ノードに対してそれを配置する順序を決定する。そして、第三ステップでは、エッジの垂直性の条件をできる限り満たすように、各ノードの位置を決定し、当該ノードにその位置に関する情報(位置座標)を付与する。こうして、各ノードの位置座標が決定されると、コンピュータは、その各ノードの位置座標に関するデータとグラフ構造データとに基づいて有向グラフを生成し、表示装置の画面に表示することができる。   First, in the first step, hierarchies where the nodes should be arranged are assigned to each node so as to satisfy conditions such as the shortest edge length and node consistency as much as possible based on the graph structure data. Here, the graph structure data includes data (node data) indicating the shape and size of each node, and data (edge data) indicating a connection relationship with the node for each edge. Such graph structure data is input to the computer in advance. Next, in the second step, in each hierarchy, the order in which the hierarchy is allocated to each node to which the hierarchy is assigned is determined so as to satisfy the minimum condition of the number of edge intersections as much as possible. In the third step, the position of each node is determined so as to satisfy the edge verticality condition as much as possible, and information (position coordinates) regarding the position is given to the node. When the position coordinates of each node are determined in this way, the computer can generate a directed graph based on the data related to the position coordinates of each node and the graph structure data, and display it on the screen of the display device.

尚、Sugiyamaアルゴリズムでは、レイアウトを行う有向グラフとして有向非循環グラフを想定しているが、実際にレイアウトを行う有向グラフは有向循環グラフである場合もある。Sugiyamaアルゴリズムを用いて有向循環グラフのレイアウトを行う場合は、上記三つのステップによる処理を行う前に、循環削除(Cycle
Remove)処理を行うようにすればよい。この循環削除処理では、有向循環グラフについてのグラフ構造データにおいて、エッジを「反転」(エッジの始点と終点を入れ替えること)もしくは「削除」することにより、有向非循環グラフについてのグラフ構造データを作成する。そして、この作成したグラフ構造データに対して上記三つのステップによる処理を行い、グラフのレイアウトを行う。最後に、「反転」若しくは「削除」したエッジを元に戻すことにより、有向循環グラフが生成される。
In the Sugiyama algorithm, a directed acyclic graph is assumed as a directed graph for layout, but a directed graph for actual layout may be a directed cyclic graph. When laying out a directed cyclic graph using the Sugiyama algorithm, the cycle deletion (Cycle
Remove) should be performed. In this cyclic deletion process, graph structure data for a directed acyclic graph is obtained by “inverting” (changing the start and end points of the edge) or “deleting” the edge in the graph structure data for the directed cyclic graph. Create The generated graph structure data is processed by the above three steps to perform graph layout. Finally, the directed cyclic graph is generated by restoring the “inverted” or “deleted” edge.

特開2002−312803号公報JP 2002-312803 A 特開2005−323109号公報JP-A-2005-323109

Kozo Sugiyama, Shojiro Tagawa andMitsuhiko Toda, “Methods for visual understanding of hierarchical systemstructures”, IEEE Trans. on Systems, Man, and Cybernetics, vol.SMC-11, no.2,pp.109-125, 1981.Kozo Sugiyama, Shojiro Tagawa and Mitsuhiko Toda, “Methods for visual understanding of hierarchical systemstructures”, IEEE Trans. On Systems, Man, and Cybernetics, vol.SMC-11, no.2, pp.109-125, 1981. Hugo A. D. do Nasciment and PeterEades, “User Hints for Directed Graph Drawing”, Graph Drawing, pp.205-219,2001.Hugo A. D. do Nasciment and PeterEades, “User Hints for Directed Graph Drawing”, Graph Drawing, pp.205-219, 2001.

しかしながら、コンピュータを利用してグラフのレイアウトを行う場合、上述した各条件をできるだけ満たすようなグラフが生成されるため、その生成されたグラフは必ずしもユーザが意図したグラフにならないことが多い。例えば、コンピュータを利用してグラフのレイアウトを行うと、エッジの交差数が少なくなるようなグラフを作成することはできるが、ノードの持つ意味やユーザの考えをレイアウトに反映することができない。   However, when a graph is laid out using a computer, a graph that satisfies the above-described conditions as much as possible is generated. Therefore, the generated graph is not necessarily a graph intended by the user. For example, if a graph is laid out using a computer, a graph can be created so that the number of edge intersections is reduced, but the meaning of nodes and the user's thoughts cannot be reflected in the layout.

また、グラフのレイアウトを行って得られたグラフがユーザの意図したレイアウトのグラフになっていない場合には、ユーザがグラフを手作業で修正することになる。しかし、例えば大規模なシステムのコールグラフでは、それに含まれるノードの数が数万個になることもあり、このようなコールグラフを手作業で修正するというのはほとんど不可能である。また、上記非特許文献2に記載されているように条件を課してグラフを自動で修正する方法も存在するが、このグラフの自動修正方法では、あくまで二つのノードに対してそれらが満たすべき条件を指定してグラフの修正を行うことができるだけであり、一度に多くのノードに対して同じ条件を課してグラフを修正することはできない。このため、この場合も、条件を課すノードが多ければ、グラフを修正するのは困難である。   In addition, when the graph obtained by performing the layout of the graph is not the graph of the layout intended by the user, the user manually corrects the graph. However, for example, in a call graph of a large-scale system, the number of nodes included in the call graph may be tens of thousands, and it is almost impossible to manually correct such a call graph. In addition, as described in Non-Patent Document 2, there is a method of automatically correcting a graph by imposing conditions. However, in this automatic correction method of a graph, they should satisfy only two nodes. The graph can only be corrected by specifying a condition, and the graph cannot be corrected by imposing the same condition on many nodes at once. For this reason, also in this case, if there are many nodes that impose conditions, it is difficult to correct the graph.

本発明は上記事情に基づいてなされたものであり、ユーザが意図したレイアウトのグラフを容易に生成することができるグラフ生成装置、グラフ生成方法及びグラフ生成プログラムを提供することを目的とするものである。   The present invention has been made based on the above circumstances, and an object thereof is to provide a graph generation device, a graph generation method, and a graph generation program that can easily generate a graph having a layout intended by a user. is there.

上記の目的を達成するための本発明に係るグラフ生成装置は、複数のノードとノード間を接続する複数のエッジとを含むグラフを生成して表示手段の画面に表示するグラフ生成装置において、各ノードについてその形状及び大きさを示すデータと各エッジについてノードとの接続関係を示すデータとを含むグラフ構造データが記憶された記憶手段と、記憶手段に記憶されているグラフ構造データに基づいて表示手段の画面に表示された複数のノードの中から、ユーザが入力手段を用いて、互いに近接した位置にレイアウトしたいノードを選択ノードとして選択したときに、その選択した選択ノードを特定する選択ノード特定データを生成して記憶手段に記憶する選択ノード特定データ生成手段と、記憶手段に記憶されている選択ノード特定データによって特定される選択ノードの全体を一つの仮ノードで置き換えて、所定のグラフレイアウトアルゴリズムに従った処理を実行することにより、仮ノードと選択ノード以外の各ノードとのレイアウト位置を算出した後、その算出された仮ノードのレイアウト位置に、選択ノードの全体をレイアウトするという条件の下で、記憶手段に記憶されているグラフ構造データに基づいてグラフレイアウトアルゴリズムに従った処理を実行することにより、各ノードのレイアウト位置を算出し、その算出された結果に基づいてグラフを生成して、表示手段の画面に表示するグラフ生成手段と、を備えることを特徴とするものである。ここで、例えば、記憶手段に記憶されているグラフ構造データは有向グラフに対するものであり、グラフレイアウトアルゴリズムは有向グラフの階層レイアウトを行うためのアルゴリズムであってもよい。   In order to achieve the above object, a graph generating apparatus according to the present invention generates a graph including a plurality of nodes and a plurality of edges connecting the nodes, and displays the graph on the screen of the display means. Storage means for storing graph structure data including data indicating the shape and size of nodes and data indicating connection relations with nodes for each edge, and display based on the graph structure data stored in the storage means When a user selects a node to be laid out at a position close to each other as a selection node from among a plurality of nodes displayed on the screen of the means, a selection node specification that specifies the selected selection node is selected. A selected node specifying data generating means for generating data and storing it in the storing means; and a selected node specifying data stored in the storing means. After calculating the layout position between the temporary node and each node other than the selected node by replacing the entire selected node specified by the data with one temporary node and executing processing according to a predetermined graph layout algorithm By executing a process according to the graph layout algorithm based on the graph structure data stored in the storage means under the condition that the entire selected node is laid out at the calculated temporary node layout position. And a graph generation unit that calculates a layout position of each node, generates a graph based on the calculated result, and displays the graph on a screen of the display unit. Here, for example, the graph structure data stored in the storage means is for a directed graph, and the graph layout algorithm may be an algorithm for performing a hierarchical layout of the directed graph.

ここで、グラフ生成手段は、選択ノード特定データ生成手段で得られた選択ノード特定データに基づいてグラフ構造データから選択ノードに関連するデータを抽出し、その抽出した選択ノードに関連するデータに基づいてグラフレイアウトアルゴリズムに従った処理を実行することにより、各選択ノードのレイアウト位置を算出する第一のレイアウト位置算出手段と、第一のレイアウト位置算出手段で得られた各選択ノードのレイアウト位置に関するデータに基づいて、選択ノードの全体をレイアウトするのに必要な領域の形状・大きさを決定する領域決定手段と、選択ノードの全体を、領域決定手段で決定された領域の形状・大きさと同じ形状・大きさを有する一つの仮ノードで置き換え、仮ノードの形状・大きさに関するデータ、仮ノードとの接続関係を示すデータ、及び、前記グラフ構造データのうち前記選択ノード以外の各ノードに関連するデータに基づいて、前記グラフレイアウトアルゴリズムに従った処理を実行することにより、前記仮ノードと前記選択ノード以外の各ノードとのレイアウト位置を算出する第二のレイアウト位置算出手段と、第二のレイアウト位置算出手段で得られた仮ノードと選択ノード以外の各ノードとのレイアウト位置に関するデータによって定められる仮ノード及び選択ノード以外の各ノードについての相対的な位置関係を維持するという条件、及び、仮ノードの代わりに選択ノードの全体をレイアウトするという条件の下で、グラフ構造データに基づいてグラフレイアウトアルゴリズムに従った処理を実行することにより、グラフ構造データに記述されている各ノードのレイアウト位置を算出する第三のレイアウト位置算出手段と、第三のレイアウト位置算出手段で得られた各ノードのレイアウト位置に関するデータとグラフ構造データとに基づいてグラフを生成し、表示手段の画面に表示するグラフ表示処理手段と、を有することが望ましい。   Here, the graph generating means extracts data related to the selected node from the graph structure data based on the selected node specifying data obtained by the selected node specifying data generating means, and based on the data related to the extracted selected node. First layout position calculating means for calculating the layout position of each selected node by executing processing according to the graph layout algorithm, and the layout position of each selected node obtained by the first layout position calculating means. Based on the data, the area determining means for determining the shape and size of the area necessary for laying out the entire selected node, and the entire selected node is the same as the area shape and size determined by the area determining means. Replace with one temporary node with shape / size, data on shape / size of temporary node, temporary no By executing processing according to the graph layout algorithm based on data indicating a connection relationship with the data and data related to each node other than the selected node in the graph structure data, the temporary node and the Defined by second layout position calculation means for calculating the layout position with each node other than the selected node, and data regarding the layout position between the temporary node and each node other than the selected node obtained by the second layout position calculation means. Graph based on the graph structure data under the condition that the relative positional relationship of each node other than the temporary node and the selected node is maintained and the entire selected node is laid out instead of the temporary node. By executing processing according to the layout algorithm, graph structure data A graph based on the third layout position calculation means for calculating the layout position of each node described in the above, data on the layout position of each node obtained by the third layout position calculation means, and the graph structure data It is desirable to have a graph display processing means for generating and displaying on the screen of the display means.

上記の構成により、本発明に係るグラフ生成装置は、入力手段を用いて選択された選択ノードの全体を一つの仮ノードで置き換えて、仮ノードと選択ノード以外の各ノードとについてのレイアウト位置を算出した後、その算出された仮ノードのレイアウト位置に、選択ノードの全体をレイアウトするという条件の下に、グラフ構造データに基づいて所定のグラフレイアウトアルゴリズムに従った処理を実行して、グラフのレイアウトを行う。このため、グラフ上には、選択ノードの全体が互いに近接した位置にレイアウトされるので、ユーザが意図したレイアウトのグラフを容易に生成することができる。   With the above configuration, the graph generation apparatus according to the present invention replaces the entire selection node selected using the input unit with one temporary node, and determines the layout position for each node other than the temporary node and the selection node. After the calculation, a process according to a predetermined graph layout algorithm is executed based on the graph structure data under the condition that the entire selected node is laid out at the calculated temporary node layout position. Do the layout. For this reason, since the entire selected nodes are laid out on the graph at positions close to each other, a graph having a layout intended by the user can be easily generated.

また、本発明に係るグラフ生成装置は、グラフ構造データに基づいてグラフレイアウトアルゴリズムに従った処理を実行することによりグラフを生成し、表示手段の画面に表示する基本グラフ生成手段を備え、選択ノード特定データ生成手段は、基本グラフ生成手段によって表示手段の画面に表示されたグラフにおいて、ユーザが入力手段を用いて、互いに近接した位置にレイアウトしたいノードを選択ノードとして選択したときに、その選択した選択ノードを特定する選択ノード特定データを生成することが望ましい。これにより、ユーザは表示手段の画面に表示されたグラフを見ながら、そのグラフに含まれるノードの中から所望のノードを選択することができるので、選択ノードの選択を容易に行うことができる。   The graph generation apparatus according to the present invention includes a basic graph generation unit that generates a graph by executing processing according to a graph layout algorithm based on the graph structure data, and displays the graph on the screen of the display unit. In the graph displayed on the screen of the display unit by the basic graph generation unit, the specific data generation unit is selected when the user selects a node to be laid out at a position close to each other using the input unit as a selection node. It is desirable to generate selection node specifying data for specifying the selection node. As a result, the user can select a desired node from among the nodes included in the graph while viewing the graph displayed on the screen of the display means, so that the selected node can be easily selected.

また、上記の目的を達成するための本発明に係るグラフ生成方法は、コンピュータを利用して、複数のノードとノード間を接続する複数のエッジとを含むグラフを生成してコンピュータの表示手段の画面に表示するグラフ生成方法において、コンピュータの記憶手段に記憶されている、各ノードについてその形状及び大きさを示すデータと各エッジについてノードとの接続関係を示すデータとを含むグラフ構造データに基づいて表示手段の画面に表示された複数のノードの中から、ユーザがコンピュータの入力手段を用いて、互いに近接した位置にレイアウトしたいノードを選択ノードとして選択したときに、コンピュータの制御手段が、その選択した選択ノードを特定する選択ノード特定データを生成して記憶手段に記憶する選択ノード特定データ生成ステップと、制御手段が、記憶手段に記憶されている選択ノード特定データによって特定される選択ノードの全体を一つの仮ノードで置き換えて、所定のグラフレイアウトアルゴリズムに従った処理を実行することにより、仮ノードと選択ノード以外の各ノードとのレイアウト位置を算出した後、その算出された仮ノードのレイアウト位置に、選択ノードの全体をレイアウトするという条件の下で、記憶手段に記憶されているグラフ構造データに基づいてグラフレイアウトアルゴリズムに従った処理を実行することにより、各ノードのレイアウト位置を算出し、その算出された結果に基づいてグラフを生成して、表示手段の画面に表示するグラフ生成ステップと、を具備することを特徴とするものである。ここで、例えば、記憶手段に記憶されているグラフ構造データは有向グラフに対するものであり、グラフレイアウトアルゴリズムは有向グラフの階層レイアウトを行うためのアルゴリズムであってもよい。   The graph generation method according to the present invention for achieving the above object uses a computer to generate a graph including a plurality of nodes and a plurality of edges connecting the nodes, and In the graph generation method to be displayed on the screen, based on graph structure data including data indicating the shape and size of each node and data indicating the connection relationship between the nodes and each edge stored in the storage unit of the computer When the user selects a node to be laid out at a position close to each other using the computer input means from among the plurality of nodes displayed on the display means screen, the computer control means A selection node specific data for generating selection node specifying data for specifying the selected selection node and storing it in the storage means. The data generation step and the control means replace the entire selected node specified by the selected node specifying data stored in the storage means with one temporary node, and execute processing according to a predetermined graph layout algorithm Thus, after calculating the layout position of the temporary node and each node other than the selected node, it is stored in the storage means under the condition that the entire selected node is laid out at the calculated layout position of the temporary node. The layout position of each node is calculated by executing processing according to the graph layout algorithm based on the existing graph structure data, and a graph is generated based on the calculated result and displayed on the screen of the display means. And a graph generation step. Here, for example, the graph structure data stored in the storage means is for a directed graph, and the graph layout algorithm may be an algorithm for performing a hierarchical layout of the directed graph.

ここで、グラフ生成ステップは、制御手段が、選択ノード特定データ生成ステップで得られた選択ノード特定データに基づいてグラフ構造データから選択ノードに関連するデータを抽出し、その抽出した選択ノードに関連するデータに基づいてグラフレイアウトアルゴリズムに従った処理を実行することにより、各選択ノードのレイアウト位置を算出する第一ステップと、制御手段が、第一ステップで得られた各選択ノードのレイアウト位置に関するデータに基づいて、選択ノードの全体をレイアウトするのに必要な領域の形状・大きさを決定する第二ステップと、制御手段が、選択ノードの全体を、第二ステップで決定された領域の形状・大きさと同じ形状・大きさを有する一つの仮ノードで置き換え、仮ノードの形状・大きさに関するデータ、仮ノードとの接続関係を示すデータ、及び、グラフ構造データのうち選択ノード以外の各ノードに関連するデータに基づいて、グラフレイアウトアルゴリズムに従った処理を実行することにより、仮ノードと選択ノード以外の各ノードとのレイアウト位置を算出する第三ステップと、制御手段が、第三ステップで得られた仮ノードと選択ノード以外の各ノードとのレイアウト位置に関するデータによって定められる仮ノード及び選択ノード以外の各ノードについての相対的な位置関係を維持するという条件、及び、仮ノードの代わりに選択ノードの全体をレイアウトするという条件の下で、グラフ構造データに基づいてグラフレイアウトアルゴリズムに従った処理を実行することにより、グラフ構造データに記述されている各ノードのレイアウト位置を算出する第四ステップと、制御手段が、第四ステップで得られた各ノードのレイアウト位置に関するデータとグラフ構造データとに基づいてグラフを生成し、表示手段の画面に表示する第五ステップと、を備えることが望ましい。   Here, in the graph generation step, the control means extracts data related to the selected node from the graph structure data based on the selected node specifying data obtained in the selected node specifying data generating step, and relates to the extracted selected node. The first step of calculating the layout position of each selected node by executing processing according to the graph layout algorithm based on the data to be processed, and the control means relate to the layout position of each selected node obtained in the first step Based on the data, the second step of determining the shape and size of the area necessary for laying out the entire selected node, and the control means determines the entire selected node as the area shape determined in the second step.・ Replace with a temporary node that has the same shape and size as the size, and change the shape and size of the temporary node. Select a temporary node by executing a process according to the graph layout algorithm based on the data indicating the connection relationship with the temporary node and the data related to each node other than the selected node in the graph structure data. A third step of calculating a layout position with each node other than the node, and a temporary node and a selection determined by the control means based on data relating to a layout position between the temporary node obtained in the third step and each node other than the selected node The graph layout algorithm was followed based on the graph structure data under the condition that the relative positional relationship of each node other than the node is maintained and the entire selected node is laid out instead of the temporary node. By executing the process, each node described in the graph structure data A fourth step of calculating an out position, and a control unit that generates a graph based on the data regarding the layout position of each node obtained in the fourth step and the graph structure data and displays the graph on the screen of the display unit. And a step.

本発明に係るグラフ生成方法では、コンピュータの制御手段が、入力手段を用いて選択された選択ノードの全体を一つの仮ノードで置き換えて、仮ノードと選択ノード以外の各ノードとについてのレイアウト位置を算出した後、その算出された仮ノードのレイアウト位置に、選択ノードの全体をレイアウトするという条件の下に、グラフ構造データに基づいて所定のグラフレイアウトアルゴリズムに従った処理を実行して、グラフのレイアウトを行う。このため、グラフ上には、選択ノードの全体が互いに近接した位置にレイアウトされるので、ユーザが意図したレイアウトのグラフを容易に生成することができる。   In the graph generation method according to the present invention, the computer control unit replaces the entire selected node selected by using the input unit with one temporary node, and the layout position for each node other than the temporary node and the selected node. After calculating the graph, a process according to a predetermined graph layout algorithm is executed on the basis of the graph structure data under the condition that the entire selected node is laid out at the calculated temporary node layout position. Do the layout. For this reason, since the entire selected nodes are laid out on the graph at positions close to each other, a graph having a layout intended by the user can be easily generated.

更に、上記の目的を達成するための本発明に係るグラフ生成プログラムは、コンピュータを利用して、複数のノードとノード間を接続する複数のエッジとを含むグラフを生成してコンピュータの表示手段の画面に表示するためのグラフ生成プログラムにおいて、コンピュータに、コンピュータの記憶手段に記憶されている、各ノードについてその形状及び大きさを示すデータと各エッジについてノードとの接続関係を示すデータとを含むグラフ構造データに基づいて表示手段の画面に表示された複数のノードの中から、ユーザがコンピュータの入力手段を用いて、互いに近接した位置にレイアウトしたいノードを選択ノードとして選択したときに、その選択した選択ノードを特定する選択ノード特定データを生成して記憶手段に記憶する選択ノード特定データ生成機能と、記憶手段に記憶されている選択ノード特定データによって特定される選択ノードの全体を一つの仮ノードで置き換えて、所定のグラフレイアウトアルゴリズムに従った処理を実行することにより、仮ノードと選択ノード以外の各ノードとのレイアウト位置を算出した後、その算出された仮ノードのレイアウト位置に、選択ノードの全体をレイアウトするという条件の下で、記憶手段に記憶されているグラフ構造データに基づいてグラフレイアウトアルゴリズムに従った処理を実行することにより、各ノードのレイアウト位置を算出し、その算出された結果に基づいてグラフを生成して、表示手段の画面に表示するグラフ生成機能と、を実現させることを特徴とするものである。ここで、例えば、記憶手段に記憶されているグラフ構造データは有向グラフに対するものであり、グラフレイアウトアルゴリズムは有向グラフの階層レイアウトを行うためのアルゴリズムであってもよい。   Furthermore, a graph generation program according to the present invention for achieving the above object uses a computer to generate a graph including a plurality of nodes and a plurality of edges connecting the nodes, and the display means of the computer. In the graph generation program for displaying on the screen, the computer includes data indicating the shape and size of each node and data indicating the connection relationship between the nodes and each edge, which are stored in the storage unit of the computer. When a user selects a node to be laid out at a position close to each other using a computer input means from among a plurality of nodes displayed on the display means screen based on the graph structure data, the selection is made. A selection node specifying data for specifying the selected selection node, and storing the data in the storage means By executing a process according to a predetermined graph layout algorithm by replacing the entire selection node specified by the node specification data generation function and the selection node specification data stored in the storage means with one temporary node After the layout position of the temporary node and each node other than the selected node is calculated, it is stored in the storage means under the condition that the entire selected node is laid out at the calculated layout position of the temporary node. A graph that calculates the layout position of each node by executing processing according to the graph layout algorithm based on the graph structure data, generates a graph based on the calculated result, and displays it on the screen of the display means The generation function is realized. Here, for example, the graph structure data stored in the storage means is for a directed graph, and the graph layout algorithm may be an algorithm for performing a hierarchical layout of the directed graph.

ここで、グラフ生成機能は、選択ノード特定データ生成機能で得られた選択ノード特定データに基づいてグラフ構造データから選択ノードに関連するデータを抽出し、その抽出した選択ノードに関連するデータに基づいてグラフレイアウトアルゴリズムに従った処理を実行することにより、各選択ノードのレイアウト位置を算出する第一のレイアウト位置算出機能と、第一のレイアウト位置算出機能で得られた各選択ノードのレイアウト位置に関するデータに基づいて、選択ノードの全体をレイアウトするのに必要な領域の形状・大きさを決定する領域決定機能と、選択ノードの全体を、領域決定機能で決定された領域の形状・大きさと同じ形状・大きさを有する一つの仮ノードで置き換え、仮ノードの形状・大きさに関するデータ、仮ノードとの接続関係を示すデータ、及び、グラフ構造データのうち選択ノード以外の各ノードに関連するデータに基づいて、グラフレイアウトアルゴリズムに従った処理を実行することにより、仮ノードと選択ノード以外の各ノードとのレイアウト位置を算出する第二のレイアウト位置算出機能と、第二のレイアウト位置算出機能で得られた仮ノードと選択ノード以外の各ノードとのレイアウト位置に関するデータによって定められる仮ノード及び選択ノード以外の各ノードについての相対的な位置関係を維持するという条件、及び、仮ノードの代わりに選択ノードの全体をレイアウトするという条件の下で、グラフ構造データに基づいてグラフレイアウトアルゴリズムに従った処理を実行することにより、グラフ構造データに記述されている各ノードのレイアウト位置を算出する第三のレイアウト位置算出機能と、第三のレイアウト位置算出機能で得られた各ノードのレイアウト位置に関するデータとグラフ構造データとに基づいてグラフを生成し、表示手段の画面に表示するグラフ表示処理機能と、を備えることが望ましい。   Here, the graph generation function extracts data related to the selection node from the graph structure data based on the selection node specification data obtained by the selection node specification data generation function, and based on the data related to the extracted selection node The first layout position calculation function for calculating the layout position of each selected node by executing processing according to the graph layout algorithm, and the layout position of each selected node obtained by the first layout position calculation function The area determination function that determines the shape and size of the area necessary for laying out the entire selection node based on the data, and the shape and size of the area determined by the area determination function for the entire selection node Replace with one temporary node with shape / size, data on shape / size of temporary node, temporary no By executing the processing according to the graph layout algorithm based on the data indicating the connection relationship with the data and the data related to each node other than the selected node in the graph structure data, Temporary node and selection determined by data relating to layout position between the second layout position calculation function for calculating the layout position with the node and the temporary node obtained by the second layout position calculation function and each node other than the selected node The graph layout algorithm was followed based on the graph structure data under the condition that the relative positional relationship of each node other than the node is maintained and the entire selected node is laid out instead of the temporary node. By executing the process, each described in the graph structure data Generating a graph based on the third layout position calculating function for calculating the layout position of the node, the data relating to the layout position of each node obtained by the third layout position calculating function, and the graph structure data; It is desirable to provide a graph display processing function to be displayed on the screen.

本発明に係るグラフ生成プログラムをコンピュータに適用すると、このコンピュータは、入力手段を用いて選択された選択ノードの全体を一つの仮ノードで置き換えて、仮ノードと選択ノード以外の各ノードとについてのレイアウト位置を算出した後、その算出された仮ノードのレイアウト位置に、選択ノードの全体をレイアウトするという条件の下に、グラフ構造データに基づいて所定のグラフレイアウトアルゴリズムに従った処理を実行して、グラフのレイアウトを行う。このため、グラフ上には、選択ノードの全体が互いに近接した位置にレイアウトされるので、ユーザが意図したレイアウトのグラフを容易に生成することができる。   When the graph generation program according to the present invention is applied to a computer, the computer replaces the entire selected node selected by using the input means with one temporary node, and the temporary node and each node other than the selected node are replaced. After calculating the layout position, a process according to a predetermined graph layout algorithm is executed based on the graph structure data under the condition that the entire selected node is laid out at the calculated layout position of the temporary node. , Layout the graph. For this reason, since the entire selected nodes are laid out on the graph at positions close to each other, a graph having a layout intended by the user can be easily generated.

本発明に係るグラフ生成装置、グラフ生成方法及びグラフ生成プログラムによれば、グラフ上には、ユーザが入力手段を用いて選択した選択ノードの全体が互いに近接した位置にレイアウトされるので、ユーザが意図したレイアウトのグラフを容易に生成することができる。   According to the graph generation device, the graph generation method, and the graph generation program according to the present invention, the entire selection nodes selected by the user using the input unit are laid out on the graph at positions close to each other. A graph with an intended layout can be easily generated.

図1は本発明の一実施形態であるグラフ生成装置の概略ブロック図である。FIG. 1 is a schematic block diagram of a graph generating apparatus according to an embodiment of the present invention. 図2はグラフ構造データの一例を示す図である。FIG. 2 is a diagram illustrating an example of the graph structure data. 図3は本実施形態のグラフ生成装置においてグラフを生成して表示装置の画面に表示する処理の手順を説明するためのフローチャートである。FIG. 3 is a flowchart for explaining a procedure of processing for generating a graph and displaying it on the screen of the display device in the graph generation device of the present embodiment. 図4は第一のグラフ生成手段によって修正された修正エッジデータの例を示す図である。FIG. 4 is a diagram showing an example of corrected edge data corrected by the first graph generating means. 図5は第一のグラフ生成手段によって生成されるレイアウト元データの例を示す図である。FIG. 5 is a diagram showing an example of layout source data generated by the first graph generating means. 図6は図5に示すレイアウト元データに対応する基本グラフを示す図である。FIG. 6 is a diagram showing a basic graph corresponding to the layout source data shown in FIG. 図7(a)はグラフ構造データのうち選択ノードに関連するデータを示す図、図7(b)は第一のレイアウト位置算出手段によって生成される、選択ノードをレイアウトするためのレイアウト元データの例を示す図である。FIG. 7A is a diagram showing data related to the selected node in the graph structure data, and FIG. 7B is layout original data for laying out the selected node generated by the first layout position calculating means. It is a figure which shows an example. 図8は図7(b)に示すレイアウト元データに対応するグラフを示す図である。FIG. 8 is a diagram showing a graph corresponding to the layout source data shown in FIG. 図9は選択ノードを一つの仮ノードで置き換えた場合のグラフ構造データを示す図である。FIG. 9 is a diagram showing graph structure data when the selected node is replaced with one temporary node. 図10は第二のレイアウト位置算出手段によって生成される、仮ノードと選択ノード以外の各ノードとをレイアウトするためのレイアウト元データの例を示す図である。FIG. 10 is a diagram showing an example of layout source data for laying out the temporary node and each node other than the selected node generated by the second layout position calculation means. 図11は図10に示すレイアウト元データに対応するグラフを示す図である。FIG. 11 is a diagram showing a graph corresponding to the layout source data shown in FIG. 図12(a)は第三のレイアウト位置算出手段が階層割当てステップに従った処理を行うことによって決定された各ノードの階層を示す図、図12(b)は第三のレイアウト位置算出手段が順序付けステップに従った処理を行うことによって決定された各ノードの階層及び階層内順序を示す図である。FIG. 12A is a diagram showing the hierarchy of each node determined by the third layout position calculation means performing processing according to the hierarchy assignment step, and FIG. 12B is the third layout position calculation means. It is a figure which shows the hierarchy and order within a hierarchy of each node determined by performing the process according to an ordering step. 図13は第三のレイアウト位置算出手段によって生成される、各ノードをレイアウトするためのレイアウト元データの例を示す図である。FIG. 13 is a diagram showing an example of layout source data for laying out each node generated by the third layout position calculating means. 図14は図13に示すレイアウト元データに対応するグラフを示す図である。FIG. 14 shows a graph corresponding to the layout source data shown in FIG. 図15は仮ノードが中間階層に配置される場合のグラフ生成処理の概要を説明するための図である。FIG. 15 is a diagram for explaining the outline of the graph generation processing when the temporary node is arranged in the intermediate hierarchy. 図16は仮ノードが中間階層に配置される場合のグラフ生成処理の概要を説明するための図である。FIG. 16 is a diagram for explaining the outline of the graph generation processing when the temporary node is arranged in the intermediate hierarchy. 図17は仮ノードが中間階層に配置される場合のグラフ生成処理の概要を説明するための図である。FIG. 17 is a diagram for explaining the outline of the graph generation processing when the temporary node is arranged in the intermediate hierarchy. 図18はSugiyamaアルゴリズムを説明するための図である。FIG. 18 is a diagram for explaining the Sugiyama algorithm.

以下に、図面を参照して、本願に係る発明を実施するための形態について説明する。図1は本発明の一実施形態であるグラフ生成装置の概略ブロック図である。   Hereinafter, embodiments for carrying out the present invention will be described with reference to the drawings. FIG. 1 is a schematic block diagram of a graph generating apparatus according to an embodiment of the present invention.

本実施形態のグラフ生成装置は、複数のノードとノード間を接続する複数のエッジとを含むグラフを生成して画面に表示するものであり、図1に示すように、入力装置10と、表示装置20と、ROM30と、RAM40と、制御部50とを備える。かかるグラフ生成装置は、例えばパーソナルコンピュータにより実現される。   The graph generation apparatus according to the present embodiment generates a graph including a plurality of nodes and a plurality of edges connecting the nodes, and displays the graph on a screen. As illustrated in FIG. The apparatus 20 includes a ROM 30, a RAM 40, and a control unit 50. Such a graph generation device is realized by a personal computer, for example.

入力装置(入力手段)10は、例えば、各種の指示やデータを入力するものである。この入力装置10としては、キーボードやマウス等が用いられる。例えば、ユーザは入力装置10を用いて、グラフを生成するのに必要なグラフ構造データを入力する。また、この入力装置10は、表示装置20の画面に表示された、グラフ構造データに記述されている複数のノードの中から、互いに近接した位置にレイアウトしたいノードを選択ノードとして選択するための選択手段として用いられる。表示装置(表示手段)20は、制御部50によって生成されたグラフを表示するものである。   The input device (input means) 10 is for inputting various instructions and data, for example. As the input device 10, a keyboard, a mouse, or the like is used. For example, the user uses the input device 10 to input graph structure data necessary for generating a graph. Further, the input device 10 is a selection for selecting, as a selection node, a node to be laid out at a position close to each other from among a plurality of nodes described in the graph structure data displayed on the screen of the display device 20 Used as a means. The display device (display unit) 20 displays a graph generated by the control unit 50.

RAM(記憶手段)40には、各種のデータ、例えば、入力装置10を用いて入力されたグラフ構造データや、入力装置10を用いて選択された選択ノードを特定するデータ等が記憶される。本実施形態では、グラフ構造データは、有向非循環グラフに対するものである場合について説明する。図2はグラフ構造データの一例を示す図である。かかるグラフ構造データには、図2に示すように、ノードデータと、エッジデータとが含まれる。ノードデータは、各ノードについてその形状及び大きさ(図形定義情報)を示すものである。例えば、グラフ上においてあるノードを円で表示する場合には、当該ノードについての図形定義情報には、当該ノードの形状が円である旨の内容とその円の半径とが含まれる。また、あるノードを長方形で表示する場合には、当該ノードについての図形定義情報には、当該ノードの形状が長方形である旨の内容とその長方形の縦の長さ及び横の長さとが含まれる。エッジデータは、各エッジについてノードとの接続関係を示すものである。有向グラフにおけるエッジは向きを持っており、この向きはエッジの始点から終点への向きとして特定される。具体的に、各エッジについてのエッジデータには、当該エッジの始点に接続されるノード(始点ノード)とその終点に接続されるノード(終点ノード)とを特定するデータが含まれる。   The RAM (storage means) 40 stores various types of data, for example, graph structure data input using the input device 10, data specifying a selected node selected using the input device 10, and the like. In the present embodiment, the case where the graph structure data is for a directed acyclic graph will be described. FIG. 2 is a diagram illustrating an example of the graph structure data. Such graph structure data includes node data and edge data as shown in FIG. The node data indicates the shape and size (graphic definition information) of each node. For example, when a certain node is displayed as a circle on the graph, the graphic definition information for the node includes the content that the shape of the node is a circle and the radius of the circle. In addition, when a node is displayed as a rectangle, the graphic definition information for the node includes the content that the shape of the node is a rectangle and the vertical and horizontal lengths of the rectangle. . The edge data indicates the connection relationship with the node for each edge. An edge in the directed graph has a direction, and this direction is specified as the direction from the start point to the end point of the edge. Specifically, the edge data for each edge includes data for specifying a node connected to the start point of the edge (start point node) and a node connected to the end point (end point node).

ROM30には、制御部50に所定の処理を実行させるための各種のプログラムが記憶されている。例えば、所定のグラフレイアウトアルゴリズムに従った処理を行うことにより各ノードのレイアウト位置を算出するためのプログラム、グラフ構造データ等に基づいてグラフを生成するプログラム、その生成したグラフを表示装置20の画面に表示するプログラム等がROM30に記憶されている。ここで、本実施形態では、グラフ構造データが有向グラフに対するものであるので、上記グラフレイアウトアルゴリズムとしては、有向グラフの階層レイアウトを行うためのアルゴリズム、具体的にはSugiyamaアルゴリズムが用いられる。   The ROM 30 stores various programs for causing the control unit 50 to execute predetermined processing. For example, a program for calculating the layout position of each node by performing processing according to a predetermined graph layout algorithm, a program for generating a graph based on graph structure data, etc., and the generated graph on the screen of the display device 20 A program or the like to be displayed on the ROM 30 is stored in the ROM 30. Here, in this embodiment, since the graph structure data is for a directed graph, an algorithm for performing hierarchical layout of a directed graph, specifically, the Sugiyama algorithm is used as the graph layout algorithm.

制御部(制御手段)50は、本装置の各部を統括して制御するものである。この制御部50は、図1に示すように、第一のグラフ生成手段51と、選択ノード特定データ生成手段52と、第二のグラフ生成手段53とを備える。   The control unit (control unit) 50 controls each unit of the apparatus in an integrated manner. As shown in FIG. 1, the control unit 50 includes a first graph generating unit 51, a selected node specifying data generating unit 52, and a second graph generating unit 53.

第一のグラフ生成手段(基本グラフ生成手段)51は、ユーザが入力装置10を用いて所定の指示を入力したときに、RAM40に記憶されているグラフ構造データに基づいてSugiyamaアルゴリズムに従った処理を実行することにより、グラフ構造データに記述されている各ノードのレイアウト位置を算出し、この算出された各ノードのレイアウト位置に関するデータとグラフ構造データとに基づいてグラフを生成して、表示装置20の画面に表示するものである。ここで、第一のグラフ生成手段51によって表示装置20の画面に表示されるグラフは、RAM40に記憶されているグラフ構造データをそのまま用いてSugiyamaアルゴリズムに従った処理を適用することによりレイアウトされたものであるので、必ずしもユーザの意図したレイアウトのグラフになっていない。以下では、この第一のグラフ生成手段51によって生成されるグラフのことを特に「基本グラフ」とも称することにする。   The first graph generation means (basic graph generation means) 51 performs processing according to the Sugiyama algorithm based on the graph structure data stored in the RAM 40 when the user inputs a predetermined instruction using the input device 10. To calculate a layout position of each node described in the graph structure data, generate a graph based on the calculated data regarding the layout position of each node and the graph structure data, and display the display device. 20 screens are displayed. Here, the graph displayed on the screen of the display device 20 by the first graph generation means 51 is laid out by applying the processing according to the Sugiyama algorithm using the graph structure data stored in the RAM 40 as it is. Therefore, it is not necessarily a graph of the layout intended by the user. Hereinafter, the graph generated by the first graph generating means 51 is particularly referred to as a “basic graph”.

選択ノード特定データ生成手段52は、表示装置20の画面に表示された基本グラフにおいて、ユーザが入力装置10を用いて、互いに近接した位置にレイアウトしたいノードを選択ノードとして選択したときに、その選択した選択ノードを特定するデータ(選択ノード特定データ)を生成するものである。ユーザは、基本グラフを見て、自身の意図したレイアウトがなされていないときに、入力装置10を用いて、その基本グラフにおいて、互いに近接した位置にレイアウトしたいノードを選択ノードとして選択することになる。選択ノード特定データ生成手段52は、こうして選択された選択ノードを特定する選択ノード特定データを生成し、RAM40に一時記憶する。   The selected node specifying data generating unit 52 selects a node in the basic graph displayed on the screen of the display device 20 when the user selects a node to be laid out at a position close to each other using the input device 10 as the selected node. Data for specifying the selected node (selected node specifying data) is generated. When the user looks at the basic graph and the intended layout is not made, the user uses the input device 10 to select, as the selection node, a node to be laid out at a position close to each other in the basic graph. . The selected node specifying data generating unit 52 generates selected node specifying data for specifying the selected node thus selected, and temporarily stores it in the RAM 40.

第二のグラフ生成手段53は、RAM40に記憶されている選択ノード特定データによって特定される選択ノードの全体を一つの仮ノードで置き換えて、Sugiyamaアルゴリズムに従った処理を実行することにより、仮ノードと選択ノード以外の各ノードとのレイアウト位置を算出した後、その算出された仮ノードのレイアウト位置に、選択ノードの全体をレイアウトするという条件の下で、RAM40に記憶されているグラフ構造データに基づいてSugiyamaアルゴリズムに従った処理を実行することにより、各ノードのレイアウト位置を算出し、その算出された結果に基づいてグラフを生成して、表示装置20の画面に表示するものである。具体的に、この第二のグラフ生成手段53は、図1に示すように、第一のレイアウト位置算出手段531と、領域決定手段532と、第二のレイアウト位置算出手段533と、第三のレイアウト位置算出手段534と、グラフ表示処理手段535とを有する。   The second graph generating means 53 replaces the entire selected node specified by the selected node specifying data stored in the RAM 40 with one temporary node, and executes a process according to the Sugiyama algorithm, thereby And the graph structure data stored in the RAM 40 under the condition that the entire selected node is laid out at the calculated layout position of the temporary node. Based on the Sugiyama algorithm, the layout position of each node is calculated, a graph is generated based on the calculated result, and displayed on the screen of the display device 20. Specifically, as shown in FIG. 1, the second graph generating unit 53 includes a first layout position calculating unit 531, an area determining unit 532, a second layout position calculating unit 533, and a third layout position calculating unit 533. A layout position calculation unit 534 and a graph display processing unit 535 are provided.

第一のレイアウト位置算出手段531は、選択ノード特定データ生成手段52で得られた選択ノード特定データに基づいてグラフ構造データから選択ノードに関連するデータを抽出し、その抽出した選択ノードに関連するデータに基づいてSugiyamaアルゴリズムに従った処理を実行することにより、各選択ノードのレイアウト位置を算出するものである。ここで、「選択ノードに関連するデータ」とは、各選択ノードについてのノードデータ、及び、始点と終点とがともに選択ノードと接続されているエッジについてのエッジデータのことである。したがって、第一のレイアウト位置算出手段531で算出される各選択ノードのレイアウト位置は、選択ノードだけをレイアウトすると仮定した場合におけるノードのレイアウト位置である。第一のレイアウト位置算出手段531によって算出された各選択ノードのレイアウト位置に関するデータはRAM40に一時記憶される。   The first layout position calculating unit 531 extracts data related to the selected node from the graph structure data based on the selected node specifying data obtained by the selected node specifying data generating unit 52, and relates to the extracted selected node. The layout position of each selected node is calculated by executing processing according to the Sugiyama algorithm based on the data. Here, “data related to the selected node” refers to node data for each selected node and edge data for an edge whose start point and end point are both connected to the selected node. Therefore, the layout position of each selected node calculated by the first layout position calculating unit 531 is the layout position of the node when it is assumed that only the selected node is laid out. Data relating to the layout position of each selected node calculated by the first layout position calculation means 531 is temporarily stored in the RAM 40.

領域決定手段532は、第一のレイアウト位置算出手段531で得られた各選択ノードのレイアウト位置に関するデータに基づいて、選択ノードの全体をレイアウトするのに必要な領域の形状・大きさを決定するものである。特に、本実施形態では、領域決定手段532は、選択ノードの全体をレイアウトするのに必要な領域として選択ノードの全体を含む最小の大きさの長方形の領域を決定することにしている。そして、領域決定手段532は、その決定した領域についてのデータとして、当該領域の形状が長方形である旨の内容とその長方形の縦の長さ及び横の長さとを含むものを生成し、RAM40に一時記憶する。   The area determining unit 532 determines the shape and size of the area necessary for laying out the entire selected node based on the data regarding the layout position of each selected node obtained by the first layout position calculating unit 531. Is. In particular, in the present embodiment, the region determining unit 532 determines a rectangular region having a minimum size including the entire selected node as a region necessary for laying out the entire selected node. Then, the area determination means 532 generates, as data about the determined area, data including the content that the shape of the area is a rectangle, the vertical length and the horizontal length of the rectangle, and stores them in the RAM 40. Memorize temporarily.

第二のレイアウト位置算出手段533は、選択ノードの全体を、領域決定手段532で決定された領域の形状・大きさと同じ形状・大きさを有する一つの仮ノードで置き換え、仮ノードの形状・大きさに関するデータ、仮ノードとの接続関係を示すデータ、及び、グラフ構造データのうち選択ノード以外の各ノードに関連するデータに基づいて、Sugiyamaアルゴリズムに従った処理を実行することにより、仮ノードと選択ノード以外の各ノードとのレイアウト位置を算出するものである。ここで、「仮ノードの形状・大きさに関するデータ」としては、領域決定手段532で得られた領域についてのデータを用いることができる。また、「仮ノードとの接続関係を示すデータ」とは、始点及び終点のうち少なくとも一方が選択ノードと接続されているエッジについてのエッジデータのことであり、かかるデータは、選択ノードを特定するデータ及びグラフ構造データに基づいて生成される。更に、「グラフ構造データのうち選択ノード以外の各ノードに関連するデータ」とは、選択ノード以外の各ノードについてのノードデータ、及び、始点と終点とがともに選択ノードと接続されていないエッジについてのエッジデータのことである。第二のレイアウト位置算出手段533によって算出された仮ノードと選択ノード以外の各ノードとのレイアウト位置に関するデータはRAM40に一時記憶される。   The second layout position calculating unit 533 replaces the entire selected node with one temporary node having the same shape and size as the region determined by the region determining unit 532, and the shape and size of the temporary node. By executing processing according to the Sugiyama algorithm based on the data related to the length, the data indicating the connection relationship with the temporary node, and the data related to each node other than the selected node among the graph structure data, The layout position with each node other than the selected node is calculated. Here, as the “data related to the shape and size of the temporary node”, the data about the area obtained by the area determining means 532 can be used. The “data indicating the connection relationship with the temporary node” is edge data of an edge where at least one of the start point and the end point is connected to the selected node, and the data specifies the selected node. Generated based on data and graph structure data. Furthermore, “data related to each node other than the selected node in the graph structure data” means node data for each node other than the selected node, and an edge whose start point and end point are not connected to the selected node. This is edge data. Data relating to the layout position of the temporary node calculated by the second layout position calculation means 533 and each node other than the selected node is temporarily stored in the RAM 40.

第三のレイアウト位置算出手段534は、第二のレイアウト位置算出手段533で得られた仮ノードと選択ノード以外の各ノードとのレイアウト位置に関するデータによって定められる仮ノード及び選択ノード以外の各ノードについての相対的な位置関係を維持するという条件、及び、仮ノードの代わりに選択ノードの全体をレイアウトするという条件の下で、グラフ構造データに基づいてSugiyamaアルゴリズムに従った処理を実行することにより、グラフ構造データに記述されている各ノードのレイアウト位置を算出するものである。したがって、第三のレイアウト位置算出手段534によって算出された各ノードのレイアウト位置に関するデータの内容は、選択ノードの全体を互いに近接した位置にレイアウトするという内容になっている。第三のレイアウト位置算出手段534によって算出された各ノードとのレイアウト位置に関するデータはRAM40に一時記憶される。   The third layout position calculation means 534 is for the nodes other than the temporary node and the selection node determined by the data regarding the layout position between the temporary node and the nodes other than the selection node obtained by the second layout position calculation means 533. By executing the process according to the Sugiyama algorithm based on the graph structure data under the condition of maintaining the relative positional relationship of and the condition of laying out the entire selected node instead of the temporary node, The layout position of each node described in the graph structure data is calculated. Accordingly, the content of the data related to the layout position of each node calculated by the third layout position calculation means 534 is such that the entire selected node is laid out at positions close to each other. Data regarding the layout position with each node calculated by the third layout position calculation means 534 is temporarily stored in the RAM 40.

グラフ表示処理手段535は、第三のレイアウト位置算出手段534で得られた各ノードのレイアウト位置に関するデータとグラフ構造データとに基づいてグラフを生成し、表示装置20の画面に表示するものである。このとき、表示装置20の画面に表示されるグラフ上には、選択ノードの全体が互いに近接した位置にレイアウトされており、これにより、ユーザが意図したレイアウトのグラフが生成される。   The graph display processing unit 535 generates a graph based on the data regarding the layout position of each node obtained by the third layout position calculation unit 534 and the graph structure data, and displays the graph on the screen of the display device 20. . At this time, on the graph displayed on the screen of the display device 20, the entire selected nodes are laid out at positions close to each other, thereby generating a graph having a layout intended by the user.

次に、本実施形態のグラフ生成装置においてグラフを生成して表示装置20の画面に表示する処理の手順について説明する。   Next, a procedure of processing for generating a graph and displaying it on the screen of the display device 20 in the graph generation device of this embodiment will be described.

図3は本実施形態のグラフ生成装置においてグラフを生成して表示装置20の画面に表示する処理の手順を説明するためのフローチャートである。以下では、図2に示すグラフ構造データがRAM40に記憶されており、このグラフ構造データに対するグラフを生成する場合を説明する。このグラフ構造データのノードデータによれば、グラフには11個のノード1〜11が含まれ、いずれのノード1〜11の形状も半径rの円である。また、そのグラフ構造データのエッジデータによれば、グラフには9つのエッジe1〜e9が含まれている。   FIG. 3 is a flowchart for explaining a procedure of processing for generating a graph and displaying it on the screen of the display device 20 in the graph generation device of the present embodiment. Hereinafter, the case where the graph structure data shown in FIG. 2 is stored in the RAM 40 and a graph for the graph structure data is generated will be described. According to the node data of this graph structure data, the graph includes eleven nodes 1 to 11, and the shape of any of the nodes 1 to 11 is a circle with a radius r. Further, according to the edge data of the graph structure data, the graph includes nine edges e1 to e9.

まず、ユーザは、入力装置10を用いてグラフを生成する旨の指示を入力する。すると、制御部50はグラフ生成処理を開始する。この処理が開始されると、最初に、制御部50の第一のグラフ生成手段51は、RAM40に記憶されているグラフ構造データに基づいてSugiyamaアルゴリズムに従った処理を実行することにより、グラフ構造データに記述されている各ノードのレイアウト位置を算出する。そして、この算出した各ノードのレイアウト位置に関するデータとグラフ構造データとに基づいて基本グラフを生成して表示装置20の画面に表示する(S1)。   First, the user inputs an instruction to generate a graph using the input device 10. Then, the control unit 50 starts a graph generation process. When this process is started, first, the first graph generation means 51 of the control unit 50 executes the process according to the Sugiyama algorithm based on the graph structure data stored in the RAM 40, thereby obtaining the graph structure. The layout position of each node described in the data is calculated. Then, a basic graph is generated based on the calculated data regarding the layout position of each node and the graph structure data, and is displayed on the screen of the display device 20 (S1).

いま、第一のグラフ生成手段51が行うSugiyamaアルゴリズムに従った処理の内容を詳しく説明する。Sugiyamaアルゴリズムは、上述したように、第一ステップとしての階層割当てステップ、第二ステップとしての順序付けステップ、第三ステップとしての座標付与ステップからなる。まず、第一のグラフ生成手段51は、Sugiyamaアルゴリズムにおける階層割当てステップに従った処理を行う。すなわち、第一のグラフ生成手段51は、図2に示すグラフ構造データのエッジデータに基づいて、エッジとノードとの接続関係をチェックした後、エッジの長さの最短性やノードの一貫性等の条件をできる限り満たすように、各ノードに対してそれを配置すべき階層を割り当てる。   Now, the contents of the processing according to the Sugiyama algorithm performed by the first graph generating means 51 will be described in detail. As described above, the Sugiyama algorithm includes a hierarchy assignment step as a first step, an ordering step as a second step, and a coordinate assigning step as a third step. First, the first graph generation means 51 performs processing according to the hierarchy assignment step in the Sugiyama algorithm. That is, the first graph generation means 51 checks the connection relation between the edge and the node based on the edge data of the graph structure data shown in FIG. In order to satisfy the above condition as much as possible, a hierarchy in which the node is to be arranged is assigned to each node.

具体的に、この階層の割当ては次のようにして行われる。図2に示すエッジデータによれば、ノード1は、いずれのエッジの終点にも接続されていないので、最上位の第1階層に割り当てられることになる。このノード1はエッジe1の始点にのみ接続されている。そして、エッジe1の終点にはノード3が接続されているが、ノード3は、エッジe1の終点を除き、いずれのエッジの終点にも接続されていないので、ノード1よりも一つ下位の階層、すなわち第2階層に割り当てられることになる。また、ノード3はエッジe2の始点とエッジe3の始点に接続されている。このエッジe2の終点にはノード5が接続されているが、ノード5は、エッジe2の終点を除き、いずれのエッジの終点にも接続されていないので、ノード3よりも一つ下位の階層、すなわち第3階層に割り当てられることになる。一方、エッジe3の終点にはノード6が接続されているが、ノード6は、エッジe3の終点を除き、いずれのエッジの終点にも接続されていないので、第3階層に割り当てられることになる。   Specifically, this hierarchical assignment is performed as follows. According to the edge data shown in FIG. 2, since the node 1 is not connected to the end point of any edge, it is assigned to the highest first layer. This node 1 is connected only to the start point of the edge e1. The node 3 is connected to the end point of the edge e1, but the node 3 is not connected to the end point of any edge except for the end point of the edge e1, so that it is one level lower than the node 1. That is, it is assigned to the second hierarchy. The node 3 is connected to the start point of the edge e2 and the start point of the edge e3. Although the node 5 is connected to the end point of the edge e2, the node 5 is not connected to the end point of any edge except the end point of the edge e2. That is, it is assigned to the third hierarchy. On the other hand, the node 6 is connected to the end point of the edge e3, but the node 6 is not connected to the end point of any edge except the end point of the edge e3. .

また、ノード2は、いずれのエッジの終点にも接続されていないので、第1階層に割り当てられることになる。このノード2はエッジe5の始点にのみ接続され、エッジe5の終点にはノード4が接続されているが、ノード4は、エッジe5の終点を除き、いずれのエッジの終点にも接続されていないので、第2階層に割り当てられることになる。また、ノード4はエッジe6の始点に接続され、エッジe6の終点にはノード7が接続されているが、ノード7は、エッジe6の終点を除き、いずれのエッジの終点にも接続されていないので、第3階層に割り当てられることになる。   Further, since the node 2 is not connected to the end point of any edge, it is assigned to the first hierarchy. The node 2 is connected only to the start point of the edge e5, and the node 4 is connected to the end point of the edge e5. However, the node 4 is not connected to the end point of any edge except the end point of the edge e5. Therefore, it is assigned to the second hierarchy. The node 4 is connected to the start point of the edge e6, and the node 7 is connected to the end point of the edge e6. However, the node 7 is not connected to the end point of any edge except the end point of the edge e6. Therefore, it is assigned to the third hierarchy.

更に、ノード9は、いずれのエッジの終点にも接続されていないので、第1階層に割り当てられることになる。このノード9はエッジe8の始点にのみ接続され、このエッジe8の終点にはノード10が接続されているが、ノード10は、エッジe8の終点を除き、いずれのエッジの終点にも接続されていないので、第2階層に割り当てられることになる。そして、ノード10はエッジe9の始点に接続され、このエッジe9の終点にはノード11が接続されているが、ノード11は、エッジe9の終点を除き、いずれのエッジの終点にも接続されていないので、第3階層に割り当てられることになる。   Furthermore, since the node 9 is not connected to the end point of any edge, it is assigned to the first layer. The node 9 is connected only to the start point of the edge e8, and the node 10 is connected to the end point of the edge e8. However, the node 10 is connected to the end point of any edge except the end point of the edge e8. Since it is not, it is assigned to the second hierarchy. The node 10 is connected to the start point of the edge e9, and the node 11 is connected to the end point of the edge e9. However, the node 11 is connected to the end point of any edge except the end point of the edge e9. Since there is not, it will be assigned to the third hierarchy.

また、ノード8は、エッジe4の終点及びエッジe7の終点に接続されている。ここで、エッジe4の始点には第3階層に割り当てられるノード5が接続され、エッジe7の始点には第2階層に割り当てられるノード4が接続されている。このため、ノード8は、ノード5及びノード4のうちより下位の階層に割り当てられているノードよりも一つ下位の階層、すなわち第4階層に割り当てられることになる。こうして、各ノードに対してそれを配置すべき階層が決定される。   The node 8 is connected to the end point of the edge e4 and the end point of the edge e7. Here, the node 5 assigned to the third hierarchy is connected to the start point of the edge e4, and the node 4 assigned to the second hierarchy is connected to the start point of the edge e7. For this reason, the node 8 is assigned to a hierarchy one level lower than the node assigned to the lower hierarchy of the nodes 5 and 4, that is, the fourth hierarchy. In this way, the hierarchy in which the node is to be arranged is determined.

次に、第一のグラフ生成手段51は、Sugiyamaアルゴリズムにおける順序付けステップに従った処理を行う。すなわち、第一のグラフ生成手段51は、各階層において、エッジの交差数の最小性等の条件をできる限り満たすように、当該階層が割り当てられた各ノードに対してそれを配置する順序を決定する。ここでは、各階層においてノードを配置する順序を、全てのノードを一列に並べたときに当該ノードが左側から何番目に配置されているかによって表すことにする。特に、第一のグラフ生成手段51は、あるエッジについてその始点に接続されるノードに割り当てられた階層とその終点に接続されるノードに割り当てられた階層との間に1以上の階層が存在する場合には、その存在する階層の各々に、当該エッジの通過点を表すためにダミーのノードを追加する。ダミーノードが追加された場合、第一のグラフ生成手段51は、ダミーノードが追加された各階層において、その追加されたダミーのノードを通常のノードに加えた全体のノードの各々に対して順序付けを行う。   Next, the first graph generating means 51 performs processing according to the ordering step in the Sugiyama algorithm. In other words, the first graph generation means 51 determines the order of arranging each node to which the hierarchy is assigned so that the conditions such as the minimum number of intersections of edges are satisfied as much as possible. To do. Here, the order in which nodes are arranged in each hierarchy is expressed by the number of nodes arranged from the left when all the nodes are arranged in a line. In particular, the first graph generating means 51 has one or more hierarchies between a hierarchy assigned to a node connected to its start point and a hierarchy assigned to a node connected to its end point for a certain edge. In some cases, a dummy node is added to each of the existing hierarchies to represent the passing point of the edge. When a dummy node is added, the first graph generation unit 51 orders each of all the nodes in which the added dummy node is added to the normal node in each hierarchy in which the dummy node is added. I do.

本実施形態では、エッジe7についてはその始点にノード4が接続され、その終点にノード8が接続されるが、上記の階層割当てステップに従った処理の結果、ノード4は第2階層に割り当てられ、ノード8は第4階層に割り当てられている。このため、第3階層にはダミーのノードd1が追加されることになる。また、このダミーノードd1の追加により、エッジe7は、ノード4とダミーノードd1とを接続するエッジe7’と、ダミーノードd1とノード8とを接続するエッジe7”とに分けられることになる。ここで、第一のグラフ生成手段51は、ダミーノードを追加したときに、そのダミーノードの追加に応じた修正をエッジデータに加え、その修正を加えたエッジデータを修正エッジデータとしてRAM40に一時記憶しておく。図4に第一のグラフ生成手段51によって修正された修正エッジデータの例を示す。その後、第一のグラフ生成手段51は、各階層においてノードの順序付けを行う。その結果、例えば、第1階層においては、ノード9を1番目に、ノード2を2番目に、ノード1を3番目に配置することが決定され、第2階層においては、ノード10を1番目に、ノード4を2番目に、ノード3を3番目に配置することが決定され、第3階層においては、ノード11を1番目に、ダミーノードd1を2番目に、ノード7を3番目に、ノード6を4番目に、ノード5を5番目に配置することが決定される。そして、第4階層にはノード8が一つだけ配置されるので、ノード8を1番目に配置することが決定される。   In the present embodiment, for the edge e7, the node 4 is connected to the start point and the node 8 is connected to the end point. As a result of the processing according to the above-described hierarchy assignment step, the node 4 is assigned to the second hierarchy. Node 8 is assigned to the fourth hierarchy. For this reason, a dummy node d1 is added to the third hierarchy. Further, due to the addition of the dummy node d1, the edge e7 is divided into an edge e7 ′ connecting the node 4 and the dummy node d1, and an edge e7 ″ connecting the dummy node d1 and the node 8. Here, when the first graph generation means 51 adds a dummy node, it adds a correction corresponding to the addition of the dummy node to the edge data, and temporarily stores the corrected edge data in the RAM 40 as corrected edge data. 4 shows an example of corrected edge data corrected by the first graph generating means 51. After that, the first graph generating means 51 performs ordering of nodes in each hierarchy. For example, in the first hierarchy, it is decided to arrange the node 9 first, the node 2 second, and the node 1 third, In this case, it is determined that the node 10 is placed first, the node 4 is placed second, and the node 3 is placed third. In the third hierarchy, the node 11 is placed first and the dummy node d1 is placed second. Then, it is determined that the node 7 is arranged third, the node 6 is arranged fourth, and the node 5 is arranged fifth, and only one node 8 is arranged in the fourth hierarchy. Is determined to be placed first.

次に、第一のグラフ生成手段51は、Sugiyamaアルゴリズムにおける座標付与ステップに従った処理を行う。すなわち、第一のグラフ生成手段51は、エッジの垂直性の条件をできる限り満たすように、各ノードの位置を決定し、当該ノードにレイアウト位置座標(レイアウト位置に関するデータ)を付与する。ここで、ダミーノードが存在していれば、ダミーノードについてもそのレイアウト位置座標が付与される。また、レイアウト位置座標としては、例えば、ノードの形状が円である場合には中心の位置座標を用いることができ、ノードの形状が長方形である場合には例えば4つの頂点のうちいずれかの頂点(例えば左上の頂点)の位置座標を用いることができる。更に、ダミーノードについてはその形状が所定の図形、例えば点とすることが予め定められており、ダミーノードについてのレイアウト位置座標としては、当該点の位置座標を用いることができる。   Next, the first graph generation means 51 performs a process according to the coordinate assignment step in the Sugiyama algorithm. That is, the first graph generation unit 51 determines the position of each node so as to satisfy the edge verticality condition as much as possible, and assigns layout position coordinates (data regarding the layout position) to the node. Here, if there is a dummy node, the layout position coordinates are also given to the dummy node. As the layout position coordinates, for example, when the node shape is a circle, the center position coordinates can be used. When the node shape is a rectangle, for example, any one of four vertices is used. The position coordinates (for example, the top left vertex) can be used. Further, it is predetermined that the shape of the dummy node is a predetermined figure, for example, a point, and the position coordinate of the point can be used as the layout position coordinate for the dummy node.

こうして、第一のグラフ生成手段51は、グラフ構造データに基づいてSugiyamaアルゴリズムに従った処理を実行することにより、グラフ生成に利用する中間的なデータとしてのレイアウト元データを生成する。レイアウト元データには、Sugiyamaアルゴリズムに従った処理で得られたデータが含まれている。図5は第一のグラフ生成手段51によって生成されるレイアウト元データの例を示す図である。具体的に、レイアウト元データには、図5に示すように、各ノードについて、当該ノードに割り当てられた階層、階層内で当該ノードが配置される順序(階層内順序)、レイアウト位置座標、図形定義情報といった各データが含まれている。但し、ダミーノードの形状・大きさは予め定められているため、レイアウト元データにはダミーノードの図形定義情報は示されていない。ところで、実際、グラフ生成のためには、各ノードのレイアウト位置座標とグラフ構造データとがあればよい。本実施形態では、本発明の内容が容易に理解することができるように、レイアウト元データに、レイアウト位置座標の他に、階層、階層内順序、及び、図形定義情報をも含めている。したがって、レイアウト元データには、少なくとも各ノードのレイアウト位置座標が含まれていればよい。   Thus, the first graph generation unit 51 generates layout original data as intermediate data used for graph generation by executing processing according to the Sugiyama algorithm based on the graph structure data. The layout source data includes data obtained by processing according to the Sugiyama algorithm. FIG. 5 is a diagram showing an example of layout source data generated by the first graph generating means 51. Specifically, in the layout source data, as shown in FIG. 5, for each node, the hierarchy assigned to the node, the order in which the node is arranged in the hierarchy (intra-hierarchy order), layout position coordinates, graphics Each data such as definition information is included. However, since the shape and size of the dummy node are determined in advance, the graphic definition information of the dummy node is not shown in the layout source data. Actually, in order to generate a graph, it is only necessary to have the layout position coordinates and graph structure data of each node. In the present embodiment, in order to easily understand the contents of the present invention, the layout source data includes not only the layout position coordinates but also the hierarchy, the order within the hierarchy, and the graphic definition information. Therefore, the layout source data only needs to include at least the layout position coordinates of each node.

その後、第一のグラフ生成手段51は、図5に示すレイアウト元データとRAM40に記憶されているグラフ構造データとに基づいて基本グラフを生成し、表示装置20の画面に表示する。図6に図5に示すレイアウト元データに対応する基本グラフを示す。ここで、グラフを生成する際、ノード上におけるエッジとの接続点は予め定められている。特に、ダミーノードについては、それを表す図形である点が接続点である。そして、ある階層のノードとそれより一つ下位の階層のノードとがエッジで接続される場合には、これら二つのノードの接続点間を矢印付きの直線で結ぶことにより、グラフを生成している。尚、本実施形態では、上述したようにダミーノードを点で表すことにしているが、図6のグラフでは、ダミーノードの存在を明確に示すため、ダミーノードを黒丸(小さな円)で表現している。また、他のグラフにおいても同様に、ダミーノードを黒丸で表現することにする。   Thereafter, the first graph generation means 51 generates a basic graph based on the layout original data shown in FIG. 5 and the graph structure data stored in the RAM 40 and displays the basic graph on the screen of the display device 20. FIG. 6 shows a basic graph corresponding to the layout source data shown in FIG. Here, when the graph is generated, the connection point with the edge on the node is determined in advance. In particular, for a dummy node, a point representing a graphic is a connection point. Then, when a node in a certain hierarchy and a node in the hierarchy one level below are connected by an edge, a graph is generated by connecting the connection points of these two nodes with a straight line with an arrow. Yes. In the present embodiment, the dummy nodes are represented by dots as described above. However, in the graph of FIG. 6, the dummy nodes are represented by black circles (small circles) in order to clearly indicate the existence of the dummy nodes. ing. Similarly, in other graphs, dummy nodes are represented by black circles.

次に、ユーザは、表示装置20の画面に表示された基本グラフを見て、その基本グラフが自分の意図したグラフになっているかどうかを判断する。ユーザの意図したグラフが生成されておらず、ユーザは、その基本グラフにおいていくつかのノードを互いに近接した位置にレイアウトしたい場合、それらのノードを選択することになる。例えば、図6に示す基本グラフにおいて、ノード5,8,11が同じ種類のノードであるため、ユーザは、ノード5,8,11を互いに近接した位置にレイアウトしたいと考えたとする。この場合、ユーザは、入力装置10を用いて、ノード5,8,11を選択した後、所定のメニュー画面を表示させて、そのメニュー画面に含まれる項目の中から、選択したノードを近接した位置にレイアウトする処理の実行を指示するための項目を選択する。すると、ユーザが選択したノード5,8,11についてのデータと選択したノードを近接した位置にレイアウトする処理の実行を指示する命令が選択ノード特定データ生成手段52に送られる。選択ノード特定データ生成手段52は、この命令を受けると、基本グラフにおいて選択されたノード5,8,11を選択ノードとして特定する選択ノード特定データを生成して、RAM40に一時記憶する(S2)。   Next, the user looks at the basic graph displayed on the screen of the display device 20 and determines whether the basic graph is a graph intended by the user. When the graph intended by the user has not been generated and the user wants to lay out some nodes in the basic graph at positions close to each other, the user selects those nodes. For example, in the basic graph shown in FIG. 6, since the nodes 5, 8, and 11 are the same type of node, the user wants to lay out the nodes 5, 8, and 11 at positions close to each other. In this case, the user selects the nodes 5, 8, and 11 using the input device 10, then displays a predetermined menu screen, and brings the selected node close to the item included in the menu screen. Select an item for instructing execution of the process of laying out the position. Then, a command for instructing execution of a process of laying out the data about the nodes 5, 8, and 11 selected by the user and the selected node in a close position is sent to the selected node specifying data generation unit 52. Upon receiving this command, the selected node specifying data generating means 52 generates selected node specifying data for specifying the nodes 5, 8, and 11 selected in the basic graph as selected nodes, and temporarily stores them in the RAM 40 (S2). .

こうして選択ノード特定データ生成手段52により選択ノード特定データが生成されると、次に、制御部50の第一のレイアウト位置算出手段531は、その生成された選択ノード特定データに基づいてグラフ構造データから選択ノード5,8,11に関連するデータを抽出する。そして、その抽出した選択ノード5,8,11に関連するデータに基づいてSugiyamaアルゴリズムに従った処理を実行することにより、各選択ノードのレイアウト位置を算出する(S3)。ここで、図7(a)にグラフ構造データのうち選択ノード5,8,11に関連するデータを示す。すなわち、選択ノード5,8,11に関連するデータは、選択ノード5,8,11についてのノードデータと、始点と終点がともに選択ノードと接続されているエッジe4についてのエッジデータとからなる。   When the selected node specifying data is generated by the selected node specifying data generating means 52, the first layout position calculating means 531 of the control unit 50 next displays the graph structure data based on the generated selected node specifying data. To extract data related to the selected nodes 5, 8, and 11. Then, the layout position of each selected node is calculated by executing processing according to the Sugiyama algorithm based on the extracted data related to the selected nodes 5, 8, and 11 (S3). Here, FIG. 7A shows data related to the selection nodes 5, 8, and 11 among the graph structure data. That is, the data related to the selection nodes 5, 8, and 11 includes node data for the selection nodes 5, 8, and 11, and edge data for the edge e4 whose start point and end point are both connected to the selection node.

具体的に、まず、第一のレイアウト位置算出手段531は、図7(a)に示すデータに基づいてSugiyamaアルゴリズムにおける階層割当てステップに従った処理を行う。これにより、選択ノード5,11を最上位の第1階層に配置し、選択ノード8を第2階層に配置することが決定される。次に、第一のレイアウト位置算出手段531は、Sugiyamaアルゴリズムにおける順序付けステップに従った処理を行う。これにより、第1階層においては、選択ノード11を1番目に、選択ノード5を2番目に配置し、第2階層においては、選択ノード8を1番目に配置することが決定される。その後、第一のレイアウト位置算出手段531は、Sugiyamaアルゴリズムにおける座標付与ステップに従った処理を行い、各選択ノードのレイアウト位置座標を決定する。こうして、第一のレイアウト位置算出手段531による処理の結果、選択ノードをレイアウトするためのレイアウト元データが生成される。図7(b)は第一のレイアウト位置算出手段531によって生成される、選択ノードをレイアウトするためのレイアウト元データの例を示す図である。また、図8に図7(b)に示すレイアウト元データに対応するグラフを示す。尚、図8は図7(b)の内容を説明するための図であり、実際にこの図8に示すグラフが表示装置20の画面に表示されるわけではない。   Specifically, first, the first layout position calculation means 531 performs processing according to the hierarchy assignment step in the Sugiyama algorithm based on the data shown in FIG. As a result, it is determined that the selection nodes 5 and 11 are arranged in the highest first hierarchy and the selection node 8 is arranged in the second hierarchy. Next, the first layout position calculation means 531 performs processing according to the ordering step in the Sugiyama algorithm. Accordingly, it is determined that the selection node 11 is arranged first and the selection node 5 is arranged second in the first hierarchy, and the selection node 8 is arranged first in the second hierarchy. Thereafter, the first layout position calculation means 531 performs processing according to the coordinate assignment step in the Sugiyama algorithm to determine the layout position coordinates of each selected node. In this way, layout source data for laying out the selected node is generated as a result of the processing by the first layout position calculation means 531. FIG. 7B is a diagram showing an example of layout source data for laying out the selected node, which is generated by the first layout position calculation unit 531. FIG. 8 shows a graph corresponding to the layout source data shown in FIG. FIG. 8 is a diagram for explaining the contents of FIG. 7B, and the graph shown in FIG. 8 is not actually displayed on the screen of the display device 20.

次に、制御部50の領域決定手段532は、第一のレイアウト位置算出手段531で得られた各選択ノード5,8,11のレイアウト位置に関するデータに基づいて、選択ノード5,8,11の全体をレイアウトするのに必要な領域の形状・大きさを決定する(S4)。例えば、領域決定手段532は、図8に示すグラフにおいて三つの選択ノード5,8,11を包含する最小面積の長方形Rを当該領域の形状として決定し、その長方形Rの縦の長さa及び横の長さbを求める。こうして得られた領域についてのデータは、RAM40に一時記憶される。   Next, the area determination unit 532 of the control unit 50 determines the selection nodes 5, 8, 11 based on the data regarding the layout positions of the selection nodes 5, 8, 11 obtained by the first layout position calculation unit 531. The shape and size of the area necessary for laying out the whole are determined (S4). For example, the region determining means 532 determines the rectangle R having the smallest area including the three selection nodes 5, 8, and 11 as the shape of the region in the graph shown in FIG. The horizontal length b is obtained. Data on the area thus obtained is temporarily stored in the RAM 40.

尚、本実施形態では、領域決定手段532が、選択ノードの全体をレイアウトするのに必要な領域として選択ノードの全体を含む最小の大きさの長方形の領域を決定することにしているが、これは一例であって、一般に、領域決定手段532は、選択ノードの全体をレイアウトするのに必要な領域として必ずしも選択ノードの全体を含む最小の大きさの領域を決定する必要はない。また、領域の形状は長方形に限らず、円等、他の形状であってもよい。   In the present embodiment, the area determining unit 532 determines a rectangular area having the minimum size including the entire selected node as an area necessary for laying out the entire selected node. In general, the area determination unit 532 does not necessarily need to determine an area having the minimum size including the entire selected node as an area necessary for laying out the entire selected node. The shape of the region is not limited to a rectangle, and may be another shape such as a circle.

次に、制御部50の第二のレイアウト位置算出手段533は、選択ノード5,8,11の全体を、領域決定手段532で決定された領域の形状・大きさと同じ形状・大きさを有する一つの仮ノード12で置き換え、仮ノード12の形状・大きさに関するデータ、仮ノード12との接続関係を示すデータ、及び、グラフ構造データのうち選択ノード以外の各ノードに関連するデータに基づいて、Sugiyamaアルゴリズムに従った処理を実行することにより、仮ノード12と選択ノード5,8,11以外の各ノード1,2,3,4,6,7,9,10とのレイアウト位置を算出する(S5)。ここで、仮ノード12の形状・大きさに関するデータは、仮ノード12についてのノードデータのことであり、その内容は、領域決定手段532で得られた領域についてのデータの内容と同じである。また、仮ノード12との接続関係を示すデータは、始点及び終点のうち少なくとも一方が仮ノードと接続されているエッジについてのエッジデータのことであり、選択ノードを特定するデータ及びグラフ構造データに基づいて生成される。例えば、図2に示すグラフ構造データのエッジデータによれば、始点及び終点のうち少なくとも一方が選択ノード5,8,11と接続されているエッジは、エッジe2,e4,e7,e9である。この四つのエッジe2,e4,e7,e9についてのエッジデータにおいて当該選択ノードを仮ノード12に置き換えることにより得られるエッジデータが、仮ノード12との接続関係を示すデータである。したがって、「仮ノード12の形状・大きさに関するデータ」、「仮ノード12との接続関係を示すデータ」、及び、「グラフ構造データのうち選択ノード以外の各ノードに関連するデータ」は全体として、選択ノード5,8,11を一つの仮ノード12で置き換え、仮ノード12と各ノード1,2,3,4,6,7,9,10とを含むグラフについてのグラフ構造データである。図9は選択ノード5,8,11を一つの仮ノード12で置き換えた場合のグラフ構造データを示す図である。尚、図2に示すグラフ構造データにおいて、エッジe4についてはその始点及び終点がともに選択ノードと接続されているので、エッジe4についてのエッジデータは、図9に示すグラフ構造データには含まれていない。   Next, the second layout position calculation unit 533 of the control unit 50 has the same shape and size as the region shape and size determined by the region determination unit 532 for the entire selection nodes 5, 8, and 11. Based on data related to the shape and size of the temporary node 12, data indicating the connection relationship with the temporary node 12, and data related to each node other than the selected node in the graph structure data, By executing processing according to the Sugiyama algorithm, the layout positions of the temporary node 12 and the nodes 1, 2, 3, 4, 6, 7, 9, 10 other than the selected nodes 5, 8, 11 are calculated ( S5). Here, the data relating to the shape and size of the temporary node 12 is node data for the temporary node 12, and the content thereof is the same as the data content for the region obtained by the region determining means 532. Further, the data indicating the connection relationship with the temporary node 12 is edge data for an edge where at least one of the start point and the end point is connected to the temporary node, and includes data for specifying the selected node and graph structure data. Based on. For example, according to the edge data of the graph structure data shown in FIG. 2, the edges at least one of the starting point and the ending point connected to the selection nodes 5, 8, 11 are the edges e2, e4, e7, e9. The edge data obtained by replacing the selected node with the temporary node 12 in the edge data for the four edges e2, e4, e7, e9 is data indicating the connection relationship with the temporary node 12. Therefore, “data related to the shape and size of the temporary node 12”, “data indicating the connection relationship with the temporary node 12”, and “data related to each node other than the selected node in the graph structure data” as a whole , The selected nodes 5, 8, 11 are replaced with one temporary node 12, and the graph structure data for the graph including the temporary node 12 and the nodes 1, 2, 3, 4, 6, 7, 9, 10. FIG. 9 is a diagram showing graph structure data when the selected nodes 5, 8, and 11 are replaced with one temporary node 12. In FIG. In the graph structure data shown in FIG. 2, since the start point and the end point of edge e4 are both connected to the selected node, the edge data for edge e4 is included in the graph structure data shown in FIG. Absent.

具体的に、まず、第二のレイアウト位置算出手段533は、図9に示すデータに基づいてSugiyamaアルゴリズムにおける階層割当てステップに従った処理を行う。これにより、ノード1,2,9を第1階層に配置し、ノード3,4,10を第2階層に配置し、ノード6,7及び仮ノード12を第3階層に配置することが決定される。ここで、仮ノード12は、第3階層及び第4階層の二つの階層にまたがって配置されるノードであると認識されている。一般に、仮ノードは一つの階層に収まって配置される場合もあるし、二つ以上の階層に跨って配置される場合もある。一つの階層に配置できるノードの最大の大きさは予め定められており、第二のレイアウト位置算出手段533は、今回配置する仮ノードの大きさを、一つの階層に配置できるノードの最大の大きさと比較することにより、当該仮ノードを何階層にまたがって配置するかを決定するのである。次に、第二のレイアウト位置算出手段533は、Sugiyamaアルゴリズムにおける順序付けステップに従った処理を行う。これにより、第1階層においては、ノード2を1番目に、ノード9を2番目に、ノード1を3番目に配置し、第2階層においては、ノード4を1番目に、ノード10を2番目に、ノード3を3番目に配置し、第3階層においては、ノード7を1番目に、仮ノード12を2番目に、ノード6を3番目に配置することが決定される。その後、第二のレイアウト位置算出手段533は、Sugiyamaアルゴリズムにおける座標付与ステップに従った処理を行い、仮ノード12と各ノード1,2,3,4,6,7,9,10とのレイアウト位置座標を決定する。こうして、第二のレイアウト位置算出手段533による処理の結果、仮ノード12と各ノード1,2,3,4,6,7,9,10とをレイアウトするためのレイアウト元データが生成される。図10は第二のレイアウト位置算出手段533によって生成される、仮ノードと選択ノード以外の各ノードとをレイアウトするためのレイアウト元データの例を示す図である。また、図11に図10に示すレイアウト元データに対応するグラフを示す。図11に示すグラフと図6に示す基本グラフとを比較すると、各ノード1,2,3,4,6,7,9,10が割り当てられる階層は同じであるが、各階層におけるノードの配置順序が異なっている。これは、選択ノード5,8,11を一つの仮ノード12に置き換えて処理を行った結果である。尚、図11は図10の内容を説明するための図であり、実際にこの図11に示すグラフが表示装置20の画面に表示されるわけではない。   Specifically, first, the second layout position calculation means 533 performs processing according to the hierarchy assignment step in the Sugiyama algorithm based on the data shown in FIG. As a result, it is determined that the nodes 1, 2, 9 are arranged in the first hierarchy, the nodes 3, 4, 10 are arranged in the second hierarchy, and the nodes 6, 7, and the temporary node 12 are arranged in the third hierarchy. The Here, the temporary node 12 is recognized as a node arranged across the two layers of the third layer and the fourth layer. Generally, a temporary node may be arranged in one hierarchy or may be arranged across two or more hierarchies. The maximum size of nodes that can be arranged in one hierarchy is determined in advance, and the second layout position calculation means 533 determines the size of the temporary node that is arranged this time as the maximum size of nodes that can be arranged in one hierarchy. The number of hierarchies in which the temporary node is arranged is determined. Next, the second layout position calculation means 533 performs processing according to the ordering step in the Sugiyama algorithm. Thus, in the first hierarchy, node 2 is arranged first, node 9 is arranged second, node 1 is arranged third, and in the second hierarchy, node 4 is arranged first and node 10 is arranged second. In the third hierarchy, it is determined that the node 7 is placed first, the temporary node 12 is placed second, and the node 6 is placed third. Thereafter, the second layout position calculation means 533 performs processing according to the coordinate assignment step in the Sugiyama algorithm, and the layout position of the temporary node 12 and each of the nodes 1, 2, 3, 4, 6, 7, 9, 10 Determine the coordinates. In this way, layout source data for laying out the temporary node 12 and each of the nodes 1, 2, 3, 4, 6, 7, 9, and 10 is generated as a result of the processing by the second layout position calculation means 533. FIG. 10 is a diagram showing an example of layout source data generated by the second layout position calculation means 533 for laying out the temporary node and each node other than the selected node. FIG. 11 shows a graph corresponding to the layout source data shown in FIG. Comparing the graph shown in FIG. 11 with the basic graph shown in FIG. 6, the layers to which the nodes 1, 2, 3, 4, 6, 7, 9, and 10 are assigned are the same, but the arrangement of the nodes in each layer The order is different. This is a result of processing with the selection nodes 5, 8, and 11 replaced with one temporary node 12. 11 is a diagram for explaining the contents of FIG. 10, and the graph shown in FIG. 11 is not actually displayed on the screen of the display device 20.

次に、制御部50の第三のレイアウト位置算出手段534は、第二のレイアウト位置算出手段533で得られた仮ノード12と選択ノード5,8,11以外の各ノード1,2,3,4,6,7,9,10とのレイアウト位置に関するデータによって定められる仮ノード12及び選択ノード5,8,11以外の各ノード1,2,3,4,6,7,9,10についての相対的な位置関係を維持するという条件、及び、仮ノード12の代わりに選択ノード5,8,11の全体をレイアウトするという条件の下で、図2に示すグラフ構造データに基づいてSugiyamaアルゴリズムに従った処理を実行することにより、各ノード1〜11のレイアウト位置を算出する(S6)。このように、上記条件を課すことにより、この第三のレイアウト位置算出手段534による処理では、図10のレイアウト元データに示される各ノード1,2,3,4,6,7,9,10の相対的な位置関係がそのまま維持されることになる。また、図10のレイアウト元データに示される仮ノード12及び選択ノード5,8,11以外の各ノード1,2,3,4,6,7,9,10についての相対的な位置関係が維持されるので、仮ノード12の代わりに選択ノード5,8,11の全体をレイアウトすると、選択ノード5,8,11及び選択ノード5,8,11以外の各ノード1,2,3,4,6,7,9,10についての相対的な位置関係も、図10のレイアウト元データに示される位置関係と同様の位置関係に保持されることになる。   Next, the third layout position calculation unit 534 of the control unit 50 includes the temporary node 12 obtained by the second layout position calculation unit 533 and the nodes 1, 2, 3, other than the selection nodes 5, 8, 11. 4, 6, 7, 9, 10 for the nodes 1, 2, 3, 4, 6, 7, 9, 10 other than the temporary node 12 and the selection nodes 5, 8, 11 determined by the data regarding the layout position The Sugiyama algorithm is based on the graph structure data shown in FIG. 2 under the condition that the relative positional relationship is maintained and the condition that the entire selection nodes 5, 8, and 11 are laid out instead of the temporary node 12. The layout position of each node 1-11 is calculated by performing the process according to (S6). In this way, by imposing the above conditions, in the processing by the third layout position calculation means 534, each of the nodes 1, 2, 3, 4, 6, 7, 9, 10 shown in the layout source data of FIG. The relative positional relationship is maintained as it is. Further, the relative positional relationship between the nodes 1, 2, 3, 4, 6, 7, 9, 10 other than the temporary node 12 and the selection nodes 5, 8, 11 shown in the layout source data of FIG. Therefore, when the entire selection nodes 5, 8, 11 are laid out instead of the temporary node 12, each of the nodes 1, 2, 3, 4, other than the selection nodes 5, 8, 11 and the selection nodes 5, 8, 11. The relative positional relationships for 6, 7, 9, and 10 are also held in the same positional relationship as that shown in the layout source data of FIG.

具体的に、まず、第三のレイアウト位置算出手段534は、Sugiyamaアルゴリズムにおける階層割当てステップに従った処理を行う。この階層割当てステップに従った処理では、第二のレイアウト位置算出手段533で得られた結果及び第一のレイアウト位置算出手段53で得られた結果を利用して、各ノード1〜11に対してそれを配置すべき階層を割り当てる。第二のレイアウト位置算出手段533で得られた結果によって定められる仮ノード12及び選択ノード5,8,11以外の各ノード1,2,3,4,6,7,9,10についての相対的な位置関係を維持するために、各ノード1,2,3,4,6,7,9,10は、第二のレイアウト位置算出手段533で決定された階層と同じ階層に配置されることになる。すなわち、ノード1,2,9を第1階層に配置し、ノード3,4,10を第2階層に配置し、ノード6,7を第3階層に配置することが決定される。また、仮ノード12の代わりに選択ノード5,8,11の全体をレイアウトするために、選択ノード5,8,11は、仮ノード12が配置される第3階層及び第4階層に配置されることになる。ここで、選択ノード5,8,11についての相対的な階層関係は維持される。第一のレイアウト位置算出手段531で得られた結果によれば、選択ノード5,11が最上位の階層に配置され、選択ノード8がその一つ下位の階層に配置されるので、選択ノード5,11を第3階層に配置し、選択ノード8を第4階層に配置することが決定される。こうして第三のレイアウト位置算出手段534が階層割当てステップに従った処理を行うことによって決定された各ノードの階層を図12(a)に示す。   Specifically, first, the third layout position calculation means 534 performs processing according to the hierarchy assignment step in the Sugiyama algorithm. In the processing in accordance with this hierarchy assignment step, each of the nodes 1 to 11 is used by using the result obtained by the second layout position calculating unit 533 and the result obtained by the first layout position calculating unit 53. Assign the hierarchy where it should be placed. Relative with respect to each of the nodes 1, 2, 3, 4, 6, 7, 9, 10 other than the temporary node 12 and the selection nodes 5, 8, 11 determined by the result obtained by the second layout position calculation means 533 In order to maintain a good positional relationship, the nodes 1, 2, 3, 4, 6, 7, 9, and 10 are arranged in the same hierarchy as the hierarchy determined by the second layout position calculation means 533. Become. That is, it is determined that the nodes 1, 2, 9 are arranged in the first hierarchy, the nodes 3, 4, 10 are arranged in the second hierarchy, and the nodes 6, 7 are arranged in the third hierarchy. Further, in order to lay out the entire selection nodes 5, 8, 11 instead of the temporary node 12, the selection nodes 5, 8, 11 are arranged in the third hierarchy and the fourth hierarchy in which the temporary node 12 is arranged. It will be. Here, the relative hierarchical relationship with respect to the selection nodes 5, 8, and 11 is maintained. According to the result obtained by the first layout position calculation means 531, the selection nodes 5 and 11 are arranged in the highest hierarchy, and the selection node 8 is arranged in the next lower hierarchy. , 11 are arranged in the third hierarchy, and the selection node 8 is arranged in the fourth hierarchy. FIG. 12A shows the hierarchy of each node determined by the third layout position calculation means 534 performing the process according to the hierarchy assignment step.

次に、第三のレイアウト位置算出手段534は、Sugiyamaアルゴリズムにおける順序付けステップに従った処理を行う。この順序付けステップに従った処理でも、第二のレイアウト位置算出手段533で得られた結果及び第一のレイアウト位置算出手段531で得られた結果を利用して、各階層において、当該階層に割り当てられた各ノードに対してそれを配置する順序を決定する。第二のレイアウト位置算出手段533で得られた結果によって定められる仮ノード12及び選択ノード5,8,11以外の各ノード1,2,3,4,6,7,9,10についての相対的な位置関係を維持するために、仮ノード12が配置されていない第1階層及び第2階層においては、当該階層に割り当てられた各ノードに対してそれを配置する順序を変更しない。すなわち、第1階層においては、ノード2を1番目に、ノード9を2番目に、ノード1を3番目に配置し、第2階層においては、ノード4を1番目に、ノード10を2番目に、ノード3を3番目に配置することが決定される。一方、仮ノード12が配置された第3階層においては、ノード6,7と仮ノード12に対応するノード5,11との間の位置関係だけは変更しないようにする。すなわち、ノード6とノード7との間に、ノード5,11が配置されるようにする。また、エッジe7についてはその始点にノード4が接続され、その終点にノード8が接続されるが、ノード4は第2階層に配置され、ノード8は第4階層に配置されるため、第3階層にはダミーのノードd1が追加される。そして、この第3階層において、エッジの単一方向性やエッジの交差数の最小性等の条件をできる限り満たすように、各ノード6,7,5,11及びダミーノードd1に対してそれを配置する順序が決定される。例えば、第3階層においては、ノード7を1番目に、ダミーのノードd1を2番目に、ノード11を3番目に、ノード5を4番目に、そして、ノード6を5番目に配置することが決定される。そして、このとき、第三のレイアウト位置算出手段534は、ダミーノードd1の追加に応じた修正をエッジデータに加え、その修正を加えたエッジデータを修正エッジデータとしてRAM40に一時記憶しておく。この修正エッジデータは、図4に示すものと同じである。すなわち、その修正エッジデータには、エッジe7についてのエッジデータの代わりに、ノード4とダミーノードd1とを接続するエッジe7’についてのエッジデータと、ダミーノードd1とノード8とを接続するエッジe7”についてのエッジデータとが含まれている。更に、第4階層にはノード8が一つだけ配置されるので、ノード8を1番目に配置することが決定される。こうして第三のレイアウト位置算出手段534が順序付けステップに従った処理を行うことによって決定された各ノードの階層及び階層内順序を図12(b)に示す。   Next, the third layout position calculation means 534 performs processing according to the ordering step in the Sugiyama algorithm. Even in the processing according to the ordering step, the result obtained by the second layout position calculating unit 533 and the result obtained by the first layout position calculating unit 531 are used to assign the layer to the layer. Determine the order in which to place each node. Relative with respect to each of the nodes 1, 2, 3, 4, 6, 7, 9, 10 other than the temporary node 12 and the selection nodes 5, 8, 11 determined by the result obtained by the second layout position calculation means 533 In order to maintain a proper positional relationship, in the first hierarchy and the second hierarchy where the temporary node 12 is not arranged, the order of arranging the nodes assigned to the hierarchy is not changed. That is, in the first hierarchy, node 2 is arranged first, node 9 is arranged second, node 1 is arranged third, node 4 is arranged first, and node 10 is arranged second in the second hierarchy. , It is determined that the node 3 is arranged third. On the other hand, in the third hierarchy in which the temporary node 12 is arranged, only the positional relationship between the nodes 6 and 7 and the nodes 5 and 11 corresponding to the temporary node 12 is not changed. That is, the nodes 5 and 11 are arranged between the node 6 and the node 7. Further, for the edge e7, the node 4 is connected to the start point and the node 8 is connected to the end point, but the node 4 is arranged in the second hierarchy, and the node 8 is arranged in the fourth hierarchy. A dummy node d1 is added to the hierarchy. In this third hierarchy, each of the nodes 6, 7, 5, 11 and the dummy node d 1 is subjected to the conditions such as the unidirectionality of the edges and the minimum number of intersections of the edges as much as possible. The order of placement is determined. For example, in the third hierarchy, the node 7 is arranged first, the dummy node d1 is arranged second, the node 11 is arranged third, the node 5 is arranged fourth, and the node 6 is arranged fifth. It is determined. At this time, the third layout position calculation means 534 adds the correction according to the addition of the dummy node d1 to the edge data, and temporarily stores the edge data after the correction in the RAM 40 as the corrected edge data. The corrected edge data is the same as that shown in FIG. That is, in the modified edge data, instead of the edge data about the edge e7, the edge data about the edge e7 ′ connecting the node 4 and the dummy node d1, and the edge e7 connecting the dummy node d1 and the node 8 are included. In addition, since only one node 8 is arranged in the fourth layer, it is determined that the node 8 is arranged first. In this way, the third layout position is determined. FIG. 12B shows the hierarchy of each node and the order within the hierarchy determined by the calculation means 534 performing processing according to the ordering step.

次に、第三のレイアウト位置算出手段534は、Sugiyamaアルゴリズムにおける座標付与ステップに従った処理を行う。すなわち、エッジの垂直性の条件をできる限り満たすように、ダミーノードを含む各ノードの位置を決定し、各ノードのレイアウト位置座標を算出する。こうして、第三のレイアウト位置算出手段534による処理の結果、各ノード1〜11,d1をレイアウトするためのレイアウト元データが生成される。図13は第三のレイアウト位置算出手段534によって生成される、各ノード1〜11,d1をレイアウトするためのレイアウト元データの例を示す図である。図13に示すレイアウト元データの内容については次のような特徴がある。すなわち、ノード間の相対的な位置関係は、図10に示すレイアウト元データによって定められるノード間の相対的な位置関係と変わらないが、仮ノードの代わりに選択ノード5,8,11の全体をレイアウトしたため、選択ノード5,8,11のレイアウト位置に応じて、全てのノードの位置座標が、図10に示すレイアウト元データにおけるものとは異なっている。また、選択ノード5,8,11のうち選択ノード8については、エッジの垂直性の条件を考慮した結果、選択ノード5,11に対する選択ノード8の相対的な位置座標が図8に示すものと異なっている。尚、一般に、第三のレイアウト位置算出手段534により順序付けステップに従った処理が実行された結果、階層内での選択ノードの順序が変更になることがあり、この場合にも、選択ノードの中でそれらの相対的な位置座標が異なることになる。また、選択ノードが最終的に配置される位置の座標により、選択ノードの全体がレイアウトされる領域の大きさは、領域決定手段532で決定された領域の大きさよりも拡がる場合がある。   Next, the third layout position calculation means 534 performs processing according to the coordinate assignment step in the Sugiyama algorithm. That is, the position of each node including the dummy node is determined so as to satisfy the edge verticality condition as much as possible, and the layout position coordinate of each node is calculated. Thus, layout source data for laying out the nodes 1 to 11 and d1 is generated as a result of the processing by the third layout position calculation means 534. FIG. 13 is a diagram showing an example of layout source data for laying out each of the nodes 1 to 11 and d1 generated by the third layout position calculation means 534. The contents of the layout original data shown in FIG. 13 have the following characteristics. That is, the relative positional relationship between the nodes is the same as the relative positional relationship between the nodes determined by the layout source data shown in FIG. 10, but the entire selected nodes 5, 8, and 11 are replaced with the temporary nodes. Since the layout is performed, the position coordinates of all the nodes are different from those in the layout source data shown in FIG. 10 according to the layout positions of the selection nodes 5, 8, and 11. As for the selection node 8 among the selection nodes 5, 8, and 11, the relative position coordinates of the selection node 8 with respect to the selection nodes 5 and 11 are shown in FIG. Is different. In general, as a result of the execution of the process according to the ordering step by the third layout position calculation means 534, the order of the selected nodes in the hierarchy may be changed. Therefore, their relative position coordinates are different. Further, the size of the region where the entire selection node is laid out may be larger than the size of the region determined by the region determination unit 532 depending on the coordinates of the position where the selection node is finally arranged.

最後に、グラフ表示処理手段535は、第三のレイアウト位置算出手段534で得られた各ノード1〜11,d1のレイアウト元データとグラフ構造データとに基づいてグラフを生成し、表示装置20の画面に表示する(S7)。図14に図13に示すレイアウト元データに対応するグラフを示す。この図14のグラフが表示装置20の画面に表示される。このグラフ上には、選択ノード5,8,11の全体が互いに近接した位置にレイアウトされている。実際、図14のグラフでは、同一階層に配置される選択ノード5,11の間には選択ノード以外のノードはレイアウトされておらず、しかも、選択ノード5,8,11の全体を含む長方形の領域を、選択ノードと無関係のエッジが横切ることもない。但し、選択ノードと無関係のエッジが選択ノードの全体を含む長方形の領域を横切ることを許容するようにしてもよい。この場合、第三のレイアウト位置算出手段534は、その横切るエッジが選択ノードに重ならないように、各ノードのレイアウト位置座標を算出する必要がある。このように、選択ノードと無関係のエッジが選択ノードの全体を含む長方形の領域を横切ることを許容しても、本実施形態では、第三のレイアウト位置算出手段534が上記条件の下で各ノードのレイアウト位置座標を算出しているので、選択ノードの全体を含む長方形の領域に選択ノード以外のノードが入ることはない。   Finally, the graph display processing unit 535 generates a graph based on the layout source data and the graph structure data of each of the nodes 1 to 11 and d1 obtained by the third layout position calculation unit 534, and the display device 20 It is displayed on the screen (S7). FIG. 14 shows a graph corresponding to the layout source data shown in FIG. The graph of FIG. 14 is displayed on the screen of the display device 20. On this graph, the entire selection nodes 5, 8, and 11 are laid out at positions close to each other. In fact, in the graph of FIG. 14, no nodes other than the selected node are laid out between the selected nodes 5 and 11 arranged in the same hierarchy, and a rectangular shape including the entire selected nodes 5, 8 and 11 is used. The region is not traversed by edges unrelated to the selected node. However, an edge unrelated to the selected node may be allowed to cross a rectangular area including the entire selected node. In this case, the third layout position calculation means 534 needs to calculate the layout position coordinates of each node so that the crossing edge does not overlap the selected node. As described above, even if the edge unrelated to the selected node is allowed to cross the rectangular region including the entire selected node, in the present embodiment, the third layout position calculating unit 534 allows each node to be Since the layout position coordinates are calculated, no node other than the selected node enters the rectangular area including the entire selected node.

尚、ユーザは、こうして表示装置20の画面に表示されたグラフが未だ自分の意図したグラフになっておらず、そのグラフにおいてさらにいくつかのノードを互いに近接した位置にレイアウトしたいと考える場合には、再度、入力装置10を用いてノードを選択し、選択したノードを近接した位置にレイアウトする処理の実行を指示する命令を入力すればよい。   In addition, when the user wants to lay out some nodes in the graph closer to each other, the graph displayed on the screen of the display device 20 is not yet the graph intended by the user. Then, it is only necessary to select a node again using the input device 10 and input a command for instructing execution of a process of laying out the selected node in a close position.

本実施形態のグラフ生成装置は、入力装置を用いて選択された選択ノードの全体をレイアウトするのに必要な領域の形状・大きさを決定し、選択ノードの全体をその決定した領域の形状・大きさを有する一つの仮ノードで置き換えて、仮ノードと選択ノード以外の各ノードとについてのレイアウト位置を算出した後、その算出した結果によって定められる仮ノード及び選択ノード以外の各ノードについての相対的な位置関係を維持するという条件、及び、仮ノードの代わりに選択ノードの全体をレイアウトするという条件の下に、グラフ構造データに基づいて所定のグラフレイアウトアルゴリズムに従った処理を実行して、グラフのレイアウトを行う。このため、グラフ上には、選択ノードの全体が互いに近接した位置にレイアウトされるので、ユーザが意図したレイアウトのグラフを容易に生成することができる。   The graph generation apparatus according to the present embodiment determines the shape / size of an area necessary for laying out the entire selection node selected using the input device, and determines the shape / size of the determined area as the entire selection node. After replacing with a temporary node having a size and calculating the layout position for each node other than the temporary node and the selected node, relative to each node other than the temporary node and the selected node determined by the calculated result A process according to a predetermined graph layout algorithm based on the graph structure data under the condition of maintaining a general positional relationship and the condition of laying out the entire selected node instead of the temporary node, Lay out the graph. For this reason, since the entire selected nodes are laid out on the graph at positions close to each other, a graph having a layout intended by the user can be easily generated.

尚、本発明は上記の実施形態に限定されるものではなく、その要旨の範囲内において種々の変形が可能である。   In addition, this invention is not limited to said embodiment, A various deformation | transformation is possible within the range of the summary.

例えば、上記の実施形態では、仮ノードが最下層に配置される場合について説明したが、仮ノードは最上層や中間階層(一番上でも一番下でもない階層)に配置されてもよい。図15、図16及び図17は仮ノードが中間階層に配置される場合のグラフ生成処理の概要を説明するための図である。ここで、図15は図6と同様に図2のグラフ構造データを用いて作成された基本グラフである。図15に示すように、ユーザがノード3,4,6を選択ノードとして選択すると、第二のレイアウト位置算出手段533は、図16に示すようなグラフに対応するレイアウト元データを生成することになる。この図16では、仮ノード12’が中間階層に配置されている。ここで、仮ノード12’は、選択ノード3,4,6に代わりに置き換えられたものである。そして、第三のレイアウト位置算出手段534は、上記の実施形態で説明したように、仮ノード12’及び選択ノード3,4,6以外の各ノード1,2,5,7,8,9,10,11についての相対的な位置関係を維持するという条件、及び、仮ノード12’の代わりに選択ノード3,4,6の全体をレイアウトするという条件の下で、各ノード1〜11のレイアウト位置を算出することにより、図17に示すようなグラフに対応するレイアウト元データを生成する。このように、仮ノードが中間階層に配置される場合でも、上記の実施形態で説明したのと同様の処理を行うことにより、ユーザが意図したレイアウトのグラフを生成することができる。   For example, in the above-described embodiment, the case where the temporary node is arranged in the lowermost layer has been described. However, the temporary node may be arranged in the uppermost layer or the middle layer (hierarchy that is neither the top nor the bottom). 15, FIG. 16 and FIG. 17 are diagrams for explaining the outline of the graph generation processing when the temporary node is arranged in the intermediate hierarchy. Here, FIG. 15 is a basic graph created using the graph structure data of FIG. 2 as in FIG. As shown in FIG. 15, when the user selects nodes 3, 4, and 6 as selection nodes, the second layout position calculation means 533 generates layout source data corresponding to the graph as shown in FIG. Become. In FIG. 16, the temporary node 12 'is arranged in the intermediate hierarchy. Here, the temporary node 12 'is replaced with the selection nodes 3, 4, and 6 instead. Then, the third layout position calculation means 534, as described in the above embodiment, each of the nodes 1, 2, 5, 7, 8, 9, other than the temporary node 12 ′ and the selection nodes 3, 4, 6. The layout of each of the nodes 1 to 11 under the condition that the relative positional relationship with respect to 10 and 11 is maintained and the entire selection nodes 3, 4 and 6 are laid out instead of the temporary node 12 ′. By calculating the position, layout source data corresponding to the graph as shown in FIG. 17 is generated. As described above, even when the temporary node is arranged in the intermediate hierarchy, a graph having a layout intended by the user can be generated by performing the same processing as described in the above embodiment.

また、上記の実施形態では、ユーザが、入力装置を用いて、第一のグラフ生成手段によって生成されて表示装置の画面に表示された基本グラフにおいて、互いに近接した位置にレイアウトしたいノードを選択ノードとして選択する場合について説明したが、一般には、ユーザが、入力装置を用いて、グラフ構造データに基づいて表示装置の画面に表示された複数のノードの中から、互いに近接した位置にレイアウトしたいノードを選択ノードとして選択するようにすればよい。例えば、基本グラフを表示装置の画面に表示するのではなく、ノードデータを表示装置の画面に表示し、ユーザが、その表示されたノードデータに含まれる複数のノードの中から、互いに近接した位置にレイアウトしたいノードを選択ノードとして選択するようにしてもよい。また、上記の実施形態において、手作業により過去に作成されたグラフや有向グラフの階層レイアウトを行うアルゴリズム以外のグラフレイアウトアルゴリズムにより過去に作成されたグラフであっても、当該グラフに対してグラフ構造データが定義済みであれば、そのグラフを基本グラフとし、当該基本グラフにおいて選択ノードを選択することが可能である。   In the above embodiment, the user selects a node to be laid out at a position close to each other in the basic graph generated by the first graph generation unit and displayed on the screen of the display device using the input device. However, in general, the user wants to lay out at a position close to each other among a plurality of nodes displayed on the screen of the display device based on the graph structure data using the input device. May be selected as a selection node. For example, instead of displaying the basic graph on the screen of the display device, the node data is displayed on the screen of the display device, and the position where the user is close to each other among the plurality of nodes included in the displayed node data. A node to be laid out may be selected as a selection node. Further, in the above embodiment, even if the graph is created by the graph layout algorithm other than the algorithm for performing the hierarchical layout of the graph or the directed graph created manually in the past, the graph structure data for the graph Can be defined as a basic graph, and a selection node can be selected in the basic graph.

また、上記の実施形態では、説明を簡単にするために、ノードの数の少ないグラフを生成する場合について説明したが、ノードの数が数千〜数万であるようなグラフを生成する場合にも本発明のグラフ生成装置、グラフ生成方法及びグラフ生成プログラムを適用することができる。この場合であっても、ユーザの意図したとおりにレイアウトされたグラフを生成することができる。このため、本発明のグラフ生成装置、グラフ生成方法及びグラフ生成プログラムは、特に、システムプログラムのサブルーチン同士の呼び出し関係を示すコールグラフを生成する場合に用いるのに適している。例えば、対象のシステムアーキテクチャーの階層がコントローラ層、サービス/ロジック層、DAO(Data Access Object)層の3階層に分かれている場合、生成するコールグラフにおいては、メソッド(ノード)をこれら3階層に分けて表示させることができる。   Further, in the above embodiment, for simplifying the explanation, the case of generating a graph with a small number of nodes has been described. However, in the case of generating a graph having the number of nodes of thousands to tens of thousands. Also, the graph generation device, the graph generation method, and the graph generation program of the present invention can be applied. Even in this case, a graph laid out as intended by the user can be generated. For this reason, the graph generation apparatus, the graph generation method, and the graph generation program of the present invention are particularly suitable for use in generating a call graph indicating a call relationship between subroutines of a system program. For example, if the target system architecture layer is divided into three layers of a controller layer, a service / logic layer, and a DAO (Data Access Object) layer, the method (node) is divided into these three layers in the generated call graph. Can be displayed separately.

また、本発明のグラフ生成装置、グラフ生成方法及びグラフ生成プログラムは、コールグラフの他にも、ネットワーク上の機器構成や企業等の組織構成などを表すグラフ等、さまざまなグラフを生成する場合に適用することができる。   In addition to the call graph, the graph generation device, the graph generation method, and the graph generation program according to the present invention generate various graphs such as a graph representing a device configuration on a network and an organization configuration of a company. Can be applied.

更に、上記の実施形態では、グラフレイアウトアルゴリズムとしてSugiyamaアルゴリズムを用いた場合について説明したが、本発明で使用するグラフレイアウトアルゴリズムはSugiyamaアルゴリズムに限定されない。   Furthermore, in the above embodiment, the case where the Sugiyama algorithm is used as the graph layout algorithm has been described, but the graph layout algorithm used in the present invention is not limited to the Sugiyama algorithm.

加えて、上記の実施形態では、有向非循環グラフを生成する場合について説明したが、本発明のグラフ生成装置、グラフ生成方法及びグラフ生成プログラムは、例えば、有向循環グラフを生成する場合や、有向グラフ以外のグラフを生成する場合にも適用することができる。   In addition, in the above-described embodiment, the case of generating a directed acyclic graph has been described. However, the graph generation device, the graph generation method, and the graph generation program of the present invention, for example, generate a directed cyclic graph, It can also be applied to the case of generating a graph other than the directed graph.

以上説明したように、本発明のグラフ生成装置、グラフ生成方法及びグラフ生成プログラムによれば、入力手段を用いて選択された選択ノードの全体を一つの仮ノードで置き換えて、仮ノードと選択ノード以外の各ノードとについてのレイアウト位置を算出した後、その算出された仮ノードのレイアウト位置に、選択ノードの全体をレイアウトするという条件の下に、グラフ構造データに基づいて所定のグラフレイアウトアルゴリズムに従った処理を実行して、グラフのレイアウトを行う。このため、グラフ上には、選択ノードの全体が互いに近接した位置にレイアウトされるので、ユーザが意図したレイアウトのグラフを容易に生成することができる。したがって、本発明は、特に、システム開発において大規模なコールグラフ等を生成して表示手段の画面に表示する場合に用いるのに好適である。   As described above, according to the graph generation device, the graph generation method, and the graph generation program of the present invention, the entire selection node selected using the input unit is replaced with one temporary node, and the temporary node and the selection node are replaced. After calculating the layout position for each node other than the above, a predetermined graph layout algorithm is applied based on the graph structure data under the condition that the entire selected node is laid out at the calculated layout position of the temporary node. Perform the process according to the layout of the graph. For this reason, since the entire selected nodes are laid out on the graph at positions close to each other, a graph having a layout intended by the user can be easily generated. Therefore, the present invention is particularly suitable for use when a large-scale call graph or the like is generated and displayed on the screen of the display means in system development.

10 入力装置
20 表示装置
30 ROM
40 RAM
50 制御部
51 第一のグラフ生成手段
52 選択ノード特定データ生成手段
53 第二のグラフ生成手段
531 第一のレイアウト位置算出手段
532 領域決定手段
533 第二のレイアウト位置算出手段
534 第三のレイアウト位置算出手段
535 グラフ表示処理手段
10 Input device 20 Display device 30 ROM
40 RAM
50 control unit 51 first graph generating unit 52 selected node specifying data generating unit 53 second graph generating unit 531 first layout position calculating unit 532 region determining unit 533 second layout position calculating unit 534 third layout position Calculation means 535 Graph display processing means

Claims (10)

複数のノードとノード間を接続する複数のエッジとを含むグラフを生成して表示手段の画面に表示するグラフ生成装置において、
各ノードについてその形状及び大きさを示すデータと各エッジについてノードとの接続関係を示すデータとを含むグラフ構造データが記憶された記憶手段と、
前記記憶手段に記憶されている前記グラフ構造データに基づいて前記表示手段の画面に表示された複数のノードの中から、ユーザが入力手段を用いて、互いに近接した位置にレイアウトしたいノードを選択ノードとして選択したときに、その選択した前記選択ノードを特定する選択ノード特定データを生成して前記記憶手段に記憶する選択ノード特定データ生成手段と、
前記記憶手段に記憶されている前記選択ノード特定データによって特定される前記選択ノードの全体を一つの仮ノードで置き換えて、所定のグラフレイアウトアルゴリズムに従った処理を実行することにより、前記仮ノードと前記選択ノード以外の各ノードとのレイアウト位置を算出した後、その算出された前記仮ノードのレイアウト位置に、前記選択ノードの全体をレイアウトするという条件の下で、前記記憶手段に記憶されている前記グラフ構造データに基づいて前記グラフレイアウトアルゴリズムに従った処理を実行することにより、前記各ノードのレイアウト位置を算出し、その算出された結果に基づいてグラフを生成して、前記表示手段の画面に表示するグラフ生成手段と、
を備えることを特徴とするグラフ生成装置。
In a graph generation device for generating a graph including a plurality of nodes and a plurality of edges connecting the nodes and displaying the graph on the screen of the display means,
Storage means for storing graph structure data including data indicating the shape and size of each node and data indicating a connection relationship with the node for each edge;
Based on the graph structure data stored in the storage unit, the user selects a node to be laid out at a position close to each other by using the input unit from among a plurality of nodes displayed on the screen of the display unit. Selection node specifying data generating means for generating selected node specifying data for specifying the selected selection node and storing it in the storage means when selected as:
By replacing the entire selected node specified by the selected node specifying data stored in the storage means with one temporary node and executing processing according to a predetermined graph layout algorithm, After the layout position with each node other than the selected node is calculated, it is stored in the storage means under the condition that the entire selected node is laid out at the calculated layout position of the temporary node. By executing processing according to the graph layout algorithm based on the graph structure data, the layout position of each node is calculated, a graph is generated based on the calculated result, and the screen of the display means A graph generating means to be displayed on
A graph generation device comprising:
前記グラフ生成手段は、
前記選択ノード特定データ生成手段で得られた前記選択ノード特定データに基づいて前記グラフ構造データから前記選択ノードに関連するデータを抽出し、その抽出した前記選択ノードに関連するデータに基づいて前記グラフレイアウトアルゴリズムに従った処理を実行することにより、前記各選択ノードのレイアウト位置を算出する第一のレイアウト位置算出手段と、
前記第一のレイアウト位置算出手段で得られた前記各選択ノードのレイアウト位置に関するデータに基づいて、前記選択ノードの全体をレイアウトするのに必要な領域の形状・大きさを決定する領域決定手段と、
前記選択ノードの全体を、前記領域決定手段で決定された前記領域の形状・大きさと同じ形状・大きさを有する一つの仮ノードで置き換え、前記仮ノードの形状・大きさに関するデータ、前記仮ノードとの接続関係を示すデータ、及び、前記グラフ構造データのうち前記選択ノード以外の各ノードに関連するデータに基づいて、前記グラフレイアウトアルゴリズムに従った処理を実行することにより、前記仮ノードと前記選択ノード以外の各ノードとのレイアウト位置を算出する第二のレイアウト位置算出手段と、
前記第二のレイアウト位置算出手段で得られた前記仮ノードと前記選択ノード以外の各ノードとのレイアウト位置に関するデータによって定められる前記仮ノード及び前記選択ノード以外の各ノードについての相対的な位置関係を維持するという条件、及び、前記仮ノードの代わりに前記選択ノードの全体をレイアウトするという条件の下で、前記グラフ構造データに基づいて前記グラフレイアウトアルゴリズムに従った処理を実行することにより、前記グラフ構造データに記述されている各ノードのレイアウト位置を算出する第三のレイアウト位置算出手段と、
前記第三のレイアウト位置算出手段で得られた各ノードのレイアウト位置に関するデータと前記グラフ構造データとに基づいてグラフを生成し、前記表示手段の画面に表示するグラフ表示処理手段と、
を有することを特徴とする請求項1記載のグラフ生成装置。
The graph generation means includes:
Data related to the selected node is extracted from the graph structure data based on the selected node specifying data obtained by the selected node specifying data generating means, and the graph is based on the extracted data related to the selected node. First layout position calculation means for calculating a layout position of each selected node by executing a process according to a layout algorithm;
Area determining means for determining the shape and size of an area necessary for laying out the entire selected node based on data relating to the layout position of each selected node obtained by the first layout position calculating means; ,
The entire selected node is replaced with one temporary node having the same shape and size as the shape and size of the region determined by the region determining means, and data relating to the shape and size of the temporary node, the temporary node By executing processing according to the graph layout algorithm based on data indicating a connection relationship with the data and data related to each node other than the selected node in the graph structure data, the temporary node and the Second layout position calculating means for calculating a layout position with each node other than the selected node;
Relative positional relationship between the temporary node and each node other than the selected node determined by data on the layout position between the temporary node and each node other than the selected node obtained by the second layout position calculating means And a process according to the graph layout algorithm based on the graph structure data under the condition of maintaining the condition and the condition of laying out the entire selected node instead of the temporary node, Third layout position calculation means for calculating the layout position of each node described in the graph structure data;
A graph display processing means for generating a graph based on the data on the layout position of each node obtained by the third layout position calculating means and the graph structure data, and displaying the graph on the screen of the display means;
The graph generation apparatus according to claim 1, wherein:
前記グラフ構造データに基づいて前記グラフレイアウトアルゴリズムに従った処理を実行することによりグラフを生成し、前記表示手段の画面に表示する基本グラフ生成手段を備え、
前記選択ノード特定データ生成手段は、前記基本グラフ生成手段によって前記表示手段の画面に表示されたグラフにおいて、ユーザが前記入力手段を用いて、互いに近接した位置にレイアウトしたいノードを前記選択ノードとして選択したときに、その選択した前記選択ノードを特定する前記選択ノード特定データを生成することを特徴とする請求項1又は2記載のグラフ生成装置。
Generating a graph by executing processing according to the graph layout algorithm based on the graph structure data, and including basic graph generation means for displaying on the screen of the display means,
In the graph displayed on the screen of the display unit by the basic graph generation unit, the selection node specifying data generation unit selects, as the selection node, a node to be laid out at a position close to each other by using the input unit. The graph generation apparatus according to claim 1, wherein the selection node specifying data for specifying the selected node is generated.
前記記憶手段に記憶されている前記グラフ構造データは有向グラフに対するものであり、前記グラフレイアウトアルゴリズムは有向グラフの階層レイアウトを行うためのアルゴリズムであることを特徴とする請求項1、2又は3記載のグラフ生成装置。   4. The graph according to claim 1, wherein the graph structure data stored in the storage means is for a directed graph, and the graph layout algorithm is an algorithm for performing a hierarchical layout of a directed graph. Generator. コンピュータを利用して、複数のノードとノード間を接続する複数のエッジとを含むグラフを生成して前記コンピュータの表示手段の画面に表示するグラフ生成方法において、
前記コンピュータの記憶手段に記憶されている、各ノードについてその形状及び大きさを示すデータと各エッジについてノードとの接続関係を示すデータとを含むグラフ構造データに基づいて前記表示手段の画面に表示された複数のノードの中から、ユーザが前記コンピュータの入力手段を用いて、互いに近接した位置にレイアウトしたいノードを選択ノードとして選択したときに、前記コンピュータの制御手段が、その選択した前記選択ノードを特定する選択ノード特定データを生成して前記記憶手段に記憶する選択ノード特定データ生成ステップと、
前記制御手段が、前記記憶手段に記憶されている前記選択ノード特定データによって特定される前記選択ノードの全体を一つの仮ノードで置き換えて、所定のグラフレイアウトアルゴリズムに従った処理を実行することにより、前記仮ノードと前記選択ノード以外の各ノードとのレイアウト位置を算出した後、その算出された前記仮ノードのレイアウト位置に、前記選択ノードの全体をレイアウトするという条件の下で、前記記憶手段に記憶されている前記グラフ構造データに基づいて前記グラフレイアウトアルゴリズムに従った処理を実行することにより、前記各ノードのレイアウト位置を算出し、その算出された結果に基づいてグラフを生成して、前記表示手段の画面に表示するグラフ生成ステップと、
を具備することを特徴とするグラフ生成方法。
In the graph generation method of generating a graph including a plurality of nodes and a plurality of edges connecting the nodes using a computer and displaying the graph on the screen of the display means of the computer,
Displayed on the screen of the display means based on graph structure data stored in the storage means of the computer and including data indicating the shape and size of each node and data indicating the connection relationship between the nodes for each edge When the user selects a node to be laid out at a position close to each other using the input means of the computer from among the plurality of nodes selected, the control means of the computer selects the selected selection node Selecting node specifying data generating step for generating selection node specifying data for specifying and storing in the storage means;
The control means replaces the entire selected node specified by the selected node specifying data stored in the storage means with one temporary node, and executes processing according to a predetermined graph layout algorithm. The storage means under the condition that after calculating the layout position of the temporary node and each node other than the selected node, the entire selected node is laid out at the calculated layout position of the temporary node. By executing the processing according to the graph layout algorithm based on the graph structure data stored in, the layout position of each node is calculated, and a graph is generated based on the calculated result. A graph generation step for displaying on the screen of the display means;
A graph generation method comprising:
前記グラフ生成ステップは、
前記制御手段が、前記選択ノード特定データ生成ステップで得られた前記選択ノード特定データに基づいて前記グラフ構造データから前記選択ノードに関連するデータを抽出し、その抽出した前記選択ノードに関連するデータに基づいて前記グラフレイアウトアルゴリズムに従った処理を実行することにより、前記各選択ノードのレイアウト位置を算出する第一ステップと、
前記制御手段が、前記第一ステップで得られた前記各選択ノードのレイアウト位置に関するデータに基づいて、前記選択ノードの全体をレイアウトするのに必要な領域の形状・大きさを決定する第二ステップと、
前記制御手段が、前記選択ノードの全体を、前記第二ステップで決定された前記領域の形状・大きさと同じ形状・大きさを有する一つの仮ノードで置き換え、前記仮ノードの形状・大きさに関するデータ、前記仮ノードとの接続関係を示すデータ、及び、前記グラフ構造データのうち前記選択ノード以外の各ノードに関連するデータに基づいて、前記グラフレイアウトアルゴリズムに従った処理を実行することにより、前記仮ノードと前記選択ノード以外の各ノードとのレイアウト位置を算出する第三ステップと、
前記制御手段が、前記第三ステップで得られた前記仮ノードと前記選択ノード以外の各ノードとのレイアウト位置に関するデータによって定められる前記仮ノード及び前記選択ノード以外の各ノードについての相対的な位置関係を維持するという条件、及び、前記仮ノードの代わりに前記選択ノードの全体をレイアウトするという条件の下で、前記グラフ構造データに基づいて前記グラフレイアウトアルゴリズムに従った処理を実行することにより、前記グラフ構造データに記述されている各ノードのレイアウト位置を算出する第四ステップと、
前記制御手段が、前記第四ステップで得られた各ノードのレイアウト位置に関するデータと前記グラフ構造データとに基づいてグラフを生成し、前記表示手段の画面に表示する第五ステップと、
を備えることを特徴とする請求項5記載のグラフ生成方法。
The graph generation step includes:
The control means extracts data related to the selected node from the graph structure data based on the selected node specifying data obtained in the selected node specifying data generation step, and data related to the extracted selected node A first step of calculating a layout position of each selected node by executing processing according to the graph layout algorithm based on
A second step in which the control means determines the shape and size of an area necessary for laying out the entire selected node based on the data relating to the layout position of each selected node obtained in the first step; When,
The control means replaces the entire selected node with one temporary node having the same shape and size as the shape and size of the region determined in the second step, and relates to the shape and size of the temporary node. By executing processing according to the graph layout algorithm based on data, data indicating a connection relationship with the temporary node, and data related to each node other than the selected node in the graph structure data, A third step of calculating layout positions of the temporary node and each node other than the selected node;
Relative position of each node other than the temporary node and the selected node determined by the control unit with respect to the layout position of the temporary node and each node other than the selected node obtained in the third step. By executing processing according to the graph layout algorithm based on the graph structure data under the condition of maintaining the relationship and the condition of laying out the entire selected node instead of the temporary node, A fourth step of calculating a layout position of each node described in the graph structure data;
A fifth step in which the control means generates a graph based on the data on the layout position of each node obtained in the fourth step and the graph structure data, and displays the graph on the screen of the display means;
The graph generation method according to claim 5, further comprising:
前記記憶手段に記憶されている前記グラフ構造データは有向グラフに対するものであり、前記グラフレイアウトアルゴリズムは有向グラフの階層レイアウトを行うためのアルゴリズムであることを特徴とする請求項5又は6記載のグラフ生成方法。   7. The graph generation method according to claim 5, wherein the graph structure data stored in the storage means is for a directed graph, and the graph layout algorithm is an algorithm for performing hierarchical layout of a directed graph. . コンピュータを利用して、複数のノードとノード間を接続する複数のエッジとを含むグラフを生成して前記コンピュータの表示手段の画面に表示するためのグラフ生成プログラムにおいて、
前記コンピュータに、
前記コンピュータの記憶手段に記憶されている、各ノードについてその形状及び大きさを示すデータと各エッジについてノードとの接続関係を示すデータとを含むグラフ構造データに基づいて前記表示手段の画面に表示された複数のノードの中から、ユーザが前記コンピュータの入力手段を用いて、互いに近接した位置にレイアウトしたいノードを選択ノードとして選択したときに、その選択した前記選択ノードを特定する選択ノード特定データを生成して前記記憶手段に記憶する選択ノード特定データ生成機能と、
前記記憶手段に記憶されている前記選択ノード特定データによって特定される前記選択ノードの全体を一つの仮ノードで置き換えて、所定のグラフレイアウトアルゴリズムに従った処理を実行することにより、前記仮ノードと前記選択ノード以外の各ノードとのレイアウト位置を算出した後、その算出された前記仮ノードのレイアウト位置に、前記選択ノードの全体をレイアウトするという条件の下で、前記記憶手段に記憶されている前記グラフ構造データに基づいて前記グラフレイアウトアルゴリズムに従った処理を実行することにより、前記各ノードのレイアウト位置を算出し、その算出された結果に基づいてグラフを生成して、前記表示手段の画面に表示するグラフ生成機能と、
を実現させることを特徴とするグラフ生成プログラム。
In a graph generation program for generating a graph including a plurality of nodes and a plurality of edges connecting between the nodes using a computer and displaying the graph on the screen of the display means of the computer,
In the computer,
Displayed on the screen of the display means based on graph structure data stored in the storage means of the computer and including data indicating the shape and size of each node and data indicating the connection relationship between the nodes for each edge Selection node specifying data for specifying the selected node when the user selects a node to be laid out at a position close to each other using the input means of the computer from among the plurality of nodes selected A selected node specifying data generating function for generating and storing in the storage means;
By replacing the entire selected node specified by the selected node specifying data stored in the storage means with one temporary node and executing processing according to a predetermined graph layout algorithm, After the layout position with each node other than the selected node is calculated, it is stored in the storage means under the condition that the entire selected node is laid out at the calculated layout position of the temporary node. By executing processing according to the graph layout algorithm based on the graph structure data, the layout position of each node is calculated, a graph is generated based on the calculated result, and the screen of the display means Graph generation function to be displayed in
A graph generation program characterized by realizing the above.
前記グラフ生成機能は、
前記選択ノード特定データ生成機能で得られた前記選択ノード特定データに基づいて前記グラフ構造データから前記選択ノードに関連するデータを抽出し、その抽出した前記選択ノードに関連するデータに基づいて前記グラフレイアウトアルゴリズムに従った処理を実行することにより、前記各選択ノードのレイアウト位置を算出する第一のレイアウト位置算出機能と、
前記第一のレイアウト位置算出機能で得られた前記各選択ノードのレイアウト位置に関するデータに基づいて、前記選択ノードの全体をレイアウトするのに必要な領域の形状・大きさを決定する領域決定機能と、
前記選択ノードの全体を、前記領域決定機能で決定された前記領域の形状・大きさと同じ形状・大きさを有する一つの仮ノードで置き換え、前記仮ノードの形状・大きさに関するデータ、前記仮ノードとの接続関係を示すデータ、及び、前記グラフ構造データのうち前記選択ノード以外の各ノードに関連するデータに基づいて、前記グラフレイアウトアルゴリズムに従った処理を実行することにより、前記仮ノードと前記選択ノード以外の各ノードとのレイアウト位置を算出する第二のレイアウト位置算出機能と、
前記第二のレイアウト位置算出機能で得られた前記仮ノードと前記選択ノード以外の各ノードとのレイアウト位置に関するデータによって定められる前記仮ノード及び前記選択ノード以外の各ノードについての相対的な位置関係を維持するという条件、及び、前記仮ノードの代わりに前記選択ノードの全体をレイアウトするという条件の下で、前記グラフ構造データに基づいて前記グラフレイアウトアルゴリズムに従った処理を実行することにより、前記グラフ構造データに記述されている各ノードのレイアウト位置を算出する第三のレイアウト位置算出機能と、
前記第三のレイアウト位置算出機能で得られた各ノードのレイアウト位置に関するデータと前記グラフ構造データとに基づいてグラフを生成し、前記表示手段の画面に表示するグラフ表示処理機能と、
を備えることを特徴とする請求項8記載のグラフ生成プログラム。
The graph generation function is:
Data related to the selected node is extracted from the graph structure data based on the selected node specifying data obtained by the selected node specifying data generation function, and the graph is extracted based on the extracted data related to the selected node. A first layout position calculating function for calculating a layout position of each selected node by executing a process according to a layout algorithm;
An area determining function for determining the shape and size of an area necessary for laying out the entire selected node based on data relating to the layout position of each selected node obtained by the first layout position calculating function; ,
The entire selected node is replaced with one temporary node having the same shape / size as the shape / size of the area determined by the area determination function, and data related to the shape / size of the temporary node, the temporary node By executing processing according to the graph layout algorithm based on data indicating a connection relationship with the data and data related to each node other than the selected node in the graph structure data, the temporary node and the A second layout position calculation function for calculating a layout position with each node other than the selected node;
Relative positional relationship between the temporary node and each node other than the selected node determined by data on the layout position between the temporary node and each node other than the selected node obtained by the second layout position calculating function And a process according to the graph layout algorithm based on the graph structure data under the condition of maintaining the condition and the condition of laying out the entire selected node instead of the temporary node, A third layout position calculation function for calculating the layout position of each node described in the graph structure data;
A graph display processing function for generating a graph based on the data regarding the layout position of each node obtained by the third layout position calculation function and the graph structure data, and displaying the graph on the screen of the display means;
The graph generation program according to claim 8, further comprising:
前記記憶手段に記憶されている前記グラフ構造データは有向グラフに対するものであり、前記グラフレイアウトアルゴリズムは有向グラフの階層レイアウトを行うためのアルゴリズムであることを特徴とする請求項8又は9記載のグラフ生成プログラム。   10. The graph generation program according to claim 8, wherein the graph structure data stored in the storage means is for a directed graph, and the graph layout algorithm is an algorithm for performing a hierarchical layout of a directed graph. .
JP2013212281A 2013-10-09 2013-10-09 Graph generation apparatus, graph generation method, and graph generation program Active JP6028703B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013212281A JP6028703B2 (en) 2013-10-09 2013-10-09 Graph generation apparatus, graph generation method, and graph generation program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013212281A JP6028703B2 (en) 2013-10-09 2013-10-09 Graph generation apparatus, graph generation method, and graph generation program

Publications (2)

Publication Number Publication Date
JP2015075960A true JP2015075960A (en) 2015-04-20
JP6028703B2 JP6028703B2 (en) 2016-11-16

Family

ID=53000757

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013212281A Active JP6028703B2 (en) 2013-10-09 2013-10-09 Graph generation apparatus, graph generation method, and graph generation program

Country Status (1)

Country Link
JP (1) JP6028703B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101974069B1 (en) * 2018-04-30 2019-04-30 한국과학기술원 System and method for visualizing binary structure
JP2019144780A (en) * 2018-02-19 2019-08-29 ヤフー株式会社 Generating device, generating method, and generating program
JP2021529381A (en) * 2018-06-28 2021-10-28 マグナビュー ビー.ブイ.Magnaview B.V. Determining a stable graph layout

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11144071A (en) * 1997-09-18 1999-05-28 Mitsubishi Electric Inf Technol Center America Inc Device, method, and interface for drawing graph
JP2003016465A (en) * 2001-06-19 2003-01-17 Internatl Business Mach Corp <Ibm> Graphics image generating device, and its method and program
WO2013128974A1 (en) * 2012-03-02 2013-09-06 インターナショナル・ビジネス・マシーンズ・コーポレーション Data display device, data display method and program

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11144071A (en) * 1997-09-18 1999-05-28 Mitsubishi Electric Inf Technol Center America Inc Device, method, and interface for drawing graph
JP2003016465A (en) * 2001-06-19 2003-01-17 Internatl Business Mach Corp <Ibm> Graphics image generating device, and its method and program
WO2013128974A1 (en) * 2012-03-02 2013-09-06 インターナショナル・ビジネス・マシーンズ・コーポレーション Data display device, data display method and program

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019144780A (en) * 2018-02-19 2019-08-29 ヤフー株式会社 Generating device, generating method, and generating program
KR101974069B1 (en) * 2018-04-30 2019-04-30 한국과학기술원 System and method for visualizing binary structure
JP2021529381A (en) * 2018-06-28 2021-10-28 マグナビュー ビー.ブイ.Magnaview B.V. Determining a stable graph layout
JP7377476B2 (en) 2018-06-28 2023-11-10 マグナビュー ビー.ブイ. Determining a stable graph layout
US12013896B2 (en) 2018-06-28 2024-06-18 Magnaview B.V. Stable graph layout determination

Also Published As

Publication number Publication date
JP6028703B2 (en) 2016-11-16

Similar Documents

Publication Publication Date Title
JP6168475B2 (en) Graph generation apparatus, graph generation method, and graph generation program
US7676348B2 (en) Layout design support system, method, and program
JP5349127B2 (en) Layout design support system, control method thereof, and control program
US7650565B2 (en) Method for managing annotations in a computer-aided design drawing
KR101778737B1 (en) Image processing device and image processing program
JP2010108321A (en) Construction progress visualization system
CN101140516A (en) Method and system for dynamic laying-out interface element
EP3465426B1 (en) User interface with movable mini-tabs
JP5006272B2 (en) Wire drawing component drawing creation apparatus and method, and program
JP4861125B2 (en) Layout design support system and method, and program
JP6028703B2 (en) Graph generation apparatus, graph generation method, and graph generation program
US11238833B2 (en) Methods and systems for display screens with relative coordinate systems
JP2017091539A (en) Ensuring that tunnel designs stay within specified design parameters and tolerances
US20170344199A1 (en) Display control method, display control device, and recording medium
JPWO2014061093A1 (en) Screen creation device and screen creation method
JP2015170009A (en) Display information generation device, program execution situation display system, method and program
JP2017123061A (en) Visualization system of finished shape and visualization data generation program of finished shape
JP5519575B2 (en) Plant construction process creation support system, plant construction process creation support method and program
WO2018163421A1 (en) System configuration creation assistance device
JP6299151B2 (en) Display program, auxiliary information automatic arrangement apparatus, and method
JP2016212613A (en) Device for evaluating effect of change in plant construction process
JP4958073B2 (en) Evaluation system, evaluation method, and evaluation program
JP5961525B2 (en) Pipe network calculator
JP2020013377A (en) Drawing check support device
JP6790200B2 (en) Information processing device and grouping execution / cancellation method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20151208

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20160915

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20161003

R150 Certificate of patent or registration of utility model

Ref document number: 6028703

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250