# HG changeset patch
# User Keshav Kini <keshav.kini@gmail.com>
# Date 1336939078 28800
# Node ID b04704c9d1b2c3db7806b7e6f91593b57180025f
# Parent 4c1b8a055328efe739c6c1079a29b63cea4020ad
PEP 8, formatting
diff git a/sage/graphs/graph_generators.py b/sage/graphs/graph_generators.py
a

b


2526  2526  
2527  2527  def Balaban10Cage(self, embedding = 1): 
2528  2528  r""" 
2529   Returns Balaban's 10 cage. 
2530   
2531   Balaban's 10cage is a 3regular graph with 70 vertices and 105 
2532   edges. See its :wikipedia:`Wikipedia page <Balaban_10cage>`. 
2533   
2534   The default embedding gives a deeper understanding of the graph's 
2535   automorphism group. It is divided into 4 layers (each layer being a set 
2536   of points at equal distance from the drawing's center). From outside to 
2537   inside : 
2538   
2539    L1 : The outer layer (vertices which are the furthest from the origin) 
2540   is actually the disjoint union of two cycles of length 10. 
 2529  Returns the Balaban 10cage. 
 2530  
 2531  The Balaban 10cage is a 3regular graph with 70 vertices and 
 2532  105 edges. See its :wikipedia:`Wikipedia page 
 2533  <Balaban_10cage>`. 
 2534  
 2535  The default embedding gives a deeper understanding of the 
 2536  graph's automorphism group. It is divided into 4 layers (each 
 2537  layer being a set of points at equal distance from the drawing's 
 2538  center). From outside to inside : 
 2539  
 2540   L1 : The outer layer (vertices which are the furthest from the 
 2541  origin) is actually the disjoint union of two cycles of length 
 2542  10. 
2541  2543  
2542  2544   L2 : The second layer is an independent set of 20 vertices. 
2543  2545  
2544  2546   L3 : The third layer is a matching on 10 vertices. 
2545  2547  
2546    L4 : The inner layer (vertices which are the closest from the origin) 
2547   is also the disjoint union of two cycles of length 10. 
2548   
2549   This graph is not vertextransitive, and its vertices are partitionned 
2550   into 3 orbits : L2, L3, and the union of L1 of L4 whose elements are 
2551   equivalent. 
 2548   L4 : The inner layer (vertices which are the closest from the 
 2549  origin) is also the disjoint union of two cycles of length 10. 
 2550  
 2551  This graph is not vertextransitive, and its vertices are 
 2552  partitioned into 3 orbits : L2, L3, and the union of L1 of L4 
 2553  whose elements are equivalent. 
2552  2554  
2553  2555  INPUT: 
2554  2556  
2555    ``embedding``  two embeddings are available, and can be selected by 
2556   setting ``embedding`` to be either 1 or 2. 
 2557   ``embedding``  two embeddings are available, and can be 
 2558  selected by setting ``embedding`` to be either 1 or 2. 
2557  2559  
2558  2560  EXAMPLE:: 
2559  2561  
… 
… 

2576  2578  17, 25, 9, 31, 13, 9, 21, 33, 17, 29, 29] 
2577  2579  
2578  2580  g = graphs.LCFGraph(70, L, 1) 
2579   g.name("Balaban's 10cage") 
 2581  g.name("Balaban 10cage") 
2580  2582  
2581  2583  if embedding == 2: 
2582  2584  return g 
2583  2585  elif embedding != 1: 
2584   raise ValueError("The value of embedding must be equal to either 1 or 2") 
 2586  raise ValueError("The value of embedding must be either 1 or 2") 
2585  2587  
2586  2588  L3 = [5, 24, 35, 46, 29, 40, 51, 34, 45, 56] 
2587  2589  _circle_embedding(g, L3, center=(0,0), radius = 4.3) 
2588  2590  
2589   L2 = [6, 4, 23, 25, 60, 36, 1, 47, 28, 30, 39, 41, 50, 52, 33, 9, 44, 20, 55, 57] 
 2591  L2 = [6, 4, 23, 25, 60, 36, 1, 47, 28, 30, 39, 41, 50, 52, 33, 9, 44, 
 2592  20, 55, 57] 
2590  2593  _circle_embedding(g, L2, center=(0,0), radius = 5, shift=.5) 
2591  2594  
2592  2595  
… 
… 

7473  7476  r""" 
7474  7477  Set some vertices on a circle in the embedding of a graph G. 
7475  7478  
7476   This method modifies the graph's embedding so that the vertices listed in 
7477   ``vertices`` appear in this ordering on a circle of given radius and 
7478   center. The ``shift`` parameter is actually a rotation of the circle. A 
7479   value of ``shift=1`` will replace in the drawing the `i` th element of the 
7480   list by the `i1` th. Noninteger values are admissible, and a value of 
7481   `\alpha` corresponds to a rotation of the circle by an angle of `\alpha 
7482   2\Pi/n` (where `n` is the number of vertices set on the circle). 
 7479  This method modifies the graph's embedding so that the vertices 
 7480  listed in ``vertices`` appear in this ordering on a circle of given 
 7481  radius and center. The ``shift`` parameter is actually a rotation of 
 7482  the circle. A value of ``shift=1`` will replace in the drawing the 
 7483  `i`th element of the list by the `(i1)`th. Noninteger values are 
 7484  admissible, and a value of `\alpha` corresponds to a rotation of the 
 7485  circle by an angle of `\alpha 2\pi/n` (where `n` is the number of 
 7486  vertices set on the circle). 
7483  7487  
7484  7488  EXAMPLE:: 
7485  7489  
… 
… 

7494  7498  
7495  7499  for i,v in enumerate(vertices): 
7496  7500  i += shift 
7497   v_x = c_x + radius * cos( 2*i*pi / n) 
7498   v_y = c_y + radius * sin( 2*i*pi / n) 
 7501  v_x = c_x + radius * cos(2*i*pi / n) 
 7502  v_y = c_y + radius * sin(2*i*pi / n) 
7499  7503  d[v] = (v_x, v_y) 
7500  7504  
7501  7505  g.set_pos(d) 