Graph (cyclic kind, not pretty picture kind) rendering algorithm?

Paul Wright -$Paul$- at verence.demon.co.uk
Sun Feb 18 23:27:59 CET 2001


In article <rw_g6.54$q04.78888 at news.pacbell.net>,
Phlip  <phlip_cpp at my-deja.com> wrote:
>Python for Pyros:
>
>Click here, then scoot down about 2 pages:
>
>        http://www.tomsawyer.com/glt/index.html
>
>On the left we see a Graph (a math object describing vertices connected by 
>edges), and on the right's the same graph drawn with all the lengths of the 
>lines balanced.
>
>Is there a Python library out there that can draw a graph like that? Or 
>which can take a graph as an input and return XY coordinates telling where 
>to place each vertice and each line?

AT&T's GraphViz tools will do directed and undirected graph drawing,
though I'm not sure what "balanced" means in this context so it may be
that they don't quite do what you want. The input format is something
like

digraph fred 
{
v1 -> v2;
v3 -> v2;
}

to put lines between v1 and v2 and between v3 and v2. Shapes, colours
and labels for vertices and edges can be controlled.

<http://www.research.att.com/sw/tools/graphviz/> is the URL I have, if
it's wrong, Google should find them. GraphViz is excellent: I wrote a
set of tools to produce data flow diagrams from C code using Exuberant
Ctags, Perl and GraphViz. 

-- 
----- Paul Wright ------| For my part, I travel not to go anywhere, but to
-paul.wright at pobox.com--| go. I travel for travel's sake. The great affair is
http://pobox.com/~pw201 | to move.  -Stevenson



More information about the Python-list mailing list