GRAIL: Scalable Reachability Index for Large Graphs ∗

GRAIL: Scalable Reachability Index for Large Graphs ∗

GRAIL: Scalable Reachability Index for Large Graphs ∗ Hilmi Yıldırım Vineet Chaoji Mohammed J. Zaki Rensselaer Polytechnic Yahoo! Labs Rensselaer Polytechnic Institute Bangalore Institute 110 8th St. India 110 8th St. Troy/NY, USA [email protected] Troy/NY, USA [email protected] [email protected] ABSTRACT It is worth noting at the outset that the problem of reachabil- Given a large directed graph, rapidly answering reachability queries ity on directed graphs can be reduced to reachability on directed acyclic graphs (DAGs). Given a directed graph G, we can obtain between source and target nodes is an important problem. Existing ′ methods for reachability trade-off indexing time and space versus an equivalent DAG G (called the condensation graph of G), in query time performance. However, the biggest limitation of exist- which each node represents a strongly connected component of the ing methods is that they simply do not scale to very large real-world original graph, and each edge represents the fact whether one com- graphs. We present a very simple, but scalable reachability index, ponent can reach another. To answer whether node u can reach v in G, we simply look up their corresponding strongly connected called GRAIL, that is based on the idea of randomized interval la- ′ beling, and that can effectively handle very large graphs. Based on components, Su and Sv, respectively, which are the nodes in G . an extensive set of experiments, we show that while more sophis- If Su = Sv, then by definition u and reach v (and vice-versa). If Su = Sv, then we pose the question whether Su can reach Sv ticated methods work better on small graphs, GRAIL is the only 6 ′ index that can scale to millions of nodes and edges. GRAIL has in G . Thus all reachability queries on the original graph can be linear indexing time and space, and the query time ranges from answered on the DAG. Henceforth, we will assume that all input constant time to being linear in the graph order and size. graphs have been transformed into their corresponding DAGs, and thus we will discuss methods for reachability only on DAGs. 1. INTRODUCTION Full Transitive Closure DFS/BFS Given a directed graph G = (V, E) and two nodes u, v V , a reachability query asks if there exists a path from u to v in∈G. If u can reach v, we denote it as u v, whereas if u cannot reach → v, we denote it as u v. Answering graph reachability queries Construction Time quickly has been the6→ focus of research for over 20 years. Tradi- O(nm) O(1) Query Time tional applications include reasoning about inheritance in class hi- O(1) O(n + m) erarchies, testing concept subsumption in knowledge representa- 2 Index Size tion systems, and checking connections in geographical informa- O(n ) O(1) tion systems. However, interest in the reachability problem re- vived in recent years with the advent of new applications which Figure 1: Tradeoff between Query Time and Index Size have very large graph-structured data that are queried for reach- There are two basic approaches to answer the reachability queries ability excessively. The emerging area of Semantic Web is com- on DAGs, which lie at the two extremes of the index design space, posed of RDF/OWL data which are indeed graphs with rich con- as illustrated in Figure 1. Given a DAG G, with n vertices and tent, and there exist RDF data with millions of nodes and billions m edges, one extreme (shown on left) is to precompute and store of edges. Reachability queries are often necessitated on these data the full transitive closure; this allows one to answer reachability to infer the relationships among the objects. In network biology, queries in constant time by a single lookup, but it unfortunately reachability play a role in querying protein-protein interaction net- requires a quadratic space index, making it practically unfeasible works, metabolic pathways and gene regulatory networks. In gen- for large graphs. On the other extreme (shown on right), one can eral, given the ubiquity of large graphs, there is a crucial need for use a depth-first (DFS) or breadth-first (BFS) traversal of the graph highly scalable indexing schemes. starting from node u, until either the target, v, is reached or it is de- ∗ termined that no such path exists. This approach requires no index, This work was supported in part by NSF Grants EMT-0829835, and CNS-0103708, and NIH Grant 1R01EB0080161-01A1. but requires O(n + m) time for each query, which is unacceptable for large graphs. Existing approaches to graph reachability index- ing lie in-between these two extremes. Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are While there is not yet a single best indexing scheme for DAGs, not made or distributed for profit or commercial advantage and that copies the reachability problem on trees can be solved effectively by in- bear this notice and the full citation on the first page. To copy otherwise, to terval labeling [11], which takes linear time and space for con- republish, to post on servers or to redistribute to lists, requires prior specific structing the index, and provides constant time querying. It labels permission and/or a fee. Articles from this volume were presented at The each node u with a range Lu = [rx,ru], where ru denotes the 36th International Conference on Very Large Data Bases, September 13-17, rank of the node u in a post-order traversal of the tree, where the 2010, Singapore. Proceedings of the VLDB Endowment, Vol. 3, No. 1 ranks are assumed to begin at 1, and all the children of a node are Copyright 2010 VLDB Endowment 2150-8097/10/09... $ 10.00. assumed to be ordered and fixed for that traversal. Further, rx de- 0 [1,10] 0 [1,10] 0 [1,10],[1,10] 1 [1,6] 2 [7,9] 1 [1,6] 2 [1,9] 1 [1,6],[1,9] 2 [1,9],[1,7] 3 [1,4] 4 [5,5] 5 [7,8] 3 [1,4] 4 [1,5] 5 [1,8] 3 [1,4],[1,6] 4 [1,5],[1,8] 5 [1,8],[1,3] 6 [7,7] 7 [1,3] 6 [1,7] 7 [1,3] 6 [1,7],[1,2] 7 [1,3],[1,5] 8 [1,1] 9 [2,2] 8 [1,1] 9 [2,2] 8 [1,1],[1,1] 9 [2,2],[4,4] (a) Tree (b) DAG: Single Interval (c) DAG: Multiple Intervals Figure 2: Interval Labeling: Tree (a) and DAG: Single (b) & Multiple (c) notes the lowest rank for any node x in the subtree rooted at u to O(n+m) (in cases where the search defaults to a DFS). GRAIL (i.e., including u). This approach guarantees that the containment is thus a light-weight index, that scales to very large graphs, due between intervals is equivalent to the reachability relationship be- to its simplicity. Via an extensive set of experiments, we show tween the nodes, since the post-order traversal enters a node before that GRAIL outperforms existing methods on very large real and all of its descendants, and leaves after having visited all of its de- synthetic graphs, sometimes by over an order of magnitude. In scendants. In other words, u v Lv Lu. For example, many cases, GRAIL is the only method that can even run on such Figure 2(a) shows the interval→ labeling⇐⇒ on a⊆ tree, assuming that large graphs. the children are ordered from left to right. It is easy to see that reachability can be answered by interval containment. For exam- 2. RELATED WORK ple, 1 9, since L9 = [2, 2] [1, 6] = L1, but 2 7, since → ⊂ 6→ L7 = [1, 3] [7, 9] = L2. As noted above, existing approaches for graph reachability com- To generalize6⊆ the interval labeling to a DAG, we have to ensure bine aspects of indexing and pure search, trading off index space for that a node is not visited more than once, and a node will keep the querying time. Major approaches include interval labeling, com- post-order rank of its first visit. For example, Figure 2(b) shows an pressed transitive closure, and 2HOP indexing [1, 21, 22, 15, 13, 5, interval labeling on a DAG, assuming a left to right ordering of the 2, 7, 20, 19, 23, 6, 12], which are discussed below, and summarized children. As one can see, interval containment of nodes in a DAG in Table 1. is not exactly equivalent to reachability. For example, 5 4, but 6→ Construction Time Query Time Index Size L4 = [1, 5] [1, 8] = L5. In other words, Lv Lu does not 2 ⊆ ⊆ Opt. Tree Cover [1] O(nm) O(n) O(n ) imply that u v. On the other hand, one can show that Lv → 6⊆ GRIPP [21] O(m + n) O(m n) O(m + n) Lu = u v. 3 − 2 ⇒ 6→ Dual Labeling [22] O(n + m + t ) O(1) O(n + t ) In this paper we present a novel, scalable graph indexing ap- PathTree [15] O(mk) O(mk)/O(mn) O(nk) 4 2HOP [7] O(n ) O(√m) O(n√m) proach for very large graphs, called GRAIL, which stands for Graph 3 Reachability Indexing via RAndomized Interval Labeling. Instead HOPI [20] O(n ) O(√m) O(n√m) GRAIL (this paper) O(d(n + m)) O(d)/O(n + m) O(dn) of using a single interval, GRAIL employs multiple intervals that are obtained via random graph traversals.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    9 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us