Finding regular simple paths in graph databases
We consider the following problem: given a labelled directed graph $G$ and a regular expression $R$, find all pairs of nodes connected by a simple path such that the concatenation of the labels along the path satisfies $R$. The problem is motivated by the observation that many recursive queries in r...
Saved in:
Published in | SIAM journal on computing Vol. 24; no. 6; pp. 1235 - 1258 |
---|---|
Main Authors | , |
Format | Journal Article |
Language | English |
Published |
Philadelphia, PA
Society for Industrial and Applied Mathematics
01.12.1995
|
Subjects | |
Online Access | Get full text |
Cover
Loading…
Summary: | We consider the following problem: given a labelled directed graph $G$ and a regular expression $R$, find all pairs of nodes connected by a simple path such that the concatenation of the labels along the path satisfies $R$. The problem is motivated by the observation that many recursive queries in relational databases can be expressed in this form, and by the implementation of a query language, $\textbf{G}^{+}$, based on this observation. We show that the problem is in general intractable, but present an algorithm than runs in polynomial time in the size of the graph when the regular expression and the graph are free of conflicts. We also present a class of languages whose expressions can always be evaluated in time polynomial in the size of both the graph and the expression, and characterize syntactically the expressions for such languages. |
---|---|
ISSN: | 0097-5397 1095-7111 |
DOI: | 10.1137/S009753979122370X |