You want to find the friendship cliques in a graph.
Construct a graph using igraph and use its built-in functionality to for clique/community detection.
igraph
TBD