# HG changeset patch
# User Nathann Cohen <nathann.cohen@gmail.com>
# Date 1262773421 -3600
# Node ID 6f5e73ba7b1e4b086a0ef5f988ea3d8cb4993819
# Parent 2ae275b5409c88f93dc342d15ef5a88f3b08c07b
Bug in Graph.block_and_cut_vertices
diff -r 2ae275b5409c -r 6f5e73ba7b1e sage/graphs/generic_graph.py
a
|
b
|
|
2937 | 2937 | sage: Graph(0).blocks_and_cut_vertices() |
2938 | 2938 | ([], []) |
2939 | 2939 | sage: Graph(1).blocks_and_cut_vertices() |
2940 | | ([0], [0]) |
| 2940 | ([0], []) |
2941 | 2941 | sage: Graph(2).blocks_and_cut_vertices() |
2942 | 2942 | Traceback (most recent call last): |
2943 | 2943 | ... |
… |
… |
|
2961 | 2961 | s = self.vertex_iterator().next() # source |
2962 | 2962 | |
2963 | 2963 | if len(self) == 1: # only one vertex |
2964 | | return [s],[s] |
| 2964 | return [s],[] |
2965 | 2965 | |
2966 | 2966 | if not self.is_connected(): |
2967 | 2967 | raise NotImplementedError("Blocks and cut vertices is currently only implemented for connected graphs.") |