Skip to content

Commit 9116807

Browse files
committed
PR 35982: add doctest for parameter work_on_copy
1 parent c61e517 commit 9116807

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/sage/graphs/domination.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,19 @@ def minimal_dominating_sets(G, to_dominate=None, work_on_copy=True, k=1):
841841
sage: list(G.minimal_dominating_sets(k=3))
842842
[{(0, 0)}, {(0, 1)}, {(0, 2)}, {(1, 0)}, {(1, 1)}, {(1, 2)}]
843843
844+
When parameter ``work_on_copy`` is ``False``, the input graph is modified
845+
(relabeled)::
846+
847+
sage: G = Graph([('A', 'B')])
848+
sage: _ = list(G.minimal_dominating_sets(work_on_copy=True))
849+
sage: set(G) == {'A', 'B'}
850+
True
851+
sage: _ = list(G.minimal_dominating_sets(work_on_copy=False))
852+
sage: set(G) == {'A', 'B'}
853+
False
854+
sage: set(G) == {0, 1}
855+
True
856+
844857
TESTS:
845858
846859
The empty graph is handled correctly::

0 commit comments

Comments
 (0)