NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Counting hypertriangles through hypergraph orientations

Daniel Paul-Pena, Vaishali Surianarayanan, Deeparnab Chakrabarty, C. SeshadhriarXiv 2026

TL;DR

The paper introduces DITCH, a highly efficient algorithm for exactly counting "hypertriangles" (3-way intersecting edge patterns) in hypergraphs. By generalizing the classical graph concepts of orientation and degeneracy to hypergraphs, DITCH dramatically reduces the search space, achieving 10–100x speedups and massive memory reductions over state-of-the-art methods.

What Problem Does This Paper Address?

Network motifs—small, recurring subgraphs like triangles—are fundamental tools for analyzing complex networks in fields ranging from biology to social science. However, standard graphs only capture pairwise relationships. Real-world data (such as co-authorship groups, email threads, or multi-person chat rooms) frequently involve group interactions that are best modeled as hypergraphs, where a single "hyperedge" can contain any number of vertices.

Counting triangles in standard graphs is a mature problem, but counting "hypertriangles" (triplets of mutually intersecting hyperedges) is vastly more challenging. Because hyperedges can overlap in intricate ways, three hyperedges can form 26 distinct intersection patterns.

Figure 2: Hypertriangles, as defined by [40]. The three circles represent the distinct hyperedges, and regions are colored if they are non-empty. Regions in exactly one set are colored green, two sets are colored blue, and three sets are colored red. The 20 closed patterns are technically the hypertriangles, whereas the 6 open patterns are akin to paths.

Previous exact counting algorithms suffer from combinatorial explosion and massive memory footprints when dealing with high-degree vertices in large, dense datasets, often forcing researchers to rely on approximations.

Methods

The authors bridge this gap by generalizing the classic Chiba-Nishizeki graph orientation and degeneracy framework (originally proposed in 1985) to the hypergraph setting.

  • Hypergraph Orientations: They introduce a vertex ordering ($\pi$) to direct the hyperedges. A vertex's out-degree ($d_v^+$) is defined as the number of hyperedges containing $v$ where $v$ is not the last vertex in the ordering.
  • Hyper-MatulaBeck Algorithm: They design a linear-time peeling algorithm that systematically removes the lowest-degree vertices to find an ordering that minimizes the maximum out-degree, bounding it by a new theoretical metric called hyperedge degeneracy ($\kappa(G)$).
  • The DITCH Algorithm Suite: Using this optimized orientation, DITCH prunes the search space. Instead of fully enumerating all triplets, it employs targeted strategies:
  • Outwedge enumeration for triangle-like patterns.
  • Containment analysis for nested hyperedges.
  • Combinatorial formulas and linear combinations to compute the counts of high-frequency "star" patterns implicitly rather than explicitly enumerating them, bypassing the worst of the degree blow-ups.

Datasets

The authors evaluated DITCH on 11 diverse, real-world hypergraph datasets spanning five domains:

  • Co-author networks: A-DBLP, A-geology, A-history
  • Social contact: C-hschool, C-pschool
  • Email networks: E-eu, E-enron
  • Discussion threads: Th-math, Th-ubuntu
  • Tags: Tg-math, Tg-ubuntu

The datasets include extremely dense networks (like Tg-ubuntu) and high-rank hypergraphs where hyperedges contain hundreds of vertices.

Key Insights and Ideas

  • Taming the Heavy Tail: Real-world hypergraphs exhibit highly skewed, heavy-tailed degree distributions. By converting standard degrees to directed out-degrees, the authors dramatically thin this tail. The maximum out-degree is typically 3–5 times smaller than the maximum standard degree. Because hypertriangle counting complexity scales with the cube of the degree, this reduction yields a massive practical speedup.
  • Math Over Enumeration: The distribution of hypertriangles in real-world data is highly skewed; a single pattern (Pattern 9, a star-like structure) often accounts for over 70% of all occurrences. DITCH exploits this by using linear equations to solve for these dominant patterns implicitly, saving immense amounts of time and memory.

Key Results

  • 10x to 100x Speedups: DITCH consistently outperformed state-of-the-art exact algorithms (Exact-adv and MoCHy-E). On the Th-ubuntu dataset, DITCH finished in under 10 seconds, while Exact-adv took hours.
  • Dramatic Memory Reductions: DITCH achieved a 10x to 1000x reduction in memory usage, staying under 1GB of memory for 8 out of 10 datasets and under 4GB overall. Baseline methods frequently crashed by exceeding the 9GB testing limit.
Figure 1: Runtime and memory comparisons: we compare our algorithm DITCH with the existing best MoCHy-E [40] and state-of-the-art Exact-adv [76] algorithms. We test on a collection of ten datasets, and set a memory limit of 9GB. Any bar that is not present means that the algorithm ran out of memory. Across all datasets, DITCH is 10-100x faster and more memory efficient than previous methods.
  • Breaking the Intractable: DITCH successfully computed the exact hypertriangle counts for the massive Tg-ubuntu dataset (containing trillions of patterns) for the first time ever, completing the task in roughly 10 hours where all prior exact methods failed or ran out of memory.

Limitations and Future Work

  • Motif Size Constraints: The current framework is strictly tailored to 3-hyperedge motifs (hypertriangles). Extending this degeneracy-based orientation to larger motifs (4 or more hyperedges) remains an open theoretical challenge.
  • Binary Intersections: The algorithm treats intersections as binary (empty vs. non-empty). The authors note that future work could adapt it to handle count-based or thresholded intersection conditions (e.g., requiring at least $\theta$ overlapping vertices).
  • Vertex-based Motifs: DITCH focuses on hyperedge-based triangles; extending the framework to support vertex-based hypertriangle motifs is another suggested direction.

Summary updated

BibTeX
@misc{paulpena2026counting,
  author = {Daniel Paul-Pena and Vaishali Surianarayanan and Deeparnab Chakrabarty and C. Seshadhri},
  title = {{Counting hypertriangles through hypergraph orientations}},
  year = {2026},
  eprint = {2601.03573},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2601.03573},
}
Figure