Top-K Graph Pattern Matching: A Twig Query Approach

  • Xianggang Zeng
  • Jiefeng Cheng
  • Jeffrey Xu Yu
  • Shengzhong Feng
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7418)


There exist many graph-based applications including bioinformatics, social science, link analysis, citation analysis, and collaborative work. All need to deal with a large data graph. Given a large data graph, in this paper, we study finding top-k answers for a graph query, and in particular, we focus on top-k cyclic graph queries where a graph query is cyclic and can be complex. The capability of supporting top-k cyclic graph queries over a data graph provides much more flexibility for a user to search graphs. And the problem itself is challenging. After investigating a direct yet infeasible solution, we propose a new twig query approach. In our approach, we first identify a spanning tree of the cyclic graph query, which is used to generate a list of ranked twig answers on-demand. Then we identify the top-k answers for the graph query based on the twig answer list. In order to find the best twig query in solving a given cyclic graph query, cost-based optimization for twig query selection is studied. We conducted extensive performance studies using a real dataset, and we report our findings in this paper.


Large Graph Subgraph Isomorphism Stop Condition Graph Query Uncertain Graph 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Agrawal, P., Widom, J.: Confidence-aware join algorithms. In: ICDE (2009)Google Scholar
  2. 2.
    Bhalotia, G., Hulgeri, A., Nakhe, C., Chakrabarti, S., Sudarshan, S.: Keyword searching and browsing in databases using BANKS. In: ICDE (2002)Google Scholar
  3. 3.
    Chen, L., Gupta, A., Kurul, M.E.: Stack-based algorithms for pattern matching on DAGs. In: VLDB (2005)Google Scholar
  4. 4.
    Cheng, J., Yu, J.X.: On-line exact shortest distance query processing. In: EDBT (2009)Google Scholar
  5. 5.
    Cheng, J., Yu, J.X., Yu, P.S., Wang, H.: Fast graph pattern matching. In: ICDE (2008)Google Scholar
  6. 6.
    Cohen, E., Halperin, E., Kaplan, H., Zwick, U.: Reachability and distance queries via 2-hop labels. In: Proc. of SODA 2002 (2002)Google Scholar
  7. 7.
    Corrales, J.C., Grigori, D., Bouzeghoub, M.: BPEL Processes Matchmaking for Service Discovery. In: Meersman, R., Tari, Z. (eds.) OTM 2006. LNCS, vol. 4275, pp. 237–254. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  8. 8.
    Demirci, M.F.: Graph-based shape indexing. In: Machine Vision and Applications (2010)Google Scholar
  9. 9.
    Fagin, R., Lotem, A., Naor, M.: Optimal aggregation algorithms for middleware. In: PODS (2001)Google Scholar
  10. 10.
    Fan, W., Li, J., Luo, J., Tan, Z., Wang, X., Wu, Y.: Incremental graph pattern matching. In: SIGMOD (2011)Google Scholar
  11. 11.
    Fan, W., Li, J., Ma, S., Tang, N., Wu, Y., Wu, Y.: Graph pattern matching: From intractable to polynomial time. In: VLDB (2010)Google Scholar
  12. 12.
    Gou, G., Chirkova, R.: Efficient algorithms for exact ranked twig-pattern matching over graphs. In: SIGMOD (2008)Google Scholar
  13. 13.
    He, H., Wang, H., Yang, J., Yu, P.S.: BLINKS: ranked keyword searches on graphs. In: SIGMOD (2007)Google Scholar
  14. 14.
    Hristidis, V., Papakonstantinou, Y.: Discover: keyword search in relational databases. In: VLDB (2002)Google Scholar
  15. 15.
    Hwang, H., Hristidis, V., Papakonstantinou, Y.: ObjectRank: a system for authority-based search on databases. In: SIGMOD (2006)Google Scholar
  16. 16.
    Ilyas, F., Aref, G., Elmagarmid, K.: Supporting top-k join queries in relational databases. The VLDB Journal 13(3), 207–221 (2004)CrossRefGoogle Scholar
  17. 17.
    Ilyas, I.F., Beskales, G., Soliman, M.A.: A survey of top-k query processing techniques in relational database systems. ACM Comput. Surv. 40(4), 1–58 (2008)CrossRefGoogle Scholar
  18. 18.
    Kempe, D., Kleinberg, J., Tardos, E.: Maximizing the spread of influence through a social network. In: KDD (2003)Google Scholar
  19. 19.
    Koenig, P.-Y., Zaidi, F., Archambault, D.: Interactive searching and visualization of patterns in attributed graphs. In: Graphics Interface Conference (2010)Google Scholar
  20. 20.
    Liu, F., Yu, C., Meng, W., Chowdhury, A.: Effective keyword search in relational databases. In: SIGMOD (2006)Google Scholar
  21. 21.
    Page, L., Brin, S., Motwani, R., Winograd, T.: The PageRank citation ranking: Bringing order to the web (1998) (submitted for publication)Google Scholar
  22. 22.
    Haichuan, S., Ying, Z., Xuemin, L., Xu, Y.J.: Taming verification hardness: an efficient algorithm for testing subgraph isomorphism. In: VLDB (2008)Google Scholar
  23. 23.
    Shasha, D., Wang, J.T.L., Giugno, R.: Algorithmics and applications of tree and graph searching. In: PODS (2002)Google Scholar
  24. 24.
    Tian, Y., Patel, J.: TALE: A tool for approximate large graph matching. In: ICDE (2008)Google Scholar
  25. 25.
    Ullmann, J.R.: An algorithm for subgraph isomorphism. J. ACM 23(1) (1976)Google Scholar
  26. 26.
    Wang, H., Li, J., Luo, J., Gao, H.: Hash-base subgraph query processing method for graph-structured XML documents. In: VLDB (2008)Google Scholar
  27. 27.
    Wang, X., Lo, D., Cheng, J., Zhang, L., Mei, H., Yu, J.X.: Matching dependence-related queries in the system dependence graph. In: ASE (2010)Google Scholar
  28. 28.
    Williams, D., Huan, J., Wang, W.: Graph database indexing using structured graph decomposition. In: ICDE (2007)Google Scholar
  29. 29.
    Yan, X., Yu, P.S., Han, J.: Graph indexing: a frequent structure-based approach. In: SIGMOD (2004)Google Scholar
  30. 30.
    Yuan, Y., Wang, G., Wang, H., Chen, L.: Efficient subgraph search over large uncertain graphs. In: VLDB (2011)Google Scholar
  31. 31.
    Zhu, F., Qu, Q., Lo, D., Yan, X., Han, J., Yu, P.S.: Mining top-k large structural patterns in a massive network. In: VLDB (2011)Google Scholar
  32. 32.
    Zou, L., Chen, L., Özsu, M.T.: Distance-join: Pattern match query in a large graph database. In: VLDB (2009)Google Scholar
  33. 33.
    Zou, L., Mo, J., Chen, L., Özsu, M.T., Zhao, D.: gstore: Answering sparql queries via subgraph matching. In: VLDB (2011)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2012

Authors and Affiliations

  • Xianggang Zeng
    • 1
  • Jiefeng Cheng
    • 1
  • Jeffrey Xu Yu
    • 2
  • Shengzhong Feng
    • 1
  1. 1.Shenzhen Institutes of Advanced TechnologyChinese Academy of SciencesChina
  2. 2.The Chinese University of Hong KongHong KongChina

Personalised recommendations