In [2]:
LoadPackage("OrbitalGraphs");
LoadPackage("Francy");
Out[2]:
Out[2]:
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]:
In [5]:
G := DihedralGroup(IsPermGroup, 16);
ogs := OrbitalGraphs(G);
Out[5]:
Out[5]:
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]:
Out[9]:
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]));
In [ ]: