Skip to content

Commit

Permalink
Trac #21704: bliss does not support multiple edges
Browse files Browse the repository at this point in the history
Example (with bliss installed):
{{{#!python
sage: G = Graph(':C_kQ')
sage: G.automorphism_group(algorithm='bliss').order()
8
sage: G.automorphism_group(algorithm='sage').order()
4
}}}

This ticket changes the default behaviour so the `'sage'` algorithm is
used by default when dealing with multiedges, and an error is raised if
`'bliss'` is given explicitly. Similar situation for `canonical_label`.

URL: https://trac.sagemath.org/21704
Reported by: jaanos
Ticket author(s): Jori Mäntysalo
Reviewer(s): Travis Scrimshaw
  • Loading branch information
Release Manager authored and vbraun committed Oct 29, 2016
2 parents f4ed683 + 2c56c67 commit e817d23
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions src/sage/graphs/generic_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -20111,10 +20111,12 @@ def coarsest_equitable_refinement(self, partition, sparse=True):
def automorphism_group(self, partition=None, verbosity=0,
edge_labels=False, order=False,
return_group=True, orbits=False, algorithm=None):
"""Returns the largest subgroup of the automorphism group of the
(di)graph whose orbit partition is finer than the partition given.
If no partition is given, the unit partition is used and the entire
automorphism group is given.
"""
Return the automorphism group of the graph.

With ``partition`` this can also return the largest subgroup
of the automorphism group of the (di)graph whose orbit
partition is finer than the partition given.

INPUT:

Expand Down Expand Up @@ -20299,14 +20301,19 @@ def automorphism_group(self, partition=None, verbosity=0,
sage: G.subgroups()
[Subgroup of (Permutation Group with generators [(0,7)(1,4)(2,3)(6,8)]) generated by [()],
Subgroup of (Permutation Group with generators [(0,7)(1,4)(2,3)(6,8)]) generated by [(0,7)(1,4)(2,3)(6,8)]]

"""
try:
from sage.graphs.bliss import automorphism_group
have_bliss = True
except ImportError:
have_bliss = False

# See trac #21704
if self.has_multiple_edges():
if algorithm == 'bliss':
raise NotImplementedError("algorithm 'bliss' can not be used for graph with multiedges")
have_bliss = False

if (algorithm == 'bliss' or # explicit choice from the user; or
(algorithm is None and # by default
not edge_labels and
Expand Down Expand Up @@ -20982,6 +20989,12 @@ def canonical_label(self, partition=None, certificate=False, verbosity=0,
except ImportError:
have_bliss = False

# See trac #21704
if self.has_multiple_edges():
if algorithm == 'bliss':
raise NotImplementedError("algorithm 'bliss' can not be used for graph with multiedges")
have_bliss = False

if (algorithm == 'bliss' or # explicit request; or
(algorithm is None and # default choice
have_bliss and
Expand Down

0 comments on commit e817d23

Please sign in to comment.