Multiple context-free path querying by matrix multiplication
Journal: Scientific and Technical Journal of Information Technologies, Mechanics and Optics (Vol.23, No. 2)Publication Date: 2023-04-18
Authors : Epelbaum I.V. Azimov R.Sh. Grigorev S.V.;
Page : 271-278
Keywords : path querying; MCFG; graph databases; RDF; Boolean matrix multiplication; GraphBLAS API;
Abstract
Many graph analysis problems can be formulated as formal language-constrained path querying problems where the formal languages are used as constraints for navigational path queries. Recently, the context-free language (CFL) reachability formulation has become very popular and can be used in many areas, for example, querying graph databases, Resource Description Framework (RDF) analysis. However, the generative capacity of context-free grammars (CFGs) is too weak to generate some complex queries, for example, from natural languages, and the various extensions of CFGs have been proposed. Multiple context-free grammar (MCFG) is one of such extensions of CFGs. Despite the fact that, to the best of our knowledge, there is no algorithm for MCFL-reachability, this problem is known to be decidable. This paper is devoted to developing the first such algorithm for the MCFL-reachability problem. The essence of the proposed algorithm is to use a set of Boolean matrices and operations on them to find paths in a graph that satisfy the given constraints. The main operation here is Boolean matrix multiplication. As a result, the algorithm returns a set of matrices containing all information needed to solve the MCFL-reachability problem. The presented algorithm is implemented in Python using GraphBLAS API. An analysis of real RDF data and synthetic graphs for some MCFLs is performed. The study showed that using a sparse format for matrix storage and parallel computing for graphs with tens of thousands of edges the analysis time can be 10–20 minutes. The result of the analysis provides tens of millions of reachable vertex pairs. The proposed algorithm can be applied in problems of static code analysis, bioinformatics, network analysis, as well as in graph databases when a path query cannot be expressed using context-free grammars. The provided algorithm is linear algebra-based, hence, it allows one to use high-performance libraries and utilize modern parallel hardware.
Other Latest Articles
- Machining Performance and Optimization of Process Parameters of Monel alloy 400 Using ECM Process
- Brief review of the development of theories of robustness, roughness and bifurcations of dynamic systems
- Variational problem of adaptive optimal control. Theoretical and applied computer analysis
- The concept of aerial photography using a two-element active optoelectronic complex
- Color triangle color separation system for colorimetric research in microscopy
Last modified: 2023-04-18 19:17:43