# 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
|
|
4203 | 4203 | H.set_pos(pos_dict) |
4204 | 4204 | return H |
4205 | 4205 | |
4206 | | def LjubljanaGraph(self, embedding = 1): |
| 4206 | def LjubljanaGraph(self, embedding=1): |
4207 | 4207 | r""" |
4208 | 4208 | Returns the Ljubljana Graph. |
4209 | 4209 | |
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>`. |
4214 | 4215 | |
4215 | 4216 | The default embedding is obtained from the Heawood graph. |
4216 | 4217 | |
… |
… |
|
4255 | 4256 | elif embedding == 2: |
4256 | 4257 | dh = graphs.HeawoodGraph().get_pos() |
4257 | 4258 | |
4258 | | # Correspondance between the vertices of the Heawood Graph and |
| 4259 | # Correspondence between the vertices of the Heawood Graph and |
4259 | 4260 | # 8-sets of the Ljubljana Graph. |
4260 | 4261 | |
4261 | 4262 | d = { |
… |
… |
|
4275 | 4276 | 5: [14, 34, 108, 70, 96, 90, 52, 40] |
4276 | 4277 | } |
4277 | 4278 | |
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. |
4280 | 4281 | |
4281 | 4282 | 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) |
4284 | 4285 | |
4285 | 4286 | return g |
| 4287 | |
4286 | 4288 | else: |
4287 | 4289 | raise ValueError("The value of embedding must be 1 or 2.") |
4288 | 4290 | |
4289 | | return g |
4290 | | |
4291 | 4291 | def KneserGraph(self,n,k): |
4292 | 4292 | r""" |
4293 | 4293 | Returns the Kneser Graph with parameters `n, k`. |