The functions in this class are not imported into the top-level networkx
namespace. You can access these functions by importing the networkx.algorithms.community
module, then accessing the functions as attributes of community
. For example:
>>> from networkx.algorithms import community >>> G = nx.barbell_graph(5, 1) >>> communities_generator = community.girvan_newman(G) >>> top_level_communities = next(communities_generator) >>> next_level_communities = next(communities_generator) >>> sorted(map(sorted, next_level_communities)) [[0, 1, 2, 3, 4], [5], [6, 7, 8, 9, 10]]
Functions for computing and measuring community structure.
Functions for computing and measuring community structure.
The functions in this class are not imported into the top-level networkx
namespace. You can access these functions by importing the networkx.algorithms.community
module, then accessing the functions as attributes of community
. For example:
>>> from networkx.algorithms import community >>> G = nx.barbell_graph(5, 1) >>> communities_generator = community.girvan_newman(G) >>> top_level_communities = next(communities_generator) >>> next_level_communities = next(communities_generator) >>> sorted(map(sorted, next_level_communities)) [[0, 1, 2, 3, 4], [5], [6, 7, 8, 9, 10]]
The following pages refer to to this document either explicitly or contain code examples using this.
networkx.algorithms.community.kclique.k_clique_communities
networkx.algorithms.community.modularity_max.greedy_modularity_communities
networkx.algorithms.community.modularity_max.naive_greedy_modularity_communities
networkx.algorithms.community.quality.modularity
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