Skip to main content
Log in

Efficient computation of the transitive closure size

  • Published:
Cluster Computing Aims and scope Submit manuscript

Abstract

Given a directed graph and a node u, the transitive closure (TC) of u(TC(u)) is the set of nodes that u can reach in the graph, and the size of u’s transitive closure is to get the number of nodes in TC(u). Considering that computing the size of TC (TC-size computation or detection) is very important in many applications, and existing approaches on TC-size computation cannot scale to large graphs appeared in recent applications, we propose a path decomposition based algorithm, namely buTC, for TC-size computation with linear space complexity. buTC first gets a set of paths by path decomposition, then process nodes in each path in bottom-up manner. The benefit of buTC is that it can utilize the reachable relationship between nodes in a path to avoid the repeatedly visiting of many nodes, such that to guarantee that after processing all nodes in a single path, all involved edges are visited only once. Considering that buTC processes each path independently, we further propose an optimized algorithm, namely buTC+, to avoid the redundant operation of buTC. buTC+ does not need to do path decomposition, it uses a stack to buffer processed nodes with unprocessed in-neighbors, such that to utilize the reachable relationship between nodes in different paths of buTC to avoid the redundant computation. We conduct rich experiment on 26 real datasets and 5 synthetic datasets. The experimental results confirm that both buTC and buTC+ has better space and time scalability, and can be scaled to large graphs.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5

Similar content being viewed by others

Notes

  1. https://code.google.com/archive/p/grail/downloads.

  2. http://www.uniprot.org/.

  3. http://pan.baidu.com/s/1bpHkFJx.

  4. http://en.wikipedia.org/wiki/Transitive_reduction.

References

  1. Aho, A.V., Garey, M.R., Ullman, J.D.: The transitive reduction of a directed graph. SIAM J. Comput. 1(2), 131–137 (1972)

    Article  MathSciNet  Google Scholar 

  2. Alves, C.E.R., Cáceres, E.N., de Castro, A.A., Song, S.W., Szwarcfiter, J.L.: Parallel transitive closure algorithm. J. Braz. Comp. Soc. 19(2), 161–166 (2013)

    Article  MathSciNet  Google Scholar 

  3. Chen, Y., Chen, Y.: Decomposing dags into spanning trees: A new way to compress transitive closures. In: Proceedings of the 27th International Conference on Data Engineering, ICDE 2011, April 11–16, 2011, Hannover, Germany, pp. 1007–1018 (2011)

  4. Cheng, J., Huang, S., Wu,H., Fu, A.W.: Tf-label: a topological-folding labeling scheme for reachability querying in a large graph. In: SIGMOD, pp. 193–204 (2013)

  5. Cohen, E.: Estimating the size of the transitive closure in linear time. In: 35th Annual Symposium on Foundations of Computer Science, Santa Fe, New Mexico, USA, 20–22 November 1994, pp. 190–200 (1994)

  6. Dar, S.: Augmenting Databases with Generalized Transitive Closure. PhD thesis, Univ. ofWisconsin-Madison (1993)

  7. Ding, C.H.Q., He, X., Peng, H.: Finding cliques in protein interaction networks via transitive closure of a weighted graph. In: Proceedings of the 5th international workshop on Bioinformatics, BIOKDD 2005, Chicago, Illinois, USA, August 21, 2005, pp. 69–75 (2005)

  8. Fletcher, G.H.L., Gyssens, M., Leinders, D., den Bussche, J.V., Gucht, D.V., Vansummeren, S., Wu., Y.: The impact of transitive closure on the boolean expressiveness of navigational query languages on graphs. In: Foundations of Information and Knowledge Systems—7th International Symposium, FoIKS 2012, Kiel, Germany, March 5-9, 2012. Proceedings, pp. 124–143 (2012)

  9. Fletcher, G.H.L., Gyssens, M., Leinders, D., den Bussche, J.V., Gucht, D.V., Vansummeren, S., Wu, Y.: The impact of transitive closure on the expressiveness of navigational query languages on unlabeled graphs. Ann. Math. Artif. Intell. 73(1–2), 167–203 (2015)

    Article  MathSciNet  Google Scholar 

  10. Gora lciková, A., Koubek, V.: A reduct-and-closure algorithm for graphs. In: Mathematical Foundations of Computer Science 1979, Proceedings, 8th Symposium, Olomouc, Czechoslovakia, September 3–7, 1979, pp. 301–307 (1979)

  11. Pfeiffer, J.J., Fond, T.L., Moreno, S., Neville, J.: Fast generation of large scale social networks while incorporating transitive closures. In: 2012 International Conference on Privacy, Security, Risk and Trust, PASSAT 2012, and 2012 International Confernece on Social Computing, SocialCom 2012, Amsterdam, Netherlands, September 3–5, 2012, pp. 154–165 (2012)

  12. Jin, R., Ruan, N., Dey, S., Yu, j.X.: SCARAB: scaling reachability computation on large graphs. In SIGMOD, pp. 169–180 (2012)

  13. Jin, R., Wang, G.: Simple, fast, and scalable reachability oracle. PVLDB 6(14), 1978–1989 (2013)

    Google Scholar 

  14. King, V.: Fully dynamic transitive closure. In: Encyclopedia of Algorithms, pp. 808–809 (2016)

    Chapter  Google Scholar 

  15. Krommidas, I., Zaroliagis, C.D.: An experimental study of algorithms for fully dynamic transitive closure. ACM J. Exp. Algorithm 12, 16 (2008)

    MathSciNet  MATH  Google Scholar 

  16. Niesink, P., Poulin, K., Sajna, M.: Computing transitive closure of bipolar weighted digraphs. Discret. Appl. Math. 161(1–2), 217–243 (2013)

    Article  MathSciNet  Google Scholar 

  17. Palkowski, M., Bielecki, W.: Optimizing numerical code by means of the transitive closure of dependence graphs. In: Proceedings of the 2017 Federated Conference on Computer Science and Information Systems, FedCSIS 2017, Prague, Czech Republic, September 3–6, 2017., pp. 523–526 (2017)

  18. Roditty, L.: A faster and simpler fully dynamic transitive closure. ACM Trans. Algorithms 4(1), 1–16 (2008)

    Article  MathSciNet  Google Scholar 

  19. Sankowski, P., Mucha, M.: Fast dynamic transitive closure with lookahead. Algorithmica 56(2), 180–197 (2010)

    Article  MathSciNet  Google Scholar 

  20. Seufert, S., Anand, A., Bedathur, S.J., Weikum, G.: FERRARI: flexible and efficient reachability range assignment for graph indexing. In: ICDE, pp. 1009–1020 (2013)

  21. Simon, K.: An improved algorithm for transitive closure on acyclic digraphs. Theor. Comput. Sci. 58, 325–346 (1988)

    Article  MathSciNet  Google Scholar 

  22. Su, J., Zhu, Q., Wei, H., Yu, J.X.: Reachability querying: can it be even faster? IEEE Trans. Knowl. Data Eng. 29(3), 683–697 (2017)

    Article  Google Scholar 

  23. Tarjan, R.E.: Depth-first search and linear graph algorithms. SIAM J. Comput. 1(2), 146–160 (1972)

    Article  MathSciNet  Google Scholar 

  24. ten Cate, B.: The expressivity of xpath with transitive closure. In: Proceedings of the Twenty-Fifth ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems, June 26–28, 2006, Chicago, Illinois, USA, pp. 328–337 (2006)

  25. Veloso, R.R., Cerf, L., Junior, W.M., Zaki, M.J.: Reachability queries in very large graphs: A fast refined online search approach. In: EDBT, pp. 511–522 (2014)

  26. Wan, J., Zhu, Q., Lei, D., Lu, J.: Outlier detection based on transitive closure. Intell. Data Anal. 19(1), 145–160 (2015)

    Article  Google Scholar 

  27. Wei, H., Yu, J.X., Lu, C., Jin, R.: Reachability querying: an independent permutation labeling approach. PVLDB 7(12), 1191–1202 (2014)

    Google Scholar 

  28. Williams, V.V: Multiplying matrices faster than coppersmith-winograd. In STOC, pp. 887–898 (2012)

  29. Yannakakis, M.: Graph-theoretic methods in database theory. In: Proceedings of the Ninth ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems, April 2–4, 1990, Nashville, Tennessee, USA, pp. 230–242 (1990)

  30. Yano, Y., Akiba, T., Iwata, Y., Yoshida, Y.: Fast and scalable reachability queries on graphs by pruned labeling with landmarks and paths. In CIKM, pp. 1601–1606 (2013)

  31. Yildirim, H., Chaoji, V., Zaki, M.J.: GRAIL: scalable reachability index for large graphs. PVLDB 3(1), 276–284 (2010)

    Google Scholar 

  32. Yildirim, H., Chaoji, V., Zaki, M.J.: GRAIL: a scalable index for reachability queries in very large graphs. VLDB J. 21(4), 509–534 (2012)

    Article  Google Scholar 

  33. Zhou, J., Zhou, S., Yu, J.X., Wei, H., Chen, Z., Tang, X.: DAG reduction: Fast answering reachability queries. In: Proceedings of the 2017 ACM International Conference on Management of Data, SIGMOD Conference 2017, Chicago, IL, USA, May 14–19, 2017, pp. 375–390 (2017)

  34. Zhu, A.D., Lin, W., Wang, S., Xiao, X.: Reachability queries on large dynamic graphs: a total order approach. In: SIGMOD, pages 1323–1334 (2014)

Download references

Acknowledgements

This work was partly supported by the grants from the Natural Science Foundation of China (Nos.: 61472339, 61303040, 61572421, 61272124), Shanghai Alliance Program (LM201552), and Shanghai University of Engineering and Technology School-Enterprise cooperation projects (15) (DZ-025).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Xian Tang.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Tang, X., Chen, Z., Li, K. et al. Efficient computation of the transitive closure size. Cluster Comput 22 (Suppl 3), 6517–6527 (2019). https://doi.org/10.1007/s10586-018-2278-9

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10586-018-2278-9

Keywords

Navigation