Interactive Graph Display routines available! (Michael Wolfe)
Fri, 7 Apr 1995 21:13:18 GMT

          From comp.compilers

Related articles
Interactive Graph Display routines available! (1995-04-07)
| List of all articles for this month |

Newsgroups: comp.compilers
From: (Michael Wolfe)
Keywords: tools, available, graphics
Organization: Oregon Graduate Institute - Computer Science & Engineering
Date: Fri, 7 Apr 1995 21:13:18 GMT


We have developed a library of routines that we use for interactive display
of graphs in our research compiler. We use these to display control flow
graphs, data flow graphs, expression trees, dominator trees, and more.
Our graph layout methods are geared towards these types of graphs, and
are oriented towards a fast, acceptable layout, as opposed to other tools,
which have prettier layouts but are slower. Our method can layout and
display a 600 node graph in less than 10 seconds (on a medium speed Sun 4).
Note that the tool is not a graph editor, and does not allow you to
'pick up' or move nodes. It is also not as general in the types of text
it can display inside a node. However, it is very fast, and allows X-Y
scrolling as well as scaling (zooming in/out) at very high speeds. We feel
that for our purposes, we feel that a graph on the screen is worth several
in the computer's memory.

We have phases in our compiler to call the layout routines directly,
depending on the type of graph we want displayed. To help you use these
library routines, we provide a toy sample application, which reads a
text file describing a directed graph, such as:
        (a,b) (b,c) (b,d) (d,e) (d,f)
and calls the routines to display that graph.

The library uses X windows and the Motif widgets. Advanced applications
can add items to the menu bar which will call routines in your application,
and can even set it up so that a button click on a node will call routines
in your application to perform some computation or change the display.

Please feel free to download the 'tar' file containing the source;
a SunOS executable is also available, along with a few sample input files
for the toy application. The address is
The executable is
or visit our WWW page:
      (gee, it'd be nice to have hypertext links from news to html or
        even other news postings).

We compiled it with gcc (c++) version 2.5.8, and have used it with SunOS
and Linux.

Let me know if it works for any of you! Thanks!
- Michael Wolfe (

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.