This Article 
 Bibliographic References 
 Add to: 
On the Graph Traversal and Linear Binary-Chain Programs
May/June 2003 (vol. 15 no. 3)
pp. 573-596

Abstract—Grahne et al. have presented a graph algorithm for evaluating a subset of recursive queries. This method consists of two phases. In the first phase, the method transforms a linear binary-chain program into a set of equations over expressions containing predicate symbols. In the second phase, a graph is constructed from the equations and the answers are produced by traversing the relevant paths. Here, we describe a new algorithm which requires less time than Grahne's. The key idea of the improvement is to reduce the search space that will be traversed when a query is invoked. Furthermore, we speed up the evaluation of cyclic data by generating most answers directly in terms of the answers already found and the associated “path information” instead of traversing the corresponding paths as usual. In this way, our algorithm achieves a linear time complexity for both acyclic and cyclic data.

[1] H. Aly and Z.M. Ozsoyoglu, “Synchronized Counting Method,” Proc. Fifth Int'l Conf. Data Eng., pp. 316-373, 1989.
[2] F. Bancilhon, "Naive Evaluation of Recursively Defined Relations," M. Brodie and J. Mylopoulos, eds., On knowledge-Base Management Systems—Integrating Database and AI Systems, pp. 165-178.New York: Springer-Verlag, 1986.
[3] F. Bancilhon, D. Maier, Y. Sagiv, and J.D. Ullman, "Magic Sets and Other Strange Ways to Implement Logic Programs," Proc. Fifth ACM PODS Symp. Principles of Database Systems, pp. 1-15, 1986.
[4] F. Bancilhon and R. Ramakrishnan,“An amateur’s introduction to recursive query processing strategies,” Proc. 1986 ACM-SIGMOD Int’l Conf. Management Data, pp. 16-52,Washington, DC, May 1986.
[5] C. Beeri and R. Ramakrisnhan, “On the Power of Magic,” J. Logic Programming, vol. 11, nos. 3 and 4, pp. 255-299, 1991.
[6] C. Chang, “On the Evaluation of Queries Containing Derived Relations in Relational Database,” Advances in Data Base Theory, vol. 1, pp. 235-260, 1981.
[7] Y. Chen and T. Härder, “Improving RQA/FQI Recursive Query Algorithm,” Proc. ISMM—First Int'l Conf. Information and Knowledge Management, pp. 413-422, 1992.
[8] Y. Chen, “A Bottom-Up Query Evaluation Method for Stratified Databases,” Proc. Ninth Int'l Conf. Data Eng., pp. 568-575, 1993.
[9] Y. Chen and T. Härder, “On the Optimal Top-Down Evaluation of Recursive Queries,” Proc. Fifth Int'l Conf. Database and Expert Systems Applications, pp. 47-56, 1994.
[10] Y. Chen, “Processing of Recursive Rules in Knowledge-Based Systems—Algorithms for Handling Recursive Rules and Negative Information and Performance Measurements,” PhD thesis, Computer Science Dept., Univ. of Kaiserslautern, Germany, Feb. 1995.
[11] Y. Chen, “On the Bottom-Up Evaluation of Recursive Queries,” Int'l J. Intelligence Systems, vol. 11, no. 10, pp. 807-832, 1996.
[12] Y. Chen, “Magic Sets and Stratified Databases,” Int'l J. Intelligent Systems, vol. 12, no. 3, pp. 203-231, 1997.
[13] M.R. Garey and R.E. Tarjan, “A Linear-Time Algorithm for Finding All Feedback Vertices,” Information Processing Letters, vol. 7, no. 6, pp. 274-276, Oct. 1978.
[14] G. Grahne, S. Sippo, and E. Soisalon-Soininen, “Efficient Evaluation for a Subset of Recursive Queries,” Proc. Sixth ACM SIGACT-SIGMOD-SIGACT Symp. Principles of Database Systems, pp. 284- 293, 1987.
[15] G. Grahne, S. Sippo, and E. Soisalon-Soininen, “Efficient Evaluation for a Subset of Recursive Queries,” J. Logic Programming, vol. 10, no. 4, pp. 301-332, 1991.
[16] J. Han, K. Zeng, and T. Lu, “Normalization of Linear Recursion in Deductive Databases,” Proc. Ninth Int'l Conf. Data Eng., pp. 559-567, 1993.
[17] J. Han and S. Chen, “Graphic Representation of Linear Recursive Rules,” Int'l J. Intelligent Systems, vol. 7, no. 3, pp. 317-337, 1992.
[18] J. Han and L.J. Henschen, “The Level-Cycle Merging Method,” Proc. First Int'l Conf. Deductive and Object-Oriented Databases, pp. 113-129, 1989.
[19] J. Han, “Chain-Split Evaluation in Deductive Databases,” IEEE Trans. Knowledge and Data Eng., vol. 7, no. 4, pp. 261-273, Aug. 1995.
[20] L.J. Henschen and S. Naqvi, “On Compiling Queries in Recursive First-Order Database,” J. ACM, vol. 31, no. 1, pp. 47-85, 1984.
[21] T. Kanamori and T. Kawamura, “Abstract Interpretation Based on OLDT Resolution,” J. Logic Programming, vol. 15, no. 1, pp. 1-30, 1993.
[22] J.W. Lloyd, Foundations of Logic Programming, Springer Series in Symbolic Computation, second ed. New York: Springer-Verlag, 1987.
[23] D.B. Johnson, “Finding All Elementary Circuits of a Directed Graph,” SIAM J. Computing, vol. 4, no. 1, Mar. 1975.
[24] A. Marchetti-Spaccamela, A. Pelaggi, and D. Sacca, “Worst Case Complexity Analysis of Methods for Logic Query Implementation,” Proc. Sixth ACM SIGACT-SIGMOD-SIGACT Symp. Principles of Database Systems, pp. 294-301, 1987.
[25] W. Nejdl, “Recursive Strategies for Answering Recursive Queries—The RQA/FQI Strategy,” Proc. 13th VLDB Conf., pp. 43-50, 1987.
[26] D. Sacca and C. Zaniolo, “On the Implementation of a Simple Class of Logic Queries for Databases,” Proc. Fifth ACM SIGMOD-SIGACT Symp. Principles of Database Systems, pp. 16-23, 1986.
[27] S. Shapiro and D. Mckay, “Inference with Recursive Rules,” Proc. Fifth Ann. Nat'l Conf. Artificial Intelligence, pp. 151-153, 1980.
[28] G. Schmidt and T. Ströhein, Relations and Graphs. Berlin: Springer-Verlag, 1991.
[29] R. Tarjan, “Depth-First Search and Linear Graph Algorithm,” SIAM J. Computing, vol. 1, no. 2, pp. 146-160, June 1972.
[30] J. Ullman, Principles of Database and Knowledge-Base Systems, vol. 1. Computer Science Press, 1988.
[31] L. Vieill, “Recursive Query Processing: The Power of Logic,” Int'l J. Theoretical Computer Science, vol. 69, no. 1, pp. 1-53, 1989.
[32] C. Wu and L.J. Henschen, “Answering Linear Recursive Queries in Cyclic Databases,” Proc. 1988 Int'l Conf. Fifth Generation Computer Systems, pp. 727-734, 1988.
[33] J. Ullman and A. Van Gelder, “Parallel Complexity of Logical Query Programs,” Proc. 27th Ann. IEEE Symp. Foundations of Computer Science, pp. 438-454, 1986.
[34] R. Dechter, “Decomposing a Relation into Tree of Binary Relations,” J. Computer and System Science, vol. 41, no. 1, pp. 2-24, 1990.
[35] A. Marchetti-Spaccamela, A. Pelaggi, and D. Sacca, “Comparison of Methods for Logic-Query Implementation,” J. Logic Programming, vol. 10, no. 4, pp. 333-360, 1991.

Index Terms:
Deductive database, binary-chain programs, automaton, graph searching, feedback node.
Yangjun Chen, "On the Graph Traversal and Linear Binary-Chain Programs," IEEE Transactions on Knowledge and Data Engineering, vol. 15, no. 3, pp. 573-596, May-June 2003, doi:10.1109/TKDE.2003.1198392
Usage of this product signifies your acceptance of the Terms of Use.