English

Triadic First-Order Logic Queries in Temporal Networks

Databases 2025-07-24 v1 Data Structures and Algorithms Information Retrieval Social and Information Networks

Abstract

Motif counting is a fundamental problem in network analysis, and there is a rich literature of theoretical and applied algorithms for this problem. Given a large input network GG, a motif HH is a small "pattern" graph indicative of special local structure. Motif/pattern mining involves finding all matches of this pattern in the input GG. The simplest, yet challenging, case of motif counting is when HH has three vertices, often called a "triadic" query. Recent work has focused on "temporal graph mining", where the network GG has edges with timestamps (and directions) and HH has time constraints. Inspired by concepts in logic and database theory, we introduce the study of "thresholded First Order Logic (FOL) Motif Analysis" for massive temporal networks. A typical triadic motif query asks for the existence of three vertices that form a desired temporal pattern. An "FOL" motif query is obtained by having both existential and thresholded universal quantifiers. This allows for query semantics that can mine richer information from networks. A typical triadic query would be "find all triples of vertices u,v,wu,v,w such that they form a triangle within one hour". A thresholded FOL query can express "find all pairs u,vu,v such that for half of ww where (u,w)(u,w) formed an edge, (v,w)(v,w) also formed an edge within an hour". We design the first algorithm, FOLTY, for mining thresholded FOL triadic queries. The theoretical running time of FOLTY matches the best known running time for temporal triangle counting in sparse graphs. We give an efficient implementation of FOLTY using specialized temporal data structures. FOLTY has excellent empirical behavior, and can answer triadic FOL queries on graphs with nearly 70M edges is less than hour on commodity hardware. Our work has the potential to start a new research direction in the classic well-studied problem of motif analysis.

Keywords

Cite

@article{arxiv.2507.17215,
  title  = {Triadic First-Order Logic Queries in Temporal Networks},
  author = {Omkar Bhalerao and Yunjie Pan and C. Seshadhri and Nishil Talati},
  journal= {arXiv preprint arXiv:2507.17215},
  year   = {2025}
}
R2 v1 2026-07-01T04:14:39.630Z