After running the command connected_components
on an undirected graph g
with LightGraphs in Julia, I obtain the following result:
9-element Array{Array{Int64,1},1}:
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10 … 41, 42, 43, 44, 45, 46, 47, 48, 49, 50]
[51, 52, 53, 54, 55, 56, 57, 58, 59, 60 … 91, 92, 93, 94, 95, 96, 97, 98, 99, 100]
[69, 88]
[71, 73, 84, 102, 114, 122, 124, 127, 128, 134, 139, 143, 147, 150]
[101, 104, 105, 111, 112, 113, 116, 117, 121, 125 … 137, 138, 140, 141, 142, 144, 145, 146, 148, 149]
[103, 106, 108, 110, 118, 119, 123, 126, 130, 131, 132, 136]
[107]
[109]
[115]
I want to add an element-wise edge between the vertices 107 109 115
and the vertices 91 113 102
. I know I can use the commands add_edge!(g,107,91)
add_edge!(g,109,113)
and add_edge!(g,115,102)
but isn't there a command that can do all that in one shot instead of creating a loop or a function?
Thank you!