One Algorithm to Evaluate Them All: Unified Linear Algebra Based Approach to Evaluate Both Regular and Context-Free Path Queries
Ekaterina Shemetova, Rustam Azimov, Egor Orachev, Ilya Epelbaum,, Semyon Grigorev

TL;DR
This paper introduces a linear algebra-based algorithm for evaluating both regular and context-free path queries in graphs, achieving a subcubic time complexity and unifying different query types with efficient matrix operations.
Contribution
It reduces a Kronecker product-based CFPQ algorithm to Boolean matrix operations, extends it to extract all paths, and proves a subcubic time complexity, offering a unified approach for path querying.
Findings
Algorithm runs in O(n^3 / log n) time complexity.
Effective for both regular and context-free path queries.
Demonstrates competitive performance as a universal path querying method.
Abstract
The Kronecker product-based algorithm for context-free path querying (CFPQ) was proposed by Orachev et al. (2020). We reduce this algorithm to operations over Boolean matrices and extend it with the mechanism to extract all paths of interest. We also prove time complexity of the proposed algorithm, where n is a number of vertices of the input graph. Thus, we provide the alternative way to construct a slightly subcubic algorithm for CFPQ which is based on linear algebra and incremental transitive closure (a classic graph-theoretic problem), as opposed to the algorithm with the same complexity proposed by Chaudhuri (2008). Our evaluation shows that our algorithm is a good candidate to be the universal algorithm for both regular and context-free path querying.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsGraph Theory and Algorithms · Data Management and Algorithms · Network Packet Processing and Optimization
