GRAPHDRAW(9.1) GRAPHDRAW(9.1) NAME graphdraw graphpic - edit (combinatoric) graphs, convert to pic files SYNOPSIS graphdraw [ file ] graphpic [ option ... ] file DESCRIPTION Graphdraw interactively edits and displays undirected graphs, and can also be used to display real-time animation of algorithms. If a file is mentioned, the graph stored in that file is edited. Click button 1 in command line (at bottom of window) to type in commands: r file Read file and display graph. w file Write current graph to file. cd directory Change directory. ! program file Execute animation program with file as input. q Quit. Button 3 gets a menu of actions, which are usually accom- plished by pointing with button 1. The parenthesized equiv- alents in the following list are explained under `Algorithm animation'. create vertex Vertex is placed where button 1 is clicked. (vc x y) delete Delete selected vertex and associated edges. (vd i) move Selected vertex moves with mouse until button 1 is released. (vm i) copy Copy of selected vertex and associated edges moves with mouse. (vc i x y) create/delete edge Point to first endpoint and click button 1. Point to second endpoint and click button 1. Continue selecting second endpoints with button 1. To unselect first end- point, click button 2. (ec i j / ed i j) restart Click button 1 to clear screen and discard current graph. (pr) standard window Restart and reshape window to standard size, in which the drawing area is square and as large as possible. small/large/no grid GRAPHDRAW(9.1) GRAPHDRAW(9.1) Impose/remove visible grid to which all new coordinates will be rounded. exit Click button 1 to confirm. labels menu label vertex Select vertex with button 1. Current label appears on command line. To accept it, click but- ton 1. Otherwise, type in new label and hit return. (vl i w) number vertices Vertex labels are set to the consecutive integers 1,2,...; this is the default. (vn) label edge Default is `1'. (el i j w) show/hide vertex labels (vs, vh) show/hide edge labels (es, eh) turn Euclidean edge labels on/off Distances are measured in pixels. (ee) show/hide sum of edges graphics menu light/heavy/empty/full/invisible vertex Select style from menu with button 3; select ver- tices to change with button 1. The default is `light'. (vg i c) light/heavy edge (eg i j c) macros menu Arrange for sets of vertices to act together. Actions on any vertex in the set apply to the whole set. Copy- ing duplicates edges internal to the set. Creating an edge between vertexes in two different sets creates edges from every vertex in one set to every vertex in the other (bipartite subgraph). select set Sweep a rectangle around the set with button 1. Dissociate conflicting sets. unselect set Dissociate set containing selected ver- tex. shrink/expand set Selected set is shrunk/expanded about its center. reshape set Selected set is redrawn in swept rectan- gle. complete/disconnect subgraph Create/delete edges between every pair of vertices in a set. Graphpic is a filter which, when applied to a file in graph- draw format, outputs pic code for the graph. The options are: -v Print vertex labels. -e Print edge labels. -i Optimize for imagen printer (default is d202). File format GRAPHDRAW(9.1) GRAPHDRAW(9.1) Graphs are stored as adjacency lists. First line: n m t, where n is the number of vertices, m is the number of edges, and t is an optional graph type. The only legal type is the default type u (undirected). For each vertex, an initial line: d w x y c, where d is the degree of the vertex, w is its label, x and y are its coor- dinates in the window, and c is an optional graphics code, L=light (default), H=heavy (circled dot), F=full (large bul- let), E=empty (empty circle), I =invisible. Window coordi- nates will be scaled to fit when graph is read in. After the initial line follow d lines for the vertex's edges: i w c, where i is the index (1 to n) of the other endpoint, w is the edge label, and c is an optional graphics code, L or H. Algorithm animation The typed command !program file causes the standard output of program to be captured by the host and interpreted as commands to graphdraw. The resulting movie can be killed or temporarily halted from the the terminal by clicking button 2 and choosing the desired option from the resulting menu. Animation codes (defined parenthetically with menu items above) appear one per line. Their arguments are: i, index of a vertex (normally the ith to be created); x, y, integer coordinates in the range 0 to maxcoord; w a label; or c, a graphic code. Other animation codes are pw n Change the value of maxcoord to n. Default is 10,000. vl i w Give vertex i the label w. pd t Delay program for t clicks of the 60Hz clock. ps Halt program until user clicks button 2 to con- tinue. pm message Print message on command line. SEE ALSO dag(1), pic(1) BUGS It is impossible to move or reshape a graphdraw layer, except via `standard window'.