Skip to content

Conversation

dcoudert
Copy link
Contributor

@dcoudert dcoudert commented Oct 1, 2025

This PR do the following:

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

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

Copy link

github-actions bot commented Oct 1, 2025

Documentation preview for this PR (built with commit 196151d; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

Copy link
Contributor

@mantepse mantepse left a 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?

@dcoudert
Copy link
Contributor Author

dcoudert commented Oct 2, 2025

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.

vbraun pushed a commit to vbraun/sage that referenced this pull request Oct 5, 2025
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
vbraun pushed a commit to vbraun/sage that referenced this pull request Oct 5, 2025
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants