Abstract
Let ℒ be the language defined by some deterministick-state automaton with accepting statesF, and letG be a directed graph withn nodes andm labeled arcs. Thedynamic ℒ-path problem is to process efficiently and on-line two kinds of operations: (1) inserting arcs intoG, and (2) given two nodesu andv inG, finding a path fromu tov that is labeled by some word of ℒ, or reporting that none exists. We present a data structure that supports insertion and regular path existence queries inO(nk 2) amortized time andO(|F|) worst-case time, respectively. Deletions only (no insertions) can also be accommodated in directed acyclic graphs. Finding an ℒ-path between two nodes can be done inO(l+|F|) worst-case time, wherel is the length of the path returned. This is an improvement over theO(m) time required to answer queries in the static version of this problem, for each fixed infinite ℒ. We show how this data structure and the techniques used for building it are applicable to the area of knowledge base querying. In an amortized setting, we provide relative improvements ofO(m/n) to the time bounds for answering many one-sided recursive queries and even some two-sided recursive queries, such as the same generation query on acyclic graphs.
Similar content being viewed by others
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.References
A.V. Aho, J.E. Hopcroft and J.D. Ullman,The Design and Analysis of Computer Algorithms (Addison-Wesley, Reading, MA, 1976).
K.R. Apt and J.M. Pugin, Maintenance of stratified databases viewed as a belief revision system, in:Proc. 6th ACM SIGACT-SIGMOD-SIGART Symp. on Principles of Database Systems (1987) pp. 136–145.
F. Bancilhon, D. Maier, Y. Sagiv and J.D. Ullman, Magic sets and other strange ways to implement logic programs, in:Proc. 5th ACM SIGACT-SIGMOD-SIGART Symp. on Principles of Database Systems (1986) pp. 1–15.
F. Bancilhon and R. Ramakrishnan, An amateur's introduction to recursive query processing strategies, in:Proc. ACM SIGMOD Symp. on the Management of Data (1986) pp. 16–52.
C. Beeri, P.C. Kanellakis, F. Bancilhon and R. Ramakrishnan, Bounds on the propagation of selection into logic programs, in:Proc. 6th ACM SIGACT-SIGMOD-SIGART Symp. on Principles of Database Systems (1987) pp. 214–226.
R.W. Haddad and J.F. Naughton, Counting methods for cyclic relations, in:Proc. 7th ACM SIGACT-SIGMOD-SIGART Symp. on Principles of Database Systems (1988) pp. 333–340.
T. Ibaraki and N. Katoh, On-line computation of transitive closure of graphs, Inf. Proc. Lett. 16 (1983) 95–97.
G.F. Italiano, Amortized efficiency of a path retrieval data structure, Theor. Comp. Sci. 48 (1986) 273–281.
G.F. Italiano, Finding paths and deleting edges in directed acyclic graphs, Inf. Proc. Lett. 28 (1988) 5–11.
A. Marchetti-Spaccamela, A. Pelaggi and D. Sacca, Worst-case complexity analysis of methods for logic query implementation, in:Proc. 6th ACM SIGACT-SIGMOD-SIGART Symp. on Principles of Database Systems (1987) pp. 294–301.
S. Naqvi and S. Tsur,A Logical Language for Data and Knowledge Bases (Computer Science Press, Rockville, MD, 1989).
J.F. Naughton, One-sided recursions, in:Proc. 6th ACM SIGACT-SIGMOD-SIGART Symp. on Principles of Database Systems (1987) pp. 340–348.
R.E. Tarjan, Amortized computational complexity, SIAM J. Alg. Discr. Meth. 6 (1985) 307–318.
R.E. Tarjan, Fast algorithms for solving path problems, J. ACM 28 (1981) 594–614.
M. Yannakakis, Graph theoretic methods in database theory, in:Proc. 9th ACM SIGACT-SIGMOD-SIGART Symp. on Principles of Database Systems (1990) pp. 230–242.
Author information
Authors and Affiliations
Additional information
Work partially completed while at Brown University. Work at Princeton partially supported by the NSF Center in Discrete Mathematics and Theoretical Computer Science (DIMACS).
Work supported in part by NSF grant IRI-8617344, by an Alfred P. Sloan Foundation Fellowship, and by ONR grant N00014-83-K-0146, ARPA Order No. 4786.
Work supported in part by an NSF Presidential Young Investigator Award with matching funds from IBM, by NSF research grant DCR-8403613, and by ONR grant N00014-83-K-0146, ARPA Order No. 4786.
Rights and permissions
About this article
Cite this article
Buchsbaum, A.L., Kanellakis, P.C. & Vitter, J.S. A data structure for arc insertion and regular path finding. Ann Math Artif Intell 3, 187–210 (1991). https://doi.org/10.1007/BF01530925
Issue Date:
DOI: https://doi.org/10.1007/BF01530925