Skip to content

Commit 157c801

Browse files
committed
tree_decomposition.pyx: Change K_{1, 4} to claw in label_nice_tree_decomposition test
1 parent fadce49 commit 157c801

File tree

1 file changed

+11
-17
lines changed

1 file changed

+11
-17
lines changed

src/sage/graphs/graph_decompositions/tree_decomposition.pyx

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,37 +1083,31 @@ def label_nice_tree_decomposition(nice_TD, root, directed=False):
10831083
EXAMPLES::
10841084
10851085
sage: from sage.graphs.graph_decompositions.tree_decomposition import make_nice_tree_decomposition, label_nice_tree_decomposition
1086-
sage: bip_one_four = graphs.CompleteBipartiteGraph(1, 4)
1087-
sage: bip_one_four_TD = bip_one_four.treewidth(certificate=True)
1088-
sage: nice_TD = make_nice_tree_decomposition(bip_one_four, bip_one_four_TD)
1086+
sage: claw = graphs.CompleteBipartiteGraph(1, 3)
1087+
sage: claw_TD = claw.treewidth(certificate=True)
1088+
sage: nice_TD = make_nice_tree_decomposition(claw, claw_TD)
10891089
sage: root = sorted(nice_TD.vertices())[0]
10901090
sage: label_TD = label_nice_tree_decomposition(nice_TD, root, directed=True)
1091-
sage: print(label_TD.name())
1092-
Labelled Nice tree decomposition of Tree decomposition
1091+
sage: label_TD.name()
1092+
'Labelled Nice tree decomposition of Tree decomposition'
10931093
sage: for node in sorted(label_TD):
10941094
....: print(node, label_TD.get_vertex(node))
10951095
(0, {}) forget
10961096
(1, {0}) forget
10971097
(2, {0, 1}) intro
10981098
(3, {0}) forget
1099-
(4, {0, 4}) join
1100-
(5, {0, 4}) intro
1101-
(6, {0, 4}) intro
1102-
(7, {0}) forget
1103-
(8, {0}) forget
1104-
(9, {0, 3}) intro
1105-
(10, {0, 2}) intro
1106-
(11, {3}) intro
1107-
(12, {2}) intro
1108-
(13, {}) leaf
1109-
(14, {}) leaf
1099+
(4, {0, 3}) intro
1100+
(5, {0}) forget
1101+
(6, {0, 2}) intro
1102+
(7, {2}) intro
1103+
(8, {}) leaf
11101104
"""
11111105
from sage.graphs.digraph import DiGraph
11121106
from sage.graphs.graph import Graph
11131107

11141108
directed_TD = DiGraph(nice_TD.breadth_first_search(start=root, edges=True),
11151109
format='list_of_edges',
1116-
name='Labelled {}'.format(nice_TD))
1110+
name='Labelled {}'.format(nice_TD.name()))
11171111

11181112
# The loop starts from the root node
11191113
# We assume the tree decomposition is valid and nice,

0 commit comments

Comments
 (0)