-
-
Notifications
You must be signed in to change notification settings - Fork 673
add methods for biconnected components #40951
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
base: develop
Are you sure you want to change the base?
add methods for biconnected components #40951
Conversation
Documentation preview for this PR (built with commit 196151d; changes) is ready! 🎉 |
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.
Looks right!
Mathematically, it is correct that the union of the components is not the full graph, right?
Here we consider the union of the biconnected components of the graph. So if a component is not biconnected (i.e., the graph has an isolated vertex), then the union of the biconnected components is not the full graph. Also, all the methods about biconnected components are consistent and recall the definition that a component is biconnected if it remains connected after the removal of any vertex. A component consisting of a single edge is therefore considered biconnected. This is a corner case. In case a user prefers components with 3 or more vertices it is possible to filter the results. Thanks for the review. |
sagemathgh-40951: add methods for biconnected components This PR do the following: - add method `number_of_biconnected_components` to follow the proposal of sagemath#40939 - add method `biconnected_components` - move method `is_biconnected` from `graph.py` to `connectivity.pyx` and expose it in `generic_graph.pyx` The addition of method `biconnected_component_containing_vertex` is more involved and deserves its own PR. Indeed, a cut vertex belongs to multiple biconnected components. ### 📝 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, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#40951 Reported by: David Coudert Reviewer(s): Martin Rubey
sagemathgh-40951: add methods for biconnected components This PR do the following: - add method `number_of_biconnected_components` to follow the proposal of sagemath#40939 - add method `biconnected_components` - move method `is_biconnected` from `graph.py` to `connectivity.pyx` and expose it in `generic_graph.pyx` The addition of method `biconnected_component_containing_vertex` is more involved and deserves its own PR. Indeed, a cut vertex belongs to multiple biconnected components. ### 📝 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, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#40951 Reported by: David Coudert Reviewer(s): Martin Rubey
This PR do the following:
number_of_biconnected_components
to follow the proposal of n_nodes and number_of_nodes_xxx in tree related classes #40939biconnected_components
is_biconnected
fromgraph.py
toconnectivity.pyx
and expose it ingeneric_graph.pyx
The addition of method
biconnected_component_containing_vertex
is more involved and deserves its own PR. Indeed, a cut vertex belongs to multiple biconnected components.📝 Checklist
⌛ Dependencies