Transcription of Drawing graphs with NEATO - Graph Visualization …
1 Drawing graphs with NEATO . Stephen C. North April 26, 2004. Abstract NEATO is a program that makes layouts of undirected graphs following the filter model of DOT. Its layout heuristic creates virtual physical models and runs an iterative solver to find low energy configurations. The intended appli- cations are in telecommunication networks, computer programming and soft- ware engineering. Here is an example layout depicting an entity-relationship database schema. It took seconds of user time to generate on a garden variety PC running Linux.
2 Name C-I n 1 code name course institute n 1. S-C. S-I. n m student name number grade Entity Relation Diagram drawn by NEATO . 1. NEATO User's Manual, April 26, 2004 2. 1 Introduction NEATO is a utility that draws undirected graphs , which are common in telecommu- nications and computer programming. It draws a Graph by constructing a virtual physical model and running an iterative solver to find a low-energy configuration. Following an approach proposed by Kamada and Kawai [KK89], an ideal spring is placed between every pair of nodes such that its length is set to the shortest path distance between the endpoints.
3 The springs push the nodes so their geometric dis- tance in the layout approximates their path distance in the Graph . This often yields reasonable layouts [Ead84][FR91]. (In statistics, this algorithm is also known as multidimensional scaling. Its application to Graph Drawing was noted by Kruskal and Seery in the late 1970s.). NEATO is compatible with the directed Graph Drawing program DOT in shar- ing the same input file format and graphics drivers [KN91]. Since the file format includes both undirected and directed graphs , NEATO draws graphs prepared for DOT, and vice versa.
4 Both programs have the same options for setting labels, col- ors, shapes, text fonts, and pagination, and for generating code in common Graph - ics languages (PostScript, raster formats such as GIF and PNG, SVG, FrameMaker MIF, HPGL/2, and web click maps). Both work with DOTTY, an interactive Graph viewer for X windows. (The lneato command script runs NEATO from an interac- tive window.). Figs. 1 4 are representative examples of NEATO 's output. The timings refer to user time on a 600 Mhz Pentium Linux server. Fig. 1 was derived from a hand- made Drawing in an operating system tutorial.
5 Fig. 2 shows the connectivity of a computer network. Fig. 3 shows the sharing of programmer-defined types between procedures in a C program. The program that was the source of this Graph parses a text file into an internal data structure. The Graph was extracted from a C program database. Its Drawing shows where interactions or conversions between types may occur. Finally, Fig. 4 shows relationships between IMRs (modification requests). in an externally released software The labeled nodes are IMRs and the small circles encode many-to-many dependencies.
6 1. Graph courtesy of J. Hoshen, Bell Labs. NEATO User's Manual, April 26, 2004 3. Graph G {. run -- intr;. intr -- runbl; runbl intr runbl -- run;. run -- kernel;. run kernel -- zombie;. kernel -- sleep;. kernel -- runmem; zombie kernel sleep -- swap;. swap -- runswap;. sleep runswap -- new;. runswap -- runmem; runmem new -- runmem; swap sleep -- runmem;. new runswap }. Figure 1: Process States in an Operating System Kernel ( seconds). FL. LZ. DR. FJ. AN. MT. ER. MV. WH1 HO3. ALC. HO1. IW. HR MH. IH1. IHP. IH4. CB HV. ERC. IH2. IHC.
7 MLM. Figure 2: R&D Internet Backbone ( seconds). NEATO User's Manual, April 26, 2004 4. check_buffer prefix main out_heading init_spec_table open_source out_data rel spec_data fill_spec_table out_rel info check_fclose spec_heading check_fopen match Figure 3: Type Sharing Between Procedures in a C Program ( seconds). NEATO User's Manual, April 26, 2004 5. 354221. 375319. 377562 373300. 375134. 355080375499 377220. 354878. 358584. 358159. 354785. 355288 356741. 360672. 355800 360144. 358155. 370510. 354546354771 357538. 378108 356116360839.
8 360104. 354757 357793 353506. 357340. 354766. 371187 358157. 357769. 358471. 370509. 375027. 375024. 354290. 379864. 379422. 376956. 358224 383039 376529. 379339 377801. 379126. 382574. 380285. 358900. 382928 359471 384909. 375508. 382103. 374700 374741. 357430 383174 374886. 375557 375507 379212. 375039 377763 359100. 377980. 380448 372568 381211 380571377719 380963. 380526380475 382161. 382827 379848 381835. 379169 381901 371942. 370706 382409 380604. 381897. 375519 377380. 352010. 379341380298. 379972378666 358930374300. 381710.
9 378362 377924 379968. 381775 377908 377971. 378656 384096. 382528. 382566. 382436 371943. 382572. 358866. 341411. Figure 4: IMR Dependencies ( seconds). NEATO User's Manual, April 26, 2004 6. n2. $ cat Graph G { n0. n0 -- n1 -- n2 -- n3 -- n0;. } n3. $ NEATO -Tps -o n1. Figure 5: Example Graph Drawing 2 Graph Drawing Basic Commands The remainder of this memo gives a synopsis of NEATO features. Many of these should be familiar to users of DOT. Fig. 5 shows a Graph file, its Drawing , and the command that was executed. A Graph file has a short header and a body consisting of nodes, edges, and attribute assignments.
10 By default, nodes are drawn as ellipses labeled with node names. Undirected edges are created by the -- operator. Edges are drawn as straight lines and tend to be all about the same length. Drawing Options Table 1 lists the Graph , node and edge attributes that affect the layout. The options to set labels, shapes, fonts, and sizes are convenient for many kinds of layouts. The Drawing in figure 6 illustrates some of these Options to set the size of the Drawing , pagination, and output graphics language are also the same as in DOT. 3 Adjusting Layouts Although layouts made by NEATO are close to a local optimum as defined by the forces the springs exert on the nodes, fine tuning or generation of alternative layouts may improve readability.