Introduction to Graphviz

The Graphviz package contains graph visualization software. Graph visualization is a way of representing structural information as diagrams of abstract graphs and networks. Graphviz has several main graph layout programs. It also has web and interactive graphical interfaces, auxiliary tools, libraries, and language bindings.

The Graphviz layout programs take descriptions of graphs in a simple text language, and creates diagrams in several useful formats such as images and SVG for web pages, Postscript for inclusion in PDF or other documents, or as objects displayed in an interactive graph browser. (Graphviz also supports GXL, an XML dialect.) In practice, graphs are usually generated from external data sources, but they can also be created and edited manually, either as raw text files or within a graphical editor. (Graphviz was not intended to be a Visio replacement, so it would probably be frustrating to try to use it that way.)

This package is useful for automatic graph drawing which has many important applications in software engineering, database and web design, networking, and in visual interfaces for many other domains. Graphviz has many useful features for concrete diagrams, such as options for colors, fonts, tabular node layouts, line styles, hyperlinks, and custom shapes.

Package Information

Additional Downloads

Graphviz Dependencies


pkg-config-0.22, expat-2.0.1, libpng-1.2.29, libjpeg-6b, FreeType-2.3.7, Fontconfig-2.4.2, X Window System, Pango-1.16.4 (built with cairo support), GTK+-2.10.13, libgnomeui-2.18.1, libglade-2.6.1, Tcl-8.4.18, Tk-8.4.18, GD Library, and Electric Fence

Optional (to Build Language Bindings)

SWIG (SWIG must be installed or no bindings will be built), Guile-1.8.2, JDK-6 Update 5, PHP-5.2.3, Python-2.5.2, Ruby-1.8.6-p111, Tcl-8.4.18, C# (DotGNU Portable.NET or Mono), Io, Lua, and Objective Caml

User Notes:

Installation of Graphviz

If you wish to compile the Java language bindings, you will need to supply the path to the Java headers with the following command:

export CPPFLAGS="$CPPFLAGS -I$JAVA_HOME/include -I$JAVA_HOME/include/linux"

Install Graphviz by running the following commands:

patch -Np1 -i ../graphviz-2.12-gd_fixes-1.patch &&
./configure --prefix=/usr &&

This package does not come with a test suite that provides meaningful results.

Now, as the root user:

make install

If desired, create a symbolic link in the system documents directory to the documentation installed in /usr/share/graphviz/doc using the following command as the root user:

ln -v -s /usr/share/graphviz/doc \

Configuring Graphviz

Config Files


Configuration Information

There are no specific configuration requirements for Graphviz. You may consider installing the additional plugins and tools available from the download page at for additional capabilities. If additional plugins are installed, you can run dot_static -c (as the root user) to update the config file in /usr/lib/graphviz.


Installed Programs: acyclic, bcomps, ccomps, circo, dijkstra, dot, dot2gxl, dot_static, dotty, fdp, gc, gvcolor, gvpack, gvpr, gxl2dot, lefty, lneato, nop, prune, sccmap, tred, twopi and unflatten
Installed Libraries: libagraph.{so,a}, libcdt.{so,a}, libexpr.{so,a}, libgraph.{so,a}, libpack.{so,a}, libpathplan.{so,a}, additional support libraries and language bindings
Installed Directories: /usr/include/graphviz, /usr/lib/graphviz and /usr/share/graphviz

Short Descriptions


is a filter that takes a directed graph as input and outputs a copy of the graph with sufficient edges reversed to make the graph acyclic. The reversed edge inherits all of the attributes of the original edge.


decomposes graphs into their biconnected components, printing the components to standard output.


decomposes graphs into their connected components, printing the components to standard output.


draws graphs using a circular layout. The tool identifies biconnected components and draws the nodes of the component on a circle. The block-cutpoint tree is then laid out using a recursive radial algorithm. Edge crossings within a circle are minimized by placing as many edges on the circle's perimeter as possible. In particular, if the component is outerplanar, the component will have a planar layout.


reads a stream of graphs and for each computes the distance of every node from sourcenode.


draws directed graphs. It works well on DAGs and other graphs that can be drawn as hierarchies. It reads attributed graph files and writes drawings. By default, the output format dot is the input file with layout coordinates appended.


converts between graphs represented in GXL and in the DOT language. Unless a conversion type is specified using a flag, gxl2dot will deduce the type of conversion from the suffix of the input file, a .dot suffix causing a conversion from DOT to GXL, and a .gxl suffix causing a conversion from GXL to DOT.


is a version of dotthat has all the Graphviz libraries compiled statically.


is a graph editor for the X Window System. It may be run as a standalone editor, or as a front end for applications that use graphs. It can control multiple windows viewing different graphs.


draws undirected graphs using a “spring” model. It relies on a force-directed approach in the spirit of Fruchterman and Reingold.


is a graph analogue to wc in that it prints to standard output the number of nodes, edges, connected components or clusters contained in the input files. It also prints a total count for all graphs if more than one graph is given.


is a filter that sets node colors from initial seed values. Colors flow along edges from tail to head, and are averaged (as HSB vectors) at nodes. The graph must already have been processed by dot.


reads in a stream of graphs, combines the graphs into a single layout, and produces a single graph serving as the union of the input graphs. The input graphs must be in dot format, and must have all necessary layout information.


is a graph stream editor inspired by awk. It copies input graphs to its output, possibly transforming their structure and attributes, creating new graphs, or printing arbitrary information.


converts between graphs represented in GXL and in the DOT language. Unless a conversion type is specified using a flag, gxl2dot will deduce the type of conversion from the suffix of the input file, a .dot suffix causing a conversion from DOT to GXL, and a .gxl suffix causing a conversion from GXL to DOT.


is a two-view graphics editor for technical pictures.


is a graph editor for the X Window System. It may be run as a standalone editor, or as a front end for applications that use graphs. It can control multiple windows viewing different graphs.


reads a stream of graphs and prints each in pretty-printed (canonical) format on stdout. If no files are given, it reads from stdin.


reads directed graphs in the same format used by dot and removes subgraphs rooted at nodes specified on the command line via options. These nodes themselves will not be removed, but can be given attributes so that they can be easily located by a graph stream editor such as gpr. prune correctly handles cycles, loops and multi-edges.


decomposes digraphs into strongly connected components and an auxiliary map of the relationship between components. In this map, each component is collapsed into a node. The resulting graphs are printed to standard out. The number of nodes, edges and strongly connected components are printed to standard error. sccmap is a way of partitioning large graphs into more manageable pieces.


computes the transitive reduction of directed graphs, and prints the resulting graphs to standard output. This removes edges implied by transitivity. Nodes and subgraphs are not otherwise affected. The “meaning” and validity of the reduced graphs is application dependent. tred is particularly useful as a preprocessor to dot to reduce clutter in dense layouts.


draws graphs using a radial layout. Basically, one node is chosen as the center and put at the origin. The remaining nodes are placed on a sequence of concentric circles centered about the origin, each a fixed radial distance from the previous circle.


is a preprocessor to dot that is used to improve the aspect ratio of graphs having many leaves or disconnected nodes. The usual layout for such a graph is generally very wide or tall. unflatten inserts invisible edges or adjusts the minlen on edges to improve layout compaction.


supports graph programming by maintaining graphs in memory and reading and writing graph files. Graphs, nodes and edges may be attributed with programmer-defined records and string name-value pairs. Graphs are composed of nodes, edges, and nested subgraphs. Internally, libagraph depends extensively on libcdt (formerly libdict) for set representation.


manages run-time dictionaries using standard container data types: unordered set/multiset, ordered set/multiset, list, stack, and queue.


is a C-like expression library.


maintains directed and undirected attributed graphs in memory and reads and writes graph files. Graphs are composed of nodes, edges, and nested subgraphs. A subgraph may contain any nodes and edges of its parents, and may be passed to any libgraph function taking a graph pointer, except the three that create new attributes (where a main graph is required).


supports the use of connected components in the context of laying out graphs using other Graphviz libraries. One set of functions can be used to take a single graph and break it apart into connected components. A complementary set of functions takes a collection of graphs (not necessarily components of a single graph) which have been laid out separately, and packs them together moderately tightly. The packing is done using the polyomino algorithm of K. Freivalds et al.


contains functions to find the shortest path between two points in a simple polygon.

Last updated on 2007-07-24 00:02:11 -0500