# HG changeset patch
# User Keshav Kini <keshav.kini@gmail.com>
# Date 1338189587 25200
# Node ID cf81c71335cfc7db3adf9a04432d6a2119dd52a9
# Parent 234482a4bfc7b956b7a813cab2b69664a6143213
Formatting, trivial optimization
diff git a/sage/graphs/graph_generators.py b/sage/graphs/graph_generators.py
a

b


3229  3229  4 
3230  3230  sage: g.diameter() 
3231  3231  2 
3232   sage: g.show(figsize = [10,10]) # long time 
 3232  sage: g.show(figsize=[10, 10]) # long time 
3233  3233  """ 
3234  3234  g = graph.Graph(pos={}) 
3235   n = 16 
3236  3235  x = 0 
3237  3236  for i in range(8): 
3238   g.add_edge(x%n,(x+1)%n) 
3239   g.add_edge(x%n,(x+6)%n) 
3240   g.add_edge(x%n,(x+8)%n) 
 3237  g.add_edge(x % 16, (x + 1) % 16) 
 3238  g.add_edge(x % 16, (x + 6) % 16) 
 3239  g.add_edge(x % 16, (x + 8) % 16) 
3241  3240  x += 1 
3242   g.add_edge(x%n,(x+3)%n) 
3243   g.add_edge(x%n,(x+2)%n) 
3244   g.add_edge(x%n,(x+8)%n) 
 3241  g.add_edge(x % 16, (x + 3) % 16) 
 3242  g.add_edge(x % 16, (x + 2) % 16) 
 3243  g.add_edge(x % 16, (x + 8) % 16) 
3245  3244  x += 1 
3246  3245  
3247   _circle_embedding(g, range(16), shift = .5) 
 3246  _circle_embedding(g, range(16), shift=.5) 
3248  3247  g.name("Clebsch graph") 
3249  3248  
3250  3249  return g 
… 
… 

3267  3266  3 
3268  3267  sage: g.diameter() 
3269  3268  4 
3270   sage: g.show(figsize = [10,10]) # long time 
 3269  sage: g.show(figsize=[10, 10]) # long time 
3271  3270  """ 
3272  3271  g = graph.Graph({ 
3273  3272  27: [6, 22, 14], 
3274  3273  24: [0, 7, 18], 
3275  3274  25: [8, 15, 2], 
3276  3275  26: [10, 16, 23], 
3277   },pos={}) 
 3276  }, pos={}) 
3278  3277  
3279  3278  g.add_cycle(range(24)) 
3280   g.add_edges([(5,11),(9,20),(12,1),(13,19),(17,4),(3,21)]) 
 3279  g.add_edges([(5, 11), (9, 20), (12, 1), (13, 19), (17, 4), (3, 21)]) 
3281  3280  
3282  3281  _circle_embedding(g, range(24)) 
3283   _circle_embedding(g, [24,25,26], radius = .5) 
3284   g.get_pos()[27] = (0,0) 
 3282  _circle_embedding(g, [24, 25, 26], radius=.5) 
 3283  g.get_pos()[27] = (0, 0) 
3285  3284  
3286  3285  g.name("Coxeter Graph") 
3287  3286  
… 
… 

4479  4478  13: [15]}) 
4480  4479  g.set_pos({}) 
4481  4480  _circle_embedding(g, range(8)) 
4482   _circle_embedding(g, range(8, 14), radius = .7, shift = .5) 
4483   _circle_embedding(g, [14,15], radius = .1) 
 4481  _circle_embedding(g, range(8, 14), radius=.7, shift=.5) 
 4482  _circle_embedding(g, [14, 15], radius=.1) 
4484  4483  
4485  4484  g.name("Hoffman Graph") 
4486  4485  