# HG changeset patch
# User Nathann Cohen <nathann.cohen@gmail.com>
# Date 1358864455 -3600
# Node ID 3c81cf1f1a81f73b7ba94a5c7a0db4bd299d2c42
# Parent 46c148d364a31d689e8f2ada71b44cdf611d2651
Simplification in GenericGraph.is_vertex_transitive
diff --git a/sage/graphs/generic_graph.py b/sage/graphs/generic_graph.py
a
|
b
|
|
16249 | 16249 | the partition provided, by default the unit partition of the |
16250 | 16250 | vertices of self (thus by default tests for vertex transitivity in |
16251 | 16251 | the usual sense). |
16252 | | |
16253 | | EXAMPLES:: |
16254 | | |
| 16252 | |
| 16253 | EXAMPLES:: |
| 16254 | |
16255 | 16255 | sage: G = Graph({0:[1],1:[2]}) |
16256 | 16256 | sage: G.is_vertex_transitive() |
16257 | 16257 | False |
… |
… |
|
16267 | 16267 | """ |
16268 | 16268 | if partition is None: |
16269 | 16269 | partition = [self.vertices()] |
| 16270 | |
| 16271 | for p in partition: |
| 16272 | if len(p) == 0: |
| 16273 | continue |
| 16274 | d = self.degree(p[0]) |
| 16275 | if not all(self.degree(x) == d for x in p): |
| 16276 | return False |
| 16277 | |
16270 | 16278 | new_partition = self.automorphism_group(partition, |
16271 | 16279 | verbosity=verbosity, edge_labels=edge_labels, |
16272 | 16280 | order=False, return_group=False, orbits=True) |
16273 | | for cell in partition: |
16274 | | for new_cell in new_partition: |
16275 | | if cell[0] in new_cell: |
16276 | | if any([c not in new_cell for c in cell[1:]]): |
16277 | | return False |
16278 | | return True |
| 16281 | |
| 16282 | return (len(partition) == len(new_partition)) |
16279 | 16283 | |
16280 | 16284 | def is_hamiltonian(self): |
16281 | 16285 | r""" |