Ticket #10310: trac_10310-smallfix.2.patch

File trac_10310-smallfix.2.patch, 1.3 KB (added by mvngu, 9 years ago)
  • sage/graphs/graph_generators.py

    # HG changeset patch
    # User Nathann Cohen <nathann.cohen@gmail.com>
    # Date 1290586657 -3600
    # Node ID 28f5ca8ffb7ba4cb98c6c1af23001996a6567ae2
    # Parent  b5d85a06a41775ad34db4d0d07efae448b9372b6
    #10310: reviewer patch: add Brinkmann graph to common graph database
    Changes include:
    
    * Use is_regular() instead of redefining it in the docstring of the
      Brinkmann graph generator.
    * Add a doctest to check the automorphism group.
    
    diff --git a/sage/graphs/graph_generators.py b/sage/graphs/graph_generators.py
    a b  
    21582158            21
    21592159            sage: G.size()
    21602160            42
    2161             sage: def is_4regular(G):
    2162             ...       D = G.degree_sequence()
    2163             ...       return all(d == 4 for d in D)
    2164             sage: is_4regular(G)
     2161            sage: G.is_regular(4)
    21652162            True
    21662163
    21672164        It is an Eulerian graph with radius 3, diameter 3, and girth 5. ::
     
    21812178            True
    21822179            sage: G.chromatic_number()
    21832180            4
     2181
     2182        Its automorphism group is isomorphic to `D_7`::
     2183
     2184            sage: ag = G.automorphism_group()
     2185            sage: ag.is_isomorphic(DihedralGroup(7))
     2186            True
    21842187        """
    21852188        edge_dict = {
    21862189            0: [2,5,7,13],