Keenan Crane
Graph Draw
October 2005

GraphDraw is a simple Java application which lets you draw graphs and save them as PostScript.

To run: Download GraphDraw.jar. Depending on your platform, either double click on the downloaded .jar file, or run

    java -jar GraphDraw.jar
from the command line.

To use:

      To create a vertex, right click on an empty spot (command-click on Mac). To remove a vertex, right click on it again. Multiple vertices can be selected by either shift-clicking or by dragging a selection rectangle, and can be dragged, copied, etc. Turning the grid on will cause vertices to snap to a grid of the specified width and height.
      To create or remove a single edge, left click on the first and then second incident vertices. To create additional edges, do the same while holding down the control key. The Flip button will reverse the direction of selected edges (or all the edges if none are selected).
      Label a vertex by selecting it, typing its label in the label field, and pressing return. Multiple vertices can be labeled in the same way. The font for all labels can be set in the font menu.
      GraphDraw will read and write adjacency matrix, adjacency list, and PostScript files. Adjacency matrix files are plain text files which have a line to specify whether the graph is undirected or directed, a line to specify the number of vertices, and then V lines representing the matrix, e.g.,

    0 1 0 0 0
    0 1 2 0 0
    0 0 2 4 0
    0 0 0 3 8
    0 0 0 0 4

      'D' specifies that the graph is directed ('U' for undirected), and it has 5 vertices. Numbers on following lines are separated by a space and represent the number of edges between vertices i and j where i is the row and j is the column.
      Adjacency list files are similar, but include a line for the number of edges. Each following line contains two numbers - a start and end vertex. Vertex indices start at 0. Multiple edges are represented by redundant lines. An example list file:

    0 1
    0 2
    3 4
    3 4
    6 5
    0 6

      Drawings of graphs can also be saved as PostScript. In addition to edge information, PostScript files save the drawing scale, font settings, vertex positions, and labels. GraphDraw will read PostScript files, but only ones saved from GraphDraw (since it needs the edge information).

    Automatic Drawing:
      At the moment, GraphDraw cannot automatically generate drawings, so the Autogen button does nothing.
      The size of the vertices, arrowheads, and width of the lines can be set using the scale field.

To complain:

    GraphDraw is not perfect. If you have any problems with it, send me an email and I'll see what I can do.