What is the optimised way to find connected components in a graph with edge weights greater than zero?

Capture this case with:

intersect(cc[length.(cc) .== 1],[[i] for i in idxs])

i.e.

result = cc[length.(cc) .> 1] ∪ ( cc[length.(cc) .== 1] ∩ [[i] for i in idxs])
1 Like