An Introduction to GraphViz

How to use command-line tools and basic GraphViz utilities to produce graphs both simple and complex.
Conclusion

Using dot, twopi and NEATO to create graphics is not difficult. The three utilities were made according to the UNIX philosophy: they are easy to use, they do one thing well and the only requirement for using them is a simple text editor.

Graphical tools that make use of dot, twopi and NEATO languages for making graphs exist as well, but I still prefer the command line. The presented tools can be used for simple graphs as well as for complex graphs.

I would like to thank Nikos Platis for proofreading the article.

Resources

GraphViz Development Web Site

Official GraphViz Web Site

"Methods for Visual Understanding of Hierarchical System Structures". Sugiyama, K., Tagawa, S. and Toda, M. Man and Cybernetics. IEEE Trans. Systems, February 1981.

A Technique for Drawing Directed Graphs. Gansner, E. R., Koutsofios, E., North, S. C. and Vo, K. IEEE Trans. Software Engineering, May 1993.

"An algorithm for drawing general undirected graphs". Kamada, T. and Kawai, S. Information Processing Letters, April 1989.

The Design and Analysis of Computer Algorithms. Aho, Hopcroft and Ullman. Addison Wesley, 1974.

Mihalis Tsoukalos lives in Greece with his wife, Eugenia, and works as a high school teacher. Previously, he worked as a UNIX systems administrator, an Oracle DBA, a UNIX programmer and a PL/SQL programmer. He holds a B.Sc. in Mathematics and a M.Sc. in Information Technology from University College, London. Mihalis can be reached at mtsouk@freemail.gr.

______________________

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: An Introduction to GraphViz

Anonymous's picture

Readers might be wondering why dia doesn't include dot, or KDE, or...

And the answer's the license, which is kind of open source, but not quite. OSI don't seem to regard it as so, anyway, and it's in nonfree in Debian.

However, for those many cases where the license doesn't matter so long as you can get the tool, graphviz is a great set of tools to have around.

Re: An Introduction to GraphViz

Anonymous's picture

Any reason you didn't mention Leon Brocard's excellent GraphViz Perl module, which makes this so much easier?

http://search.cpan.org/~lbrocard/GraphViz-2.00/

To say nothing of the other GraphViz related modules on CPAN.

Re: An Introduction to GraphViz

Anonymous's picture

Great article!
I wrote a web log analyzer that outputs a graphviz
graph from the web server logs (www.hping.org/visitors)
and I think I can modify the program to produce a better
output thanks to this article.

Btw a note about the graphviz's license: it's not opensource
if I remember correctly (or at least not an OSI approved
license).

Graphviz (AT&T source code) license

Stephen North's picture

Thank you for the nice articles about Graphviz.

We're aware of the problems about the AT&T Source
Code License, and expect to have some good news shortly.

Stephen

Graphviz is now under the CPL

Stephen North's picture

We hope this will be beneficial to the open source community.
Please visit www.graphviz.org for downloads and other info.

Webinar
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Webinar
Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix