diff --git a/src/sage/graphs/generic_graph.py b/src/sage/graphs/generic_graph.py index 969ed45add1..55e9a229763 100644 --- a/src/sage/graphs/generic_graph.py +++ b/src/sage/graphs/generic_graph.py @@ -5376,7 +5376,8 @@ def blocks_and_cuts_tree(self): to `u`. The resulting graph is a tree, with the additional characteristic - property that the distance between two leaves is even. + property that the distance between two leaves is even. When ``self`` is + not connected, the resulting graph is a forest. When ``self`` is biconnected, the tree is reduced to a single node of type `B`. @@ -5408,6 +5409,14 @@ def blocks_and_cuts_tree(self): sage: T.vertices() [('B', (0, 1, 2, 3, 4, 5, 6, 7, 8, 9))] + TESTS: + + When ``self`` is not connected, the resulting graph is a forest (:trac:`24163`):: + + sage: T = Graph(2).blocks_and_cuts_tree() + sage: T.is_forest() + True + REFERENCES: .. [HarPri] \F. Harary and G. Prins. The block-cutpoint-tree of