Network motifs are recurring local interaction patterns in graphs that reveal how structure relates to function in complex systems. Traditional static pairwise networks cannot capture many real‑world interactions that involve groups of nodes, evolve over time, or have directionality. We therefore introduce temporal motifs for hypergraphs and directed hypergraphs, extending motif analysis to timestamped many‑body interactions. After formalizing the mining problem, we examine the combinatorial properties of these motifs and devise exact enumeration algorithms. The key contribution is a dynamic‑programming based algorithm that dramatically cuts computational cost, delivering orders‑of‑magnitude speedups on empirical datasets. To judge statistical significance we propose a null model for temporal hypergraphs, enabling measurement of motif over‑ and under‑expression. Applying the framework to datasets from face‑to‑face contacts, scientific collaborations, e‑mail exchanges, and Bitcoin transactions uncovers distinct forms of local organization across domains. Focused case studies on persistent patterns in scientific collaborations and e‑mail communications further illustrate the utility of temporal hypergraph motifs as an exploratory tool.
Review