@@ -1083,37 +1083,31 @@ def label_nice_tree_decomposition(nice_TD, root, directed=False):
1083
1083
EXAMPLES::
1084
1084
1085
1085
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 )
1089
1089
sage: root = sorted( nice_TD. vertices( )) [0 ]
1090
1090
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'
1093
1093
sage: for node in sorted( label_TD) :
1094
1094
.... : print( node, label_TD. get_vertex( node))
1095
1095
( 0, {}) forget
1096
1096
( 1, {0} ) forget
1097
1097
( 2, {0, 1}) intro
1098
1098
( 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
1110
1104
"""
1111
1105
from sage.graphs.digraph import DiGraph
1112
1106
from sage.graphs.graph import Graph
1113
1107
1114
1108
directed_TD = DiGraph(nice_TD.breadth_first_search(start = root, edges = True ),
1115
1109
format = ' list_of_edges' ,
1116
- name = ' Labelled {}' .format(nice_TD))
1110
+ name = ' Labelled {}' .format(nice_TD.name() ))
1117
1111
1118
1112
# The loop starts from the root node
1119
1113
# We assume the tree decomposition is valid and nice,
0 commit comments