In the densest neighborhoods of a network, it is sometimes possible to find groups of nodes that are all connected to each other. Such groups are called cliques. Identification of cliques is another way to analyze the medium-scale structure of a network. Because cliques are highly interconnected, the nodes in a clique rarely belong to different communities. In fact, cliques often form the cores of communities.
Chapter 4, Affiliation Networks, described how to transform an affiliation network into a single-mode network using projections. For each node removed by such projections, its neighbors are connected into a clique. Cliques can give clues to an underlying affiliation network structure.
NetworkX provides the find_cliques() function to find cliques in a network. This function returns an iterator over all cliques in an arbitrary order. For example, using this function...