Hi all,

I'm currently using LightGraphs package in my student research work. And I 
have some problems with it. Imagine we have a undirrected graph G, which 
contains, for example, 10 vertices and some edges. I would like to know 
which components of graph G are connected, so I call 
"connected_components(G)". Suppose I have this situation:

julia> connected_components(G)
6-element Array{Array{Int64,1},1}:
[1,2,3]
[4,7]
[5]
[6]
[8,9]
[10]

And now I would like to delete all subgraphs, except [1,2,3]. In other 
words, I would like to have subgraph [1,2,3] as a graph G further. Is there 
any effective methods to do this in LightGraphs or in any other packages? I 
mean, I can delete vertices one by one (I guess I saw this function 
somewhere in GitHub), but that would be pretty slow, I imagine.

Thank you in advance.

Reply via email to