A C++ implementation of the Leiden community detection algorithm that visualizes hierarchical community structures as flame graphs. Takes a graph and finds communities within it, then shows how those communities merge together at different levels as a flame graph visualization.
# Run on a graph
./leiden-flamegraph-main my_network.edgelist
# Creates hierarchy.folded and leiden.svgSimple edge list format:
0 1
0 2
1 2
3 4
3 5
4 5
Each line is an edge between two nodes. The algorithm treats graphs as undirected.
chmod +x build.sh
./build.shRequires C++23 and cmake.
hierarchy.folded: Flame graph data in folded stack formatleiden.svg: Visual flame graph (if flamegraph.pl is installed)
The flame graph shows:
- Width: Number of nodes in each community
- Height: Hierarchy level (deeper = more refined)
- Branching: How communities split and merge