uses NetworkX module to find cliques