Skip to content

Commit 97b0d9b

Browse files
committed
add doctest to maximum_cardinality_search
1 parent 02fee8f commit 97b0d9b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/sage/graphs/traversals.pyx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,6 +1422,17 @@ def maximum_cardinality_search(G, reverse=False, tree=False, initial_vertex=None
14221422
Traceback (most recent call last):
14231423
...
14241424
ValueError: vertex (17) is not a vertex of the graph
1425+
1426+
Immutable graphs;:
1427+
1428+
sage: G = graphs.RandomGNP(10, .7)
1429+
sage: G._backend
1430+
<sage.graphs.base.sparse_graph.SparseGraphBackend ...>
1431+
sage: H = Graph(G, immutable=True)
1432+
sage: H._backend
1433+
<sage.graphs.base.static_sparse_backend.StaticSparseBackend ...>
1434+
sage: G.maximum_cardinality_search() == H.maximum_cardinality_search()
1435+
True
14251436
"""
14261437
if tree:
14271438
from sage.graphs.digraph import DiGraph

0 commit comments

Comments
 (0)