Analytics Engine
HyperMesh DB includes a built-in hypergraph analytics engine with 25 measures, computed in-process using SciPy sparse matrices.
Accessing analytics
Section titled “Accessing analytics”Python
Section titled “Python”analytics = db.analytics("CoProximity")
# Structuralprint(analytics.density())print(analytics.uniformity())
# Centralitypr = analytics.pagerank() # dict: node_id → scorebc = analytics.betweenness()
# Spectralsg = analytics.spectral_gap()ac = analytics.algebraic_connectivity()
# Temporaltb = analytics.temporal_burstiness()ta = analytics.temporal_activity()curl -H "X-API-Key: hmdb_yourkey" \ http://localhost:8000/v1/analytics/CoProximity/pagerankTypeScript
Section titled “TypeScript”const pr = await db.analytics("CoProximity", "pagerank");console.log(pr.result); // { "1": 0.23, "2": 0.31, ... }All 25 measures
Section titled “All 25 measures”Structural
Section titled “Structural”| Measure | Description |
|---|---|
density | Fraction of all possible hyperedges that are present |
uniformity | Proportion of hyperedges with the modal edge size |
overlapping_coefficient | Mean node participation across hyperedges |
redundancy | Fraction of node pairs that share multiple hyperedges |
isolated_nodes | Count of nodes in no hyperedge |
isolated_edges | Count of hyperedges with no shared nodes |
Degree / size distributions
Section titled “Degree / size distributions”| Measure | Description |
|---|---|
node_degree | Dict: node → number of hyperedges it belongs to |
edge_size | Dict: edge_id → number of members |
Centrality
Section titled “Centrality”| Measure | Description |
|---|---|
betweenness | Hyperedge betweenness centrality |
closeness | Closeness centrality via star-expansion |
pagerank | PageRank over the bipartite hyperedge graph |
harmonic_centrality | Harmonic mean of inverse distances |
clique_number | Size of the largest clique in the 2-section graph |
Spectral
Section titled “Spectral”| Measure | Description |
|---|---|
spectral_gap | λ₂ − λ₁ of the normalised hypergraph Laplacian |
algebraic_connectivity | Second-smallest Laplacian eigenvalue (Fiedler value) |
Clustering
Section titled “Clustering”| Measure | Description |
|---|---|
zhou_clustering | Zhou et al. 2006 hypergraph clustering coefficient |
pairwise_clustering | Fraction of co-member pairs that share another hyperedge |
modularity | Louvain-style hypergraph modularity |
s-walk (HNX-compatible)
Section titled “s-walk (HNX-compatible)”| Measure | Description |
|---|---|
s_adjacency | s-adjacency matrix (edges sharing ≥ s nodes) |
s_distance | Shortest s-walk distance between all hyperedge pairs |
s_connected_components | Number of s-connected components |
s_diameter | Diameter of the largest s-component |
Temporal
Section titled “Temporal”| Measure | Description |
|---|---|
temporal_activity | Dict: node → number of distinct time buckets active |
temporal_burstiness | Coefficient of variation of inter-event times per node |
temporal_coreness | k-core decomposition of the temporal projection |