On the graph traversal method for evaluating linear binary-chain programs

  • Yangjun Chen


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. A new algorithm is described 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. Further, the evaluation of cyclic data is speeded up 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, this algorithm achieves a linear time complexity for both acyclic and most of cyclic data.


graph traversal method linear binary-chain programs 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Chang, C., On the evaluation of queries containing derived relations in relational database, inAdvances in Data Base Theory, Vo. 1, New York: Plenum Press, 1981.Google Scholar
  2. 2.
    Chen, Y., Harder, T., Improving RQA/FQI recursive query algorithm, inProceedings ISMM-First Int. Conf. on Information and Knowledge Management, Baltimore, Maryland, Nov. 1992, New York: ACM, 1992, 106–115.Google Scholar
  3. 3.
    Chen, Y., A bottom-up query evaluation method for stratified databases, inProceedings of 9th International Conference on Data Engineering, Vienna, Austria, April 1993, California: IEEE, 1993, 568–575.CrossRefGoogle Scholar
  4. 4.
    Chen, Y., Harder, T., On the optimal top-down evaluation of recursive queries, inProc. of 5th Int. Conf. on Database and Expert Systems Applications, Greece, Athens, Sept. 1994 (ed. Karagiannis, D.), Berlin: Springer-Verlag, 1994, 47–56.Google Scholar
  5. 5.
    Chen, Y., Processing of recursive rules in knowledge-based systems—Algorithms for handling recursive rules and negative information and performance measurements, Ph. D. Thesis, Computer Science Department, University of Kaiserslautern, Germany, Feb. 1995.Google Scholar
  6. 6.
    Chen, Y., On the bottom-up evaluation of recursive queries,Int. J. Intelligent Systems, 1996, 11(10): 807.MATHCrossRefGoogle Scholar
  7. 7.
    Chen, Y., Magic sets and stratified databases,Int. J. Intelligent Systems, 1997, 12(3): 203.MATHCrossRefGoogle Scholar
  8. 8.
    Han, J., Chain-split evaluation in deductive databases,IEEE Trans. Knowledge and Data Engineering, 1995, 7: 261.CrossRefGoogle Scholar
  9. 9.
    Ullman, J. D.,Principles of Databases and Knowledge-base Systems, Rockville: Computer Science Press, 1989.Google Scholar
  10. 10.
    Shapiro, S., Mckay, D., Inference with recursive rules, inProceedings of the 1st Annual National Conference on Artificial Intelligence (ed. Bazler, R.), California: MIT Press, 1980, 151–156.Google Scholar
  11. 11.
    Bancilhon, F., Naive evaluation of recursively defined relations,On Knowledge Base Management Systems-Integrating Database and AI Systems (ed. Bancihon, F.), Berlin: Springer-Verlag, 1985, 165–178.Google Scholar
  12. 12.
    Vieille, L., From QSQ to QoSaQ: Global optimization of recursive queries, inProc. 2nd Int. Conf. on Expert Database System, Charleston (ed. Kerschberg, L.), Virginia: Benjamin Cummings, 1988, 743–748.Google Scholar
  13. 13.
    Nejdl, W., Recursive strategies for answering recursive queries-The RQA/FQI strategy, inProc. 13th VLDB Conf., Brighton, England (ed. Stocker, P. M.), California: Morgan Kaufmann, 1987, 43–50.Google Scholar
  14. 14.
    Henschen, L. J., Naqvi, S., On compiling queries in recursive first-order database,J. ACM, 1984, 31(1): 47.MATHCrossRefMathSciNetGoogle Scholar
  15. 15.
    Han, J., Zeng, K., Lu, T., Normalization of linear recursion in deductive databases, inProc. of the 9th International Conf. on Data Engineering, Vienna, Austria, April 1993, California: IEEE, 1993, 559–567.CrossRefGoogle Scholar
  16. 16.
    Han, J., Chen, S., Graphic representation of linear recursive rules,International Journal of Intelligent Systems, 1992, 7: 317.MATHCrossRefGoogle Scholar
  17. 17.
    Han, J., Henschen, L. J., The level-cycle merging method, inProc. of the 1st International Conf. on Deductive and Object-oriented Databases, Kyoto (ed. Kim W.), Berlin: Springer-Verlag, 1989, 113–129.Google Scholar
  18. 18.
    Bancilhon, F., Maier, D., Sagiv, Y. et al., Magic sets and other strange ways to implement logic programs, inProc 5th ACM Symp. Principles of Database Systems, Cambridge, MA, March 1986 (ed. Zaniolo, C.), California: ACM, 1986, 1–15.CrossRefGoogle Scholar
  19. 19.
    Beeri, C., Ramakrishnan, R., On the power of magic,J. Logic Programming, 1991, November, 10: 255.MATHCrossRefMathSciNetGoogle Scholar
  20. 20.
    Grahne, G., Sippo, S., Soisalon-Soininen, E., Efficient evaluation for a subset of recursive queries, inProceedings of ACM-PODS, California: ACM, 1987, 284–293.Google Scholar
  21. 21.
    Grahne, G., Sippo, S., Soisalon-Soininen, E., Efficient evaluation for a subset of recursive queries,J. Logic Programming, 1991, 10: 301.MATHCrossRefMathSciNetGoogle Scholar
  22. 22.
    Lloyd, J. W.,Foundations of Logic Programming, Berlin: Springer-Verlag, 1987.MATHGoogle Scholar
  23. 23.
    Kanamori, T., Kawamura, T., Abstract interpretation based on OLDT resolution,J. Logic. Programming, 1993, 15: 1.MATHCrossRefMathSciNetGoogle Scholar
  24. 24.
    Tarjan, R., Depth-first search and linear graph algorithm,SIAM J. Comput., 1972, 1(2): 146.MATHCrossRefMathSciNetGoogle Scholar
  25. 25.
    Johnson, D. B., Finding all elementary circuits of a directed graph,SIAM J. Comput., 1975, 4(1): 50.CrossRefGoogle Scholar
  26. 26.
    Garey, M. R., Tarjan, R. E., A linear-time algorithm for finding all feedback vertices,Information Processing Letters, 1978, 7(6): 274.MATHCrossRefMathSciNetGoogle Scholar
  27. 27.
    Aly, H., Ozsoyoglu, Z. M., Synchronized counting method, inProc. of the 5th International Conf. on Data Engineering, Los Angeles, California: IEEE, 1989, 366–373.Google Scholar
  28. 28.
    Bancilhon, F., Ramakrishnan, R., An amateur's introduction to recursive query processing strategies, inProc. 1986 ACM-SIGMOD Conf. Management of Data, Washington, DC, May 1986, California: ACM, 1986, 16–52.CrossRefGoogle Scholar
  29. 29.
    Wu, C., Henschen, L. J., Answering linear recursive queries in cyclic databases, inProc. of the 1988 International Conf. on Fifth Gen. Computer Systems, Tokyo, California: ACM, 1988, 16–52.Google Scholar
  30. 30.
    Marchetti-Spaccamela, A., Pelaggi, A., Sacca, D., Worst case complexity analysis of methods for logic query implementation, inProc. of ACM-PODS 87, California: ACM, 1987, 294–301.CrossRefGoogle Scholar
  31. 31.
    Sacca, D., Zaniolo, C., On the implementation of a simple class of logic queries for databases, inProceedings of the 5th ACM SIGMOD-SIGACT Symposium on Principles of Database Systems, California: ACM, 1986, 16–23.CrossRefGoogle Scholar

Copyright information

© Science in China Press 1999

Authors and Affiliations

  • Yangjun Chen
    • 1
    • 2
  1. 1.Technical Institute of ChangshaChangshaChina
  2. 2.Department of Computer ScienceTechnical University of ChemnitzChemnitzGermany

Personalised recommendations