<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Answering reachability queries on streaming graphs</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Gulay Unel</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Florian Fischer</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Barry Bishop</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Semantic Technology Institute (STI) Innsbruck, University of Innsbruck</institution>
          ,
          <country country="AT">Austria</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Graph reachability is a fundamental problem in many applications, such as reasoning in lightweight formalisms, geographic navigation, XML/RDF/OWL query processing, etc. Many real world scenarios involve huge graphs and require fast algorithms to test for reachability between nodes. The problem becomes even more challenging when the graph is rapidly changing and received as a real-time stream of nodes and arcs. In this paper we will review current graph reachability algorithms and focus on how they can be adapted to the streaming setting. We will also outline a new algorithm for answering reachability queries on huge, rapidly changing graphs.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 Introduction</title>
      <p>
        The graph reachability problem is defined as: given two vertices u and v on a
directed graph find out whether there is a path from u to v. The problem has been
explored in depth in several research fields [
        <xref ref-type="bibr" rid="ref1 ref2 ref3 ref4 ref5 ref6">1–6</xref>
        ] and becomes more challenging
when the reachability query is performed on rapidly changing graphs.
      </p>
      <p>Some typical applications involve geographic navigation, traffic control, click
streams, etc. The problem is also a fundamental step in many reasoning tasks
based on various logical formalisms such as OWL, WSML, DL. The reason for
this is that for a directed graph its reachability relation is also its transitive
closure, which in turn can be considered a classical example of monotonic reasoning
and used as a building block to facilitate more complex reasoning.</p>
      <p>
        As a more specific use case we can consider Urban Computing [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], which is
the application of pervasive computing to urban environments. The data in this
application can be modeled as streams representing real objects such as cars,
trains, crowds, etc. monitored at given locations. Reasoning on such streams
can be very costly if we consider the amount of dynamically changing data. For
instance, if we want to answer queries such as: list all the cars that traveled
between location a and b and return the results periodically then we need efficient
reachability query answering capabilities on rapidly changing graphs
representing the movement of the traffic. The applicability of the problem is not limited
to these applications since almost any structured data can be represented using
graph structures, e.g. data on the Web, computer networks, ontologies,
physical models, neural networks, etc. Many graph models have edges of a dynamic
nature and these can be represented using streaming graphs.
      </p>
      <p>The outlined recent applications of the problem where large, rapidly changing
graphs are involved rekindled the interest in the graph reachability problem. The
solutions proposed for the problem clearly show the trade-off between time and
space requirements: 1)Additional information about the graph (i.e the transitive
closure) needs to be stored and maintained for fast query answering, 2)The query
time becomes linearly proportional to the size of the graph if no additional
information is kept. In this paper, we will review various graph reachability
algorithms, comment on their applicability to the streaming setting, and outline
a new algorithm designed for rapidly changing graphs.</p>
      <p>The outline of the paper is as follows: in Section 2 we will review the current
graph reachability algorithms and focus on how they can be adapted to the
streaming setting. In Section 3 we will outline a new algorithm for streaming
graph reachability queries. Finally we will present our conclusions and outline
the future work in Section 4.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Overview of the Existing Algorithms</title>
      <p>Given a graph G = (V, E) where V is the set of vertices, E is the set of edges
and |V | = n, |E| = m, there are two naive approaches for answering reachability
queries. One is to use the shortest path algorithm with O(m) query time. Another
naive approach to this problem is to pre-compute reachability between every
pair of vertices in a graph so that reachability queries over this graph can be
answered in constant time and require O(n2) space. As can be seen from their
time and space requirements, these approaches are impractical for large graphs,
even if they are static. If we consider the streaming setting we also need to
consider real-time updates to the graph and the ability to continuously evaluate
a reachability query. The query time of the first approach and update time of the
second approach clearly show the infeasibility of their use for streaming graphs.</p>
      <p>
        Efficient solutions to this problem on large sparse graphs involve reachability
labeling methods. Several approaches have been proposed to encode graph
reachability information using labeling schemes [
        <xref ref-type="bibr" rid="ref1 ref3 ref5 ref6 ref8">1, 3, 5, 8, 6</xref>
        ]. A labeling scheme assigns
labels to vertices of the graph and answers a reachability query over two vertices
by comparing the labels of the vertices. Interval-based labeling is used for tree
structures that can answer reachability queries in constant time. However, the
time complexity of this method is O(m) for graphs. Cohen et al [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] proposed a
2-hop labeling scheme which uses O(nm1/2) storage and O(m1/2) time. Indexing
(labeling) time for this method is O(n4) which is then reduced to O(n3) by the
HOPI algorithm proposed by Schenkel et. Al [
        <xref ref-type="bibr" rid="ref5 ref8">5, 8</xref>
        ]. As it can be seen from the
complexity results it is challenging to adapt these algorithms for streaming huge
graphs. The space requirement of the Interval algorithm is O(n2) and the index
time for HOPI is O(n3) which are quite high for huge graphs especially if they
are rapidly changing.
      </p>
      <p>
        The last method is called dual labeling by Wang et al. [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], which represents a
graph using two components: a spanning tree and a set of t non-tree edges. For
sparse, tree-like graphs, it is assumed that t &lt;&lt; n. The two components together
      </p>
      <p>Shortest Path
Transitive Closure</p>
      <p>Interval
2-Hop
HOPI
Dual-I</p>
      <p>Dual-II
Fluid Path</p>
      <p>O(m)
O(1)</p>
      <p>O(n)
O(m1/2)
O(m1/2)</p>
      <p>O(1)
O(logt)</p>
      <p>O(t)</p>
      <p>0
O(n3)
O(n)
O(n4)</p>
      <p>O(n3)
O(n + m + t3)
O(n + m + t3)
O(n + m + t)</p>
      <p>0
O(n2)</p>
      <p>O(n2)
O(nm1/2)
O(nm1/2)
O(n + t2)
O(n + t2)</p>
      <p>O(n + t)
contain the complete information needed to answer a reachability query over
the original graph. The dual labeling method integrates interval-based labeling,
which encodes reachability in the spanning tree and non-tree labeling to complete
the reachability information of the graph. This method consists of two schemes
Dual-I and Dual-II. The Dual-I scheme has constant query time, whereas it is
O(logt) for Dual-II. Both schemes have O(n + t2) space complexity, however
Dual-II uses less space in practice. These algorithms are more promising for the
streaming graph reachability problem, especially Dual-I with its constant query
time. However the dynamically changing nature of the graph will impose further
requirements on the efficiency of storing this index structure composed of two
components. For each update we need to regenerate the index which is very
costly for huge streaming graphs. Figure 1 summarizes the complexity results
for the methods mentioned in this section and in the next section.
3</p>
    </sec>
    <sec id="sec-3">
      <title>An Algorithm for Reachability on Streaming Graphs</title>
      <p>In this section, we outline an algorithm for answering reachability queries on
rapidly changing graphs which we call ‘fluid path’. Our algorithm uses
intervalbased labeling and is comparable to dual labeling in terms of the trade off
between time and space complexities which depend on the size of the set of non
tree edges in the graph.</p>
      <p>
        The input is a directed graph G = (V, E) where |V | = n, |E| = m. We assume
that G is acyclic and if not it can be transformed to an equivalent acyclic one
in terms of reachability information in O(n + m) time [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. The next step is to
find a spanning tree in the graph and and assign interval-based labels to all
the nodes. The non-tree edges must be detected and added to a set T where
|T | = t. Then we convert the directed graph to a tree with size O(n + t) using
this information, where non-tree edges are converted to tree edges by duplicating
the target node as shown in Figure 2. The interval based label of the duplicate
nodes are inherited from the parent of the duplicate node and the original node.
Hence if there is a non-tree edge (u, v) and v is duplicated to (v, 1) and (v, 2),
where there is an edge (u, (v, 2)) in the tree transformation, then the label of the
node (v, 2) is (l1, l2), where l1 is the label of u and l2 is the label of v. All the
remaining nodes are also assigned a timestamp which is 1, the initial timestamp.
      </p>
      <p>In the streaming setting, we assume that the graph information is received
as this tree transformation since time-based labels can be added to the nodes
as they are received, so a node is a pair (n1, t1) in this case where t1 is the
timestamp assigned to the node.</p>
      <p>The last step of the algorithm is to check whether a node v is reachable from
u in the original graph using the labeling information. For this we need to check
whether (v, 1) is reachable from (u, 1) in the tree transformation. Assume that
the label of (v, 1) is l1 and the label of (u, 1) is l2 then there are two cases.
First if the interval represented by l1 is in the interval represented by l2 then
v is reachable from u and this step takes constant time. Second if the interval
represented by l1 is not in the interval represented by l2 then we also need to
check the other copies of v and determine if a copy of v is reachable from a
duplicated node that is reachable from (u, 1). For instance if the label of (v, 2) is
l3 = (l4, l1) to determine if (v, 2) is reachable from (u, 1) we check if at least one
of the intervals represented by l4 or l1 is in the interval represented by l2 and
return ’reachable’ if so, otherwise we check all the duplicated nodes reachable
from (u, 1) and determine whether a copy of v is reachable from them. Since the
size of the set of the duplicated nodes is O(t), the time complexity of this step
is O(t).
4</p>
    </sec>
    <sec id="sec-4">
      <title>Conclusions and Future Work</title>
      <p>Graph reachability is a well studied problem which has applications in many
fields. The problem attracted more attention with the huge increase in data
where graph structures play an important role in representing the connections
and the dynamic nature of it. In this paper, we reviewed the various graph
reachability algorithms and their applicability for rapidly changing graphs. We
also outlined an algorithm designed exclusively for these types of graphs.</p>
      <p>As future work we plan to extend our survey on the literature, provide a
detailed algorithm and analyze how it performs in real applications that involve
rapidly changing graphs. We also plan to propose methods for a reasoner
component that uses different (and possibly hybrid) reachability algorithms depending
on the structure of the input graph and time/space requirements.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Agrawal</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Borgida</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jagadish</surname>
            ,
            <given-names>H.V.</given-names>
          </string-name>
          :
          <article-title>Efficient management of transitive relationships in large data and knowledge bases</article-title>
          .
          <source>SIGMOD Rec</source>
          .
          <volume>18</volume>
          (
          <issue>2</issue>
          ) (
          <year>1989</year>
          )
          <fpage>253</fpage>
          -
          <lpage>262</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Abiteboul</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kaplan</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Milo</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>Compact labeling schemes for ancestor queries</article-title>
          .
          <source>In: SODA '01: Proceedings of the twelfth annual ACM-SIAM symposium on Discrete algorithms</source>
          , Philadelphia, PA, USA,
          <source>Society for Industrial and Applied Mathematics</source>
          (
          <year>2001</year>
          )
          <fpage>547</fpage>
          -
          <lpage>556</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Cohen</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Halperin</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kaplan</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zwick</surname>
            ,
            <given-names>U.</given-names>
          </string-name>
          :
          <article-title>Reachability and distance queries via 2-hop labels</article-title>
          .
          <source>SIAM J. Comput</source>
          .
          <volume>32</volume>
          (
          <issue>5</issue>
          ) (
          <year>2003</year>
          )
          <fpage>1338</fpage>
          -
          <lpage>1355</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Roditty</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zwick</surname>
            ,
            <given-names>U.</given-names>
          </string-name>
          :
          <article-title>A fully dynamic reachability algorithm for directed graphs with an almost linear update time</article-title>
          .
          <source>In: STOC '04: Proceedings of the thirty-sixth annual ACM symposium on Theory of computing</source>
          , New York, NY, USA, ACM (
          <year>2004</year>
          )
          <fpage>184</fpage>
          -
          <lpage>191</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Schenkel</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Theobald</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Weikum</surname>
          </string-name>
          , G.:
          <article-title>HOPI: An efficient connection index for complex XML document collections</article-title>
          . In Bertino, E.,
          <string-name>
            <surname>Christodoulakis</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Plexousakis</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Christophides</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Koubarakis</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>B</surname>
          </string-name>
          ¨ohm,
          <string-name>
            <given-names>K.</given-names>
            ,
            <surname>Ferrari</surname>
          </string-name>
          , E., eds.:
          <article-title>Advances in database technology</article-title>
          ,
          <source>EDBT 2004 : 9th International Conference on Extending Database Technology. Volume 2992 of Lecture Notes in Computer Science</source>
          .,
          <string-name>
            <surname>Heraklion</surname>
          </string-name>
          , Crete, Greece, Springer (
          <year>2004</year>
          )
          <fpage>237</fpage>
          -
          <lpage>255</lpage>
          Acceptance ratio 1:
          <fpage>7</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Wang</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>He</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Yang</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Yu</surname>
            ,
            <given-names>P.S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Yu</surname>
            ,
            <given-names>J.X.</given-names>
          </string-name>
          :
          <article-title>Dual labeling: answering graph reachability queries in constant time</article-title>
          .
          <source>In: in Proc. 22nd International Conference on Data Engineering</source>
          , IEEE Computer Society (
          <year>2006</year>
          )
          <fpage>75</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Kindberg</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Chalmers</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Paulos</surname>
          </string-name>
          , E.: Guest editors'
          <article-title>introduction: Urban computing</article-title>
          .
          <source>IEEE Pervasive Computing</source>
          <volume>6</volume>
          (
          <issue>3</issue>
          ) (
          <year>2007</year>
          )
          <fpage>18</fpage>
          -
          <lpage>20</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Schenkel</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Theobald</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Weikum</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          :
          <article-title>Efficient creation and incremental maintenance of the hopi index for complex xml document collections</article-title>
          .
          <source>In: ICDE '05: Proceedings of the 21st International Conference on Data Engineering</source>
          , Washington, DC, USA, IEEE Computer Society (
          <year>2005</year>
          )
          <fpage>360</fpage>
          -
          <lpage>371</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Paige</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tarjan</surname>
            ,
            <given-names>R.E.</given-names>
          </string-name>
          :
          <article-title>Three partition refinement algorithms</article-title>
          .
          <source>SIAM J. Comput</source>
          .
          <volume>16</volume>
          (
          <issue>6</issue>
          ) (
          <year>1987</year>
          )
          <fpage>973</fpage>
          -
          <lpage>989</lpage>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>