Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
added remaining Witt graphs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivo-Maffei committed Aug 4, 2020
1 parent 85b4d55 commit 4c4f69b
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 2 deletions.
52 changes: 51 additions & 1 deletion src/sage/graphs/generators/distance_regular.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,10 @@ def LargeWittGraph():
The construction is taken from
http://mathworld.wolfram.com/LargeWittGraph.html
EXAMPLES:
This is a distance-regular graph with intersection array
`[30,28,24;1,3,15]`.
EXAMPLES::
sage: g = graphs.LargeWittGraph()
sage: g.is_distance_regular(True)
Expand All @@ -419,3 +422,50 @@ def LargeWittGraph():
W = Graph(edges, format='list_of_edges')
W.name("Large Witt graph")
return W

def TruncatedWittGraph():
r"""
Return the truncated Witt graph.
This builds the large Witt graph, then removes
all vertices whose codeword start with a 1.
The graph is distance-regular with intersection array
`[15,14,12;1,1,9]`.
EXAMPLES::
sage: G = graphs.TruncatedWittGraph()
sage: G.is_distance_regular(True)
([15, 14, 12, None], [None, 1, 1, 9])
"""
# get large witt graph and remove all vertices which start with a 1
G = LargeWittGraph()
G.delete_vertices(filter(lambda x : x[0] == 1, G.vertices()))

G.name("Truncated Witt graph")
return G

def DoublyTruncatedWittGraph():
r"""
Return the doubly truncated Witt graph.
This builds the truncated Witt graph, then removes
all vertices whose codeword start with a 1.
The graph is distance-regular with intersection array
`[7,6,4,4;1,1,1,6]`.
EXAMPLES::
sage: G = graphs.DoublyTruncatedWittGraph()
sage: G.is_distance_regular(True)
([7, 6, 4, 4, None], [None, 1, 1, 1, 6])
"""

G = TruncatedWittGraph()
G.delete_vertices(filter(lambda x : x[1] == 1, G.vertices()))

G.name("Doubly Truncated Witt graph")
return G
6 changes: 5 additions & 1 deletion src/sage/graphs/graph_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def __append_to_doc(methods):
"DesarguesGraph",
"DejterGraph",
"DoubleStarSnark",
"DoublyTruncatedWittGraph",
"DurerGraph",
"DyckGraph",
"EllinghamHorton54Graph",
Expand Down Expand Up @@ -177,6 +178,7 @@ def __append_to_doc(methods):
"TietzeGraph",
"TruncatedIcosidodecahedralGraph",
"TruncatedTetrahedralGraph",
"TruncatedWittGraph",
"Tutte12Cage",
"TutteCoxeterGraph",
"TutteGraph",
Expand Down Expand Up @@ -1937,6 +1939,7 @@ def quadrangulations(self, order, minimum_degree=None, minimum_connectivity=None
DejterGraph = staticmethod(smallgraphs.DejterGraph)
DesarguesGraph = staticmethod(smallgraphs.DesarguesGraph)
DoubleStarSnark = staticmethod(smallgraphs.DoubleStarSnark)
DoublyTruncatedWittGraph = staticmethod(distance_regular.DoublyTruncatedWittGraph)
DurerGraph = staticmethod(smallgraphs.DurerGraph)
DyckGraph = staticmethod(smallgraphs.DyckGraph)
EllinghamHorton54Graph = staticmethod(smallgraphs.EllinghamHorton54Graph)
Expand Down Expand Up @@ -2005,7 +2008,8 @@ def quadrangulations(self, order, minimum_degree=None, minimum_connectivity=None
TietzeGraph = staticmethod(smallgraphs.TietzeGraph)
Tutte12Cage = staticmethod(smallgraphs.Tutte12Cage)
TruncatedIcosidodecahedralGraph = staticmethod(smallgraphs.TruncatedIcosidodecahedralGraph)
TruncatedTetrahedralGraph= staticmethod(smallgraphs.TruncatedTetrahedralGraph)
TruncatedTetrahedralGraph = staticmethod(smallgraphs.TruncatedTetrahedralGraph)
TruncatedWittGraph = staticmethod(distance_regular.TruncatedWittGraph)
TutteCoxeterGraph = staticmethod(smallgraphs.TutteCoxeterGraph)
TutteGraph = staticmethod(smallgraphs.TutteGraph)
U42Graph216 = staticmethod(smallgraphs.U42Graph216)
Expand Down

0 comments on commit 4c4f69b

Please sign in to comment.