![]() Volume 10, Issue 1 Articles Trott's Corner New Products New Publications Calendar News Bulletins New Resources Classifieds Download This Issue Editorial Policy Staff and Contributors Submissions Subscriptions Advertising Back Issues Contact Information |
Efficient, High-Quality Force-Directed Graph Drawing
1. IntroductionGraphs are often used to encapsulate the relationship between objects. Graph drawing enables visualization of these relationships. The usefulness of the representation is dependent on the aesthetics of the drawing. While there are no strict criteria for aesthetics, it is generally agreed that minimal edge crossing, evenly distributed vertices, and depiction of graph symmetry is desirable. This problem has been studied extensively in the literature [3] and many approaches have been proposed. In this article we concentrate on drawing undirected graphs with straight-line edges using force-directed methods [4, 5, 6, 7]. Force-directed methods, however, are one of many classes of methods proposed for straight-edge drawing. Other methods include the spectral method [8] and the high-dimensional embedding method [9]. A force-directed algorithm models the graph drawing problem through a physical system of bodies with forces acting between them. The algorithm finds a good placement of the bodies by minimizing the energy of the system. There are many variations of force-directed algorithms. The algorithm of Fruchterman and Reigold [4], which is based on the work of [5, 6], models the graph drawing problem with a system of springs between neighboring vertices of the graph, pulling them together. At the same time, repulsive electrical forces that exist push all vertices away from each other. The algorithm of Kamada and Kawai [7], on the other hand, associates springs between all vertices, with the ideal length of a spring proportional to the graph distance of the vertices. In a force-directed algorithm, the energy of the system is typically minimized iteratively by moving the vertices along the direction of the force. This amount may be large initially, but reduces gradually based on a "cooling schedule." There are two limiting factors in drawing large graphs for standard force-directed algorithms. The first is that the physical model typically has many local minimums, particularly so for a large graph. Starting from a random configuration, the system is likely to settle in a local minimum. This may be improved, to a limited extent, by using a slow cooling schedule at the expense of more iterations. Nevertheless, it is practically impossible to use the standard force-directed algorithms to find a good layout of very large graphs. The second limiting factor is the computational complexity of the standard force-directed algorithms. In the algorithm of Fruchterman and Reigold [4], for any given vertex, repulsive force from all other vertices needs to be calculated. This makes the per iteration cost of the algorithm To overcome the first limiting factor, a multilevel approach was proposed. This idea has been successfully used in many fields, including graph partitioning [10, 11, 12] and was found to be able to overcome the localized nature of the Kernighan-Lin algorithm. Fruchterman and Reigold [4, 1148] alluded to that type of solution when, in the context of overcoming local minimums, they stated "we suspect that if we apply a multi-grid technique that allows whole portions of the graph to be moved, it might be of some help...". Harel and Koren [13], extending the earlier work of Hadany and Harel [14], proposed the so-called multiscale approach. In that approach, a sequence of coarser and coarser graphs are formed by finding the Reducing the computational cost by restricting force calculation to a neighborhood has been an often used practice, dating at least as far back as Fruchterman and Reigold [4]. Such a practice, however, comes at a cost. Because long-range forces are ignored, there is no force to evenly distribute faraway vertices. When used within the multilevel approach, Walshaw [2] argued that global untangling has been achieved on coarser graphs, thus for the final large graphs, restricting force calculation to a small neighborhood does not penalize the quality of the placement. While this is to a large extent true, for some graphs we found that the lack of long-range force did hurt at least one, if not more, of the drawings in [2]. It is possible to take account of long-range forces in an efficient way in the spring-electrical model. In this model the attractive force (the spring force) is only between neighboring vertices, while the repulsive force is global and is proportional to the inverse of the (physical) distance between vertices. The repulsive force calculation resembles the In this article we propose an algorithm that is both efficient and of high quality for large graphs. The algorithm is included with Mathematica 5.1 and later versions in the package DiscreteMath`GraphPlot. We combine a multilevel approach, which effectively overcomes local minimums, with the Barnes and Hut octree algorithm, which approximates short- and long-range forces satisfactorily and efficiently. In addition, we propose an adaptive cooling scheme for the basic force-directed algorithms and a scheme for selecting the optimal depth of the octree/quadtree in the Barnes and Hut algorithm. Our numerical results show that the algorithm is competitive with Walshaw's [2] highly efficient graph drawing algorithm, yet gives better results on some of the difficult problems. We also analyze the distortion effect of the standard Fruchterman-Reigold spring-electrical model and propose a general repulsive force model to overcome this side effect. In Section 2, we give definitions and notations. In Section 3, we present the basic force-directed algorithms, as well as an adaptive cooling scheme. In Section 4, we briefly introduce the Barnes-Hut force calculation algorithm. In Section 5, we describe the multilevel scheme used. In Section 6, we compare the efficiency and drawings of our algorithm with that of Walshaw [2]. In Section 7, we conclude by suggesting some future works.
|
||||||||
About Mathematica | Download Mathematica Player © 2006 Wolfram Media, Inc. All rights reserved. |