A technique for drawing directed graphs

E.R. Gansner, E. Koutsofios, S.C. North, K.-P. Vo
1993 IEEE Transactions on Software Engineering  
We describe a four-pass algorithm for drawing directed graphs. The first pass finds an optimal rank assignment using a network simplex algorithm. The second pass sets the vertex order within ranks by an iterative heuristic incorporating a novel weight function and local transpositions to reduce crossings. The third pass finds optimal coordinates for nodes by constructing and ranking an auxiliary graph. The fourth pass makes splines to draw edges. The algorithm makes good drawings and runs fast.
more » ... ings and runs fast. Overview The graph drawing algorithm has four passes, as shown in figure 1-1. The first pass places the nodes in discrete ranks. The second sets the order of nodes within ranks to avoid edge crossings. The third sets the actual layout coordinates of nodes. The final pass finds the spline control points for edges. 1. procedure draw_graph() 2. begin 3. rank(); 4. ordering(); 5. position(); 6. make_splines(); 7. end Figure 1-1. Main algorithm Our contributions are: (1) an efficient way of ranking the nodes using a network simplex algorithm; (2) improved heuristics to reduce edge crossings; (3) a method for computing the node coordinates as a rank assignment problem; and (4) a method for setting spline control points. Techniques (1) and (2) were first implemented in the graph drawing program dag, described in [GNV1] . Further work, especially (3) and (4) , have been incorporated in dot [KN], a successor to dag. Figures 1-2 and 1-3 are samples of dot's output with the corresponding input files.
doi:10.1109/32.221135 fatcat:ez3r2m7p6zhohdhdnxvknxvffi