Skip to content

Commit

Permalink
Add FolkmanGraph
Browse files Browse the repository at this point in the history
  • Loading branch information
james-d-mitchell authored and wilfwilson committed May 22, 2021
1 parent b98f611 commit e5bf02f
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gap/examples.gd
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,7 @@ DeclareOperation("TadpoleDigraph", [IsFunction, IsPosInt, IsPosInt]);
DeclareConstructor("BookDigraphCons", [IsDigraph, IsPosInt]);
DeclareOperation("BookDigraph", [IsPosInt]);
DeclareOperation("BookDigraph", [IsFunction, IsPosInt]);

DeclareConstructor("FolkmanGraphCons", [IsDigraph]);
DeclareOperation("FolkmanGraph", []);
DeclareOperation("FolkmanGraph", [IsFunction]);
15 changes: 15 additions & 0 deletions gap/examples.gi
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,21 @@ function(filt, m, n)
return D;
end);

InstallMethod(FolkmanGraphCons, "for IsMutableDigraph", [IsMutableDigraph],
function(filt)
return DigraphFromGraph6String(IsMutableDigraph,
"Sl?gHS?_g?oTS?AA_?GOT@O??_i_?G@@S");
end);

InstallMethod(FolkmanGraphCons, "for IsImmutableDigraph", [IsImmutableDigraph],
filt -> MakeImmutable(FolkmanGraphCons(IsMutableDigraph)));

InstallMethod(FolkmanGraph, [],
{} -> FolkmanGraphCons(IsImmutableDigraph));

InstallMethod(FolkmanGraph, "for a function", [IsFunction],
filt -> FolkmanGraphCons(filt));

InstallMethod(BookDigraphCons,
"for IsMutableDigraph and one positive integer",
[IsMutableDigraph, IsPosInt],
Expand Down
22 changes: 22 additions & 0 deletions tst/standard/examples.tst
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,28 @@ Error, the arguments <n> and <k> must be non-negative integers,
gap> JohnsonDigraph(IsMutableDigraph, 4, 2);
<mutable digraph with 6 vertices, 24 edges>

# Folkman
gap> D := FolkmanGraph();
<immutable digraph with 20 vertices, 80 edges>
gap> DigraphNrVertices(D) = 20;
true
gap> DigraphNrEdges(D) = 80;
true
gap> Size(AutomorphismGroup(D)) = 3840;
true
gap> IsHamiltonianDigraph(D);
true
gap> ChromaticNumber(D);
2
gap> DigraphDiameter(D);
4
gap> IsBipartiteDigraph(D);
true
gap> IsRegularDigraph(D);
true
gap> D := FolkmanGraph(IsMutableDigraph);
<mutable digraph with 20 vertices, 80 edges>

# LollipopGraph
gap> LollipopGraph(5, 4);
<immutable connected symmetric digraph with 9 vertices, 28 edges>
Expand Down

0 comments on commit e5bf02f

Please sign in to comment.