__init__.py 1.1 KB

123456789101112131415161718192021222324
  1. """Functions for computing and measuring community structure.
  2. The ``community`` subpackage can be accessed by using :mod:`networkx.community`, then accessing the
  3. functions as attributes of ``community``. For example::
  4. >>> import networkx as nx
  5. >>> G = nx.barbell_graph(5, 1)
  6. >>> communities_generator = nx.community.girvan_newman(G)
  7. >>> top_level_communities = next(communities_generator)
  8. >>> next_level_communities = next(communities_generator)
  9. >>> sorted(map(sorted, next_level_communities))
  10. [[0, 1, 2, 3, 4], [5], [6, 7, 8, 9, 10]]
  11. """
  12. from networkx.algorithms.community.asyn_fluid import *
  13. from networkx.algorithms.community.centrality import *
  14. from networkx.algorithms.community.kclique import *
  15. from networkx.algorithms.community.kernighan_lin import *
  16. from networkx.algorithms.community.label_propagation import *
  17. from networkx.algorithms.community.lukes import *
  18. from networkx.algorithms.community.modularity_max import *
  19. from networkx.algorithms.community.quality import *
  20. from networkx.algorithms.community.community_utils import *
  21. from networkx.algorithms.community.louvain import *