Demo for the OrbitalGraphs GAP package

This attempts to draw orbital graphs for groups $G \leq S_n$


In [2]:
LoadPackage("OrbitalGraphs");
LoadPackage("Francy");


Out[2]:
true
Out[2]:
true

In [3]:
# Input: an orbital graph
# Draws orbital graphs

DrawOrbitalGraph := function(OG)
    local canvas, fgraph, i, e, nodes;
    
    # todo: make it possible to put a caption here
    canvas := Canvas(Concatenation("Orbital Graph of", ""));
    fgraph := Graph(GraphType.DIRECTED);
    Add(canvas, fgraph);

    nodes := [];

    for i in DigraphVertices(OG) do
        nodes[i] := Shape(ShapeType.CIRCLE, String(i));;
        Add(fgraph, nodes[i]);
    od;
    for i in [1..Length(nodes)-1] do
        e := Link(nodes[i], nodes[i+1]);
        SetInvisible(e, true);
        Add(fgraph, e);
    od;
    e := Link(nodes[Length(nodes)], nodes[1]);
    SetInvisible(e, true);
    Add(fgraph, e);

    for e in DigraphEdges(OG) do
        Add(fgraph, Link(nodes[e[1]], nodes[e[2]]));
    od;

    return Draw(canvas);
end;


Out[3]:
function( OG ) ... end

In [5]:
G := DihedralGroup(IsPermGroup, 16);
ogs := OrbitalGraphs(G);


Out[5]:
Group([ (1,2,3,4,5,6,7,8), (2,8)(3,7)(4,6) ])
Out[5]:
[ <digraph with 8 vertices, 8 edges>, <digraph with 8 vertices, 16 edges>, <digraph with 8 vertices, 16 edges>, <digraph with 8 vertices, 16 edges> ]

In [6]:
# This seems to work quite ok
DrawOrbitalGraph(ogs[1]);


Out[6]:

In [7]:
# This, not so much
DrawOrbitalGraph(ogs[2]);


Out[7]:

In [9]:
G := DirectProduct(SymmetricGroup(3), CyclicGroup(IsPermGroup, 5));
ogs := OrbitalGraphs(G);


Out[9]:
Group([ (1,2,3), (1,2), (4,5,6,7,8) ])
Out[9]:
[ <digraph with 8 vertices, 5 edges>, <digraph with 8 vertices, 5 edges>, <digraph with 8 vertices, 5 edges>, <digraph with 8 vertices, 5 edges>, <digraph with 8 vertices, 6 edges>, <digraph with 8 vertices, 15 edges>, <digraph with 8 vertices, 15 edges> ]

In [10]:
DrawOrbitalGraph(ogs[2]);


Out[10]:

In [10]:
# Maybe slightly more useful?
JupyterSplashDot(DotDigraph(ogs[2]));
JupyterSplashDot(DotDigraph(ogs[5]));
JupyterSplashDot(DotDigraph(ogs[7]));


Error, operations: IN of character and boolean or fail is not defined in
  '/' in path at /home/ec2-user/environment/gap/pkg/io-4.6.0/gap/io.gi:945 called from 
IO_FindExecutable( path ) at /home/ec2-user/environment/gap/pkg/io-4.6.0/gap/io.gi:1047 called from
IO_Popen( IO_FindExecutable( "dot" ), [ "-Tsvg", fn ], "r" ) at /home/ec2-user/environment/gap/pkg/JupyterKernel-1.3/gap/JupyterUtil.gi:16 called from
<function "JupyterSplashDot">( <arguments> )
 called from read-eval loop at stream:2
Error, operations: IN of character and boolean or fail is not defined in
  '/' in path at /home/ec2-user/environment/gap/pkg/io-4.6.0/gap/io.gi:945 called from 
IO_FindExecutable( path ) at /home/ec2-user/environment/gap/pkg/io-4.6.0/gap/io.gi:1047 called from
IO_Popen( IO_FindExecutable( "dot" ), [ "-Tsvg", fn ], "r" ) at /home/ec2-user/environment/gap/pkg/JupyterKernel-1.3/gap/JupyterUtil.gi:16 called from
<function "JupyterSplashDot">( <arguments> )
 called from read-eval loop at stream:3
Error, operations: IN of character and boolean or fail is not defined in
  '/' in path at /home/ec2-user/environment/gap/pkg/io-4.6.0/gap/io.gi:945 called from 
IO_FindExecutable( path ) at /home/ec2-user/environment/gap/pkg/io-4.6.0/gap/io.gi:1047 called from
IO_Popen( IO_FindExecutable( "dot" ), [ "-Tsvg", fn ], "r" ) at /home/ec2-user/environment/gap/pkg/JupyterKernel-1.3/gap/JupyterUtil.gi:16 called from
<function "JupyterSplashDot">( <arguments> )
 called from read-eval loop at stream:4

In [ ]: