k_clique_communities(G, k, cliques=None)
A k-clique community is the union of all cliques of size k that can be reached through adjacent (sharing k-1 nodes) k-cliques.
Size of smallest clique
Precomputed cliques (use networkx.find_cliques(G))
Find k-clique communities in graph using the percolation method.
>>> from networkx.algorithms.community import k_clique_communities
... G = nx.complete_graph(5)
... K5 = nx.convert_node_labels_to_integers(G, first_label=2)
... G.add_edges_from(K5.edges())
... c = list(k_clique_communities(G, 4))
... sorted(list(c[0])) [0, 1, 2, 3, 4, 5, 6]
>>> list(k_clique_communities(G, 6)) []See :
The following pages refer to to this document either explicitly or contain code examples using this.
networkx.algorithms.community.kclique.k_clique_communities
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them