Graph method to get subgraph (including descendants) given a set of vertex IDs

Would it be possible to extend induced_subgraph(vids) to include an argument such as mode/method where you can opt to include all descendants or all ancestors along with vids. Or is there an elegant way to implement this with current available methods?

Or perhaps the better candidate is bfs() but allowing vid to be a singular ID or list of IDs.

You might want to check out subcomponent, I think that does (mostly) what you would want.

1 Like