-
-
Notifications
You must be signed in to change notification settings - Fork 487
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 ? |
Let me know when you are satisfied with the current version. |
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.
do you plan to add the missing tests for codecov ?
L608, L623-624, L644, L649, L652, L1126
Yes.
…On Thu, 7 Nov, 2024, 7:27 pm David Coudert, ***@***.***> wrote:
***@***.**** commented on this pull request.
do you plan to add the missing tests for codecov ?
L608, L623-624, L644, L649, L652, L1126
—
Reply to this email directly, view it on GitHub
<#38742 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AT2NIZBODS7DDRV3NEKWKMLZ7NWTLAVCNFSM6AAAAABPBUYNF6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDIMRRGA2TMMZUHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
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
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.