networkx 2.8.2 Pypi GitHub Homepage
Other Docs
ParametersReturnsBackRef
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.

Parameters

G : NetworkX graph
k : int

Size of smallest clique

cliques: list or generator :

Precomputed cliques (use networkx.find_cliques(G))

Returns

Yields sets of nodes, one for each k-clique community.

Find k-clique communities in graph using the percolation method.

Examples

>>> 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 :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

networkx.algorithms.community.kclique.k_clique_communities

Local connectivity graph

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


GitHub : /networkx/algorithms/community/kclique.py#7
type: <class 'function'>
Commit: