finds communities in the graph g.


uses rules vw to specify the graph g.

Details and Options

  • FindGraphCommunities finds communities with many edges joining vertices of the same community and comparatively few edges joining vertices of different communities.
  • FindGraphCommunities returns a list of communities {c1,c2,}, where each community ci is a list of vertices.
  • The communities are ordered by their length, with the largest community first.
  • FindGraphCommunities supports a Method option that specifies the detailed method to use.
  • Possible settings for the Method option include:
  • "Modularity"modularity-based clustering
    "Centrality"centrality-based clustering
    "CliquePercolation"clique percolation-based clustering
    "Hierarchical"hierarchical-based clustering
    "Spectral"spectral-based clustering
  • FindGraphCommunities works with undirected graphs, directed graphs, weighted graphs, multigraphs, and mixed graphs.


open allclose all

Basic Examples  (2)

Find communities in a graph:

Highlight the communities:

Visualize communities:

Scope  (7)

FindGraphCommunities works with undirected graphs:

Directed graphs:

Weighted graphs:


Mixed graphs:

Use rules to specify the graph:

FindGraphCommunities works with large graphs:

Options  (6)

Method  (6)

By default, FindGraphCommunities uses modularity maximization methods:

This can also be obtained with Method->"Modularity":

Use Method->"Hierarchical" for hierarchical clustering based on vertex similarity:

Use Method->"Spectral" for spectral partitioning:

Use Method->"Centrality" for partitioning based on edge centrality:

Use Method->"CliquePercolation" for k-clique percolation:

Use Method->"VertexMoving" to improve the result obtained by default:

Applications  (2)

Find communities in a friendship network between members of a karate club:

Predict the split of the network in case of an internal conflict:

A weighted network of wins in the National Hockey League during regular season 20102011. Group teams by conferences:

Partition teams in six divisions:

Properties & Relations  (5)

Communities are ordered by their length, with the largest community first:

By default, FindGraphCommunities gives communities with high modularity:

Use GraphAssortativity to compute the modularity:

Use FindGraphPartition to find partitions of vertices into k parts of approximately equal size:

The size of communities in the WattsStrogatz model:

In random spatial graphs:

CommunityGraphPlot finds and visualizes communities:

Specify communities:

Wolfram Research (2012), FindGraphCommunities, Wolfram Language function, (updated 2015).


Wolfram Research (2012), FindGraphCommunities, Wolfram Language function, (updated 2015).


Wolfram Language. 2012. "FindGraphCommunities." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015.


Wolfram Language. (2012). FindGraphCommunities. Wolfram Language & System Documentation Center. Retrieved from


@misc{reference.wolfram_2024_findgraphcommunities, author="Wolfram Research", title="{FindGraphCommunities}", year="2015", howpublished="\url{}", note=[Accessed: 24-June-2024 ]}


@online{reference.wolfram_2024_findgraphcommunities, organization={Wolfram Research}, title={FindGraphCommunities}, year={2015}, url={}, note=[Accessed: 24-June-2024 ]}