Perl-Sensitive Sunglasses | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I don't know whether you need an ASCII-art representation or an image, but for this job, GraphViz springs instantly to mind for me. Its raison d'être is to layout graphs, and there's a lot of research that's gone into it. It does its job very well.
If you'd rather do something by hand, then as a first step here is how you "rank" the vertices to get a nice attractive flow graph for a DAG:
Now if you lay out the vertices in columns so that the i-th column contains the rank-i vertices, then when you draw in the edges, they will all go from left to right (it's easy to see this from the definition of rank). It should look very pretty. This is essentially what GraphViz (dot engine) does anyway, at least as a first step according to its description on the main GraphViz page. It also has smart ways to arrange the vertices within each column, to minimize the number of edge crossings and other Ugly Things. And it will do something sensible when there are cycles. And it allows you to override and tweak everything of course. blokhead In reply to Re: How to print/draw a network graph
by blokhead
|
|