forked from sagemath/sage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sagemathgh-38742: Introduced the class
MatchingCoveredGraph
<!-- ^ Please provide a concise and informative title. --> The objective of this issue is to introduce a new class `MatchingCoveredGraph` through a new file `src/sage/graphs/matching_covered_graph.py` in order to address the decompositions, generation methods and related concepts in the theory of Matching Covered Graphs. <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> This PR introduces a new class pertaining to matching, namely `MatchingCoveredGraph` and aims to list out all functions fundamentally related to matching covered graph in the file `src/sage/graphs/matching_covered_graph.py`. The initialization and some basic class methods in this context, that shall be addressed through this PR, are described below: - [x] `__init__()`: Create a matching covered graph, that is a connected nontrivial graph wherein each edge participates in some perfect matching. - [x] `__repr__()`: Return a short string representation of the matching covered graph. - [x] `_subgraph_by_adding()`: Return the matching covered subgraph containing the given vertices and edges. - [x] `_upgrade_from_graph()`: Upgrade the given graph to a matching covered graph if eligible. - [x] `add_edge()`: Add an edge from vertex ``u`` to vertex ``v``. - [x] `add_edges()`: Add edges from an iterable container. - [x] `add_vertex()`: Add a vertex to the (matching covered) graph. - [x] `add_vertices()`: Add vertices to the (matching covered) graph from an iterable container of vertices. - [x] `allow_loops()`: Change whether loops are allowed in (matching covered) graphs. - [x] `allows_loops()`: Return whether loops are permitted in (matching covered) graph. - [x] `delete_vertex()`: Delete a vertex, removing all incident edges.0 - [x] `delete_vertices()`: Delete specified vertices form ``self``. - [x] `get_matching()`: Return a :class:`~EdgesView` of ``self._matching`` (a perfect matching of the (matching covered) graph computed at the initialization). - [x] `has_perfect_matching()`: Return whether the graph has a perfect matching. - [x] `update_matching()`: Update the perfect matching captured in ``self._matching``. <!-- v Why is this change required? What problem does it solve? --> This PR shall establish a foundation to address the methods related to matching covered graphs. <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> Fixes sagemath#38216. Note that this issue fixes a small part of the above-mentioned issue. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> Nothing as of now (up to my knowledge). <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> cc: @dcoudert. URL: sagemath#38742 Reported by: Janmenjaya Panda Reviewer(s): David Coudert, Janmenjaya Panda
- Loading branch information
Showing
6 changed files
with
2,133 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.