louvain
Detect communities in graphs by grouping densely-connected nodes using modularity optimization. Adjust resolution to control community size.
Instructions
Detect communities using the Louvain modularity-optimization algorithm.
Groups densely-connected nodes into communities. Higher resolution values produce more (smaller) communities; lower values produce fewer (larger) communities.
Use this tool when: you want to discover clusters or groups in the graph. Do NOT use this for: finding paths (use dijkstra) or ranking nodes (use pagerank).
Args: resolution: Resolution parameter (default 1.0). Values > 1 favor smaller communities, values < 1 favor larger ones.
Returns: JSON object with {modularity, num_communities, communities} where communities maps community_id -> list of node summaries. Output is truncated if it exceeds the token budget.
Error recovery: If this returns 0 communities, the graph may have no edges. Check with graph_info.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| resolution | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |