Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overwrote methods concerning connectivity in a matching covered graph #39657

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 50 additions & 1 deletion src/sage/graphs/matching_covered_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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"""
Expand Down
Loading