Skip to content

Commit

Permalink
WIP: Faster OrbitalGraphs
Browse files Browse the repository at this point in the history
  • Loading branch information
wilfwilson committed Feb 1, 2022
1 parent 2891b90 commit 3ecaa6f
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions gap/OrbitalGraphs.gi
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,28 @@ end);
# * a version one that only gives a representative in the isomorphism class
# * a version that gives the ones actually used in backtrack?
#
InstallMethod(OrbitalGraphs,
"for a permutation group and a homogeneous list (super basic)",
[IsPermGroup, IsHomogeneousList],
function(G, points)
local graphs, stab, innerorbits, orb, iorb;

# Commented out lines give the behaviour of the original OrbitalGraphs method

graphs := [];
for orb in Orbits(G, points) do
stab := Stabilizer(G, orb[1]);
innerorbits := Orbits(stab, MovedPoints(stab));
#innerorbits := Orbits(stab, Difference(points, [orb[1]]));
for iorb in innerorbits do
AddSet(graphs, EdgeOrbitsDigraph(G, [orb[1], iorb[1]]));
od;
od;
return graphs;
end);

# TODO decide what to do about non-moved points

InstallMethod(OrbitalGraphs, "for a permutation group and a homogeneous list",
[IsPermGroup, IsHomogeneousList],
function(G, points)
Expand Down Expand Up @@ -111,6 +133,55 @@ function(G, points)
return graphlist;
end);

InstallMethod(OrbitalGraphs,
"for a permutation group an a homogeneous list (no stab chain)",
[IsPermGroup, IsHomogeneousList],
-1, # TEMPORARY so that it doesn't get called
function(G, points)
local n, gens, seen, reps, graphs, root, D, orbit, schreier_gens, b, schreier_gen, innerorbits, a, i, inner;

# FIXME: Currently ignores points

n := LargestMovedPoint(G);
gens := GeneratorsOfGroup(G);
seen := BlistList([1 .. n], []);
reps := [];
graphs := [];

repeat
root := First([1 .. n], x -> not seen[x]);
seen[root] := true;
reps[root] := ();
orbit := [root];
schreier_gens := [];

# Construct a basic Schreier tree for <root> and Schreier generators for stabiliser of <root>
for a in orbit do
for i in [1 .. Length(gens)] do
b := a ^ gens[i];
if not seen[b] then
reps[b] := reps[a] * gens[i];
seen[b] := true;
Add(orbit, b);
else
schreier_gen := reps[a] * gens[i] * reps[b] ^ -1;
Add(schreier_gens, schreier_gen);
fi;
od;
od;

# Compute the orbits of the stabilizer of <root>, and hence the orbital graphs
if not IsTrivial(orbit) then
innerorbits := Orbits(Group(schreier_gens));
for inner in innerorbits do
AddSet(graphs, EdgeOrbitsDigraph(G, [orbit[1], inner[1]]));
od;
fi;

until SizeBlist(seen) = n;
return graphs;
end);


# Individual orbital graphs

Expand Down

0 comments on commit 3ecaa6f

Please # to comment.