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

Return to the regular view of this page.

Layout Engines

1 - dot

“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 a reasonable default tool to use for undirected graphs that aren’t too large (about 100 nodes), when you don’t know anything else about the graph.

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 algorithm1, using steepest descent, is also available.

PDF Manual

3 - fdp

stands for Force Directed Placement.

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

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

PDF Manual

4 - sfdp

stands for Scalable Force Directed Placement.

sfdp is a fast, multilevel, force-directed algorithm that efficiently layouts large graphs, outlined in “Efficient and High Quality Force-Dircted Graph Drawing”1.

Multiscale version of the fdp layout, for the layout of large graphs.

PDF Manual

6 - twopi

radial layout.

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

7 - 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

8 - 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