@@ -22,6 +22,7 @@ Here is what the module can do:
2222 :meth:`connected_components_sizes` | Return the sizes of the connected components as a list.
2323 :meth:`blocks_and_cut_vertices` | Return the blocks and cut vertices of the graph.
2424 :meth:`blocks_and_cuts_tree` | Return the blocks-and-cuts tree of the graph.
25+ :meth:`is_biconnected` | Check whether the graph is biconnected.
2526 :meth:`biconnected_components` | Return the list of biconnected components.
2627 :meth:`biconnected_components_subgraphs` | Return a list of biconnected components as graph objects.
2728 :meth:`number_of_biconnected_components` | Return the number of biconnected components.
@@ -92,7 +93,7 @@ def is_connected(G, forbidden_vertices=None):
9293
9394 .. SEEALSO::
9495
95- - :meth:`~Graph .is_biconnected`
96+ - :meth:`~sage.graphs.generic_graph.GenericGraph .is_biconnected`
9697
9798 EXAMPLES::
9899
@@ -507,7 +508,7 @@ def blocks_and_cut_vertices(G, algorithm='Tarjan_Boost', sort=False, key=None):
507508
508509 - :meth:`blocks_and_cuts_tree`
509510 - :func:`sage.graphs.base.boost_graph.blocks_and_cut_vertices`
510- - :meth:`~Graph .is_biconnected`
511+ - :meth:`~sage.graphs.generic_graph.GenericGraph .is_biconnected`
511512 - :meth:`~Graph.bridges`
512513
513514 EXAMPLES:
@@ -718,7 +719,7 @@ def blocks_and_cuts_tree(G):
718719 .. SEEALSO::
719720
720721 - :meth:`~sage.graphs.generic_graph.GenericGraph.blocks_and_cut_vertices`
721- - :meth:`~Graph .is_biconnected`
722+ - :meth:`~sage.graphs.generic_graph.GenericGraph .is_biconnected`
722723
723724 EXAMPLES::
724725
@@ -780,6 +781,46 @@ def blocks_and_cuts_tree(G):
780781 return g
781782
782783
784+ def is_biconnected (G ):
785+ r """
786+ Check whether the graph is biconnected.
787+
788+ A biconnected graph is a connected graph on two or more vertices that is not
789+ broken into disconnected pieces by deleting any single vertex.
790+
791+ .. SEEALSO::
792+
793+ - :meth:`~sage. graphs. generic_graph. GenericGraph. is_connected`
794+ - :meth:`~sage. graphs. generic_graph. GenericGraph. blocks_and_cut_vertices`
795+ - :meth:`~sage. graphs. generic_graph. GenericGraph. blocks_and_cuts_tree`
796+ - :wikipedia:`Biconnected_graph`
797+
798+ EXAMPLES::
799+
800+ sage: G = graphs. PetersenGraph( )
801+ sage: G. is_biconnected( )
802+ True
803+ sage: G. add_path( [0,'a','b' ])
804+ sage: G. is_biconnected( )
805+ False
806+ sage: G. add_edge( 'b', 1)
807+ sage: G. is_biconnected( )
808+ True
809+
810+ TESTS::
811+
812+ sage: Graph( ) . is_biconnected( )
813+ False
814+ sage: Graph( 1) . is_biconnected( )
815+ False
816+ sage: graphs. CompleteGraph( 2) . is_biconnected( )
817+ True
818+ """
819+ if G.order() < 2 or not G.is_connected():
820+ return False
821+ return not G.blocks_and_cut_vertices()[1 ]
822+
823+
783824def biconnected_components (G ):
784825 r """
785826 Return the list of biconnected components.
@@ -867,7 +908,7 @@ def number_of_biconnected_components(G):
867908 .. SEEALSO::
868909
869910 - :meth:`~sage. graphs. generic_graph. GenericGraph. blocks_and_cut_vertices`
870- - :meth:`~Graph . is_biconnected`
911+ - :meth:`~sage . graphs . generic_graph . GenericGraph . is_biconnected`
871912
872913 EXAMPLES:
873914
@@ -3466,7 +3507,7 @@ cdef class TriconnectivitySPQR:
34663507 .. SEEALSO::
34673508
34683509 - :meth:`sage. graphs. connectivity. spqr_tree`
3469- - :meth:`~Graph . is_biconnected`
3510+ - :meth:`~sage . graphs . generic_graph . GenericGraph . is_biconnected`
34703511 - :wikipedia:`SPQR_tree`
34713512
34723513 EXAMPLES:
@@ -4892,7 +4933,7 @@ def is_triconnected(G):
48924933 .. SEEALSO::
48934934
48944935 - :meth:`~sage. graphs. generic_graph. GenericGraph. is_connected`
4895- - :meth:`~Graph . is_biconnected`
4936+ - :meth:`~sage . graphs . generic_graph . GenericGraph . is_biconnected`
48964937 - :meth:`~sage. graphs. connectivity. spqr_tree`
48974938 - :wikipedia:`SPQR_tree`
48984939
0 commit comments