[GAP Forum] Diagrams

Tim Boykett tim at timesup.org
Wed May 9 09:30:12 BST 2007


Hello,

when I want to construct diagrams from GAP data, I usually get  
"outside the box"
and use graphViz (see http://graphviz.org for details) by creating  
data files from GAP using Print
commands, then using this data file in graphviz.

For instance the following code creates the diagram of a graph that  
is described
by a permutation:

RandomRevDynamicsGraph := function(n)
local i,p;
   p := Random(SymmetricGroup(n));
   Print("digraph dynamics {\n");
   for i in [1..n] do
     Print (i, " -> ", i^p,";\n");
   od;
   Print("}\n");
end;

The printed output in GAP can be copy-pasted into a textfile (use the  
suffix
.dot as the graph layout language is called DOT).

If you have access to a Mac OSX  machine, there is a simple front end
for GraphViz, otherwise you have to use the programs dot, neato and  
other
layout programs on the command line to create e.g. postscript or jpeg  
output.

e.g.

dot -Tps permAut3.dot > permAut3.ps

Of course most layouts are more complex, the DOT language allows  
nodes and
edges to be labelled, there are various formatting algorithms, one can
fix certain nodes and have graphViz automatically position the rest.  
The above
example is meant to be simple example to "get you started" as they say
in those DIY books.

This is the way that I have been doing this, and I find it quite  
satisfactory.

Best,

   Tim



On 27/04/2007, at 2:40 AM, Breandán Mac Parland wrote:

> Hello,
>
> I was wondering if there is a way to output a tree diagram from  
> GAP. Say you have a group G, then below this you could have output  
> from MaximalSubgroups(G), then you could have the output to  
> IsSolvable() below each maximal subgroup, for example, all  
> connected in a diagram.
>
> Thanks,
>
> Breandán.
> _______________________________________________
> Forum mailing list
> Forum at mail.gap-system.org
> http://mail.gap-system.org/mailman/listinfo/forum
>




More information about the Forum mailing list