-
-
Notifications
You must be signed in to change notification settings - Fork 532
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
Introduced the class MatchingCoveredGraph
#38742
Conversation
Hi,
A comment on this would be highly appreciated. |
Check |
Documentation preview for this PR (built with commit c63a2bb; changes) is ready! 🎉 |
Hi, Actually, the errors in the test cases that are coming up, I suppose due to the use of Thank you. |
I have rectified the errors caused in |
The sage: def foo(a=1, b=2, *, c=3):
....: return a + b + c
sage: foo()
6
sage: foo(7)
12
sage: foo(7, 8)
18
sage: foo(7, 8, 9)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[7], line 1
----> 1 foo(Integer(7), Integer(8), Integer(9))
TypeError: foo() takes from 0 to 2 positional arguments but 3 were given
sage: foo(7, 8, c=9)
24
sage: foo(a=10)
15
sage: foo(b=10)
14
sage: foo(c=10)
13
sage: foo(b=20, c=10)
31 |
Now that we have this class, what happens if I add/remove a vertex or an edge ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thank you. |
<!-- ^ 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
<!-- ^ 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
…tition of a matching covered graph <!-- ^ Please provide a concise and informative title. --> The objective of this issue is to implement the methods pertaining to the canonical partition of a matching covered graph. <!-- ^ 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. --> More specifically, this PR aims to implement the following two methods: - [x] `maximal_barrier()`: Return the (unique) maximal barrier containing the provided vertex. - [x] `canonical_partition()`: Return the canonical partition of the (matching covered) graph. <!-- v Why is this change required? What problem does it solve? --> This PR shall address the methods related to canonical partition of 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 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 This PR depends on the PR sagemath#38742. <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> cc: @dcoudert. URL: sagemath#38892 Reported by: Janmenjaya Panda Reviewer(s): David Coudert, Janmenjaya Panda
…overed graph <!-- ^ Please provide a concise and informative title. --> The objective of this issue is to overwrite the methods pertaining to loops for a matching covered graph. <!-- ^ 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. --> More specifically, this PR aims to implement/ update the following methods: - [x] `allow_loops()`: Change whether loops are allowed in (matching covered) graphs. - [x] `allows_loops()`: Return whether loops are permitted in (matching covered) graphs. - [x] `has_loops()`: Check whether thare are loops in the (matching covered) graph. - [x] `loop_edges()`: Return a list of all loops in the (matching covered) graph. - [x] `loop_vertices()`: Return a list of vertices with loops. - [x] `loops()`: Return a list of all loops in the (matching covered) graph. - [x] `number_of_loops()`: Return the number of edges that are loops. - [x] `remove_loops()`: Remove loops on vertices in ``vertices``. <!-- v Why is this change required? What problem does it solve? --> This PR shall address the methods related to loops for 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 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 This PR depends on the PR sagemath#38742. <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> cc: @dcoudert. URL: sagemath#38955 Reported by: Janmenjaya Panda Reviewer(s): David Coudert
…tition of a matching covered graph <!-- ^ Please provide a concise and informative title. --> The objective of this issue is to implement the methods pertaining to the canonical partition of a matching covered graph. <!-- ^ 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. --> More specifically, this PR aims to implement the following two methods: - [x] `maximal_barrier()`: Return the (unique) maximal barrier containing the provided vertex. - [x] `canonical_partition()`: Return the canonical partition of the (matching covered) graph. <!-- v Why is this change required? What problem does it solve? --> This PR shall address the methods related to canonical partition of 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 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 This PR depends on the PR sagemath#38742. <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> cc: @dcoudert. URL: sagemath#38892 Reported by: Janmenjaya Panda Reviewer(s): David Coudert, Janmenjaya Panda
…overed graph <!-- ^ Please provide a concise and informative title. --> The objective of this issue is to overwrite the methods pertaining to loops for a matching covered graph. <!-- ^ 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. --> More specifically, this PR aims to implement/ update the following methods: - [x] `allow_loops()`: Change whether loops are allowed in (matching covered) graphs. - [x] `allows_loops()`: Return whether loops are permitted in (matching covered) graphs. - [x] `has_loops()`: Check whether thare are loops in the (matching covered) graph. - [x] `loop_edges()`: Return a list of all loops in the (matching covered) graph. - [x] `loop_vertices()`: Return a list of vertices with loops. - [x] `loops()`: Return a list of all loops in the (matching covered) graph. - [x] `number_of_loops()`: Return the number of edges that are loops. - [x] `remove_loops()`: Remove loops on vertices in ``vertices``. <!-- v Why is this change required? What problem does it solve? --> This PR shall address the methods related to loops for 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 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 This PR depends on the PR sagemath#38742. <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> cc: @dcoudert. URL: sagemath#38955 Reported by: Janmenjaya Panda Reviewer(s): David Coudert
…tition of a matching covered graph <!-- ^ Please provide a concise and informative title. --> The objective of this issue is to implement the methods pertaining to the canonical partition of a matching covered graph. <!-- ^ 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. --> More specifically, this PR aims to implement the following two methods: - [x] `maximal_barrier()`: Return the (unique) maximal barrier containing the provided vertex. - [x] `canonical_partition()`: Return the canonical partition of the (matching covered) graph. <!-- v Why is this change required? What problem does it solve? --> This PR shall address the methods related to canonical partition of 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 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 This PR depends on the PR sagemath#38742. <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> cc: @dcoudert. URL: sagemath#38892 Reported by: Janmenjaya Panda Reviewer(s): David Coudert, Janmenjaya Panda
…overed graph <!-- ^ Please provide a concise and informative title. --> The objective of this issue is to overwrite the methods pertaining to loops for a matching covered graph. <!-- ^ 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. --> More specifically, this PR aims to implement/ update the following methods: - [x] `allow_loops()`: Change whether loops are allowed in (matching covered) graphs. - [x] `allows_loops()`: Return whether loops are permitted in (matching covered) graphs. - [x] `has_loops()`: Check whether thare are loops in the (matching covered) graph. - [x] `loop_edges()`: Return a list of all loops in the (matching covered) graph. - [x] `loop_vertices()`: Return a list of vertices with loops. - [x] `loops()`: Return a list of all loops in the (matching covered) graph. - [x] `number_of_loops()`: Return the number of edges that are loops. - [x] `remove_loops()`: Remove loops on vertices in ``vertices``. <!-- v Why is this change required? What problem does it solve? --> This PR shall address the methods related to loops for 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 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 This PR depends on the PR sagemath#38742. <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> cc: @dcoudert. URL: sagemath#38955 Reported by: Janmenjaya Panda Reviewer(s): David Coudert
… a matching covered graph <!-- ^ Please provide a concise and informative title. --> The objective of this issue is to implement the methods pertaining to the bricks and brace of a matching covered graph. <!-- ^ 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. --> More specifically, this PR aims to implement the following two methods: <!-- - [ ] `bricks_and_braces()` | Return the list of (underlying simple graph of) the bricks and braces of the (matching covered) graph. --> - [x] `is_brace()` | Check if the (matching covered) graph is a brace - [x] `is_brick()` | Check if the (matching covered) graph is a brick. <!-- - [ ] `number_of_braces()` | Return the number of braces. --> <!-- - [ ] `number_of_bricks()` | Return the number of bricks. --> <!-- - [ ] `number_of_petersen_bricks()` | Return the number of Petersen bricks. --> <!-- - [ ] `tight_cut_decomposition()` | Return a tight cut decomposition. --> <!-- v Why is this change required? What problem does it solve? --> This PR shall address the methods related to bricks, braces and tight cut decomposition of 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 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 This PR depends on the PR sagemath#38742 and sagemath#38892. <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> cc: @dcoudert. URL: sagemath#39065 Reported by: Janmenjaya Panda Reviewer(s): David Coudert, Janmenjaya Panda, user202729
… a matching covered graph <!-- ^ Please provide a concise and informative title. --> The objective of this issue is to implement the methods pertaining to the bricks and brace of a matching covered graph. <!-- ^ 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. --> More specifically, this PR aims to implement the following two methods: <!-- - [ ] `bricks_and_braces()` | Return the list of (underlying simple graph of) the bricks and braces of the (matching covered) graph. --> - [x] `is_brace()` | Check if the (matching covered) graph is a brace - [x] `is_brick()` | Check if the (matching covered) graph is a brick. <!-- - [ ] `number_of_braces()` | Return the number of braces. --> <!-- - [ ] `number_of_bricks()` | Return the number of bricks. --> <!-- - [ ] `number_of_petersen_bricks()` | Return the number of Petersen bricks. --> <!-- - [ ] `tight_cut_decomposition()` | Return a tight cut decomposition. --> <!-- v Why is this change required? What problem does it solve? --> This PR shall address the methods related to bricks, braces and tight cut decomposition of 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 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 This PR depends on the PR sagemath#38742 and sagemath#38892. <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> cc: @dcoudert. URL: sagemath#39065 Reported by: Janmenjaya Panda Reviewer(s): David Coudert, Janmenjaya Panda, user202729
… a matching covered graph <!-- ^ Please provide a concise and informative title. --> The objective of this issue is to implement the methods pertaining to the bricks and brace of a matching covered graph. <!-- ^ 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. --> More specifically, this PR aims to implement the following two methods: <!-- - [ ] `bricks_and_braces()` | Return the list of (underlying simple graph of) the bricks and braces of the (matching covered) graph. --> - [x] `is_brace()` | Check if the (matching covered) graph is a brace - [x] `is_brick()` | Check if the (matching covered) graph is a brick. <!-- - [ ] `number_of_braces()` | Return the number of braces. --> <!-- - [ ] `number_of_bricks()` | Return the number of bricks. --> <!-- - [ ] `number_of_petersen_bricks()` | Return the number of Petersen bricks. --> <!-- - [ ] `tight_cut_decomposition()` | Return a tight cut decomposition. --> <!-- v Why is this change required? What problem does it solve? --> This PR shall address the methods related to bricks, braces and tight cut decomposition of 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 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 This PR depends on the PR sagemath#38742 and sagemath#38892. <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> cc: @dcoudert. URL: sagemath#39065 Reported by: Janmenjaya Panda Reviewer(s): David Coudert, Janmenjaya Panda, user202729
… a matching covered graph <!-- ^ Please provide a concise and informative title. --> The objective of this issue is to implement the methods pertaining to the bricks and brace of a matching covered graph. <!-- ^ 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. --> More specifically, this PR aims to implement the following two methods: <!-- - [ ] `bricks_and_braces()` | Return the list of (underlying simple graph of) the bricks and braces of the (matching covered) graph. --> - [x] `is_brace()` | Check if the (matching covered) graph is a brace - [x] `is_brick()` | Check if the (matching covered) graph is a brick. <!-- - [ ] `number_of_braces()` | Return the number of braces. --> <!-- - [ ] `number_of_bricks()` | Return the number of bricks. --> <!-- - [ ] `number_of_petersen_bricks()` | Return the number of Petersen bricks. --> <!-- - [ ] `tight_cut_decomposition()` | Return a tight cut decomposition. --> <!-- v Why is this change required? What problem does it solve? --> This PR shall address the methods related to bricks, braces and tight cut decomposition of 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 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 This PR depends on the PR sagemath#38742 and sagemath#38892. <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> cc: @dcoudert. URL: sagemath#39065 Reported by: Janmenjaya Panda Reviewer(s): David Coudert, Janmenjaya Panda, user202729
… a matching covered graph <!-- ^ Please provide a concise and informative title. --> The objective of this issue is to implement the methods pertaining to the bricks and brace of a matching covered graph. <!-- ^ 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. --> More specifically, this PR aims to implement the following two methods: <!-- - [ ] `bricks_and_braces()` | Return the list of (underlying simple graph of) the bricks and braces of the (matching covered) graph. --> - [x] `is_brace()` | Check if the (matching covered) graph is a brace - [x] `is_brick()` | Check if the (matching covered) graph is a brick. <!-- - [ ] `number_of_braces()` | Return the number of braces. --> <!-- - [ ] `number_of_bricks()` | Return the number of bricks. --> <!-- - [ ] `number_of_petersen_bricks()` | Return the number of Petersen bricks. --> <!-- - [ ] `tight_cut_decomposition()` | Return a tight cut decomposition. --> <!-- v Why is this change required? What problem does it solve? --> This PR shall address the methods related to bricks, braces and tight cut decomposition of 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 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 This PR depends on the PR sagemath#38742 and sagemath#38892. <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> cc: @dcoudert. URL: sagemath#39065 Reported by: Janmenjaya Panda Reviewer(s): David Coudert, Janmenjaya Panda, user202729
… a matching covered graph <!-- ^ Please provide a concise and informative title. --> The objective of this issue is to implement the methods pertaining to the bricks and brace of a matching covered graph. <!-- ^ 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. --> More specifically, this PR aims to implement the following two methods: <!-- - [ ] `bricks_and_braces()` | Return the list of (underlying simple graph of) the bricks and braces of the (matching covered) graph. --> - [x] `is_brace()` | Check if the (matching covered) graph is a brace - [x] `is_brick()` | Check if the (matching covered) graph is a brick. <!-- - [ ] `number_of_braces()` | Return the number of braces. --> <!-- - [ ] `number_of_bricks()` | Return the number of bricks. --> <!-- - [ ] `number_of_petersen_bricks()` | Return the number of Petersen bricks. --> <!-- - [ ] `tight_cut_decomposition()` | Return a tight cut decomposition. --> <!-- v Why is this change required? What problem does it solve? --> This PR shall address the methods related to bricks, braces and tight cut decomposition of 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 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 This PR depends on the PR sagemath#38742 and sagemath#38892. <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> cc: @dcoudert. URL: sagemath#39065 Reported by: Janmenjaya Panda Reviewer(s): David Coudert, Janmenjaya Panda, user202729
… a matching covered graph <!-- ^ Please provide a concise and informative title. --> The objective of this issue is to implement the methods pertaining to the bricks and brace of a matching covered graph. <!-- ^ 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. --> More specifically, this PR aims to implement the following two methods: <!-- - [ ] `bricks_and_braces()` | Return the list of (underlying simple graph of) the bricks and braces of the (matching covered) graph. --> - [x] `is_brace()` | Check if the (matching covered) graph is a brace - [x] `is_brick()` | Check if the (matching covered) graph is a brick. <!-- - [ ] `number_of_braces()` | Return the number of braces. --> <!-- - [ ] `number_of_bricks()` | Return the number of bricks. --> <!-- - [ ] `number_of_petersen_bricks()` | Return the number of Petersen bricks. --> <!-- - [ ] `tight_cut_decomposition()` | Return a tight cut decomposition. --> <!-- v Why is this change required? What problem does it solve? --> This PR shall address the methods related to bricks, braces and tight cut decomposition of 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 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 This PR depends on the PR sagemath#38742 and sagemath#38892. <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> cc: @dcoudert. URL: sagemath#39065 Reported by: Janmenjaya Panda Reviewer(s): David Coudert, Janmenjaya Panda, user202729
… a matching covered graph <!-- ^ Please provide a concise and informative title. --> The objective of this issue is to implement the methods pertaining to the bricks and brace of a matching covered graph. <!-- ^ 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. --> More specifically, this PR aims to implement the following two methods: <!-- - [ ] `bricks_and_braces()` | Return the list of (underlying simple graph of) the bricks and braces of the (matching covered) graph. --> - [x] `is_brace()` | Check if the (matching covered) graph is a brace - [x] `is_brick()` | Check if the (matching covered) graph is a brick. <!-- - [ ] `number_of_braces()` | Return the number of braces. --> <!-- - [ ] `number_of_bricks()` | Return the number of bricks. --> <!-- - [ ] `number_of_petersen_bricks()` | Return the number of Petersen bricks. --> <!-- - [ ] `tight_cut_decomposition()` | Return a tight cut decomposition. --> <!-- v Why is this change required? What problem does it solve? --> This PR shall address the methods related to bricks, braces and tight cut decomposition of 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 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 This PR depends on the PR sagemath#38742 and sagemath#38892. <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> cc: @dcoudert. URL: sagemath#39065 Reported by: Janmenjaya Panda Reviewer(s): David Coudert, Janmenjaya Panda, user202729
The objective of this issue is to introduce a new class
MatchingCoveredGraph
through a new filesrc/sage/graphs/matching_covered_graph.py
in order to address the decompositions, generation methods and related concepts in the theory of Matching Covered Graphs.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 filesrc/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:__init__()
: Create a matching covered graph, that is a connected nontrivial graph wherein each edge participates in some perfect matching.__repr__()
: Return a short string representation of the matching covered graph._subgraph_by_adding()
: Return the matching covered subgraph containing the given vertices and edges._upgrade_from_graph()
: Upgrade the given graph to a matching covered graph if eligible.add_edge()
: Add an edge from vertexu
to vertexv
.add_edges()
: Add edges from an iterable container.add_vertex()
: Add a vertex to the (matching covered) graph.add_vertices()
: Add vertices to the (matching covered) graph from an iterable container of vertices.allow_loops()
: Change whether loops are allowed in (matching covered) graphs.allows_loops()
: Return whether loops are permitted in (matching covered) graph.delete_vertex()
: Delete a vertex, removing all incident edges.0delete_vertices()
: Delete specified vertices formself
.get_matching()
: Return a :class:~EdgesView
ofself._matching
(a perfect matching of the (matching covered) graph computed at the initialization).has_perfect_matching()
: Return whether the graph has a perfect matching.update_matching()
: Update the perfect matching captured inself._matching
.This PR shall establish a foundation to address the methods related to matching covered graphs.
Fixes #38216.
Note that this issue fixes a small part of the above-mentioned issue.
📝 Checklist
⌛ Dependencies
Nothing as of now (up to my knowledge).
cc: @dcoudert.