Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit c661615

Browse files
Release Managervbraun
authored andcommitted
Trac #24727: Graphs, check for algorithm
Try {{{ g = graphs.PetersenGraph() g.is_chordal(algorithm='junk') g.canonical_label(algorithm=0) }}} URL: https://trac.sagemath.org/24727 Reported by: jmantysalo Ticket author(s): Jori Mäntysalo Reviewer(s): David Coudert
2 parents 055b6b0 + cd25d3e commit c661615

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/sage/graphs/generic_graph.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13151,7 +13151,7 @@ def random_subgraph(self, p, inplace=False):
1315113151
vertices.append(v)
1315213152
return self.subgraph(vertices=vertices, inplace=inplace)
1315313153

13154-
def is_chordal(self, certificate = False, algorithm = "B"):
13154+
def is_chordal(self, certificate=False, algorithm="B"):
1315513155
r"""
1315613156
Tests whether the given graph is chordal.
1315713157

@@ -13295,6 +13295,9 @@ def is_chordal(self, certificate = False, algorithm = "B"):
1329513295
Pacific J. Math 1965
1329613296
Vol. 15, number 3, pages 835--855
1329713297
"""
13298+
if algorithm not in ['A', 'B']:
13299+
raise ValueError('unknown algorithm "{}"'.format(algorithm))
13300+
1329813301
self._scream_if_not_simple()
1329913302

1330013303
# If the graph is not connected, we are computing the result on each component
@@ -22499,7 +22502,7 @@ class by some canonization function `c`. If `G` and `H` are graphs,
2249922502
deprecation(19517, "Verbosity-parameter is removed.")
2250022503

2250122504
# Check parameter combinations
22502-
if algorithm and algorithm not in ['sage', 'bliss']:
22505+
if algorithm not in [None, 'sage', 'bliss']:
2250322506
raise ValueError("'algorithm' must be equal to 'bliss', 'sage', or None")
2250422507
if algorithm != 'bliss' and not return_graph:
2250522508
raise ValueError("return_graph=False can only be used with algorithm='bliss'")

0 commit comments

Comments
 (0)