Ticket #12981: trac_12981.reviewer.patch

File trac_12981.reviewer.patch, 2.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 1337816242 25200
    # Node ID adae90472437d40b5e5659caa2d9f3645ed894d4
    # Parent  8a3cdded007083c2415a50df16c5ce4e754be179
    Formatting, typos, faster casting, dead code
    
    diff --git a/sage/graphs/graph_generators.py b/sage/graphs/graph_generators.py
    a b  
    42034203        H.set_pos(pos_dict)
    42044204        return H
    42054205
    4206     def LjubljanaGraph(self, embedding = 1):
     4206    def LjubljanaGraph(self, embedding=1):
    42074207        r"""
    42084208        Returns the Ljubljana Graph.
    42094209
    4210         The Ljubljana graph is a bipartite 3-regular graph on 112 vertices and
    4211         168 edges. It is not vertex-transitive as it has two orbits which are
    4212         also independent sets og size 56. See the :wikipedia:`Wikipedia page on
    4213         the Ljubljana Graph <Ljubljana_graph>`.
     4210        The Ljubljana graph is a bipartite 3-regular graph on 112
     4211        vertices and 168 edges. It is not vertex-transitive as it has
     4212        two orbits which are also independent sets of size 56. See the
     4213        :wikipedia:`Wikipedia page on the Ljubljana Graph
     4214        <Ljubljana_graph>`.
    42144215
    42154216        The default embedding is obtained from the Heawood graph.
    42164217
     
    42554256        elif embedding == 2:
    42564257            dh = graphs.HeawoodGraph().get_pos()
    42574258
    4258             # Correspondance between the vertices of the Heawood Graph and
     4259            # Correspondence between the vertices of the Heawood Graph and
    42594260            # 8-sets of the Ljubljana Graph.
    42604261
    42614262            d = {
     
    42754276                5: [14, 34, 108, 70, 96, 90, 52, 40]
    42764277                }
    42774278
    4278             # The vertices of each 8-set is plotted on a circle, and the circles
    4279             # is slowly shifted to obtain a symmetric drawing.
     4279            # The vertices of each 8-set are plotted on a circle, and the
     4280            # circles are slowly shifted to obtain a symmetric drawing.
    42804281
    42814282            for i, (u, vertices) in enumerate(d.iteritems()):
    4282                 i = i+0.
    4283                 _circle_embedding(g, vertices, center=dh[u], radius=.1, shift=8*i/14)
     4283                _circle_embedding(g, vertices, center=dh[u], radius=.1,
     4284                        shift=8.*i/14)
    42844285
    42854286            return g
     4287
    42864288        else:
    42874289            raise ValueError("The value of embedding must be 1 or 2.")
    42884290
    4289         return g
    4290 
    42914291    def KneserGraph(self,n,k):
    42924292        r"""
    42934293        Returns the Kneser Graph with parameters `n, k`.