diff --git a/src/sage/graphs/graph.py b/src/sage/graphs/graph.py index 3eda130f4d8..f0e7f19f449 100644 --- a/src/sage/graphs/graph.py +++ b/src/sage/graphs/graph.py @@ -8159,9 +8159,9 @@ def modular_decomposition(self, algorithm=None, style='tuple'): Singleton Vertex:: sage: Graph(1).modular_decomposition() - (PRIME, [0]) + 0 sage: Graph(1).modular_decomposition(style='tree') - PRIME[0[]] + 0[] Vertices may be arbitrary --- check that :issue:`24898` is fixed:: @@ -8209,8 +8209,7 @@ def modular_decomposition(self, algorithm=None, style='tuple'): if not self.order(): D = None elif self.order() == 1: - D = create_prime_node() - D.children.append(create_normal_node(self.vertices(sort=False)[0])) + D = create_normal_node(next(self.vertex_iterator())) else: D = habib_maurer_algorithm(self)