Recursive community structures

Triangle of triangles, and deeper. A level-k graph is three copies of level-(k−1) joined pairwise — a clean nested hierarchy. ← benchmark · gallery · tutorial · repo

These graphs are built to have hierarchy at every scale, which is exactly what structural entropy is for. Two things stand out. First, selib.optimal_2d recovers exactly 3k−1 communities — the finest triangles (3, then 9, then 27) — with no number-of-clusters hint. Second, and more telling: as the graph grows 9 → 27 → 81 nodes, the flat 2D entropy climbs (1.90 → 2.41 → 2.95) but the encoding-tree entropy HT barely moves (1.60 → 1.72 → 1.79). A self-similar hierarchy is almost free to encode hierarchically — the dendrogram on the right captures the full nesting, which a flat partition cannot. This is the clearest possible picture of why structural entropy is defined over a tree rather than a single cut.

Triangle of triangles (3²)

graph (colour = top-level community)
se_hier encoding tree
nodes / edges9 / 12
flat communities (SE-optimal)3 = 31
encoding-tree height5
1D structural entropy3.085
2D structural entropy (optimal)1.896
encoding-tree entropy HT1.597
compression vs 1D38.5%

Triangle³ (3³)

graph (colour = top-level community)
se_hier encoding tree
nodes / edges27 / 39
flat communities (SE-optimal)9 = 32
encoding-tree height7
1D structural entropy4.612
2D structural entropy (optimal)2.412
encoding-tree entropy HT1.722
compression vs 1D47.7%

Triangle⁴ (3⁴)

graph (colour = top-level community)
se_hier encoding tree
nodes / edges81 / 120
flat communities (SE-optimal)27 = 33
encoding-tree height9
1D structural entropy6.169
2D structural entropy (optimal)2.949
encoding-tree entropy HT1.786
compression vs 1D52.2%
Built with scripts/run_recursive.py (triangle fractal + selib) on a fleet box; every value computed, the tree drawn from the actual se_hier output.