Documentation
¶
Overview ¶
Example 09_leiden — runs Leiden community detection on two K4 cliques joined by a single bridge edge and prints the discovered communities.
The graph has a textbook community structure: each K4 clique is densely connected internally and the two cliques touch only through one bridge edge, so a modularity-optimising method recovers exactly two communities. The example also shows how to read a Partition back: the Community slice is NodeID-indexed and ghost slots created by sharded packing carry the sentinel -1, so the report iterates the eight live nodes explicitly rather than walking the raw slice.
Sample output: run `go run ./examples/09_leiden` and capture the stdout — the output is deterministic for the inputs hard-coded above and serves as the regression baseline a future change should preserve.