Skip to content

Commit 3ecaa6f

Browse files
committed
WIP: Faster OrbitalGraphs
1 parent 2891b90 commit 3ecaa6f

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

Diff for: gap/OrbitalGraphs.gi

+71
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,28 @@ end);
2727
# * a version one that only gives a representative in the isomorphism class
2828
# * a version that gives the ones actually used in backtrack?
2929
#
30+
InstallMethod(OrbitalGraphs,
31+
"for a permutation group and a homogeneous list (super basic)",
32+
[IsPermGroup, IsHomogeneousList],
33+
function(G, points)
34+
local graphs, stab, innerorbits, orb, iorb;
35+
36+
# Commented out lines give the behaviour of the original OrbitalGraphs method
37+
38+
graphs := [];
39+
for orb in Orbits(G, points) do
40+
stab := Stabilizer(G, orb[1]);
41+
innerorbits := Orbits(stab, MovedPoints(stab));
42+
#innerorbits := Orbits(stab, Difference(points, [orb[1]]));
43+
for iorb in innerorbits do
44+
AddSet(graphs, EdgeOrbitsDigraph(G, [orb[1], iorb[1]]));
45+
od;
46+
od;
47+
return graphs;
48+
end);
49+
50+
# TODO decide what to do about non-moved points
51+
3052
InstallMethod(OrbitalGraphs, "for a permutation group and a homogeneous list",
3153
[IsPermGroup, IsHomogeneousList],
3254
function(G, points)
@@ -111,6 +133,55 @@ function(G, points)
111133
return graphlist;
112134
end);
113135

136+
InstallMethod(OrbitalGraphs,
137+
"for a permutation group an a homogeneous list (no stab chain)",
138+
[IsPermGroup, IsHomogeneousList],
139+
-1, # TEMPORARY so that it doesn't get called
140+
function(G, points)
141+
local n, gens, seen, reps, graphs, root, D, orbit, schreier_gens, b, schreier_gen, innerorbits, a, i, inner;
142+
143+
# FIXME: Currently ignores points
144+
145+
n := LargestMovedPoint(G);
146+
gens := GeneratorsOfGroup(G);
147+
seen := BlistList([1 .. n], []);
148+
reps := [];
149+
graphs := [];
150+
151+
repeat
152+
root := First([1 .. n], x -> not seen[x]);
153+
seen[root] := true;
154+
reps[root] := ();
155+
orbit := [root];
156+
schreier_gens := [];
157+
158+
# Construct a basic Schreier tree for <root> and Schreier generators for stabiliser of <root>
159+
for a in orbit do
160+
for i in [1 .. Length(gens)] do
161+
b := a ^ gens[i];
162+
if not seen[b] then
163+
reps[b] := reps[a] * gens[i];
164+
seen[b] := true;
165+
Add(orbit, b);
166+
else
167+
schreier_gen := reps[a] * gens[i] * reps[b] ^ -1;
168+
Add(schreier_gens, schreier_gen);
169+
fi;
170+
od;
171+
od;
172+
173+
# Compute the orbits of the stabilizer of <root>, and hence the orbital graphs
174+
if not IsTrivial(orbit) then
175+
innerorbits := Orbits(Group(schreier_gens));
176+
for inner in innerorbits do
177+
AddSet(graphs, EdgeOrbitsDigraph(G, [orbit[1], inner[1]]));
178+
od;
179+
fi;
180+
181+
until SizeBlist(seen) = n;
182+
return graphs;
183+
end);
184+
114185

115186
# Individual orbital graphs
116187

0 commit comments

Comments
 (0)