Skip to content

Commit

Permalink
Trac #18460: Broken (optional) doctests with bliss
Browse files Browse the repository at this point in the history
I still fail to see how we missed that in #17464 `O_o`

Nathann

URL: http://trac.sagemath.org/18460
Reported by: ncohen
Ticket author(s): Nathann Cohen
Reviewer(s): David Coudert
  • Loading branch information
Release Manager authored and vbraun committed May 20, 2015
2 parents 91fcf02 + db9c4fc commit 447835d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 26 deletions.
2 changes: 0 additions & 2 deletions src/sage/graphs/bliss.pyx
Expand Up @@ -10,8 +10,6 @@ Implemented functions:
:meth:`automorphism_group` | Returns the automorphism group of the given (di)graph
:meth:`canonical_form` | Computes a canonical certificate for the given (di) graph.
:meth:`is_isomorphic` | Tests whether the passed (di) graphs are isomorphic.
AUTHORS:
Expand Down
33 changes: 9 additions & 24 deletions src/sage/graphs/generic_graph.py
Expand Up @@ -17771,7 +17771,7 @@ def automorphism_group(self, partition=None, verbosity=0,
sage: A1 = G.automorphism_group() # optional - bliss
sage: A2 = G.automorphism_group(algorithm='bliss') # optional - bliss
sage: A1.is_isomorphic(A2) # optional - bliss
True # optional - bliss
True

TESTS:

Expand Down Expand Up @@ -18083,8 +18083,9 @@ def is_hamiltonian(self):
except EmptySetError:
return False

def is_isomorphic(self, other, certify=False, verbosity=0, edge_labels=False, algorithm=None):
"""Tests for isomorphism between self and other.
def is_isomorphic(self, other, certify=False, verbosity=0, edge_labels=False):
r"""
Tests for isomorphism between self and other.

INPUT:

Expand All @@ -18095,12 +18096,9 @@ def is_isomorphic(self, other, certify=False, verbosity=0, edge_labels=False, al
- ``edge_labels`` - default False, otherwise allows
only permutations respecting edge labels.

- ``algorithm`` - If ``algorithm = "bliss"`` the automorphism group is
computed using bliss
(http://www.tcs.tkk.fi/Software/bliss/index.html). Note that bliss
package must be installed.
EXAMPLES:

EXAMPLES: Graphs::
Graphs::

sage: from sage.groups.perm_gps.permgroup_named import SymmetricGroup
sage: D = graphs.DodecahedralGraph()
Expand Down Expand Up @@ -18173,13 +18171,6 @@ def is_isomorphic(self, other, certify=False, verbosity=0, edge_labels=False, al
sage: G.is_isomorphic(H, edge_labels=True, certify=True)
(True, {0: 1, 1: 2, 2: 3, 3: 4, 4: 0})

Isomorphism testing using the software Bliss is supported as well::

sage: G = graphs.PetersenGraph() # optional - bliss
sage: G.is_isomorphic(graphs.GeneralizedPetersenGraph(5,2),algorithm='bliss')# optional - bliss
True # optional - bliss


TESTS::

sage: g1 = '~?A[~~{ACbCwV_~__OOcCW_fAA{CF{CCAAAC__bCCCwOOV___~____OOOOcCCCW___fAAAA'+\
Expand Down Expand Up @@ -18294,19 +18285,13 @@ def is_isomorphic(self, other, certify=False, verbosity=0, edge_labels=False, al
if self.order() == other.order() == 0:
return True

if (self.is_directed() != other.is_directed() or self.order() != other.order() or
self.size() != other.size() or self.degree_sequence() != other.degree_sequence()):
if (self.is_directed() != other.is_directed() or self.order() != other.order() or
self.size() != other.size() or self.degree_sequence() != other.degree_sequence()):
if certify:
return False,None
else:
return False

from sage.misc.package import is_package_installed
if algorithm == 'bliss' and is_package_installed("bliss") and not edge_labels:
from sage.graphs.bliss import is_isomorphic

return is_isomorphic(self, other, certify)

from sage.groups.perm_gps.partn_ref.refinement_graphs import isomorphic

self_vertices = self.vertices()
Expand Down Expand Up @@ -18481,7 +18466,7 @@ def canonical_label(self, partition=None, certify=False, verbosity=0,
sage: s1 = G.canonical_label(return_graph=false,algorithm='bliss') # optional - bliss
sage: s2 = H.canonical_label(return_graph=false,algorithm='bliss') # optional - bliss
sage: s1 == s2 # optional - bliss
True # optional - bliss
True

"""
from sage.misc.package import is_package_installed
Expand Down

0 comments on commit 447835d

Please sign in to comment.