Skip to content

Commit

Permalink
Add OrbitalGraph for a group and a base-pair
Browse files Browse the repository at this point in the history
  • Loading branch information
wilfwilson committed Oct 15, 2021
1 parent af82d83 commit 1232848
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gap/OrbitalGraphs.gd
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ DeclareOperation("OrbitalGraphs", [IsPermGroup, IsInt]);
# TODO: Implement constructing the orbital graph with a given base pair
#! @BeginGroup orbital
#! @Returns An orbital graph
#! @Arguments G, u, v
#! @Arguments G, basepair, n
#! @Description
#! TODO.
DeclareOperation("OrbitalGraph", [IsPermGroup, IsPosInt, IsPosInt]);
DeclareOperation("OrbitalGraph", [IsPermGroup, IsHomogeneousList, IsPosInt]);
#! @EndGroup
#! @Group orbital
#! @Arguments G, basepair
Expand Down
39 changes: 39 additions & 0 deletions gap/OrbitalGraphs.gi
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,45 @@ function(G, points)
end);


# Individual orbital graphs

InstallMethod(OrbitalGraph, "for a permutation group and homogenous list",
[IsPermGroup, IsHomogeneousList],
function(G, basepair)
if not (Length(basepair) = 2 and ForAll(basepair, IsPosInt)) then
ErrorNoReturn("the second argument <basepair> must be a pair of ",
"positive integers");
fi;
return OrbitalGraph(G, basepair,
Maximum(NrMovedPoints(G), Maximum(basepair)));
end);

InstallMethod(OrbitalGraph,
"for a permutation group, homogeneous list, and pos int",
[IsPermGroup, IsHomogeneousList, IsPosInt],
function(G, basepair, max)
return OrbitalGraph(G, basepair, [1 .. max]);
end);

InstallMethod(OrbitalGraph,
"for a permutation group and two homogeneous lists",
[IsPermGroup, IsHomogeneousList, IsHomogeneousList],
function(G, basepair, points)
local D;
if not ForAll(points, IsPosInt) then
ErrorNoReturn("the third argument <points> must be... TODO")
elif not (Length(basepair) = 2 and IsSubset(points, basepair)) then
ErrorNoReturn("the second argument <basepair> must be... TODO");
fi;
# FIXME This is naive
D := DigraphByEdges(Orbit(G, basepair, OnPairs), n);
SetFilterObj(D, IsOrbitalGraphOfGroup);
SetUnderlyingGroup(D, G);
SetBasePair(D, basepair);
return D;
end);


# Transformation semigroups

InstallMethod(OrbitalGraphs, "for a transformation semigroup",
Expand Down

0 comments on commit 1232848

Please sign in to comment.