Ticket #13411: trac_13411-smallfix.patch

File trac_13411-smallfix.patch, 1.6 KB (added by ncohen, 9 years ago)
  • sage/graphs/graph_generators.py

    # HG changeset patch
    # User Nathann Cohen <nathann.cohen@gmail.com>
    # Date 1349184033 -7200
    # Node ID 847104463fe53e636bdd48a10f8cc24b6f62bacf
    # Parent  8ca52d065639927bf62a48c0044e34b5f9781808
    Code cleanup and new layout for graphs.HoltGraph
    
    diff --git a/sage/graphs/graph_generators.py b/sage/graphs/graph_generators.py
    a b  
    47144714            sage: g.automorphism_group().cardinality()
    47154715            54
    47164716        """
    4717         from sage.rings.finite_rings.integer_mod_ring import Zmod
    4718         from sage.combinat.cartesian_product import CartesianProduct
    47194717        g = graph.Graph(loops=False, name = "Holt graph", pos={})
    4720         for x,y in CartesianProduct(Zmod(9),Zmod(3)):
    4721             g.add_edge((x,y),(4*x+1,y-1))
    4722             g.add_edge((x,y),(4*x-1,y-1))
    4723             g.add_edge((x,y),(7*x+7,y+1))
    4724             g.add_edge((x,y),(7*x-7,y+1))
    4725             _circle_embedding(g, [(x,y) for y in Zmod(3) for x in Zmod(9)])
     4718        for x in range(9):
     4719            for y in range(3):
     4720                g.add_edge((x,y),((4*x+1)%9,(y-1)%3))
     4721                g.add_edge((x,y),((4*x-1)%9,(y-1)%3))
     4722                g.add_edge((x,y),((7*x+7)%9,(y+1)%3))
     4723                g.add_edge((x,y),((7*x-7)%9,(y+1)%3))
     4724
     4725        for j in range(0,6,2):
     4726            _line_embedding(g, [(x,j/2) for x in range(9)],
     4727                            first=(cos(2*j*pi/6),sin(2*j*pi/6)),
     4728                            last=(cos(2*(j+1)*pi/6),sin(2*(j+1)*pi/6)))
     4729
    47264730        return g
    47274731
    47284732    def LjubljanaGraph(self, embedding=1):