Ticket #13709: trac_13709.patch

File trac_13709.patch, 4.3 KB (added by ncohen, 7 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  
    22022202
    22032203    REFERENCES:
    22042204
    2205     - [1] Godsil, C. and Royle, G. Algebraic Graph Theory.
     2205    .. [GodsilRoyle] Godsil, C. and Royle, G. Algebraic Graph Theory.
    22062206      Springer, 2001.
    22072207
    22082208    EXAMPLES::
     
    26992699    P.name("Petersen graph")
    27002700    return P
    27012701
     2702def 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
    27022748def ShrikhandeGraph():
    27032749    """
    27042750    Returns the Shrikhande graph.
    27052751
    27062752    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.
    27102760
    27112761    EXAMPLES:
    27122762
  • sage/graphs/graph_generators.py

    diff --git a/sage/graphs/graph_generators.py b/sage/graphs/graph_generators.py
    a b  
    129129     "NauruGraph",
    130130     "PappusGraph",
    131131     "PetersenGraph",
     132     "SchlaefliGraph",
    132133     "ShrikhandeGraph",
    133134     "ThomsenGraph",
    134135     "Tutte12Cage",
     
    719720        These will be simple graphs: no loops, no multiple edges, no
    720721        directed edges.
    721722
     723        .. SEEALSO::
     724
     725            :meth:`Graph.is_strongly_regular` -- tests whether a graph is
     726            strongly regular and/or returns its parameters.
     727
    722728        EXAMPLES:
    723729
    724730        The generator can be used to construct graphs for testing,
     
    812818           cospectral graphs (lists of cadinality 1 being omitted).
    813819
    814820
     821        .. SEEALSO::
     822
     823            :meth:`Graph.is_strongly_regular` -- tests whether a graph is
     824            strongly regular and/or returns its parameters.
     825
    815826        EXAMPLES::
    816827
    817828            sage: g=graphs.cospectral_graphs(5)
     
    974985    NauruGraph               = staticmethod(sage.graphs.generators.smallgraphs.NauruGraph)
    975986    PappusGraph              = staticmethod(sage.graphs.generators.smallgraphs.PappusGraph)
    976987    PetersenGraph            = staticmethod(sage.graphs.generators.smallgraphs.PetersenGraph)
     988    SchlaefliGraph           = staticmethod(sage.graphs.generators.smallgraphs.SchlaefliGraph)
    977989    ShrikhandeGraph          = staticmethod(sage.graphs.generators.smallgraphs.ShrikhandeGraph)
    978990    ThomsenGraph             = staticmethod(sage.graphs.generators.smallgraphs.ThomsenGraph)
    979991    Tutte12Cage              = staticmethod(sage.graphs.generators.smallgraphs.Tutte12Cage)