From e5bf02f9c34ca3ee50956e796f658a771cb4da37 Mon Sep 17 00:00:00 2001 From: "James D. Mitchell" Date: Wed, 20 Jan 2021 15:16:43 +0000 Subject: [PATCH] Add FolkmanGraph --- gap/examples.gd | 4 ++++ gap/examples.gi | 15 +++++++++++++++ tst/standard/examples.tst | 22 ++++++++++++++++++++++ 3 files changed, 41 insertions(+) diff --git a/gap/examples.gd b/gap/examples.gd index 406ac18ae..750dd4201 100644 --- a/gap/examples.gd +++ b/gap/examples.gd @@ -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]); diff --git a/gap/examples.gi b/gap/examples.gi index bd916be38..e7d9a97a6 100644 --- a/gap/examples.gi +++ b/gap/examples.gi @@ -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], diff --git a/tst/standard/examples.tst b/tst/standard/examples.tst index 8ede44549..03d563a40 100644 --- a/tst/standard/examples.tst +++ b/tst/standard/examples.tst @@ -228,6 +228,28 @@ Error, the arguments and must be non-negative integers, gap> JohnsonDigraph(IsMutableDigraph, 4, 2); +# Folkman +gap> D := FolkmanGraph(); + +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); + + # LollipopGraph gap> LollipopGraph(5, 4);