For example, if I have a tree
1 - 2 - 3 - 4
| |
5 6 - 7 - 8
If breaking the ege (3,6), I want to obtain two induced subgraphs
1 - 2 - 3 - 4
|
5
and
6 - 7 - 8
At present, I implemented a very cumbersome approach, which is
- Enumerate the neighbors of vertex 6 (excluding 3 of course) and the neighbors of those neighbors and so on (recursively). Recording the vertices in a list, then serve the list to
LightGraphs.induced_subgraph(g, the_list)
. - Do the same thing for vertex 3.
I wonder if there is a better approach?