This the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Layout Engines

1 - dot

Makes “hierarchical” or layered drawings of directed graphs.

dot is the default tool to use if edges have directionality.

The layout algorithm aims edges in the same direction (top to bottom, or left to right) and then attempts to avoid edge crossings and reduce edge length.

PDF Manual

2 - neato

“spring model” layouts.

neato is the default tool to use if the graph is not too large (about 100 nodes) and you don’t know anything else about it.

neato attempts to minimize a global energy function, which is equivalent to statistical multi-dimensional scaling.

The solution is achieved using stress majorization, though the older Kamada-Kawai algorithm, using steepest descent, is also available.

PDF Manual

3 - twopi

Radial layouts, after Graham Wills 19971.

Nodes are placed on concentric circles depending their distance from a given root node.

You can set the root node, or let twopi do it.

PDF Manual


  1. Graham J. Wills (1999) NicheWorks—Interactive Visualization of Very Large Graphs, Journal of Computational and Graphical Statistics, 8:2, 190-212 ↩︎

5 - fdp

“spring model” layouts similar to those of neato, but does this by reducing forces rather than working with energy.

fdp implements the Fruchterman-Reingold heuristic including a multigrid solver that handles larger graphs and clustered undirected graphs.

PDF Manual

6 - osage

osage draws clustered graphs.

As input, osage takes any graph in the dot format.

osage draws the graph recursively. At each level, there will be a collection of nodes and a collection of cluster subgraphs. The internals of each cluster subgraph are laid out, then the cluster subgraphs and nodes at the current level are positioned relative to each other, treating each cluster subgraph as a node.

At each level, the nodes and cluster subgraphs are viewed as rectangles to be packed together. At present, edges are ignored during packing. Packing is done using the standard packing functions. In particular, the graph attributes pack and packmode control the layout. Each graph and cluster can specify its own values for these attributes. Remember also that a cluster inherits its attribute values from its parent graph.

After all nodes and clusters, edges are routed based on the value of the splines attribute.

PDF Manual

7 - patchwork

patchwork draws clustered graphs using a squarified treemap layout.

As input, patchwork takes any graph in the dot format.

Each cluster is given an area based on the areas specified by the clusters and nodes it contains. The areas of nodes and empty clusters can be specified by the area attribute. The default area is 1.

The root graph is laid out as a square. Then, recursively, the region of a cluster or graph is partitioned among its top-level nodes and clusters, with each given a roughly square subregion with its specified area.

PDF Manual

8 - sfdp

Multiscale version of fdp for the layout of large graphs.

PDF Manual