diff --git a/src/sage/graphs/matching_covered_graph.py b/src/sage/graphs/matching_covered_graph.py index b52333443a9..35aa16854e8 100644 --- a/src/sage/graphs/matching_covered_graph.py +++ b/src/sage/graphs/matching_covered_graph.py @@ -57,7 +57,6 @@ ``delete_multiedge()`` | Delete all edges from ``u`` to ``v``. ``disjoint_union()`` | Return the disjoint union of ``self`` and ``other``. ``disjunctive_product()`` | Return the disjunctive product of ``self`` and ``other``. - ``is_biconnected()`` | Check if the matching covered graph is biconnected. ``is_block_graph()`` | Check whether the matching covered graph is a block graph. ``is_cograph()`` | Check whether the matching covered graph is cograph. ``is_forest()`` | Check if the matching covered graph is a forest, i.e. a disjoint union of trees. @@ -2345,6 +2344,56 @@ def has_perfect_matching(G, algorithm='Edmonds', solver=None, verbose=0, raise ValueError('algorithm must be set to \'Edmonds\', ' '\'LP_matching\' or \'LP\'') + @doc_index('Overwritten methods') + def is_biconnected(self): + r""" + Check whether the (matching covered) graph is biconnected. + + A biconnected graph is a connected graph on two or more vertices that + is not broken into disconnected pieces by deleting any single vertex. + By definition of matching covered graphs, it follows that a graph, that + is matching covered, is biconnected. + + Observe that `K_2` (upto multiple edges) is biconnected. A matching + covered graph `G`, that is not `K_2` (upto multiple edges), has at + least four vertices and four edges. Consider any two adjacent edges + (`e` and `f`) of `G`. Take a perfect matching `M` of `G` containing + the edge `e` and a different perfect matching `N` of `G` containing + the edge `f`. Observe that the symmetric difference of `M` and `N` + has a cycle containing both of the edges `e` and `f`. Thus, each edge + of `G` is contained in some cycle of `G`. Therefore, `G` is + biconnected. + + .. NOTE:: + + This method overwrites the + :meth:`~sage.graphs.graph.Graph.is_biconnected` method + in order to return ``True`` as matching covered graphs are + biconnected. + + EXAMPLES: + + The complete graph on two vertices is the smallest biconnected graph + that is matching covered:: + + sage: K2 = graphs.CompleteGraph(2) + sage: G = MatchingCoveredGraph(K2) + sage: G.is_biconnected() + True + + Petersen graph is matching covered and biconnected:: + + sage: P = graphs.PetersenGraph() + sage: G = MatchingCoveredGraph(P) + sage: G.is_biconnected() + True + + .. SEEALSO:: + + - :meth:`~sage.graphs.matching_covered_graph.MatchingCoveredGraph.is_connected` + """ + return True + @doc_index('Bricks, braces and tight cut decomposition') def is_brace(self, coNP_certificate=False): r"""