Skip to content

Commit 2b3555d

Browse files
committed
WIP: Faster OrbitalGraphs
1 parent 1bd6cc1 commit 2b3555d

File tree

1 file changed

+68
-1
lines changed

1 file changed

+68
-1
lines changed

Diff for: gap/OrbitalGraphs.gi

+68-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,29 @@
1010
# a version that only gives a representative in the isomorphism class, and
1111
# a version that gives the ones actually used in backtrack?
1212
#
13-
InstallMethod(OrbitalGraphs, "for a permutation group", [IsPermGroup],
13+
InstallMethod(OrbitalGraphs, "for a permutation group (super basic)", [IsPermGroup],
14+
function(G)
15+
local pts, graphs, stab, innerorbits, orb, iorb;
16+
17+
# Commented out lines give the behaviour of the original OrbitalGraphs method
18+
19+
pts := MovedPoints(G);
20+
#pts := [1 .. LargestMovedPoint(G)];
21+
graphs := [];
22+
for orb in Orbits(G, pts) do
23+
stab := Stabilizer(G, orb[1]);
24+
innerorbits := Orbits(stab, MovedPoints(stab));
25+
#innerorbits := Orbits(stab, Difference(pts, [orb[1]]));
26+
for iorb in innerorbits do
27+
AddSet(graphs, EdgeOrbitsDigraph(G, [orb[1], iorb[1]]));
28+
od;
29+
od;
30+
return graphs;
31+
end);
32+
33+
# TODO decide what to do about non-moved points
34+
35+
InstallMethod(OrbitalGraphs, "for a permutation group (uses stab chain)", [IsPermGroup],
1436
function(G)
1537
local orb, orbitsG, iorb, graph, graphlist, val, p, i, orbsizes,
1638
orbpos, innerorblist, orbitsizes, orbreps, fillRepElts, lmp, moved;
@@ -61,6 +83,51 @@ function(G)
6183
return graphlist;
6284
end);
6385

86+
87+
InstallMethod(OrbitalGraphs, "for a permutation group (no stab chain)", [IsPermGroup],
88+
function(G)
89+
local n, gens, seen, reps, graphs, root, D, orbit, schreier_gens, b, schreier_gen, innerorbits, a, i, inner;
90+
91+
n := LargestMovedPoint(G);
92+
gens := GeneratorsOfGroup(G);
93+
seen := BlistList([1 .. n], []);
94+
reps := [];
95+
graphs := [];
96+
97+
repeat
98+
root := First([1 .. n], x -> not seen[x]);
99+
seen[root] := true;
100+
reps[root] := ();
101+
orbit := [root];
102+
schreier_gens := [];
103+
104+
# Construct a basic Schreier tree for <root> and Schreier generators for stabiliser of <root>
105+
for a in orbit do
106+
for i in [1 .. Length(gens)] do
107+
b := a ^ gens[i];
108+
if not seen[b] then
109+
reps[b] := reps[a] * gens[i];
110+
seen[b] := true;
111+
Add(orbit, b);
112+
else
113+
schreier_gen := reps[a] * gens[i] * reps[b] ^ -1;
114+
Add(schreier_gens, schreier_gen);
115+
fi;
116+
od;
117+
od;
118+
119+
# Compute the orbits of the stabilizer of <root>, and hence the orbital graphs
120+
if not IsTrivial(orbit) then
121+
innerorbits := Orbits(Group(schreier_gens));
122+
for inner in innerorbits do
123+
AddSet(graphs, EdgeOrbitsDigraph(G, [orbit[1], inner[1]]));
124+
od;
125+
fi;
126+
127+
until SizeBlist(seen) = n;
128+
return graphs;
129+
end);
130+
64131
InstallMethod(OrbitalClosure, "for a permutation group", [IsPermGroup],
65132
G -> Intersection(List(OrbitalGraphs(G), AutomorphismGroup)));
66133
# TODO: TwoClosure as implemented by Heiko Theißen requires the group

0 commit comments

Comments
 (0)