Ticket #13709: trac_13709.patch
File trac_13709.patch, 4.3 KB (added by , 8 years ago) |
---|
-
sage/graphs/generators/smallgraphs.py
# HG changeset patch # User Nathann Cohen <nathann.cohen@gmail.com> # Date 1352892814 -3600 # Node ID 01d6d36fbee902347447c91b0294095bdff07414 # Parent f4cbda7c354e4f5c27adb054b495dcafce5d5db1 Schlaefli graph constructor diff --git a/sage/graphs/generators/smallgraphs.py b/sage/graphs/generators/smallgraphs.py
a b 2202 2202 2203 2203 REFERENCES: 2204 2204 2205 - [1] Godsil, C. and Royle, G. Algebraic Graph Theory.2205 .. [GodsilRoyle] Godsil, C. and Royle, G. Algebraic Graph Theory. 2206 2206 Springer, 2001. 2207 2207 2208 2208 EXAMPLES:: … … 2699 2699 P.name("Petersen graph") 2700 2700 return P 2701 2701 2702 def SchlaefliGraph(): 2703 r""" 2704 Returns the Schläfli graph. 2705 2706 The Schläfli graph is the only strongly regular graphs of parameters 2707 `(27,16,10,8)` (see [GodsilRoyle]_). 2708 2709 For more information, see the :wikipedia:`Wikipedia article on the 2710 Schläfli graph <Schläfli_graph>`. 2711 2712 .. SEEALSO:: 2713 2714 :meth:`Graph.is_strongly_regular` -- tests whether a graph is strongly 2715 regular and/or returns its parameters. 2716 2717 .. TODO:: 2718 2719 Find a beautiful layout for this beautiful graph. 2720 2721 EXAMPLE: 2722 2723 Checking that the method actually returns the Schläfli graph:: 2724 2725 sage: S = graphs.SchlaefliGraph() 2726 sage: S.is_strongly_regular(parameters = True) 2727 (27, 16, 10, 8) 2728 2729 The graph is vertex-transitive:: 2730 2731 sage: S.is_vertex_transitive() 2732 True 2733 2734 The neighborhood of each vertex is isomorphic to the complement of the 2735 Clebsch graph:: 2736 2737 sage: neighborhood = S.subgraph(vertices = S.neighbors(0)) 2738 sage: graphs.ClebschGraph().complement().is_isomorphic(neighborhood) 2739 True 2740 """ 2741 from sage.graphs.graph import Graph 2742 G = Graph('ZBXzr|}^z~TTitjLth|dmkrmsl|if}TmbJMhrJX]YfFyTbmsseztKTvyhDvw') 2743 order = [1,8,5,10,2,6,11,15,17,13,18,12,9,24,25,3,26,7,16,20,23,0,21,14,22,4,19] 2744 _circle_embedding(G, order) 2745 G.name("Schläfli graph") 2746 return G 2747 2702 2748 def ShrikhandeGraph(): 2703 2749 """ 2704 2750 Returns the Shrikhande graph. 2705 2751 2706 2752 For more information, see the `MathWorld article on the Shrikhande graph 2707 <http://mathworld.wolfram.com/ShrikhandeGraph.html>`_ or the `Wikipedia 2708 article on the Shrikhande graph 2709 <http://en.wikipedia.org/wiki/Shrikhande_graph>`_. 2753 <http://mathworld.wolfram.com/ShrikhandeGraph.html>`_ or the 2754 :wikipedia:`Wikipedia article on the Shrikhande graph <Shrikhande_graph>`. 2755 2756 .. SEEALSO:: 2757 2758 :meth:`Graph.is_strongly_regular` -- tests whether a graph is strongly 2759 regular and/or returns its parameters. 2710 2760 2711 2761 EXAMPLES: 2712 2762 -
sage/graphs/graph_generators.py
diff --git a/sage/graphs/graph_generators.py b/sage/graphs/graph_generators.py
a b 129 129 "NauruGraph", 130 130 "PappusGraph", 131 131 "PetersenGraph", 132 "SchlaefliGraph", 132 133 "ShrikhandeGraph", 133 134 "ThomsenGraph", 134 135 "Tutte12Cage", … … 719 720 These will be simple graphs: no loops, no multiple edges, no 720 721 directed edges. 721 722 723 .. SEEALSO:: 724 725 :meth:`Graph.is_strongly_regular` -- tests whether a graph is 726 strongly regular and/or returns its parameters. 727 722 728 EXAMPLES: 723 729 724 730 The generator can be used to construct graphs for testing, … … 812 818 cospectral graphs (lists of cadinality 1 being omitted). 813 819 814 820 821 .. SEEALSO:: 822 823 :meth:`Graph.is_strongly_regular` -- tests whether a graph is 824 strongly regular and/or returns its parameters. 825 815 826 EXAMPLES:: 816 827 817 828 sage: g=graphs.cospectral_graphs(5) … … 974 985 NauruGraph = staticmethod(sage.graphs.generators.smallgraphs.NauruGraph) 975 986 PappusGraph = staticmethod(sage.graphs.generators.smallgraphs.PappusGraph) 976 987 PetersenGraph = staticmethod(sage.graphs.generators.smallgraphs.PetersenGraph) 988 SchlaefliGraph = staticmethod(sage.graphs.generators.smallgraphs.SchlaefliGraph) 977 989 ShrikhandeGraph = staticmethod(sage.graphs.generators.smallgraphs.ShrikhandeGraph) 978 990 ThomsenGraph = staticmethod(sage.graphs.generators.smallgraphs.ThomsenGraph) 979 991 Tutte12Cage = staticmethod(sage.graphs.generators.smallgraphs.Tutte12Cage)