I would like to find all the connected components of a graph where the components have more than one element.
using the clusters
gives the membership to different clusters and using cliques
does not give connected components.
This is a follow up from
multiple intersection of lists in R
My main goal was to find all the groups of lists which have elements in common with each other.
Thanks in advance!
clusters
? – Atheling?clusters
function returns cluster membership and size - should be easy enough to subset it to only include clusters with more than one node – Athelingclusters
? – Displayclusters
. One way:cl <- clusters(g); lapply(seq_along(cl$csize)[cl$csize > 1], function(x) V(g)$name[cl$membership %in% x])
– Atheling$name
and why not you post the answer? Also we need to convertvertex
type to numeric – Display