drawing graphs with nonuniform nodes using potential...

25
Drawing Graphs with Nonuniform Nodes Using Potential Fields Chun-Cheng Lin ab , Hsu-Chun Yen ac, and Jen-Hui Chuang d a Department of Electrical Engineering, National Taiwan University, Taipei, Taiwan 106, R.O.C. b Department of Computer Science and Information Engineering, National Kaohsiung University of Applied Sciences, Kaohsiung, Taiwan 807, R.O.C. c Department of Computer Science, Kainan University, Taoyuan, Taiwan 338, R.O.C. d Department of Computer Science, National Chiao-Tung University, Hsinchu, Taiwan 300, R.O.C. Graphs with nonuniform nodes arise naturally in many real-world applications. Although graph drawing has been a very active research in the computer science community during the past decade, most of the graph drawing algorithms developed thus far have been designed for graphs whose nodes are represented as single points. As a result, it is of importance to develop drawing methods for graphs whose nodes are of different sizes and shapes, in order to meet the need of real-world applications. To this end, a potential field approach, coupled with an idea commonly found in force-directed methods, is proposed in this paper for drawing graphs with nonuniform nodes in 2-D and 3-D. In our framework, nonuniform nodes are uniformly charged, while edges are modelled by springs. Using certain techniques developed in the field of potential-based path planning, we are able to find analytically tractable procedures for computing the repulsive force and torque of a node in the potential field induced by the remaining nodes. The crucial feature of our approach is that the rotation of every nonuniform node and the multiple edges between two nonuniform nodes are taken into account. In comparison with the existing algorithms found in the literature, our experimental results suggest this new approach to be promising, as drawings of good quality for a variety of moderate-sized graphs in 2-D and 3-D can be produced reasonably efficiently. That is, our approach is suitable for moderate-sized interactive graphs or larger-sized static graphs. Furthermore, to illustrate the usefulness of our new drawing method for graphs with zero-sized nodes, we give an application to the visualization of hierarchical clustered graphs, for which our method offers a very efficient solution. 1. Introduction As graphs are known to be one of the most im- portant abstract models in various scientific and engineering areas, graph drawing (or information visualization in a broader sense) has naturally emerged as a fast growing research topic in com- puter science (e.g., see [1]). In visualizing graphs associated with real-world entities, it is common to annotate each node with some labels (such as name, attribute), and a good way to display such A preliminary version of this work was presented at the 11th International Symposium on Graph Drawing, September 21-24, 2003, Perugia, Italy. Corresponding author; research supported in part by NSC Grant 97-2221-E-002-094-MY3. E-mail: [email protected] information (in the form of text or icon) is to fill the information inside the drawing of the node. As a result, it is of importance and interest to be able to cope with nodes of different sizes and shapes in graph drawing. Among the various graph drawing techniques reported in the literature, the so-called force- directed methods (see, e.g., [2–11]) have received much attention and have become very popular for drawing undirected graphs. In such a frame- work, a graph is viewed as a system of particles with forces acting between the particles, and then a good configuration or drawing of the particles could be generated with locally minimal energy, i.e., the sum of the forces on each particle is zero. According to the experimental and theoretical re- 1

Upload: others

Post on 17-Jun-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Drawing Graphs with Nonuniform Nodes Using Potential Fieldsacms.nctu.edu.tw/papers/JVLC2009-potential.pdf · Drawing Graphs with Nonuniform Nodes Using Potential Fields∗ Chun-Cheng

Drawing Graphs with Nonuniform Nodes Using Potential Fields∗

Chun-Cheng Linab, Hsu-Chun Yenac†, and Jen-Hui Chuangd

aDepartment of Electrical Engineering, National Taiwan University, Taipei, Taiwan 106, R.O.C.

bDepartment of Computer Science and Information Engineering, National Kaohsiung University ofApplied Sciences, Kaohsiung, Taiwan 807, R.O.C.

cDepartment of Computer Science, Kainan University, Taoyuan, Taiwan 338, R.O.C.

dDepartment of Computer Science, National Chiao-Tung University, Hsinchu, Taiwan 300, R.O.C.

Graphs with nonuniform nodes arise naturally in many real-world applications. Although graph drawing hasbeen a very active research in the computer science community during the past decade, most of the graph drawingalgorithms developed thus far have been designed for graphs whose nodes are represented as single points. As aresult, it is of importance to develop drawing methods for graphs whose nodes are of different sizes and shapes,in order to meet the need of real-world applications. To this end, a potential field approach, coupled with anidea commonly found in force-directed methods, is proposed in this paper for drawing graphs with nonuniformnodes in 2-D and 3-D. In our framework, nonuniform nodes are uniformly charged, while edges are modelledby springs. Using certain techniques developed in the field of potential-based path planning, we are able to findanalytically tractable procedures for computing the repulsive force and torque of a node in the potential fieldinduced by the remaining nodes. The crucial feature of our approach is that the rotation of every nonuniformnode and the multiple edges between two nonuniform nodes are taken into account. In comparison with theexisting algorithms found in the literature, our experimental results suggest this new approach to be promising,as drawings of good quality for a variety of moderate-sized graphs in 2-D and 3-D can be produced reasonablyefficiently. That is, our approach is suitable for moderate-sized interactive graphs or larger-sized static graphs.Furthermore, to illustrate the usefulness of our new drawing method for graphs with zero-sized nodes, we givean application to the visualization of hierarchical clustered graphs, for which our method offers a very efficientsolution.

1. Introduction

As graphs are known to be one of the most im-portant abstract models in various scientific andengineering areas, graph drawing (or informationvisualization in a broader sense) has naturallyemerged as a fast growing research topic in com-puter science (e.g., see [1]). In visualizing graphsassociated with real-world entities, it is commonto annotate each node with some labels (such asname, attribute), and a good way to display such

∗A preliminary version of this work was presented atthe 11th International Symposium on Graph Drawing,September 21-24, 2003, Perugia, Italy.†Corresponding author; research supported in partby NSC Grant 97-2221-E-002-094-MY3. E-mail:[email protected]

information (in the form of text or icon) is to fillthe information inside the drawing of the node.As a result, it is of importance and interest tobe able to cope with nodes of different sizes andshapes in graph drawing.

Among the various graph drawing techniquesreported in the literature, the so-called force-directed methods (see, e.g., [2–11]) have receivedmuch attention and have become very popularfor drawing undirected graphs. In such a frame-work, a graph is viewed as a system of particleswith forces acting between the particles, and thena good configuration or drawing of the particlescould be generated with locally minimal energy,i.e., the sum of the forces on each particle is zero.According to the experimental and theoretical re-

1

Page 2: Drawing Graphs with Nonuniform Nodes Using Potential Fieldsacms.nctu.edu.tw/papers/JVLC2009-potential.pdf · Drawing Graphs with Nonuniform Nodes Using Potential Fields∗ Chun-Cheng

2 C.-C. Lin, H.-C. Yen, and J.-H. Chuang

sults of [12,13], graph drawing methods based onthe force-directed strategy usually enjoy the meritof producing graph layouts with a high degree ofsymmetry and uniformity of the edge length.

Unfortunately, most of the conventional force-directed graph drawing algorithms only deal withgraphs with zero-sized nodes. A naive exten-sion of conventional drawing algorithms by plug-ging in objects of nonzero size for point nodes inthe drawing is unlikely to produce a high qualitydrawing. In view of this, it becomes apparent thata new line of research has to be carried out in hopeof narrowing the gap between the conventionalforce-directed algorithms and graphs consistingof nodes of various sizes and shapes that are fre-quently encountered in the real world. Aboutprevious work, Harel and Koren [14] extendedthe conventional force-directed methods to de-velop three new algorithms to draw graphs witheither elliptic or rectangular nodes. Huang andLai [15] proposed a force-directed graph drawingalgorithm for graphs with rectangular nodes inwhich they guaranteed that there is no overlap-ping between any pair of rectangular nodes.

In this paper, we present a new approach, com-bining the force-directed strategy as well as thetheory of potential fields, for drawing graphs withnonuniform nodes. Although there exist otherconventions (e.g., like hierarchical-layered draw-ing [16] and orthogonal drawing [17]) for drawinggraphs with nonuniform nodes, we for the firsttime take node rotations into account when im-plementing our force-directed-based drawing al-gorithm. The concept of potential fields hasalready found applications in a variety of ar-eas in computer science and engineering, suchas path planning [18,19], among others. In oursetting, each edge is modelled by a spring (likein conventional force-directed methods) and theboundary of every nonuniform node is uniformlycharged. We consider both 2-D and 3-D drawingsof nonuniform nodes, each of which is representedby a polygon (in 2-D) or polyhedron (in 3-D).Other shapes of objects can be approximated bytheir enclosing polygons (or polyhedrons). For agiven nonuniform node, the forces on the nodecome from two sources: one resulting from beingconnected by springs, and the other is caused by

being present in the potential field induced by theremaining nodes. From the efficiency viewpoint,it turns out that computing the repulsive forceand torque of a node in the potential field inducedby the remaining nodes is analytically tractable,as our subsequent discussion indicates.

In comparison with [14], our approach differs inthe following. First, we deal with graphs in both2-D and 3-D, whereas in [14], only 2-D graphswith either elliptical or rectangular nodes are in-vestigated. Second and perhaps a more signifi-cant difference is that when measuring the move-ment of a nonuniform node, rotation is taken intoaccount rather naturally in our framework, whilethe algorithm in [14] lacks this capability. In theprocess of reaching equilibrium, the degree of in-clination of a nonuniform node can be adjustedwhile moving from one position to another. Bydoing so, the final drawing has a tendency todisplay a high degree of symmetry or occupy asmall area, which will be shown by our experi-mental results. Consider various drawings of agraph with nonuniform nodes shown in Figure 1,which can be classified into four styles, depend-ing on where the end points of the drawing edgesare emanated from and whether the orientationof each nonuniform node can be modified. In Fig-ures 1(a) and 1(b), every edge connects two cor-ners between a pair of nonuniform nodes; in Fig-ures 1(c) and 1(d), each edge connects the centersof two nonuniform nodes. Figures 1(b) and 1(d)allow each nonuniform node with angle of incli-nation, but Figures 1(a) and 1(c) do not. Thealgorithm in [14] can only produce the drawingdepicted in Figure 1(c). In contrast, our approachcan produce all four drawing styles simply by al-tering the values of some parameters in our draw-ing algorithm. In view of this example, it is clearthat rotation plays a crucial role in producing anicer drawing for a graph with nonuniform nodes.Another feature of our approach is that multipleedges can be dealt with in a natural way. By al-lowing an edge to come out from a corner or theinterior of a nonuniform node rather than fromits center, our approach can produce drawingsof graphs with multiple edges. Note that Fig-ures 1(a) and 1(b) allow multiple edges betweentwo nonuniform nodes.

Page 3: Drawing Graphs with Nonuniform Nodes Using Potential Fieldsacms.nctu.edu.tw/papers/JVLC2009-potential.pdf · Drawing Graphs with Nonuniform Nodes Using Potential Fields∗ Chun-Cheng

Drawing Graphs with Nonuniform Nodes Using Potential Fields 3

Figure 1. Various drawings of a graph with threesquare-shaped nodes and three edges.

Aside from the fact that natural objects tend tobe of nonzero size, another motivation behind theneed of handling graphs with nonuniform nodeshas to do with drawing clustered graphs, whichare frequently used for in the visualization ofhuge graphs. Assuming that each cluster of aclustered graph has already been drawn nicely,our idea (motivated by [20]) is to view the con-vex hull (polygon) of each nicely drawn clusteras a nonuniform node first. The next step is toproduce a nice drawing for the graph with itsconstituent clusters represented by nonuniformnodes. In the final phase of the drawing proce-dure, the details of each cluster are then pluggedinto the corresponding nonuniform node. Thedrawing approach by abstracting out the detailsof each cluster runs very efficiently, making themethod suitable for graph drawing in dynamicscenarios (see, e.g., [21]).

We have developed a prototype system to com-pare our new graph drawing method with otherexisting approaches empirically. Our experimen-tal results look promising as our subsequent dis-cussion indicates. However, our method is slowerthan the previous methods for moderate-sizedgraphs without rotations of nonuniform nodes,and hence our method is suitable for moderate-sized interactive graphs or larger-sized staticgraphs (note that graph drawing algorithms maybe designed for the static or dynamic scenarios,e.g., Biedl and Kaufmann [22] presented algo-rithms for generating orthogonal drawings in thestatic and dynamic scenarios). Therefore, find-ing a more efficient algorithm for drawing graphswith nonuniform nodes remains open. In addi-tion, note that some applications do not allow ro-

tations of nonuniform nodes. Therefore, we giveexamples applied to UML class diagrams by usingour approach in this paper.

The rest of this paper is organized as follows.Section 2 gives some preliminaries. In Section 3,the theory behind potential fields in graph draw-ing is developed in depth. Section 4 gives someexperimental results in 2-D and 3-D, and Section5 gives an application. Finally, a conclusion isgiven in Section 6.

2. Preliminaries

In this section, we give formal definitions forthe problem at hand, as well as the necessarybackground in force-directed methods.

2.1. Basic definitionsA graph is a pair G = (V, E) where V is the

set of nodes and E ⊆ V ×V is the set of edges. Adrawing of a graph G on the plane is a mapping Dfrom V to R

2, where R is the set of real numbers.That is, each node v is placed at point D(v) onthe plane, and each edge (u, v) is displayed as astraight-line segment connecting D(u) and D(v).

A nonuniform node refers to a polygon in 2-Dor a polyhedron in 3-D. Points of zero size are re-garded as degenerated nonuniform nodes, and todraw other types of nonuniform nodes (such ascircles and ovals (in 2-D) or balls (in 3-D)), wesimply use polygons or polyhedra to approximatesuch nonuniform nodes. Note that nonuniformnodes may be of different shapes and differentsizes. A graph with nonuniform nodes (abbrevi-ated by GNN) is a pair G = (N, E) such that Nis the set of nonuniform nodes and E is the setof edges. For satisfying different applications, wecan classify drawings of a GNN into four cate-gories, as shown in Figure 1, depending on wherethe end points of the drawing edges are emanatedfrom and whether the orientation of every nonuni-form node can be altered. Through the rest of thispaper, we denote S1-S4 as the drawing styles ofFigure 1(a)–(d), respectively, in which:

• S1: every drawing edge connects two cor-ners between a pair of nonuniform nodes,and nonuniform nodes are not allowed tobe rotated;

Page 4: Drawing Graphs with Nonuniform Nodes Using Potential Fieldsacms.nctu.edu.tw/papers/JVLC2009-potential.pdf · Drawing Graphs with Nonuniform Nodes Using Potential Fields∗ Chun-Cheng

4 C.-C. Lin, H.-C. Yen, and J.-H. Chuang

• S2: every drawing edge connects two cor-ners between a pair of nonuniform nodes,and nonuniform nodes are allowed to be ro-tated;

• S3: every drawing edge connects the centersof two nonuniform nodes, and nonuniformnodes are not allowed to be rotated;

• S4: every drawing edge connects the centersof two nonuniform nodes, and nonuniformnodes are allowed to be rotated.

It should be noticed that S1 and S2 allow multi-ple edges between two nonuniform nodes. Here,we assume that the ports to which the edges areconnected are given.

A hierarchical clustered graph C = (G, H) is agraph with its nodes clustered recursively in a waythat each leaf (resp. internal node) of the rootedtree H called inclusion tree corresponds to a node(resp. a subset of nodes called “cluster”) of G. Inthe drawing of a hierarchical clustered graph, ev-ery node of G is drawn as a point, every edge ofG is drawn as a simple curve, and every inter-nal node of H is drawn as a simple closed regionbounding its descendents. A c-planar drawing[23], i.e., the drawing of a hierarchical clusteredgraph without any crossing between edge pairs oredge/region pairs, is of importance in the fields ofgraph drawing or information visualization. Al-though there exist polynomial time algorithms fordrawing restricted types of c-planar graphs [24],whether c-planar drawings can be generated effi-ciently in the general case remains a challengingunanswered problem. Dogrusoz et al. [21] (resp.,Bertault and Miller [20]) applied force-directedstrategy (resp., layered-drawing strategy) to pro-ducing the straight-line drawings of hierarchicalclustered graphs where every internal node of theinclusion tree is drawn as a rectangular box.

In order to draw hierarchical clustered graphs,Eades and Huang [25] devised a force-directedmodel where the edges between two nodes thatbelong to the same cluster are replaced bystronger springs; the edges between two nodesthat belong to different clusters are replaced byweaker springs. By this setting, the nodes ofthe same cluster are drawn closer; the nodes of

different clusters are drawn farther. Hence, therelationship of clustering can be observed in vi-sualization even if we do not draw the simpleclosed regions of the internal nodes of the inclu-sion tree. In this paper, we propose an approachto drawing clustered graphs. Although this ap-proach cannot avoid crossings between edge pairsand edge/region pairs, it may run more efficientlythan the force-directed strategy in [25] applied toclustered graphs. In this paper, we show that ourapproach gives nicer quality than them.

2.2. Defining the problemThe drawing problem considered in this paper

is addressed as follows. Suppose we begin withan initial drawing of a GNN, one is required toproduce a nice drawing of the GNN with respectto the following aesthetic criteria: no overlappingbetween any two nonuniform nodes, no overlap-ping between any pair of nonuniform node andedge, symmetry, uniform edge length, and mini-mizing the size of the drawing. In addition, theefficiency of the drawing algorithm is also factoredinto our design.

2.3. Previous work on force-directed meth-ods

The graph drawing algorithm of Tutte [26,27]described by pure mathematics can be regardedas the earliest force-directed method. In the Tuttemodel, the set of nodes is divided into two sets,a set of fixed nodes and a set of free nodes. Bynailing down the fixed nodes as a strictly convexpolygon and then placing each free node at thebarycenter of its neighbor in each iteration, themodel can yield a nice drawing.

Furthermore, since the introduction of the sim-ple force-directed method by Eades in [2] (a.k.a.spring algorithm), there has been a number ofvariants of force-directed approaches reported inthe literature. Generally speaking, such modifica-tions fall into the following two categories. Onehas to do with altering the repulsive force andthe spring force models, while the other attemptsto manipulate the local minima problem result-ing from the equilibrium between attractive andrepulsive forces.

The model introduced by Eades uses logarith-

Page 5: Drawing Graphs with Nonuniform Nodes Using Potential Fieldsacms.nctu.edu.tw/papers/JVLC2009-potential.pdf · Drawing Graphs with Nonuniform Nodes Using Potential Fields∗ Chun-Cheng

Drawing Graphs with Nonuniform Nodes Using Potential Fields 5

mic strength springs in place of Hooke’s law forspring forces fa, and the inverse square law forrepulsive forces fr as follows:

fa(duv) = (ca ∗ log(|duv|/l))duv/|duv| (1)fr(duv) = − (cr/|duv|2

)duv/|duv|

where ca and cr are scaling constants, l is thegiven spring natural length, and duv is the vectorfrom node u to node v. Besides above consid-ering repulsive forces between every node–nodepair, the models of considering repulsive forcesbetween every node–edge pair [3] and every edge–edge pair [4] also were developed to preserve theedge crossing property and handle the zero angu-lar resolution problem, respectively.

Subsequently, a number of variations ofspring algorithms have been proposed to im-prove the performance as well as the draw-ing quality. Notable examples include [5–9]. The algorithm in [5] uses the following asalternate spring and repulsive force formulas:fa(duv) =

(|duv|2/k)duv/|duv| and fr(duv) =

− (k2/|duv|)duv/|duv|, respectively, where k is a

constant. As it turns out, this change makes thealgorithm more efficient than the original springalgorithm. In addition, a parameter called tem-perature is used to terminate the algorithm. Ev-ery node initially has a temperature value and thevalue decreases by computing some cooling func-tion at the end of each iteration. Until all nodescool down to some constant value, the algorithmstops to attain a nice drawing. In a similar work,the approach of GEM [6] makes use of the historyof the moving trajectory of all nodes to computethe temperature.

As the algorithm in [7] indicates, the simu-lated annealing [28] approach also plays a con-structive role in graph drawing. The basic idea isas follows. Given a evaluation function consist-ing a set of criteria, e.g., number of edge cross-ings, the temperature of every node decreases atthe end of each iteration, but the temperatureof a node may increase when the return value ofthe evaluation function for the new position ofthe node is worse than that regarding the orig-inal position of the node. The algorithm termi-nates when the temperature of every node is be-low some predefined value. In addition, Kamada

and Kawai [8] have used a potential formula toreplace the force formula, and the optimizationprocedure tries to minimize the total energy ofthe system. Sugiyama and Misue [9] have con-sidered the force-directed method based on mag-netic forces. Their method replaces some or allof the edges of a graph by magnetized springs,and gives a global magnetic field that acts on thesprings. It gives three basic types of magneticfields (i.e., parallel, radial, and concentric) to con-trol the orientation of the edges, and hence cangenerate drawings with different aesthetic crite-ria.

In the past, the force-directed techniques onlycan handle moderate-sized graphs (about 50nodes). Recently, the multi-scale approaches[10,11] make them successful with much largergraphs (over 10,000 nodes).

2.4. Previous work on graph drawings withnonuniform nodes

Harel and Koren [14] extended the conventionalforce-directed methods to develop three new al-gorithms to draw graphs with either elliptic orrectangular nodes. Rectangular nodes can beviewed as the special case of nonuniform nodes(polygons) in 2-D, so the force-directed strat-egy in [14] for drawing graphs with rectangularnodes is related to our work, and will be com-pared in this paper. The spring and repulsiveforce formula of their approach are calculated ac-cording to fa(u, v) = lb(u, v)2/Len and fr(u, v) =Len2/ max(lb(u, v), ε), respectively, where lb(u, v)is the shortest distance between the boundariesof rectangular nodes u and v, and Len and ε arepositive constants.

Other work concerning the force-directed meth-ods for drawing graphs with rectangular nodes in-cludes [15,29,30], which mainly focus on only theaesthetic criterion that removes the overlaps be-tween any pairs of nodes, and hence, the resultsof our paper are not compared with those work.

3. Force-Directed Method Using PotentialFields

To draw GNNs, our force-directed approach isbased upon the idea of replacing each edge by

Page 6: Drawing Graphs with Nonuniform Nodes Using Potential Fieldsacms.nctu.edu.tw/papers/JVLC2009-potential.pdf · Drawing Graphs with Nonuniform Nodes Using Potential Fields∗ Chun-Cheng

6 C.-C. Lin, H.-C. Yen, and J.-H. Chuang

a spring and assuming that the border of ev-ery nonuniform node is uniformly charged. Inthis setting, the repulsive forces among nonuni-form nodes avoid crossings between nonuniformnodes, and the spring forces pull nonuniformnodes closer. A nice drawing would be generatedwhen the corresponding model reaches an equi-librium between the repulsive forces due to thecharged nonuniform nodes and attractive forcesdue to springs.

In each iteration of our algorithm, each nonuni-form node moves and rotates, respectively, ac-cording to the force (consisting of repulsive andspring forces) and the torque (consisting of re-pulsive and spring torque) acting at that node.In what follows, since we use Eq. (1) as thespring force formula, we mainly focus on derivingthe repulsive forces as well as the repulsive andspring torques. Note that the torque acting ateach nonuniform node is a measure to cause thatnode to rotate counterclockwise about an axis,called pivot point of that node, i.e., the rotationcenter of the node.

In what follows, we only consider the style S2

(the remaining styles are similar and simpler) andelaborate on the foundations of the theory behindthe use of potential fields in graph drawing. Thereader is referred to [18,19] for more about poten-tial fields as well as some of the detailed deriva-tions of formulas involved in our subsequent dis-cussion.

3.1. 2-D modelConsider two polygons (representing two

nonuniform nodes) A and B in 2-D connected bytwo edges a1b2 and a3b2 as shown in Figure 2(a).Polygon A has vertices a1, ..., a6, and polygon Bhas b1, b2, and b3 along their boundaries. Eachpolygon is associated with a pivot point exertedby repulsive and attractive forces, and shifts androtations are carried out with respect to this pivotpoint. For instance, in Figure 2 ea and eb are thepivot points of polygons A and B, respectively.In xy-plane, for any two points of unit chargeand of distance r apart, the Newtonian potentialis defined as V = 1/r and the Newtonian po-tential of a point q with respect to a uniformlycharged line segment a1a2 is V =

∫ a2

a11/r(x)dx

where r(x) is the distance between q and x. Fig-ure 3 shows uniformly charged edges along withthe equi-potential contours.

ABea

b2 = eb

a6

b3

b1

y

x

v

uea

A

B

(a) (b)

u1

v = au + b

a1

a2

a3a4

a5

b1

u2

a1 a2

),(Qb2 = eb

Figure 2. Coordinate transformation of a 2-Dgraph with two nonuniform nodes A and B whereea and eb are the pivot points. (a) The originalcoordinate system (xy-plane). (b) The new co-ordinate system (uv-plane) after the transforma-tion.

Figure 3. Potential contours due to uniformlycharged square boundary. (Left: charge distribu-tion; right: equi-potential contours.)

Consider two line segments a1a2 and b1b2 onthe new coordinate system (uv-plane), placing a1

on the original point and a1a2 on the positive u-axis (v-axis is perpendicular to u-axis), after co-ordinate transformation as shown in Figure 2(b).Q(μ, η) is some point on b1b2, and v = au + b(where a and b are constants) is the line equa-tion representing b1b2. d is the length of a1a2,and u1 and u2 are the projection points of theend points of b1b2. After a sequence of compu-tations of the above Newtonian potential func-

Page 7: Drawing Graphs with Nonuniform Nodes Using Potential Fieldsacms.nctu.edu.tw/papers/JVLC2009-potential.pdf · Drawing Graphs with Nonuniform Nodes Using Potential Fields∗ Chun-Cheng

Drawing Graphs with Nonuniform Nodes Using Potential Fields 7

tion, such as negative gradient, integral, coordi-nate transformation, and integral, the repulsiveforce on b1b2 due to a1a2, i.e., the repulsive forcebetween two line segments, along the u-axis andthe v-axis can be respectively expressed as

fru = fru(u2) − fru(u1) (2)frv = frv(u2) − frv(u1) (3)

where

fru(u) = logf ′1(u)/2 +

√1 + a2f

1/21 (u)

f ′2(u)/2 +

√1 + a2f

1/22 (u)

,

frv(u) =(1a

logf ′1(u)/2 +

√1 + a2f

1/21 (u)

f ′2(u)/2 +

√1 + a2f

1/22 (u)

+√

1 + a2(b + d)a(ad + b)

× log2(ad + b)(d − u) + 2(ad + b)f1/2

1 (u)au + b

+√

1 + a2

alog

−2bu + 2bf1/22 (u)

au + b

),

f1(u) = (au + b)2 + (u − d)2, and f2(u) =(au + b)2 + u2. And the repulsive torque onb1b2 due to a1a2, i.e., the repulsive torque be-tween two line segments, with respect to thepivot point eb = (eu

b , evb ) can be expressed as

τebr = τeb

r (u2) − τebr (u1) where

τebr (u) =

(b − ev

b − ba2 + b2

1 + a2− eu

b + b

a

)× log

f ′1(u)/2 +

√1 + a2f

1/21 (u)

f ′2(u)/2 +

√1 + a2f

1/22 (u)

−(

b2

a2+ eu

b d +beu

b + bd

a

) √1 + a2

b + da

× log2(ad + b)(d − u) + 2(ad + b)f1/2

1 (u)au + b

+(b

a+ eu

b )√

1 + a2

alog

−2bu + 2bf1/22 (u)

au + b

+√

1 + a2

a(f1/2

1 (u) − f1/22 (u)) (4)

whose direction is iz = iu × iv, in which iu and ivare the unit vectors of u-axis and v-axis, respec-tively.

In addition, the torques due to the spring forcesshould be considered. For example, in Figure 2,suppose the attractive force on the point b2 dueto the spring edge b2a1 is equal to fa(−−→b2a1), fromEq. (1), and B rotates with respect to the pivotpoint eb. The torque with respect to point eb dueto the attractive force fa(−−→b2a1) from spring b2a1,on point b2, is equal to the cross product

(b2 − eb) × fa(−−→b2a1). (5)

Note that it is inappropriate to choose the cen-ter of shape as the pivot point of a polygon be-cause the forces and torques due to springs arecomputed by the spring lengths and the springsare not connected to the centers of the shape.Instead, the mean of the coordinates of the ver-tices connected by springs is selected as the pivotpoint. Consider Figure 2 for instance. Thepolygon A has vertices a1 and a3 connected bysprings, and the midpoint of a1 and a3 is the pivotpoint of A. The polygon B only has a single ver-tex b2 connected by a spring, and hence b2 is thepivot point of B.

In view of the above derivations, the force be-tween two polygons can be derived. For example,in Figure 2, the total repulsive force on polygonB due to polygon A is equal to

Fr =∑

i∈B(B)

∑j∈B(A)

f ijr (6)

where B(X) is the set of border lines of polygonX , and f ij

r = (f ijru

, f ijrv

) is the repulsive force onborder line segment i due to j in which f ij

ru(resp.,

f ijrv

) is the component along the u-axis (resp., v-axis) computed by Eq. (2) (resp., Eq. (3)).

On the other hand, the total spring force onpolygon B due to all of the springs is equal to

Fa =∑

p∈P(B)

∑(p,q)∈E

fa(−→pq) (7)

where P(B) is the set of vertices of B, E is theedge set, p is a vertex of B, q is a vertex of somepolygon, and fa is the spring force defined in Eq.(1).

In summary, the total force applied to polygonB due to the remaining polygons and springs is

Page 8: Drawing Graphs with Nonuniform Nodes Using Potential Fieldsacms.nctu.edu.tw/papers/JVLC2009-potential.pdf · Drawing Graphs with Nonuniform Nodes Using Potential Fields∗ Chun-Cheng

8 C.-C. Lin, H.-C. Yen, and J.-H. Chuang

equal to the sum of the repulsive force (Eq. (6))and the attractive force (Eq. (7)) as follows:

F =∑

N−{B}(Fr + Fa) (8)

Similar results can be obtained for the totaltorque T with respect to the pivot point eb in-cluding repulsive and spring torques.

3.2. 3-D modelNow we turn our attention to drawing nonuni-

form nodes in 3-D in the framework of potentialfields.

In Figure 4(a), consider two polyhedra (repre-senting nonuniform nodes in 3-D) A and B, whereq is a sample point of B, and S is a plane surfaceof A surrounded by border lines C1˜C4 and ∂Sdenotes the boundary of S. Figure 4(b) only illus-trates q and S where ui and li are along the (out-ward) normal and tangential directions of ∂S, andn is its surface normal, where n = ui × li. Con-sider a generalized potential function (i.e., higher-order potential function) of the kind used in [18]for reasoning about motion planning.

According to the derivation from [18], the re-pulsive force at point q due to S is can be ex-pressed as the following analytical from. (See [18]for more.)

Fr = (Frx , Fry , Frz )

= −∑

i

∇i

[Φ3,i(xi = l+i , yi, z)

−Φ3,i(xi = l−, yi, z)]+

α

z2iz (9)

where, for each Ci, the triple xi, yi, and z = d⊥ >0 are measured along li, −ui, and n, respectively,with the origin located at the projection of q onCi; the gradient ∇i is determined by the coordi-nate system in which Ci resides, and iz is the unitvector of z, i.e., n. And then the Eq. (9) can beresolved as follows∂Φ3

∂x=

y

(x2 + y2)√

x2 + y2 + z2

∂Φ3

∂y=

−x(x2 + 2y2 + z2)

(x2 + y2)(y2 + z2)√

x2 + y2 + z2

∂Φ3

∂z= −

tan−1 xz

y√

x2+y2+z2

z2

(b)

(a)

B

eb

q

Aea

C1

C2

C4

C3S

q

RQ

P10 C1

C2

C4

S

l1-

l1+

C3

P10^

n

u1^

q’q

d

l1^

l1

{

ix = l1^

iz = n^

iy = - u1^

Figure 4. A 3-D graph consisting of two poly-hedra. (a) Uniformly selected sample points onthe surfaces of the right polyhedron B. (b) Geo-metric quantities associated with a sample pointq from B and a surface S of A, where Q is theplane containing S.

+xy(x2 + y2)

z(x2 + y2)(y2 + z2)√

x2 + y2 + z2.

In 3-D, the repulsive force between two poly-hedra A and B is the sum of the repulsive forcesof every possible pair of polygonal surfaces in Aand B. However, the repulsive force between twopolygonal surfaces is a complicated four-order in-tegral. In order to reduce the complexity of com-puting repulsive forces between A and B, we uni-formly select sample points on the surfaces of eachpolyhedron. Hence the repulsive force on B dueto A is the sum of the repulsive forces at eachsample point q due to every polygonal surface ofB. See Figure 4(a) for an illustrating example.The complexity of computing the forces betweentwo polyhedra can be reduced because the forcesat a single point due to polygons is a two-orderintegral.

Assume that SP(X) is the set of sample pointsof polyhedron X and S(X) is set of polygonalsurfaces of polyhedron X . The repulsive force at

Page 9: Drawing Graphs with Nonuniform Nodes Using Potential Fieldsacms.nctu.edu.tw/papers/JVLC2009-potential.pdf · Drawing Graphs with Nonuniform Nodes Using Potential Fields∗ Chun-Cheng

Drawing Graphs with Nonuniform Nodes Using Potential Fields 9

a sample point pi on B due to A is the sum ofthe repulsive forces at pi due to n (all) polygo-nal surfaces on A. Thus, the repulsive force Fr,standing for the force at B due to A, is the sumof the repulsive forces for all sample points on B,as follows:

Fr =∑

i∈SP(B)

∑j∈S(A)

F ijr (10)

where the repulsive force at pi due to the j-th polygonal surface of A is denoted as F ij

r =(F ij

rx, F ij

ry, F ij

rz), which is computed according to

Eq. (9).On the other hand, the total attractive force on

polyhedron B due to all of the springs is equal to

Fa =∑

p∈P(B)

∑(p,q)∈E

fa(−→pq) (11)

where p is a vertex of B, and fa = (fax , fay , faz)in which fax , fay , faz are the projections of thespring force defined in (1) along x, y, and z-axis,respectively.

Thus, the total force on polyhedron B due toall springs and the other polyhedra except for Bcan be expressed as the sum of (10) and (11), asfollows:

F =∑

N−{B}(Fr + Fa) (12)

The repulsive torque (13) is the cross productof the repulsive force F i

r at sample point pi anddistance vector Xi which is the distance from thereference point eb to pi. So the total repulsivetorque (14) is the sum of torques due to all of thesample points.

T ir = Xi × F i

r (13)

Tr =∑

i∈SP(B)

T irx

(14)

The total attractive torque Ta can be derivedsimilarly. Consequently, the total torque (15) onpolyhedron B due to all springs and the otherpolyhedra except for B can be expressed as

T = Tr + Ta. (15)

Note that an important aspect of our approachlies in the formulas derived in our potential fieldmodel being analytically tractable, making ouralgorithm computationally tractable.

4. Implementation and Experimental Re-sults

Based on the theory of potential fields detailedin the previous section, in this section we pro-pose our algorithm, detail the implementation ofour algorithm, and develop a prototype systemfor drawing GNNs in 2-D and 3-D and give someexperimental results.

4.1. AlgorithmOur drawing algorithm, based upon the theory

of potential fields, is presented in Algorithm 1,which has a structure similar to those found inconventional force-directed methods. The algo-rithm operates iteratively to generate a continu-ous process from the initial drawing to the finaldrawing, as shown in Figure 7. It is worthy ofpointing out that if the drawing of each iterationis rendered, the animated process allows the userto predict the dynamics of the drawing, whichmeets the requirement in information visualiza-tion.

In Algorithm 1, c1 and c2 (resp., t1 and t2) areconstants used to control the magnitudes (resp.,upper bounds) of movement and rotation of ev-ery nonuniform node, NewPos and OldPos aredata structures used to record the new and oldpositions of vertices of all nonuniform nodes in Nrespectively, and ε1 (resp., ε2) in line 12 is thetolerance of convergence for force (resp., torque)which is usually a very small positive number. Inaddition, by using the flag converged, the whileloop in lines 2–16, especially lines 2–4 and 12–14, stops when the drawing remains unchangedbetween two iterations, i.e., the algorithm con-verges, or the maximal number of iterations isreached. There exist two for loops in the restof the main loop, i.e., in each iteration, the first(lines 5–9) is to compute all the forces and torquesof each nonuniform node according to the deriva-tions in previous sections, and the second (lines10–15) is to move and rotate each nonuniformnode and then render the graph. To avoid adrastic change in position, we can assign upperbounds to the movement and rotation for eachnonuniform node.

The way of rotating a nonuniform node in line

Page 10: Drawing Graphs with Nonuniform Nodes Using Potential Fieldsacms.nctu.edu.tw/papers/JVLC2009-potential.pdf · Drawing Graphs with Nonuniform Nodes Using Potential Fields∗ Chun-Cheng

10 C.-C. Lin, H.-C. Yen, and J.-H. Chuang

Algorithm 1 Potential Spring (graph G)1: assign the initial locations of nonuniform nodes of G according to a given (or random) initial drawing2: while converged �= 1 or the maximal number of iterations is reached do3: converged ← 14: oldPosn ← newPosn5: for each nonuniform node Ni in G do6: Calculate the total force Fi of node Ni, consisting of:

(a) the repulsive force due to the other nonuniform nodes locatedwithin the neighborhood of node Ni (the circle in 2-D (ball in 3-D)with center Ni and a small radius γ) according to spring forceformula (1), and

(b) the spring force due to its adjacent springs according to repulsiveforce formulas (2) and (3) in 2-D or (9) in 3-D;

7: Calculate its total torque Ti according to 2-D formulas (4) and (5) or 3-D formulas (13) and(14);

8: Save Fi and Ti;9: end for

10: for each nonuniform node Ni in G do11: Simultaneously move and rotate every nonuniform node Ni according to min(c1 × Fi, t1) and

min(c2 × Ti, t2), respectively,and then save new positions to newPosn;12: if ‖c1Fi‖ > ε1 or ‖c2Ti‖ > ε2 then13: converged ← 014: end if15: end for16: end while

11 is by taking the pivot point as the center ofrotation and rotating with an angle with degreec2 × Ti counterclockwise.

About the computation of repulsive forces inline 6(a) of Algorithm 1, we consider only the lo-cal repulsive forces (derived from the approach in[5]) to speed up the algorithm. Like most of theforce-directed approaches to drawing huge graphs[10,11], the idea is to compute the local repulsiveforce of each nonuniform node Ni, i.e., only tocompute the repulsive force of Ni due to the othernonuniform nodes placed within the neighborhoodof Ni (which is defined as the circle in 2-D (spherein 3-D) with center Ni and a small radius γ) in-stead of all the other nonuniform nodes.

As for the time complexity, since line 6(a) in Al-gorithm 1 needs to enumerate all pairs of nonuni-form nodes, one can easily check that each itera-tion of Algorithm 1 takes time O(|N |2 + |E|) inthe worse case. Line 6(a) in Algorithm 1 may take

time O(|N |) if nonuniform nodes are uniformlydistributed in the 2-D plane (note that the situ-ation often occurs in the drawings generated byforce-directed methods). In this case, each itera-tion of Algorithm 1 taking time O(|N |+ |E|) maybe executed efficiently. In order to evaluate thetotal number of iterations experimentally, we ex-ecute our algorithms on a number of GNNs withmoderate sizes (|N | ≤ 100), which are generatedrandomly, under our setting of parameters. Theexperimental evaluation shows the total numberof iterations to be at most about 1000.

4.2. ImplementationThe analysis on the convergence and the ad-

justments of parameters in force-directed meth-ods has been discussed a lot in previous work(e.g., see [7,11,13]). On theoretical aspect, Eadesand Lin [13] have shown that the general frame-work of force-directed methods can lead to a sta-ble drawing in which many symmetries are dis-

Page 11: Drawing Graphs with Nonuniform Nodes Using Potential Fieldsacms.nctu.edu.tw/papers/JVLC2009-potential.pdf · Drawing Graphs with Nonuniform Nodes Using Potential Fields∗ Chun-Cheng

Drawing Graphs with Nonuniform Nodes Using Potential Fields 11

played. In fact, our force-directed approach onlymodifies the force formulas and considers addi-tional torque formulas, but does not have toomuch modification on the optimized procedureof conventional force-directed algorithms. There-fore, like [13], our approach also can be shown tolead to a stable drawing, under appropriate set-ting of parameters.

In Algorithm 1, it should be noticed that thesetting of c1, c2, ε1, ε2 influences not only therunning time but also the convergence of our ap-proach and the quality of the final drawing. Inthe following, we briefly explain how to set thoseparameters in Algorithm 1 to achieve conver-gence. W.l.o.g., we consider that the input graphis connected; thus, each node must be exerted bynonzero spring and repulsive forces. That is, ifthe total force acted at a node is nonzero, then thenode moves either inward into or outward fromthe other nodes of the graph. Since parametersc1 and c2 (resp., t1 and t2) control the magnitudes(resp., upper bounds) of movement and rotation,the ranges in which nodes move and rotate arebounded. That is, if those parameters are setsmaller, then the movement and rotation rangesof nodes are smaller. Note that parameters ε1 andε2 control the tolerance of convergence, so underlarger ε1 and ε2 nodes do not move and rotatein smaller movement and rotation ranges. As aresult, smaller c1, c2, t1, t2, as well as larger ε1,ε2 narrow the movement and rotation ranges ofnodes, so our algorithm can achieve convergenceif the movement and rotation ranges are set ap-propriately.

In fact, given certain setting of parameters,the user can easily verify whether the parametersetting achieves convergence or not by observingthe differences of the drawings generated by someconsecutive iterations of Algorithm 1. If the al-gorithm under a given parameter setting is diver-gent, the user can judge the divergence type toadjust the parameters so that the algorithm be-comes convergent. The possible divergence typesare stated as follows:

1. Bigger movement (resp., rotation) magni-tude parameter c1 (resp., c2) makes nodesmove farther (resp., be rotated faster) so

that the final drawing may be generatedfaster and hence the total running time maybe shorter. Note that t1 and t2 control theupper bounds of the movement and rota-tion, respectively. However, if some nodesmove back and forth between two consecu-tive drawings (resp., rotates very fast dur-ing a series of drawings) so that the con-vergent positions (resp., convergent inclina-tion degrees) of these nodes cannot be de-termined, then it implies that the value ofc1 (resp., c2) should be decremented;

2. Bigger force (resp., torque) convergence tol-erance ε1 (resp., ε2) can make the algorithmachieve the convergence of forces (resp.,torque) faster. However, if we observe thata further iteration executed at the finaldrawing can obtain a drawing with betterplacements of nodes (resp., better inclina-tion degrees of nodes), then it implies thatthe value of ε1 (resp., ε2) should be decre-mented.

3. Smaller neighborhood radius γ can makethe algorithm run faster because only thelocal repulsive forces are computed. How-ever, if we observe that the final drawinglooks bad, i.e., we encounter a local mini-mal problem, then it implies that the valueof γ should be incremented.

Intuitively, our approach with repulsive forcesbetween nonuniform nodes handles the problemof node–node overlapping1, except for the casewhen the pivot point of a small-size node falls in-side a large node. If there is no overlapping in theinitial drawing, this pathological case would oc-cur only when the small-size node moves so fastsuch that it rushes into the big-size node, andhence the problem can be solved by setting c1

smaller. In future work, we may apply an alter-native strategy in which each iteration checks outthis case and adds a repulsive force between thetwo nodes.

1Without considering edges, the approach in [15] producesthe drawing of style S3 without the overlapping betweenthe rectangular nodes.

Page 12: Drawing Graphs with Nonuniform Nodes Using Potential Fieldsacms.nctu.edu.tw/papers/JVLC2009-potential.pdf · Drawing Graphs with Nonuniform Nodes Using Potential Fields∗ Chun-Cheng

12 C.-C. Lin, H.-C. Yen, and J.-H. Chuang

Aside from the problem of node–node over-lapping, the problem of node-edge overlappingalso needs to be taken into account. In [14], itwas proven that a drawing is free from edge–node overlapping if the distance between any twononuniform nodes is at least half of the maxi-mal edge length. If we also consider uniformedge lengths, it is required that the ratio betweenthe maximal edge length and the minimal edgelength is less than two. Hence, in practice edgesrarely intersect with nodes if the deviation be-tween the edge lengths is not too large. Moreover,a post-processing strategy may be applied to re-move node–edge overlapping, e.g, adding repul-sive forces between nodes and edges [7] or draw-ing edges as curves [29], bypassing the intersectednodes.

In the future work, we may consider the fol-lowing. The repulsive forces make our approachcomputationally expensive, and so we may ap-ply an extension of the conventional spring algo-rithms (viewing each nonuniform node as a zero-size point) as the preprocessing procedure of ourapproach may be a good strategy of reducing thetotal executing time as well as ‘jumping’ out localminimal problems initially. Especially, if all thenodes of the input graph are rectangles, applyingthe algorithm in [14] as the preprocessing pro-cedure of our approach is a good starting point.Obviously, we can imagine that [14] is used toproduce an initial drawing with a nice embedding,and then our approach only takes a slight amountof additional effort to adjust the initial drawingby means of rotations for achieving a smaller areaor a higher degree of symmetry.

Note that conventional force-directed methodscannot guarantee nice drawings for all kinds ofgraphs because they in general do not necessar-ily reach minimal configurations, i.e., the repul-sive forces among some nodes might be too weakor too strong. Fortunately, some local minimalproblems can be overcome by adjusting the co-efficients of the models. Our model for drawingGNNs can also handle the local minimal problemin the same way.

4.3. 2-D experimental resultsIn what follows, we present some experimen-

tal results for a variety of graphs in 2-D andgive some discussion. Recall that there exist fourstyles S1-S4 for drawing GNNs. In this subsec-tion, we only consider the drawings of style S2 orS4 because the other styles can be formed fromthese by rotation.

In practice, setting different spring magnitudesfor the same GNN may produce a variety of nicedrawings. Technically, spring magnitude is con-trolled by scaling constant ca or spring naturallength l in Eq. (1), and we say that spring isstronger (resp. weaker) if ca is set larger (resp.smaller) or l is set shorter (resp. longer). In Fig-ure 5, all the various drawings of style S2 displaysymmetrically regardless of the setting of springmagnitudes.

initial weak spring medium spring strong spring

Figure 5. A variety of drawings of style S2 forthe same GNN with respect to different kindsof springs. (average running time per iteration:0.00452 s.)

Figure 6 and 7 display the continuous processfrom initial drawing to final drawing of stylesS2 and S4, respectively. Note that Figure 6 al-lows multiple edges, and hence is easy to manip-ulate nonuniform nodes arbitrarily. By observ-ing the continuous processes of many instances,we find that springs can be set very strong suchthat our approach can output a nice drawing witha compact area as well as avoiding node–nodeoverlapping although there may exist some node–node overlapping in the process. However, settingsprings too strongly may result in an unbalancedand divergent state because of lacking a compro-mise between spring and repulsive forces. On the

Page 13: Drawing Graphs with Nonuniform Nodes Using Potential Fieldsacms.nctu.edu.tw/papers/JVLC2009-potential.pdf · Drawing Graphs with Nonuniform Nodes Using Potential Fields∗ Chun-Cheng

Drawing Graphs with Nonuniform Nodes Using Potential Fields 13

other hand, setting springs weaker may not onlylead to a local minimal problem but also producea final drawing with larger area. Therefore, thestrength of springs might as well be adjusted caseby case, and there exist a tradeoff between springmagnitude and drawing area.

Note that it is more difficult to draw a GNNwith more edges. Consider Figure 8 as an exam-ple. Figure 8(a) illustrates an initial drawing ofa hypercube-structure GNN, where each nonuni-form node has degree four. Consider the draw-ings produced by our approach with weaker andstronger springs in Figure 8(b) and 8(c), respec-tively. Our approach with weaker springs can pro-duce a larger-sized nice drawing, as shown in Fig-ure 8(b). If a smaller-sized drawing is required,since each nonuniform node occupies a nonzerosize, the crossings among edges are easily over-lapped by nonuniform nodes, as shown in Fig-ure 8(c), so that the degrees of those nonuniformnodes may not be easily recognized by users. Notethat the case is not serious for graphs with zero-sized nodes, as show in Figure 8(d). As a result,our approach may be more suitable for GNNswith fewer edges.

Figure 9 gives some 2-D drawings for variousgraphs with rectangular nodes, where the graphsof (a)–(d) comes from the analogies of the ex-amples in [14] in which we initially give everynonuniform node a certain angle of inclination,and the experimental statistics is given in Ta-ble 1. For comparison, five drawings for eachgraph are given in Figure 9. That is, the initialdrawing displays graphs by randomly assigningthe location and the inclination degree of everynonuniform node, while the classical, HK, ourdrawings with stronger and weaker springs dis-play graphs by respectively using the naive ex-tension of [2]2, [14], and Algorithm 1 with respectto the initial drawing. The criteria of displayingsmaller drawing area and more symmetries maybe conflicting with each other, and hence in Fig-ure 9 our approaches using stronger springs andweaker springs are applied to respectively display

2The classical spring algorithm is carried out by first as-suming all nodes to be of zero size. Once the drawingusing a spring algorithm is done, each of the point node isreplaced by its actual structure (a small or a large ball).

smaller drawing area and more symmetries. Notethat we only give the classical and HK drawingswith stronger springs in Figure 9 because thosewith weaker springs occupy larger area and can-not generate any symmetry. It is obvious fromFigure 9 to see that the rotations of nonuniformnodes play an important role in the drawing areaand symmetries.

In Table 1, the term ‘area’ measures the rectan-gular region bounding the graph drawing, and thearea value is calculated by viewing the smallest(square) node of graph as one unit. The degreeof uniform edge length is measured by the term‘standard deviation of edge length’ [14], and ob-viously a drawing with more uniform edge lengthhas lower deviation. The symmetries of generic2-D graph drawings involve reflectional and rota-tional symmetries, and the relationship betweenforce-directed methods and symmetries has beenformally defined in [13]. Nevertheless, the sym-metries of the drawings for GNNs has a littledifference. A drawing for GNNs has reflectionalsymmetry if it can be folded in half along a re-flection axis and the two halves line up with eachother, while the drawing has k-rotational symme-try if it can be rotated around degrees 2π/k andstill look the same. Table 1 records the numberof reflection axes and k in the columns ‘reflec-tion axes’ and ‘k-rotational symmetries’ respec-tively. That is, the higher both the two values are,and the more symmetric the drawing appears. Inaddition, Figures 9(b) and 9(d) reveal that thedrawings of some subgraphs in the drawings gen-erated by our approach display a high degree ofsymmetries.

In what follows, we observe and analyze theentries in Table 1 in greater detail. As for run-ning time, the total running time and total it-erations3 depend on many complicated factors,e.g., movement magnitude parameter c1, rota-tion magnitude parameter c2, force convergencetolerance ε1, torque convergence tolerance ε2, na-ture length of spring, and so on, and hence inTable 1 ‘average time per iteration’ and ‘num-

3After trying many examples of moderate-size graphs, wefind that our approach can generate nice drawing by takingabout two or three times of the number of iterations of HKapproach.

Page 14: Drawing Graphs with Nonuniform Nodes Using Potential Fieldsacms.nctu.edu.tw/papers/JVLC2009-potential.pdf · Drawing Graphs with Nonuniform Nodes Using Potential Fields∗ Chun-Cheng

14 C.-C. Lin, H.-C. Yen, and J.-H. Chuang

iteration 10

iteration 20iteration 30

intial

iteration 40

iteration 50

iteration 60iteration 70

iteration 243

Figure 6. Continuous process from initial drawing to final drawing of style S2 with multiple edges for abird structure. (average running time per iteration: 0.127572 s.) Note that in this case each spring hasdifferent strength for yielding good drawing.

(a) A simple case makes us easy to realize how to follow the dynamic drawing.

(b) Bigger nodes walk along a collision-free path.

randomdrawing

final drawing(iteration 244)

iteration 5iteration 10

iteration 15iteration 20

iteration 25iteration 30

randomdrawing

final drawing(iteration 67)

iteration 4iteration 8

iteration 12iteration 16

iteration 20iteration 24

Figure 7. Continuous process from initial drawing to final drawing.

Page 15: Drawing Graphs with Nonuniform Nodes Using Potential Fieldsacms.nctu.edu.tw/papers/JVLC2009-potential.pdf · Drawing Graphs with Nonuniform Nodes Using Potential Fields∗ Chun-Cheng

Drawing Graphs with Nonuniform Nodes Using Potential Fields 15

(a) initial (b) our (weaker spring) (d)

Each nonuniformnode is replaced bya zero-sized node.

(c) our (stronger spring)

Figure 8. Different drawings of a hypercube.

Table 1Statistics on the experimental results. Running time is measured on an Athlon 64 X2 Dual Core 1.99 GHzPC with 1.25 GB memory under setting c1 = 0.1, c2 = 0.01, t1 = 10, t2 = π/2, ε1 = 0.1, ε2 = π/1800 =0.1◦, γ = 40.

graph |N | method standard deviation of area reflect. k-rotational ave. time per number total run.name edge length ( StdDev

AvgLen ) axes symmetries iter. (s) of iter.∗ time (s)

spring type stronger weaker stronger weaker weakerclassical 0.3950 - 386.50 - - .00019 984 0.187

HK A 31 HK 0.4121 - 349.98 - - .00109 1047 1.141our 0.4746 0.3817 305.28 - - .05371 208 11.172

classical 0.4152 - 475.99 0 0 .00011 282 0.031HK B 25 HK 0.4989 - 405.94 0 0 .00077 366 0.281

our 0.6366 0.3768 249.31 2 2 .05558 244 13.562classical 0.2697 - 1012.32 - - .00020 1181 0.234

HK C 31 HK 0.3454 - 603.20 - - .00112 460 0.515our 0.4813 0.2950 500.31 - - .05263 293 15.422

classical 0.2702 - 283.26 0 0 .00005 87 0.004HK D 15 HK 0.3001 - 181.00 0 0 .00031 562 0.172

our 0.4754 0.2764 70.68 1 0 .01895 357 6.766classical 0.3170 - 28.94 0 0 .00007 222 0.016

mesh 4 × 4 16 HK 0.2341 - 32.15 0 0 .00030 256 0.078our 0.3584 0.2961 22.66 4 4 .02379 67 1.594

classical 0.3649 - 80.10 - - .00025 557 0.141mesh 6 × 6 36 HK 0.4269 - 63.59 - - .00157 1390 2.188

our 0.4737 - 44.61 - - .08758 529 46.328

∗The number of iterations is measured when all the three approaches obtain the drawings withthe same total edge length.

Page 16: Drawing Graphs with Nonuniform Nodes Using Potential Fieldsacms.nctu.edu.tw/papers/JVLC2009-potential.pdf · Drawing Graphs with Nonuniform Nodes Using Potential Fields∗ Chun-Cheng

16 C.-C. Lin, H.-C. Yen, and J.-H. Chuang

(c) HK_C (The size of each drawing is 40% of the original.)

(a) HK_A

(d) HK_D

classicalour

(stronger springs)HKinitialour

(weaker springs)

classicalour

(stronger springs)HKinitialour

(weaker springs)

(b) HK_B

classicalour

(stronger springs)HKinitialour

(weaker springs)

classicalour

(stronger springs)HKinitialour

(weaker springs)

(f) mesh 6 x 6(The size of each drawing in (f) is 30% of the original.)

classical HKinitial

(e) mesh 4 x 4

classical ourHKinitialour (strong--er springs)

our (weak--er springs)

Figure 9. 2-D drawing of styles S4 for various graphs with rectangular nodes.

Page 17: Drawing Graphs with Nonuniform Nodes Using Potential Fieldsacms.nctu.edu.tw/papers/JVLC2009-potential.pdf · Drawing Graphs with Nonuniform Nodes Using Potential Fields∗ Chun-Cheng

Drawing Graphs with Nonuniform Nodes Using Potential Fields 17

ber of iterations’ are measured under the set-ting c1 = 0.1, c2 = 0.01, t1 = 10, t2 = π/2, ε1 =0.1, ε2 = π/1800 = 0.1◦, γ = 40 and consideringthat all the three approaches obtain the drawingswith the same total edge length. Note that, in or-der to speed up the convergence of our algorithm,the force and torque convergence tolerances (i.e.,ε1 and ε2) are set as large values as possible suchthat in visualization the final drawing is hardlymodified by subsequent iterations. We apply thesame idea to setting the force tolerances used bythe classical and HK drawings, which are natu-rally different from ε1.

As for the standard deviation of the edgelength, Table 1 seems to indicate that our ap-proach using weaker springs is the best. However,a closer examination reveals that the measure ofthe remaining methods can be reduced by adjust-ing the parameter of stretching the nature lengthsof springs, which has a tendency to maintain theuniformity of the edge length. Therefore, it ap-pears that there is no clear winner in producingdrawings with the most uniform edge lengths. Asfor the drawing area, the HK drawing and ourdrawing using stronger springs (in Figure 9) per-form better, as the numerical values in Table 1suggest. Obviously, our approach has the capa-bility of producing the drawing with the smallestarea because the rotations of nonuniform nodesare considered in our procedure. As for symme-tries, both Figure 9 and Table 1 suggest that ourapproach using weaker springs enjoys the meritof a high degree of symmetries.

(a) classical (b) our (c) HK

Figure 10. The drawing of a mesh GNN with10 × 10 nodes produced by our approach.

Table 2Statistics of the experimental result for the meshGNN shown in Figure 10.

mesh 10 × 10 (|N | = 100)method average time per number of total running

iterations (s) iterations time (s)classical .00200 2267 4.531

HK .01187 1316 15.625Algorithm 1∗ .20775 753 156.438

∗Applying the classical approach as the preprocessingprocedure of our approach (i.e., applying the output ofthe classical approach as the input of our approach)costs only about 95.406 s.

In order to estimate the number of nodes thatour algorithms can handle, Figures 10(a)–(c) givethe drawings of a mesh GNN with 100 nodesproduced by the classical approach, the HK ap-proach, and Algorithm 1, respectively, and theirexperimental statistics is given in Table 2. Inview of Tables 1 and 2, our algorithm can still beconsidered tractable for handling moderate-sizedgraphs, although it runs slower than the others,as expected. On average, for the GNNs in Ta-ble 1, our algorithm runs 263–505 times slowerthan the classical approach, whereas from Table2 our algorithm runs about 34.5 times slower thanthe classical approach for a 100-node mesh GNN.It implies that, as far as a larger-sized GNN isconcerned, the effect of computing only the localrepulsive forces in Algorithm 1 on the reductionof time complexity is getting more obvious, andthe gap of time complexity between Algorithm1 and the classical approach is getting narrower.Although Algorithm 1 still run slower than theclassical approach by a large multiple, Algorithm1 takes about 156.438 s (≈ 2.6 minutes) to han-dle such a 100-node GNN. This leads us to a con-clusion that our algorithm is mostly suitable foreither moderate-sized GNNs or the larger-sizedGNNs in the static scenario. Note that applyingthe classical approach as the preprocessing pro-cedure of our approach may reduce the total run-ning time (in the example, this strategy costs onlyabout 95.406 s ≈ 1.6 minutes). It is of interestto see whether the multi-scale technique [10,11]could be applied and incorporated into our algo-rithm to improve the time complexity.

Page 18: Drawing Graphs with Nonuniform Nodes Using Potential Fieldsacms.nctu.edu.tw/papers/JVLC2009-potential.pdf · Drawing Graphs with Nonuniform Nodes Using Potential Fields∗ Chun-Cheng

18 C.-C. Lin, H.-C. Yen, and J.-H. Chuang

In summary, allowing the rotation of eachnonuniform node has the advantage that weakersprings make our final drawing more symmetri-cal, whereas strong springs make our final draw-ing with a smaller size. In graph drawing, sym-metry is a much admired property [31]. A moresymmetrical drawing can help users observe thestructure and the properties of the graph clearlyin visualization. On the other hand, because thedisplay screen is limited, it is crucial to generatea drawing with a smaller area, especially, in thecase when every node has a nonzero size. Whenwe zoom in a smaller-sized drawing with tiny at-tributes (texts or icons) associated with nonuni-form nodes, the size of the attributes are en-larged simultaneously and hence can be displayedclearly.

Take Figure 11 for an example. The Uni-fied Modeling Language (UML) is a standardizedspecification language for object modeling, andit is often used to describe the static view ofan application [33]: the main constitutions areclasses and their relationships. In the graphi-cal notations of UML, classes are represented bynonuniform nodes and their relationships are rep-resented by arcs. For example, Figure 11(a) givesa drawing of a UML class diagram derived from[32], depicting the procedure followed for orga-nizing honors students’ seminars. Figure 11(b)(resp., Figure 11(c)) redraws Figure 11(a) by ourapproach with weaker (resp., stronger) springs,which gives a nearly symmetrical drawing (resp.a smaller-sized drawing). As compared to thedrawing in Figure 11(a), the drawing in Figure11(b) reveals the information that the UML classdiagram is a symmetrical graph if we delete thenode labeled by ‘:Lecture’ (the bottommost nodein Figure 11(b)). As for the advantage of a small-sized drawing, Figure 11(d) gives the drawing af-ter zooming in the small-sized drawing in Figure11(c) until the drawing height is the same as Fig-ure 11(a). By doing this, although some text in-side nonuniform nodes in Figure 11(d) is oblique,they still can be observed more clearly than thosein Figure 11(a), under the same display screen. Iftext labels are too oblique to be observed, we mayfurther restrict every nonuniform node to rotatingunder a range of inclination angles.

For graphs with not only rectangular nodes, weconsider an example shown in Figure 12. Fig-ure 12(a) is a diagram derived from [34], whichapplies UML notations and a special type of high-level Petri-nets [35] to the visual modeling ofobject-oriented distributed system. Note thatFigure 12(a) is drawn manually. By represent-ing each object by a polygon and each net bystraight line segments, we obtain a straight-linedrawing of a GNN in Figure 12(b), where multi-ple edges are allowed. Figure 12(c) redraws Fig-ure 12(b) by our approach. We observe that thereare three clusters of nonuniform nodes which aredivided by two dashed curves in Figures 12(b)and 12(c), respectively. Note that the way to di-vide the GNN into three clusters in Figure 12(c)is different from that in Figure 12(b). It is easyto see that the clusters in Figure 12(c) are morereasonable (e.g., according to the connectivity ofnode ‘processtask’, the node should belong to thelargest cluster, but Figure 12(b) is not the case).Therefore, like other force-directed methods, ourapproach has the advantage that the nodes withhighly connectivity are drawn closely.

4.4. 3-D experimental resultsNow we turn our attention to drawing GNNs in

3-D. Figures 13 shows some experimental resultsof our algorithm on pyramid, cube, mesh, flower,and sphere. As one can easily see, each of the finaldrawings displays a high degree of symmetry andis reasonably ‘nice’. In Figure 13 (e), we compareour approach with a naive extension of the clas-sical spring algorithm [2] using an example of a3-D sphere structure. In this graph, a large ballis surrounded by a number of small balls. Ourpotential fields approach produces a nicer draw-ing as Figure 13 (e) indicates. This is because ourapproach can detect the large ball and consider itto draw the GNN.

It should be noticed that the nonuniform nodes(polyhedra) in each graph of Figure 13 do notdisplay symmetrically. The reason is that our 3-D approach uses sample points to approximateeach polyhedron for reducing the running time,and hence it may easily result in local minimalproblems between polyhedra.

In the future, it is of interest to further compare

Page 19: Drawing Graphs with Nonuniform Nodes Using Potential Fieldsacms.nctu.edu.tw/papers/JVLC2009-potential.pdf · Drawing Graphs with Nonuniform Nodes Using Potential Fields∗ Chun-Cheng

Drawing Graphs with Nonuniform Nodes Using Potential Fields 19

(a) original

:student

:Em

ployee

:Honour’s Project

Seminar

:DeptAdmin

:Rooms

:Timetable

:Tutors

:TutorA

dmin

:Subject

:Honours

:Lecture

:student

:Em

ployee

:Honour’s Project

Seminar

:DeptAdmin

:Rooms

:Timetable

:Tutors

:TutorA

dmin

:Subject

:Honours

:Lecture

:student

:Em

ployee

:Honour’s Project

Seminar

:DeptAdmin

:Rooms

:Timetable

:Tutors

:TutorA

dmin

:Subject

:Honours

:Lecture

(b) our (weaker springs)

(c) our (stronger springs)

(d) Zooming in (c) until the height is the same as (a)

:Honour’s Project

Seminar

:DeptAdmin

:Subject:Honours

:Employee

:student

:Lecture

:Rooms:TutorAdmin

:Timetable:Tutors

Figure 11. Different drawings of a UML class diagram, where (a) is derived from [32]. Note that theoriginal drawing in [32] includes texts associated with edges, but the texts are omitted in (a) because theedge labeling is not concerned in our work.

(a) original

(c) our

tasks tasks

[done] [working]

processtask

delay

query

update

[updated][actual]addTask

Archive status

select

(b) straight-line drawing

tasks

tasks

[done]

[working]

processtaskdelay

query

update[updated]

[actual]

addTask

Archive

selectstatus

Figure 12. (a) A diagram derived from [34]. (b) A straight-line drawing of (a). (c) A drawing of thediagram produced by our approach. Note that two dashed lines divide the diagram into three clusters in(b) and (c), respectively.

Page 20: Drawing Graphs with Nonuniform Nodes Using Potential Fieldsacms.nctu.edu.tw/papers/JVLC2009-potential.pdf · Drawing Graphs with Nonuniform Nodes Using Potential Fields∗ Chun-Cheng

20 C.-C. Lin, H.-C. Yen, and J.-H. Chuang

weaker spring stronger spring

approximation classical our

(a) (b) (c)

(d) (e)

Figure 13. 3-D graph drawing. (a) For the same structure, using different springs show two differentlayouts. (b) Cube structure. (c) Mesh structure. (d) Flower structure. (e) Sphere structure (our approachuses polyhedra to approximate spherical nodes). (Respectively average running time per iteration (s):0.00015, 0.00453, 0.00593, 0.02203, 0.02375)

our 3D approach with other 3D methods, e.g.,GEOMI [36] or WilmaScope [37].

5. Applications

Aside from the fact that natural objects tendto be of nonzero size, another motivation behindthe need of handling GNNs has to do with draw-ing clustered graphs. Consider the scenario ofdrawing a graph with millions of nodes. Applyinga drawing algorithm to the huge graph directlysuffers from a number of drawbacks. Disregard-ing the inefficiency of the method, the outcomeof the drawing often fails to reflect the structureof the graph, for related nodes may not be closeto each other as one normally prefers. As a re-sult, a number of strategies have been developedtargeting at keeping related nodes in a cluster.For instance, the EH method [25] suggests theuse of three types of springs: ‘weaker’ springs forconnecting inter-cluster nodes, ‘stronger’ springs

for intra-cluster ones, and ‘virtual springs’ forgathering adjacent and nonadjacent intra-clusternodes. Using this idea, it becomes easier to ‘nav-igate’ through clustered graphs with huge num-bers of nodes. However, with nodes added into(or deleted form) the graph, the EH algorithmhas to be applied to all the nodes in the newgraph, even to clusters that already exist in theoriginal graph. This leaves us to wonder, in-stead of re-drawing an existing cluster, whetherit is possible to inherit the drawing of the clusterfrom its original graph. By treating each clusteras a nonuniform node, one would naturally ex-pect that drawing graphs with nonuniform nodesmight find another application in the study ofclustered graphs.

Take Figure 14 for example. Instead of apply-ing a drawing algorithm (such as a force-directedmethod) to the entire graph, it might be beneficialto take advantage of the nature of the graph be-

Page 21: Drawing Graphs with Nonuniform Nodes Using Potential Fieldsacms.nctu.edu.tw/papers/JVLC2009-potential.pdf · Drawing Graphs with Nonuniform Nodes Using Potential Fields∗ Chun-Cheng

Drawing Graphs with Nonuniform Nodes Using Potential Fields 21

(a) (b) (c)

(d) (e) (f)

tree mesh

trianglemesh

Petersengraph

unknown

Figure 14. Drawing a clustered graph. (a) Cluster partition. (b) Drawing individual clusters using theconventional force-directed method. (c) Convex hulls of clusters. (d) Drawing while treating clusters asnonuniform nodes. (e) Output of our algorithm (taking (d) as the input). (f) Final drawing by pluggingin details of clusters.

(a) classcal (without clustering)

(b) EH

(c) our

C1 C2

C3

C4C5

C1C2

C3

C4 C5

C1C2

C3

C4 C5

C1

C2

C3

C4 C5

Figure 15. Comparison of drawing the clustered graph in Figure 14.

Page 22: Drawing Graphs with Nonuniform Nodes Using Potential Fieldsacms.nctu.edu.tw/papers/JVLC2009-potential.pdf · Drawing Graphs with Nonuniform Nodes Using Potential Fields∗ Chun-Cheng

22 C.-C. Lin, H.-C. Yen, and J.-H. Chuang

ing clustered. By using some technique, we parti-tion the graph into some clusters, e.g., the graphof Figure 14(a) is divided into clusters of tree,mesh, triangle mesh, and Petersen graph, and theremaining nodes form a cluster called ‘unknown’.Knowing the constituent clusters, a good start-ing point to draw such a clustered graph, per-haps, is to draw each individual cluster separatelyby means of, for instance, the classical spring al-gorithm (Figure 14(b)). Once this is done, thedetails of each cluster can be abstracted out byregarding its convex hull as a nonuniform node.See Figure 14(c)(d). The next step is to apply ourapproach to producing a layout of the GNN suchas Figure 14(e) shows. Finally, a nice drawing ofthe original clustered graph is obtained by restor-ing the details of all the clusters as Figure 14(f)illustrates. Now suppose new nodes are addedto or deleted from Figure 14(a). Instead of run-ning the drawing algorithm on the new (possiblyhuge) graph all over again, our approach allows usto keep the internal drawings of those unaffected(due to insertion/deletion of nodes) clusters in-tact, while the redrawing need only be appliedto a much smaller graph, giving rise to a muchbetter performance.

With respect to hierarchical clustered graphs,the superiority of our approach is twofold. First,by taking advantage of the cluster structure, ourmethod requires a much lesser amount of com-putation than the EH method as pointed out inthe above discussion. Furthermore, the drawingquality of our approach is also better than theEH method with respect to the example shownin Figure 15. To see this, the drawings of clustersC2 and C5 are somewhat distorted by using theEH method; on the other hand, these two clustersare nicely displayed by ours. (See the left-mostdrawings of Figures 15 (b) and (c).) Now if weadd two edges to the graph (see the middle draw-ings of Figures 15 (b) and (c)), and re-draw thegraph using the two methods, we end up withthe right-most drawings of Figures 15 (b) and(c). Comparing the left-most drawing with theright-most drawing in Figure 15 (b), the embed-ding (see C3 and C4 clusters) and the contour (seeC2 cluster) have changed. Our approach, on theother hand, does not have this problem as Figure

15 (c) shows.Note that our approach, however, may have a

disadvantage as follows. The inter-cluster edgeincident to a node that is not drawn on theboundary of a cluster (polygon) can induce edgecrossings (see the thick edge in the right-most ofFigures 15 (c)). This is because the drawings ofclusters which are generated in earlier stages andnot changed afterwards are not aware of whetherthe nodes drawn inside the cluster drawings areconnected by inter-cluster edges in later stages.

Our approach to drawing hierarchical clusteredgraphs would also work well in the visualizationof social networks [38]. Their comparison is re-mained as the future work.

Although the graph used in Figures 14 and 15 isa hierarchical clustered graph with a 3-level inclu-sion tree, our approach can be easily applied tomore complicated hierarchical clustered graphs.Figure 16(a) gives an example of the drawing of a4-level hierarchical clustered graph. In compari-son with Figure 16(b) which is generated by usingthe classical embedder [2] (regardless of its clus-ter structure), our approach performs about 13times more efficient than the classical approach.Figure 16(a) in fact displays the cluster structureof the hierarchical clustered graph. What makesour approach run faster than the classical one isthat our drawing method need not re-draw theclusters at the lower levels when processing theclusters at the higher levels. As the size of thegraph increases, the classical approach is likelyto run even slower and often suffers from a moreserious local minimal problem. In view of theabove, our approach also has similar merits as so-called multi-scale approach [10,11], which runs ef-ficiently because in the multi-scale approach eachnode only considers the local forces instead of theglobal forces. The main difference between ourapproach and the multi-scale approach is that themain purpose of the multi-scale approach is todraw generic graphs instead of hierarchical clus-tered graphs, and hence, the multi-scale approachcannot display the cluster structure of a clusteredgraph.

Page 23: Drawing Graphs with Nonuniform Nodes Using Potential Fieldsacms.nctu.edu.tw/papers/JVLC2009-potential.pdf · Drawing Graphs with Nonuniform Nodes Using Potential Fields∗ Chun-Cheng

Drawing Graphs with Nonuniform Nodes Using Potential Fields 23

(a) our (b) classical

Figure 16. Drawing a 1024-node mesh graph by(a) using our approach which considers the graphas a hierarchical clustered graph with four-levelinclusion tree (total running time: 73.297 s); (b)using classical spring embedder [2] (total runningtime: 1477.250 s).

6. Conclusion

A potential-based approach, coupled with aforce-directed method, has been proposed and im-plemented for drawing graphs with nodes of dif-ferent sizes and shapes. Some applications, in-cluding drawing clustered graphs, have also beengiven to demonstrate the usefulness of our ap-proach. A unique feature of our approach is thatin the process of reaching equilibrium, the degreeof inclination of a nonuniform node can be ad-justed while moving from one position to another.By doing so, the final drawing has a tendencyto display a high degree of symmetry as well asto fit in a compact area. An equally importantaspect of our approach is that the formulas de-rived in our potential field model are analyticallytractable, making our algorithm computationallyefficient. In comparison with some existing al-gorithms, our experimental results look promis-ing. A line of future improvement includes thereduction of time complexity and the investiga-tion of a more general model for potential fieldsin 3-D, for our current treatment of a 3-D nodeis based on approximating its faces using samplepoints. It would be of interest to find solutionsto overcome the local minimal problems for draw-ing graphs with nonuniform nodes, to apply the

multi-scale technique to handle graphs with hugenonuniform nodes, and to produce dynamic draw-ings of graphs while preserving the mental map.In addition, it would also be of interest to find awider variety of instances for our approach suchthat users may decide whether our approach suitstheir practical needs.

Acknowledgements

The authors thank the anonymous referees forcomments that improved the content as well asthe presentation of this paper.

REFERENCES

1. K. Kaufmann, D. Wagner (Eds.), DrawingGraphs: Methods and Models, Vol. 2025 ofLNCS, Springer, 2001.

2. P. Eades, A heuristic for graph drawing,Congress Numerantium 42 (1984) 149–160.

3. F. Bertault, A force-directed algorithm thatpreserves edge crossing properties, in: GraphDrawing 1999, Vol. 1731 of LNCS, Springer,1999, pp. 351–358.

4. C.-C. Lin, H.-C. Yen, A new force-directedgraph drawing method based on edge-edge re-pulsion, in: IV 2005, IEEE CS Press, 2005,pp. 329–334.

5. T. Fruchterman, E. Reingold, Graph draw-ing by force-directed placement, Software-Practice and Experience 21 (1991) 1129–1164.

6. A. Frick, A. Ludwig, H. Mehldau, A fastadaptive layout algorithm for undirectedgraphs, in: Graph Drawing ’94, Vol. 894 ofLNCS, Springer, 1995, pp. 388–403.

7. R. Davidson, D. Harel, Drawing graphs nicelyusing simulated annealing, ACM Transac-tions on Graphics 15 (1996) 301–331.

8. T. Kamada, S. Kawai, An algorithm for draw-ing general undirected graphs, InformationProcessing Letters 31 (1989) 7–15.

9. K. Sugiyama, K. Misue, Graph drawing bythe magnetic spring model, Journal of VisualLanguages and Computing 6 (1995) 217–231.

10. S. Hachul, M. Junger, Drawing large graphswith a potential-field-based multilevel algo-

Page 24: Drawing Graphs with Nonuniform Nodes Using Potential Fieldsacms.nctu.edu.tw/papers/JVLC2009-potential.pdf · Drawing Graphs with Nonuniform Nodes Using Potential Fields∗ Chun-Cheng

24 C.-C. Lin, H.-C. Yen, and J.-H. Chuang

rithm, in: Graph Drawing 2004, Vol. 3383 ofLNCS, Springer, 2004, pp. 285–295.

11. D. Harel, Y. Koren, A fast multi-scale methodfor drawing large graphs, Journal of GraphAlgorithms and Applications 6 (3) (2002)179–202.

12. F. J. Brandenburg, M. Himsolt, C. Rohrer,An experimental comparison of force-directedand randomized graph drawing algorithms,in: Graph Drawing ’95, Vol. 1027 of LNCS,Springer, 1995, pp. 76–87.

13. P. Eades, X. Lin, Spring algorithms and sym-metry, Theoretical Computer Science 240 (2)(2000) 379–405.

14. D. Harel, Y. Koren, Drawing graphs withnonuniform vertices, in: AVI 2002, ACMPress, 2002, pp. 157–166.

15. X. Huang, W. Lai, Force-transfer: a newapproach to removing overlapping nodes ingraph layout, in: 25th Australasian Com-puter Science Conference, Vol. 16 of CRPIT,Australian Computer Society, 2003, pp. 349–358.

16. H. Eichelberger, SugiBib, in: Graph Drawing2001, Vol. 2265 of LNCS, Springer, 2002, pp.467–468.

17. C. Gutwenger, M. Junger, K. Klein, J. Kupke,S. Leipert, P. Mutzel, A new approach for vi-sualizing UML class diagrams, in: SOFTVIS2003, ACM Press, 2003, pp. 179–188.

18. J.-H. Chuang, Potential-based modeling ofthree-dimensional workspace for obstacleavoidance, IEEE Transactions on Roboticsand Automation 14 (5) (1998) 778–785.

19. J.-H. Chuang, N. Ahuja, An analyticallytractable potential field model of free spaceand its application in obstacle avoidance,IEEE Transactions on System, Man, and Cy-bernetics - Part B: Cybernetics 28 (5) (1998)729–736.

20. F. B. M. Miller, An algorithm for drawingcompound graphs, in: Graph Drawing ’99,Vol. 1731 of LNCS, Springer, 1999, pp. 197–204.

21. U. Dogrusoz, E. Giral, A. Cetintas, A. Civril,E. Demir, A compound graph layout algo-rithm for biological pathways, in: GraphDrawing 2004, Vol. 3383 of LNCS, Springer,

2004, pp. 442–447.22. T. C. Biedl, M. Kaufmann, Area-efficient

static and incremental graph drawings, in:ESA’97, Vol. 1284 of LNCS, Springer, 1997,pp. pp. 37–52.

23. Q. Feng, R. Cohen, P. Eades, Planarity forclustered graphs, in: ESA’95, Vol. 979 ofLNCS, Springer, 1995, pp. pp. 213–226.

24. Q. Feng, Algorithms for drawing clusteredgraphs, Ph.D. thesis, University of Newcas-tle, Australia (1997).

25. P. Eades, M. L. Huang, Navigating clusteredgraphs using force-directed methods, Journalof Graph Algorithms and Applications 4 (3)(2000) 157–181.

26. W. T. Tutte, Convex representations ofgraphs, Proceedings of the London Mathe-matical Society 10 (1960) 304–320.

27. W. T. Tutte, How to draw a graph, Proceed-ings of the London Mathematical Society 13(1963) 743–768.

28. S. Kirkpatrick, C. D. Gelatt, M. P. Vecchi,Optimization by simulated annealing, Science220 (1983) 671–680.

29. E. Gansner, S. North, Improved force-directed layouts, in: Graph Drawing ’98, Vol.1547 of LNCS, Springer, 1998, pp. 364–373.

30. T. Dwyer, K. Marriott, P. J. Stuckey, Fastnode overlap removal, in: Graph Drawing2005, Vol. 3843 of LNCS, Springer, 2005, pp.153–164.

31. H. Purchase, Which aesthetics has the great-est effect on human understanding, in: GraphDrawing ’97, Vol. 1353 of LNCS, Springer,1997, pp. 248–261.

32. H. Purchase, J.-A. Allder, D. Carrington,Graph layout aesthetics in UML diagrams:user preferences, Journal of Graph Algo-rithms and Applications 6 (3) (2002) 255–279.

33. J. Rumbaugh, J. Jacobson, G. Booch, TheUnified Modeling Language Reference Man-ual, Addison-Wesley Longman Ltd., Essex,UK, 1998.

34. H. Giese, G. Wirtz, Visual modeling ofobject-oriented distributed systems, Jour-nal of Visual Languages and Computing 12(2001) 183–202.

35. W. Brauer, W. Reisig, G. Rozenberg

Page 25: Drawing Graphs with Nonuniform Nodes Using Potential Fieldsacms.nctu.edu.tw/papers/JVLC2009-potential.pdf · Drawing Graphs with Nonuniform Nodes Using Potential Fields∗ Chun-Cheng

Drawing Graphs with Nonuniform Nodes Using Potential Fields 25

(Eds.), Petri Nets: Central Models (partI)/Applications (part II), Vol. 254/255 ofLNCS, Springer, 1987.

36. A. Ahmed et. al, GEOME: GEOmetry formaximum insight, in: Graph Drawing 2005,Vol. 3843 of LNCS, Springer, 2005, pp. 468–479.

37. T. Dwyer, Extending the WilmaScope 3Dgraph visualization system - software demon-stration, in: Proceedings of Asia Pacific Sym-posium on Information Visualisation 2005(APVIS2005), Vol. 45 of CRPIT, 2005, pp.35–42.

38. N. Henry, J.-D. Fekete, M. J. McGuffin,NodeTrix: a hybrid visualization of social net-works, IEEE Transactions on Visualizationand Computer Graphics 13 (6).