Skip to content
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

How to split graph into disconnected subgraphs #163

Open
orzel7 opened this issue Dec 17, 2023 · 4 comments · May be fixed by #171
Open

How to split graph into disconnected subgraphs #163

orzel7 opened this issue Dec 17, 2023 · 4 comments · May be fixed by #171

Comments

@orzel7
Copy link

orzel7 commented Dec 17, 2023

Is there a way to split graph into subgraphs which are not connected with each other?
For example, the graph with vertices A,B,C,D,E and edges A-B ,C-D, D-E(please note lack of B-C edge) could be divided into two "isolated" graphs:
(A-B)
(C-D-E)

@orzel7 orzel7 changed the title How to split graph into isolated subgraphs How to split graph into disconnected subgraphs Dec 17, 2023
@AkashKumar7902
Copy link

@orzel7 did you found a solution for it ?

@orzel7
Copy link
Author

orzel7 commented Feb 9, 2024

@AkashKumar7902 I used github.com/yourbasic/graph package(function graph.Components()) to complete my task. But i still hope this functionality will be added to this package.

@dominikbraun
Copy link
Owner

Hi, I'm going to open a feature request for this function.

@orzel7 orzel7 linked a pull request Apr 7, 2024 that will close this issue
@orzel7
Copy link
Author

orzel7 commented Apr 7, 2024

@dominikbraun, please take a look on my change: #171 If is conceptually ok for you, I'll add some tests.
@AkashKumar7902, this PR works for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants