Ticket #14271: trac_14271.patch

File trac_14271.patch, 3.7 KB (added by ncohen, 8 years ago)
  • sage/graphs/generators/smallgraphs.py

    # HG changeset patch
    # User Nathann Cohen <nathann.cohen@gmail.com>
    # Date 1363287649 -3600
    # Node ID d6520eaf656935dfad337168831a594e94dfe558
    # Parent  5ede04e6bce52102dca9323a193a09257b1dc027
    Sylvester and Sims-Gewirtz graphs
    
    diff --git a/sage/graphs/generators/smallgraphs.py b/sage/graphs/generators/smallgraphs.py
    a b  
    29532953
    29542954    return graph.Graph(edge_dict, pos=pos_dict, name="Shrikhande graph")
    29552955
     2956def SylvesterGraph():
     2957    """
     2958    Returns the Sylvester Graph.
     2959
     2960    This graph is obtained from the Hoffman Singleton graph by considering the
     2961    graph induced by the vertices at distance two from the vertices of an (any)
     2962    edge.
     2963
     2964    For more information on the Sylvester graph, see
     2965    `<http://www.win.tue.nl/~aeb/graphs/Sylvester.html>`_.
     2966
     2967    .. SEEALSO::
     2968
     2969        * :meth:`~sage.graphs.graph_generators.GraphGenerators.HoffmanSingletonGraph`.
     2970
     2971    EXAMPLE::
     2972
     2973        sage: g = graphs.SylvesterGraph(); g
     2974        Sylvester Graph: Graph on 36 vertices
     2975        sage: g.order()
     2976        36
     2977        sage: g.size()
     2978        90
     2979        sage: g.is_regular(k=5)
     2980        True
     2981    """
     2982    g = HoffmanSingletonGraph()
     2983    e = g.edge_iterator(labels = False).next()
     2984    g.delete_vertices(g.neighbors(e[0]) + g.neighbors(e[1]))
     2985    g.relabel()
     2986    g.name("Sylvester Graph")
     2987    g.set_pos({})
     2988    return g
     2989
     2990def SimsGewirtzGraph():
     2991    """
     2992    Returns the Sims-Gewirtz Graph.
     2993
     2994    This graph is obtained from the Higman Sims graph by considering the graph
     2995    induced by the vertices at distance two from the vertices of an (any)
     2996    edge. It is the only strongly regular graph with parameters `v = 56, k = 10,
     2997    \lambda = 0, \mu = 2`
     2998
     2999    For more information on the Sylvester graph, see
     3000    `<http://www.win.tue.nl/~aeb/graphs/Sims-Gewirtz.html>`_ or its
     3001    :wikipedia:`Wikipedia page <Gewirtz graph>`.
     3002
     3003    .. SEEALSO::
     3004
     3005        * :meth:`~sage.graphs.graph_generators.GraphGenerators.HigmanSimsGraph`.
     3006
     3007    EXAMPLE::
     3008
     3009        sage: g = graphs.SimsGewirtzGraph(); g
     3010        Sims-Gewirtz Graph: Graph on 56 vertices
     3011        sage: g.order()
     3012        56
     3013        sage: g.size()
     3014        280
     3015        sage: g.is_strongly_regular(parameters = True)
     3016        (56, 10, 0, 2)
     3017
     3018    """
     3019    g = HigmanSimsGraph()
     3020    e = g.edge_iterator(labels = False).next()
     3021    g.delete_vertices(g.neighbors(e[0]) + g.neighbors(e[1]))
     3022    g.relabel()
     3023    g.name("Sims-Gewirtz Graph")
     3024    g.set_pos({})
     3025    return g
     3026
    29563027def ThomsenGraph():
    29573028    """
    29583029    Returns the Thomsen Graph.
  • sage/graphs/graph_generators.py

    diff --git a/sage/graphs/graph_generators.py b/sage/graphs/graph_generators.py
    a b  
    121121     "HerschelGraph",
    122122     "HigmanSimsGraph",
    123123     "HoffmanSingletonGraph",
     124     "SylvesterGraph",
     125     "SimsGewirtzGraph",
    124126     "HoffmanGraph",
    125127     "HoltGraph",
    126128     "LjubljanaGraph",
     
    991993    PetersenGraph            = staticmethod(sage.graphs.generators.smallgraphs.PetersenGraph)
    992994    SchlaefliGraph           = staticmethod(sage.graphs.generators.smallgraphs.SchlaefliGraph)
    993995    ShrikhandeGraph          = staticmethod(sage.graphs.generators.smallgraphs.ShrikhandeGraph)
     996    SylvesterGraph           = staticmethod(sage.graphs.generators.smallgraphs.SylvesterGraph)
     997    SimsGewirtzGraph         = staticmethod(sage.graphs.generators.smallgraphs.SimsGewirtzGraph)
    994998    ThomsenGraph             = staticmethod(sage.graphs.generators.smallgraphs.ThomsenGraph)
    995999    Tutte12Cage              = staticmethod(sage.graphs.generators.smallgraphs.Tutte12Cage)
    9961000    TutteCoxeterGraph        = staticmethod(sage.graphs.generators.smallgraphs.TutteCoxeterGraph)