hierarchical_leiden
Generic Description
A multi-level Leiden variant that exposes community structure at more than one resolution.
Simple example:
CALL nexyron.hierarchical_leiden()
Community detection procedures partition or group nodes by structural affinity. They are useful for segmentation, fraud-ring analysis, recommendation features, and exploratory graph profiling.
Consumer-Level Explanation
Use this when one flat partition is too crude and your users need both broad clusters and finer sub-clusters. Different community algorithms optimize different objectives and assumptions. Modularity methods, label propagation, block models, overlapping memberships, and partition-quality metrics should be chosen for the question, not swapped blindly.
Conceptual Explanation
Many real graphs have nested structure: enterprise divisions contain teams; interest groups contain subcultures; fraud rings contain specialized roles. Hierarchical Leiden preserves that nested shape so analysis can move from overview to drill-down without rerunning a completely different algorithm.
How It Differs From Nearby Algorithms
Compared with plain Leiden, this is for analysts who need multiple resolutions. Compared with stochastic block variants, the emphasis remains community hierarchy rather than probabilistic block interaction. Compared with overlap algorithms, a node still belongs to one branch at each level.
When To Choose It
- executive-to-analyst drill-down reporting
- taxonomy discovery where coarse and fine communities both matter
- investigations where a broad ring must later be split into operating cells
More Detailed Explanation
This is especially valuable when the argument in the room is not whether a cluster exists, but at what scale it should be reported. The same run can support a board-level summary and an operator-level breakdown.
Advanced Example
The advanced example keeps hierarchical_leiden in a named Cypher pipeline so the procedure output shape, downstream filters, and returned columns are visible to planner tooling.
CALL nexyron.hierarchical_leiden() YIELD node_id, level, community_id, modularity
RETURN node_id, level, community_id, modularity
LIMIT 10
Real Use Cases
- Show the top 5 customer super-communities and then inspect their internal sub-clusters.
- Map a criminal network into large rings first, then into recruiters, cash-out actors, and mule groups.
- Break an enterprise dependency graph into platform domains and then service-level subdomains.
- compare algorithm output with domain labels or time windows before operationalizing it
- feed graph-analytic scores into ranked reports, feature contracts, or investigation queues only after checking the modeling assumptions
Real Limitations And Tradeoffs
- More output complexity means documentation and downstream consumers must understand levels clearly.
- If users only need one simple partition, the hierarchy can be unnecessary cognitive overhead.
- Nested structure is still only as good as the graph projection and weighting choices.
- algorithm output reflects the projected graph, not an abstract real-world network outside the data model
- nearby algorithms can answer different questions even when their output columns look similar