# 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
|
b
|
class Graph(GenericGraph): |
2258 | 2258 | |
2259 | 2259 | * Any two non-adjacent vertices of `G` have `\mu` common neighbors. |
2260 | 2260 | |
| 2261 | By convention, the complete graphs, the graphs with no edges |
| 2262 | and the empty graph are not strongly regular. |
| 2263 | |
| 2264 | See :wikipedia:`Strongly regular graph` |
| 2265 | |
2261 | 2266 | INPUT: |
2262 | 2267 | |
2263 | 2268 | - ``parameters`` (boolean) -- whether to return the quadruple `(n, |
… |
… |
class Graph(GenericGraph): |
2289 | 2294 | sage: g = graphs.ChvatalGraph() |
2290 | 2295 | sage: g.is_strongly_regular() |
2291 | 2296 | False |
| 2297 | |
| 2298 | Complete graphs are not strongly regular. (:trac:`14297`) :: |
| 2299 | |
| 2300 | sage: g = graphs.CompleteGraph(5) |
| 2301 | sage: g.is_strongly_regular() |
| 2302 | False |
| 2303 | |
| 2304 | Completements of graphs are not strongly regular:: |
| 2305 | |
| 2306 | sage: g = graphs.CompleteGraph(5).complement() |
| 2307 | sage: g.is_strongly_regular() |
| 2308 | False |
| 2309 | |
| 2310 | The empty graph is not strongly regular:: |
| 2311 | |
| 2312 | sage: g = graphs.EmptyGraph() |
| 2313 | sage: g.is_strongly_regular() |
| 2314 | False |
2292 | 2315 | """ |
2293 | 2316 | degree = self.degree() |
| 2317 | if len(degree) == 0: # the empty graph |
| 2318 | return False |
2294 | 2319 | k = degree[0] |
2295 | 2320 | if not all(d == k for d in degree): |
2296 | 2321 | return False |
2297 | 2322 | |
| 2323 | if k == 0: # graphs with no edges |
| 2324 | return False |
| 2325 | |
2298 | 2326 | if self.is_clique(): |
2299 | | l = self.order()-2 |
2300 | | m = 0 |
2301 | | elif self.size() == 0: |
2302 | | l = 0 |
2303 | | m = 0 |
| 2327 | return False |
2304 | 2328 | else: |
2305 | 2329 | l = m = None |
2306 | 2330 | for u in self: |
… |
… |
class Graph(GenericGraph): |
2324 | 2348 | if m != inter: |
2325 | 2349 | return False |
2326 | 2350 | |
2327 | | if parameters: |
2328 | | return (self.order(),k,l,m) |
2329 | | else: |
2330 | | return True |
| 2351 | if parameters: |
| 2352 | return (self.order(),k,l,m) |
| 2353 | else: |
| 2354 | return True |
2331 | 2355 | |
2332 | 2356 | def odd_girth(self): |
2333 | 2357 | r""" |