Ticket #12971: trac_12971.reviewer.patch

File trac_12971.reviewer.patch, 4.5 KB (added by kini, 9 years ago)

apply to $SAGE_ROOT/devel/sage

  • sage/graphs/graph_generators.py

    # HG changeset patch
    # User Keshav Kini <keshav.kini@gmail.com>
    # Date 1337764991 25200
    # Node ID 28bf06caf2d19b215e8c0a0550ca9265523bb60b
    # Parent  60a6d394b6b3afb8d2098c6ebca3e276a0cdebe4
    Naming, formatting
    
    diff --git a/sage/graphs/graph_generators.py b/sage/graphs/graph_generators.py
    a b  
    9898- :meth:`Balaban10Cage <GraphGenerators.Balaban10Cage>`
    9999- :meth:`Balaban11Cage <GraphGenerators.Balaban11Cage>`
    100100- :meth:`BidiakisCube <GraphGenerators.BidiakisCube>`
    101 - :meth:`BiggsSmith <GraphGenerators.BiggsSmith>`
     101- :meth:`BiggsSmithGraph <GraphGenerators.BiggsSmithGraph>`
    102102- :meth:`BrinkmannGraph <GraphGenerators.BrinkmannGraph>`
    103103- :meth:`DoubleStarSnark <GraphGenerators.DoubleStarSnark>`
    104104- :meth:`ChvatalGraph <GraphGenerators.ChvatalGraph>`
     
    28022802            11: [-0.5, 0.866025403784439]}
    28032803        return graph.Graph(edge_dict, pos=pos_dict, name="Bidiakis cube")
    28042804
    2805     def BiggsSmith(self, embedding = 1):
     2805    def BiggsSmithGraph(self, embedding=1):
    28062806        r"""
    28072807        Returns the Biggs-Smith graph.
    28082808
     
    28182818
    28192819        Basic properties::
    28202820
    2821             sage: g = graphs.BiggsSmith()
     2821            sage: g = graphs.BiggsSmithGraph()
    28222822            sage: g.order()
    28232823            102
    28242824            sage: g.size()
     
    28292829            7
    28302830            sage: g.automorphism_group().cardinality()
    28312831            2448
    2832             sage: g.show(figsize=[10,10])
     2832            sage: g.show(figsize=[10, 10])
    28332833
    28342834        The other embedding::
    28352835
    2836             sage: graphs.BiggsSmith(embedding = 2).show()
     2836            sage: graphs.BiggsSmithGraph(embedding=2).show()
    28372837
    28382838        TESTS::
    28392839
    2840             sage: graphs.BiggsSmith(embedding='xyzzy')
     2840            sage: graphs.BiggsSmithGraph(embedding='xyzzy')
    28412841            Traceback (most recent call last):
    28422842            ...
    2843             ValueError: The value of embedding must be 1, or 2.
     2843            ValueError: The value of embedding must be 1 or 2.
    28442844
    28452845        """
    28462846        L = [16, 24, -38, 17, 34, 48, -19, 41, -35, 47, -20, 34, -36,
     
    28582858        if embedding == 1:
    28592859
    28602860            orbs = [[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 0],
    2861                     [17, 101, 25, 66, 20, 38, 53, 89, 48, 75, 56, 92, 45, 78, 34, 28, 63],
    2862                     [18, 36, 26, 65, 19, 37, 54, 90, 47, 76, 55, 91, 46, 77, 35, 27, 64],
    2863                     [21, 39, 52, 88, 49, 74, 57, 93, 44, 79, 33, 29, 62, 83, 100, 24, 67],
    2864                     [22, 97, 51, 96, 50, 95, 58, 94, 59, 80, 60, 81, 61, 82, 99, 23, 98],
    2865                     [30, 86, 84, 72, 70, 68, 42, 40, 31, 87, 85, 73, 71, 69, 43, 41, 32]]
     2861                    [17, 101, 25, 66, 20, 38, 53, 89, 48, 75, 56, 92, 45, 78,
     2862                     34, 28, 63],
     2863                    [18, 36, 26, 65, 19, 37, 54, 90, 47, 76, 55, 91, 46, 77,
     2864                     35, 27, 64],
     2865                    [21, 39, 52, 88, 49, 74, 57, 93, 44, 79, 33, 29, 62, 83,
     2866                     100, 24, 67],
     2867                    [22, 97, 51, 96, 50, 95, 58, 94, 59, 80, 60, 81, 61, 82,
     2868                     99, 23, 98],
     2869                    [30, 86, 84, 72, 70, 68, 42, 40, 31, 87, 85, 73, 71, 69,
     2870                     43, 41, 32]]
    28662871
    28672872            # central orbits
    2868             _circle_embedding(g, orbs[1], center = (-.4,0), radius = .2)
    2869             _circle_embedding(g, orbs[3], center = (.4,0), radius = .2, shift = 4)
    2870 
    2871             # Lower orbtis
    2872             _circle_embedding(g, orbs[0], center = (-.9,-.5), radius = .3, shift = 2)
    2873             _circle_embedding(g, orbs[2], center = (-.9,.5), radius = .3)
    2874 
    2875             # Upper orbits
    2876             _circle_embedding(g, orbs[4], center = (.9,-.5), radius = .3, shift = 4)
    2877             _circle_embedding(g, orbs[5], center = (.9,.5), radius = .3, shift = -2)
     2873            _circle_embedding(g, orbs[1], center=(-.4, 0), radius=.2)
     2874            _circle_embedding(g, orbs[3], center=(.4, 0), radius=.2, shift=4)
     2875
     2876            # lower orbits
     2877            _circle_embedding(g, orbs[0], center=(-.9, -.5), radius=.3,
     2878                    shift=2)
     2879            _circle_embedding(g, orbs[2], center=(-.9, .5), radius=.3)
     2880
     2881            # upper orbits
     2882            _circle_embedding(g, orbs[4], center=(.9, -.5), radius=.3, shift=4)
     2883            _circle_embedding(g, orbs[5], center=(.9, .5), radius=.3, shift=-2)
    28782884
    28792885        elif embedding == 2:
    28802886            pass
    28812887        else:
    2882             raise ValueError("The value of embedding must be 1, or 2.")
     2888            raise ValueError("The value of embedding must be 1 or 2.")
    28832889
    28842890        return g
    28852891