# Ticket #14297: trac-14297-fc.patch

File trac-14297-fc.patch, 2.4 KB (added by chapoton, 10 years ago)
• ## sage/graphs/graph.py

# HG changeset patch
# User Frederic Chapoton <chapoton at math.univ-lyon1.fr>
# Date 1364586400 -3600
# Node ID 3fb2d72773f9b74a2a13b989c32b31e3c8b72e5f
# Parent  84234f2f136613740756b56ccdbde5753bc3ee13
trac #14297 complete graphs and their complements are not strongly regular

diff --git a/sage/graphs/graph.py b/sage/graphs/graph.py
 a class Graph(GenericGraph): * Any two non-adjacent vertices of G have \mu common neighbors. By convention, the complete graphs, the graphs with no edges and the empty graph are not strongly regular. See :wikipedia:Strongly regular graph INPUT: - parameters (boolean) -- whether to return the quadruple (n, class Graph(GenericGraph): sage: g = graphs.ChvatalGraph() sage: g.is_strongly_regular() False Complete graphs are not strongly regular. (:trac:14297`) :: sage: g = graphs.CompleteGraph(5) sage: g.is_strongly_regular() False Completements of graphs are not strongly regular:: sage: g = graphs.CompleteGraph(5).complement() sage: g.is_strongly_regular() False The empty graph is not strongly regular:: sage: g = graphs.EmptyGraph() sage: g.is_strongly_regular() False """ degree = self.degree() if len(degree) == 0: # the empty graph return False k = degree[0] if not all(d == k for d in degree): return False if k == 0: # graphs with no edges return False if self.is_clique(): l = self.order()-2 m = 0 elif self.size() == 0: l = 0 m = 0 return False else: l = m = None for u in self: class Graph(GenericGraph): if m != inter: return False if parameters: return (self.order(),k,l,m) else: return True if parameters: return (self.order(),k,l,m) else: return True def odd_girth(self): r"""