Apparatus and method for multi-source graph reachability searching

The MS-RCH method addresses inefficiencies in multi-source reachability querying by sharing computations across queries through intermediate vertex identification and bit operations, enhancing performance on both dense and sparse graphs by reducing redundant calculations and merging traversals, resulting in efficient batch processing of reachability queries.

WO2024175206A1PCT designated stage expired Publication Date: 2024-08-29HUAWEI TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
PCT/EP2023/054715
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-02-24
Publication Date
2024-08-29

AI Technical Summary

Technical Problem

Existing multi-source reachability querying methods are inefficient over sparse data graphs, as they fail to effectively share computations across different query instances, leading to redundant calculations and slower performance compared to single-source BFS algorithms.

Method used

The proposed apparatus and method, Multi-Source Reachability (MS-RCH), share computations by identifying intermediate vertices at different or same depth levels across multiple queries, merging traversals and avoiding redundant calculations by maintaining a status for each vertex using bit operations and a FIFO queue, allowing simultaneous processing of multiple queries.

Benefits of technology

MS-RCH achieves high efficiency by maximizing computation sharing across multiple query instances, improving performance over both dense and sparse graphs by reducing redundant calculations and merging traversals at various depth levels, thus efficiently processing batches of reachability queries.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure EP2023054715_29082024_PF_FP_ABST
    Figure EP2023054715_29082024_PF_FP_ABST
Patent Text Reader

Abstract

An apparatus (700) for performing reachability searching in data graphs comprising one or more processors (701) configured to: receive (601) a graph comprising a plurality of vertices (301-306) and a plurality of edges (307); receive (602) a set of queries each indicating a source vertex from which to perform a reachability search to compute other vertices reachable from the respective source vertex via one or more of the edges; and for a first query indicating a first source vertex, determine (603) a set of vertices reachable from the first source vertex by sharing computation with a second query indicating a second source vertex, wherein the set of vertices comprises an intermediate vertex at a different depth level from the first source vertex than from the second source vertex and the computation shared with the second query comprises computation of one or more vertices that are reachable from the intermediate vertex.
Need to check novelty before this filing date? Find Prior Art

Description

[0001]APPARATUS AND METHOD FOR MULTI-SOURCE GRAPH REACHABILITY SEARCHING FIELD OF THE INVENTION This invention relates to data graphs, in particular to reachability searching in such graphs. BACKGROUND Reachability querying is an important graph search operation which can determine the reachable vertices from a source vertex s over a data graph G. Reachability queries are widely used in many application scenarios for retrieving information from data graphs. For example, as shown in Figs. 1(a)-1(d), reachability searching can be used to identify connected bank accounts for money laundering detection in financial networks, to find interesting places that are reachable from a location in road networks, to test the reachability to some Internet Protocol (IP) destinations from a local host in IP networks, and to check whether some people are connected for crime detection in social networks. In emerging applications, the volumes of the data graphs are typically very large and a large number of reachability queries may come within a very short time frame. Such applications require query engines to answer those reachability queries in a timely manner. For example, it is common for a Location Search or POI (Point of Interest) service system to receive hundreds or thousands of reachability queries from the users in a very short time frame, and it is important for the search engine to rapidly process all of those queries and return the query results to users. Common approaches for answering single reachability queries can generally be classified into two categories. The first is online approaches, in which the Breadth-First-Search (BFS) algorithm is the most commonly used algorithm, which runs in linear time to answer a query. The second is offline approaches that involve a time-consuming pre-processing step to precompute and store the transitive closure of the data graph beforehand, such that it can answer online reachability queries in constant time. The BFS algorithm traverses a data graph G from the source vertex s in rounds. It explores vertices at the present depth level and then moves on to explore the neighbour vertices at the next depth level. In each round, it explores one newly discovered vertex from previous rounds by accessing all their adjacent edges and traversing to their neighbour vertices. This iterative process stops until all vertices reachable from source s have been explored. It can be said that a vertex v is discovered by source s at the i-th (BFS) depth level if v is of distance i (i ≥ 0) from source s (suppose the weight ^(^) of each edge is 1). The BFS method traverses G by visiting vertices one by one, starting from the source s. When it visits a vertex v, it decides whether v is discovered or explored. A vertex v is marked as discovered if it has been visited. If not only v but also all of its neighbours in G are visited, then v is marked as explored. The process uses a set called status to record all vertices that have already been discovered, and uses ^, a First-in-First-Out (FIFO) queue to maintain vertices yet to be explored. Initially, status and ^ include only the source s, respectively. By iterating over ^, vertices in ^ are explored to find new reachable vertices. In each round, it pops out a vertex u from ^ for exploration by traversing to each of its neighbour vertex v, checking whether v has not been discovered, i.e., ^ ∉ ^^^^^^; and if so, it marks ^ as discovered by adding ^ to status, and adds ^ to ^. This iterative process stops until all vertices reachable from source s have been explored. BFS can be used for answering a batch of multiple reachability queries by iteratively calling the BFS algorithm to process those queries one-by-one independently. However, this is expensive when the data graphs are very large. The Multi-Source BFS (MS-BFS) algorithm can be used for answering a batch of multiple reachability queries altogether over the same data graph in one shot and sharing common computations across different query instances whenever possible, to improve efficiency. It is based on the observation that multiple BFS traversals from close source vertices are likely to have a large overlap of what vertices they are exploring at a single depth level. MS-BFS therefore identifies these overlaps and aligns traversals from multiple sources to share the visit to the overlapped vertices, therefore improving efficiency by sharing common computations. As described in “The more the merrier: Efficient multi-source graph traversal”, Proceedings of the VLDB Endowment 2014, Volume 8, Issue 4, Pages 449-460, this method takes as input a set of source vertices ^^, … , ^^and outputs the query answers for each source vertex ^^(^ ∈ [1, ^]) over data graph G in one go. More specifically, similar to BFS, MS-BFS traverses data graphs in rounds. It starts traversal from all source vertices simultaneously, and merges traversals when some of them reach to the same neighbour vertex at the same depth level. It explores vertices at the present depth level and then moves on to explore the (merged) neighbour vertices at the next depth level. This iterative process stops until all vertices reachable from source ^^(^ ∈ [1, ^]) have been explored. MS-BFS is efficient over dense data graphs, i.e., graphs with small diameter and large vertex degrees. It is faster than the one-by-one BFS algorithm over dense graphs such as social networks. However, MS-BFS is generally inefficient over sparse data graphs, i.e., graphs with large diameter and small vertex degrees and is slower than the one-by-one BFS algorithm over sparse graphs, such as road networks. It is desirable to develop an approach for multi-source reachability querying that overcomes at least some of the above issues. SUMMARY OF THE INVENTION According to a first aspect, there is provided an apparatus for performing reachability searching in data graphs, the apparatus comprising one or more processors configured to: receive a data graph comprising a plurality of vertices and a plurality of edges; receive a set of queries, each query indicating a respective source vertex of the plurality of vertices from which to perform a reachability search to compute other vertices of the plurality of vertices that are reachable from the respective source vertex via one or more of the plurality of edges; and for a first query indicating a first source vertex, determine a set of vertices of the plurality of vertices that are reachable from the first source vertex by sharing computation with a second query indicating a second source vertex, wherein the set of vertices comprises an intermediate vertex that is at a different depth level from the first source vertex than from the second source vertex and wherein the computation shared with the second query comprises computation of one or more vertices that are reachable from the intermediate vertex. This may provide an approach for answering multiple reachability queries that is efficient over both dense and sparse data graphs, achieving high efficiency by maximizing common computation sharing across multiple query instances. The computation shared with the second query may comprise computation relating to the discovery of the one or more vertices that are reachable from the intermediate vertex. A vertex is discovered when it is visited on a traversal of the graph. Computation can therefore be shared for queries that discover the intermediate vertex from their respective source vertices. The one or more processors may be configured to run the first query and the second query simultaneously. The one or more processors may be configured to run one or more other additional queries simultaneously with the first query and the second query. The approach may therefore process multiple reachability queries in one shot. As the computation shared with the second query may comprise computation of one or more vertices that are reachable from the intermediate vertex, this approach may therefore share common sub-traversal computation between multiple query instances. This can improve efficiency. The intermediate vertex may be between the first source vertex and an end vertex of the plurality of vertices on a traversal path between the first source vertex and the end vertex. This may allow common sub-traversals from the intermediate vertex to be identified. The set of vertices may further comprise the one or more vertices that are reachable from the intermediate vertex. This may avoid these vertices being computed multiple times for different query instances where the intermediate vertex is a common vertex in the set of vertices reachable from each of multiple source nodes. The intermediate vertex may be reachable from the second source vertex. The intermediate vertex may be between the second source vertex and the end vertex on a traversal path between the second source vertex and the end vertex. The approach may therefore share computation for queries having common paths to avoid duplication. The one or more processors may be configured to maintain a respective status for each of the plurality of vertices of the graph, the respective status indicating those queries that have determined a respective vertex as being reachable from the respective source vertex of those queries. This may allow the one or more processors to determine which vertices have been discovered and which queries can benefit from computation sharing. The one or more processors may be configured to indicate each status using one or more bits. The bit values may be 1 or 0. This may improve efficiency. The one or more processors may be configured to perform an iterative process comprising multiple rounds. In each round, one vertex of the plurality of vertices of the graph is explored to determine which queries have determined the neighbour vertices of that one vertex as being reachable from its respective source vertex. This may allow the one or more processors to determine whether computation can be shared between queries. The vertex to be explored in each round may be output from a queue. For example, it may be output from a first-in-first out (FIFO) queue. The queue may alternatively be in the form of a list or an array. In some implementations, the queue may be in the form of a bool array. This may allow vertices to be explored to be organized efficiently. The set of queries may comprise a third query indicating a third source vertex. The set of vertices may be determined by sharing computation with the third query, wherein the set of vertices comprises a second intermediate vertex that is at a same depth level from the first source vertex than from the third source vertex. The second intermediate vertex may be on respective traversal paths between the first and third source vertices and the end vertex. The present approach can therefore share computation between queries where the intermediate vertex is at a different depth and / or the same depth from the respective source vertices of the queries. The plurality of edges may be directed or undirected edges. The present approach is therefore suitable for use in a variety of graph types and applications. The apparatus may be further configured to output the set of vertices for processing in an application, wherein the application is a social network, a road network or an Internet Protocol network. The approach may also be used in any other application where graph data is processed. The present approach is therefore highly versatile. According to a second aspect, there is provided a computer-implemented method for performing reachability searching in data graphs, the method comprising: receiving a data graph comprising a plurality of vertices and a plurality of edges; receiving a set of queries, each query indicating a respective source vertex of the plurality of vertices from which to perform a reachability search to compute other vertices of the plurality of vertices that are reachable from the respective source vertex via one or more of the plurality of edges; and for a first query indicating a first source vertex, determining a set of vertices of the plurality of vertices that are reachable from the first source vertex by sharing computation with a second query indicating a second source vertex, wherein the set of vertices comprises an intermediate vertex that is at a different depth level from the first source vertex than the from second source vertex and wherein the computation shared with the second query comprises computation of one or more vertices that are reachable from the intermediate vertex. The method may provide an approach for answering multiple reachability queries that is efficient over both dense and sparse data graphs, achieving high efficiency by maximizing common computation sharing across multiple query instances. Advantageously, the graph may be a sparse graph. For example, the graph may have an average vertex degree of less than 3. The method may be also used on dense graphs. Therefore, unlike prior methods, the present approach may perform well for both sparse and dense data graphs. According to a further aspect, there is provided a computer program comprising instructions that when executed by a computer cause the computer to perform the method above. According to a further aspect, there is provided a computer-readable storage medium having stored thereon computer readable instructions that when executed at a computer (for example, comprising one or more processors) cause the computer to perform the method above. The computer-readable storage medium may be a non-transitory computer-readable storage medium. The computer may be implemented as a system of interconnected devices. BRIEF DESCRIPTION OF THE FIGURES The present invention will now be described by way of example with reference to the accompanying drawings. In the drawings: Figs.1(a)-(d) show examples of applications of reachability querying. Fig.2 illustrates an exemplary algorithm for multi-source reachability querying. Fig.3(a) shows a data graph ^. Fig.3(b) shows reachability queries to be run for graph ^ in Fig.3(a). Fig.3(c) depicts the traversal trace of the multi-source reachability search method described herein for the reachability queries of Fig.3(b). Fig.4 illustrates an exemplary algorithm for multi-source reachability querying using bit operations. Fig.5 shows the traversal trace of the algorithm when implementing status using bit operations. Fig.6 shows a flowchart illustrating the steps of an example of a method of performing reachability searching in data graphs. Fig.7 shows an example of an apparatus for performing reachability searching in data graphs and some of its associated components. DETAILED DESCRIPTION A data graph can be generally denoted by G (V, E, ^), where V is a set of vertices, E ⊆ ^ × ^ is a set of edges of G, ^: E → ℝ is a function that assigns each edge ^ ∈ E a weight ^(^). In addition, vertices and edges of G may also carry one or more labels. It may be assumed that there is an iterator that, given a vertex ^ ∈ V, returns all neighbours of ^ in G in some deterministic order, in ^(^^^(^))-time, where ^^^(^) is the degree of ^ when G is undirected or out-degree when G is directed. That is, when G is directed and given a directed edge (u, v) in G, one can traverse only from u to v. When G is undirected and given an undirected edge (u, v) in G, one can traverse both from u to v and v to u. Given a data graph G = (V, E) and a source vertex s in G, a reachability query is to find a vertex set containing all vertices v such that there is a path in G from s to v. In some embodiments, this may be a directed path, i.e. the edges are directed edges. In other embodiments, the edges may not be directed. Without loss of generality, it is assumed that G is directed in the following embodiments. However, the method also works on undirected graphs, by treating each undirected edge (u, v) as a pair of directed edges (u, v) and (v, u). For a given query, the set of vertices that can be reached from the respective source node for that query are therefore computed. Described herein is a Multi-Source Reachability method (referred to herein as MS-RCH) for answering multiple reachability queries simultaneously that is efficient over both dense and sparse data graphs, achieving high efficiency by enabling a higher degree of common computation sharing, both at the same and between different depth levels from different source vertices. As a result, the MS-RCH method can provide improved performance over both sparse and dense graphs. In contrast to the former approaches described above, MS-RCH enables higher degree of computation sharing by sharing visits to vertices both at the same depth level and between different depth levels from different sources. That is, assume an intermediate vertex v is discovered by a BFS traversal from ^^at the i-th depth level, and by another BFS traversal from ^^at the j-th depth level (1 ≤ ^, ^ ≤ ^; ^, ^ ≥ 0). MS-RCH can merge the two traversals of the graph at the intermediate vertex v and therefore share the common sub-traversal from v, either when v is at the same (i.e. i=j) or a different (i.e. i≠j) depth level from ^^and ^^. The respective sets of vertices reachable from ^^and ^^both comprise the one or more vertices reachable from the intermediate vertex v. An example of an MS-RCH algorithm that can be implemented by a processor is shown as Algorithm 1 in Fig.2. This algorithm takes as input a data graph G, a set of k source vertices ^ = {^^, … , ^^}, and a set of k reachability query identifiers ℝ = {^^, … , ^^}, where each ^^in ^ corresponds to a reachability query (identifier) ^^in ℝ ( ^ ∈ [1, ^]) . Differently from the textbook BFS algorithm that marks discovered vertices with a single set status for maintaining discovered vertices, MS-RCH uses a set status(v) for each vertex v, for maintaining queries that have already discovered vertex v. MS-RCH maintains vertices yet to be explored with a FIFO queue ^. MS-RCH initially marks the source vertex ^^of each reachability query ^^ discovered (which means that the traversal has already visited the vertex) by adding the query identifier ^^of ^^to status(^^) and also adds source ^^to ^, to indicate which vertices need to be explored (which means that not only the vertex but also its adjacent edges and neighbour vertices have been visited) in the following process (lines 2-4). After the initialization step, MS-RCH iteratively pops out vertices from ^ for exploration (lines 5-12). In each round, it pops out one vertex u from ^ (line 6) and explores u by traversing to each of its neighbour vertex v for discovering new reachable vertices that are to be explored in future rounds (lines 7-12). It uses a query identifier set ℕ for storing the queries that have discovered u in previous rounds but not discovered v yet in the current round (line 8). If ℕ is not empty, there is at least one reachability query that discovers v in the current round (line 9). MS-RCH then marks v as discovered by adding all query identifiers in ℕ to status(v) (line 10), and adds v to ^ if v is not in ^ (lines 11- 12). Note that this is different from the single-source BFS that if a vertex is not discovered, then it must not exist in ^. Here for the multi-source reachability, v may already exist in ^ as it may be added to ^ by other traversals ℕ′ from parent vertex ^′ in previous rounds. Therefore, throughout the process in which a vertex v exists in ^, status(v) is updated by taking the union of all the traversals that discover v from its parent vertices. It at last returns status(v) for each v as the final answers, where status(v) contains the set of reachability queries ^^in ℝ that can reach v from source ^^(line 13). The computation / visits may be shared as follows. The method explores u by visiting each of its adjacent edges (u, v) and neighbour vertices v only once for all ^^in ℕ, and in the future round when v is popped out for exploration, each vertex v will be explored only once for those reachability queries. In this way, redundant computation is avoided and efficiency is therefore improved. Traversals can be merged at an intermediate vertex that is at different BFS depth levels from sources. This can be achieved with ^ and status(v). Specifically, only one vertex is explored in each round, and vertices to be explored are organized and explored in a FIFO (first- in-first-out) order according to when they are discovered and added to ^ . In this way, throughout the process when a vertex v exists in ^, status(v) accumulates all the traversals that discover v from its parent vertices, and the parents can be at different BFS depth levels from the sources, such that v can merge traversals at different traversal paces. Therefore, the method computes the result of each query instance, whilst running multiple queries simultaneously, and outputs the results of each query. Computation is shared between multiple queries to avoid redundant calculation for sub-traversals of multiple queries where the reachable vertices are common between the multiple queries. In one example, consider data graph ^ 300 in Fig. 3(a). Graph ^ 300 comprises vertices ^0 – ^5, shown at 301-306 respectively. In this example, the vertices 301-306 are connected by directed edges, one of which is shown at 307 connecting vertices 305 and 306. A set of reachability queries (namely, ^^, ^^, ^^with source vertices ^^, ^^, ^^in graph G) are shown in Fig.3(b). The previous one-by-one BFS approach accesses eleven edges in total for processing the three queries one-by-one independently. The traversal trace of MS-RCH over ^ is depicted in Fig. 3(c), via runtime status of (i) status, recording the discovered status of vertices for corresponding queries, (ii) ^, maintaining the vertices to be explored in which the “top” vertex to be explored in the next round is marked in a square, (iii) edges accessed in the round, and (iv) ℕ, maintaining queries that have discovered u in previous rounds but not discovered v yet in the current round upon accessing an edge (u, v). MS-RCH accesses six edges in total for sources ^0, ^1 and ^3. In this example, at the beginning, all status sets are initialized to empty except that ^0, ^1and ^3are discovered by ^^, ^^and ^^, respectively (empty ones are omitted in Fig. 3(c)). ^ is initialized to contain all sources and the “top” vertex ^0to be explored in the first round is marked in a square. In the first round, MS-RCH pops ^0 out of ^ for exploration. It accesses each of its adjacent edges, i.e., (^^, ^^) and (^^, ^^), and traverses to each of its neighbours ^1 and ^2, resulting in ℕ^={^^} and ℕ^={^^} (line 8 of Algorithm 1), respectively. It then updates status(^^) and status(^^) (line 10 of Algorithm 1), and appends ^^at the end of ^ since ^^is already in ^ (lines 11-12 of Algorithm 1). The state of status and ^ at the end of the first round is shown in Fig.3(c) Round 1. In the second round, it pops out ^1, accesses edge (^^, ^^) which reaches ^^and produces ℕ^={^^,, ^^}. That is, ^^is explored only once for ^^and ^^, and (^^, ^^) is accessed only once and ^^is discovered simultaneously by both ^^and ^^, avoiding one redundant edge access. Similarly, (^^, ^^) is accessed only once for all three queries in round 3, and (^^, ^^) is accessed only once for all three queries in round 5, while they are accessed three times by one-by-one BFS. In Fig.3(c), Round 5 shows the state at the end of the fifth round, and in the sixth round, MS-RCH pops out ^^for all three queries and finds no adjacent edges, so status is not changed and no vertices are added to ^. Since there are no vertices in ^ at this point, the process finishes and the answers of the queries can be output by the processor(s). A respective status is therefore maintained for each of the plurality of vertices of the graph which indicates those queries that have determined a respective vertex as being reachable from the respective source vertex of those queries. This approach can not only merge traversals at vertices that are at the same depth level from respective source vertices, but can also align traversals, and thus share computation, at vertices across different BFS depth levels. For example, ^^is at the second BFS depth level of query ^^ with source ^^, the first depth level of query ^^with source ^^, and the zeroth depth level of query ^^with source ^^. Therefore, the depth level of a vertex from the source vertex for a particular query instance corresponds to the number of edges traversed from the source vertex to reach that vertex, when performing a standard BFS traversal. Each vertex of the set of vertices reachable from a source vertex therefore has a respective depth level from the source vertex. In this example, the traversals are merged for all three queries at the intermediate vertex ^^at the end of round 2, as shown in Fig.3(c). When some traversals are merged at a vertex v, and once v is popped out for exploration in the following rounds, this approach can benefit from common computation sharing by exploring v only once for multiple queries. This can enable more shared accesses to edges and vertices across the sources when multiple queries are run simultaneously. The intermediate vertex from which the computation is shared for two or more queries is between a first source vertex and an end vertex on a traversal path between the first source vertex and the end vertex. The intermediate vertex is also between a second source vertex and the end vertex on a traversal path between the second source vertex and the end vertex. The intermediate vertex may also be part of a traversal path between one or more other source vertices and the end vertex. Computation can also be shared with the queries having these other source vertices. Some specific embodiments of the use of the above approach will now be described. A first embodiment is now described to show an implementation of the status. For illustrative purposes, Algorithm 1 shown in Fig.2 represents status(v) as a set. However, in practice, it may be less efficient to implement status(v) as a set, because the set union and set difference operations on status(v) are expensive. To make the process more practical, status(v) may be implemented as a bit array of size k, where k is the number of reachability queries, such that the ^^-th bit in status(v) is 1 if and only if query ^^from source ^^has discovered v. An advantage of using bit arrays is that the multi-source computation logics can be implemented as bitwise operations instead of set operations. That is, bitwise OR operations can be used instead of set unions, and bitwise ANDNOT operations can be used instead of set differences. A bit array containing all zeros can be denoted as 0^, and a bit array with only the ^^-th bit set to 1 can be denoted as 1 << ^^. status for all vertices from G can be stored as a |V|-size array of bit arrays, with status[v] representing the bit array for vertex v. Therefore, the algorithm can implement status as an array of bit arrays and uses bitwise operations, as shown in Algorithm 2 in Fig. 4. The workflow of Algorithm 2 is generally the same as Algorithm 1, except that the data structure (sets) and associated set operations for status in line 3, 8, 9 and 10 in Algorithm 1 are replaced with bit arrays and associated bitwise operations as shown in Algorithm 2. Fig.5 illustrates the example presented in Figs.3(a)-3(c) using an array of bit arrays for status. Each row of status, when viewed as a matrix, records the status of a vertex in a bit array. Each column of status corresponds to a reachability query. Each bit value is either 1, shown as the symbol ‘X’, or is 0. In particular, when a bit value is set to 1 in the current round, it is highlighted with a shaded square. In this example, at the beginning, all bits in status are initialized to 0 except that status[^0], status[^1] and status[^3] have a bit array of value 100, 010 and 001, since ^0, ^1 and ^3 are discovered by ^^, respectively. In the first round, ^0 is popped out for exploration for ^^(i.e., status[^0] is 100), leading to the discovery of its neighbours ^^by ^^. In addition, ^1 itself is a source vertex for ^^. Therefore, status[^1] and status[^2] have a bit array of value 110 and 100, indicating that query ^^ discovered ^1 and query ^^has discovered ^2, respectively. In the second round, vertex ^1is explored only once for both ^^and ^^(i.e., status[^1] is 110), such that its neighbour ^3is discovered for both ^^and ^^. In addition, since ^3itself is a source vertex for ^^, status[^3] has a bit array of value 111 at the end of round 2. That is, ^3merges the traversals for all three queries. Afterwards, ^3and ^4(status[^3]= status[^4]=111) are explored once for all three queries in round 3 and 5, respectively. Since there are no adjacent edges of ^^when it is popped out for exploration in the sixth round, so status is not changed. There are no vertices in ^ after ^^is popped out, the algorithm finishes. The approach described herein can be used to run any number of reachability queries by using a bit array of any size. However, it can leverage efficient native machine instructions for implementing bit operations when k is a multiple of the register and instruction width of the CPU used. For example, for Intel CPUs with the AVX-512 extension which support instructions and registers with a width of up to 512 bits, this approach can efficiently process a batch of 512 reachability queries in one shot. Another embodiment will now be described to show the implementation of queue ^. The FIFO queue ^ may be implemented as a list, as in the first embodiment. It appends the vertex at the end of the list when adding a newly discovered vertex to ^ and pops out the first vertex from the list for exploration at the beginning of each round. The queue may also be implemented as a bool array of size |V| for dense graphs (pseudocode omitted). All items in the array are initialized to False. When adding a newly discovered vertex, it sets the corresponding item in the array to Ture. The method loops through the bool array to find the next vertex to be explored with the corresponding item in the array set to True. Note that it can loop through the array many rounds during the whole traversal process, and the method finishes when it finds no items in the array are set to True in the last round. This implementation can improve the efficiency of the process for dense graphs, since it can reduce the overhead of frequently inserting vertices into and popping vertices out of ^ when ^ is implemented as a list. Generally, Fig. 6 shows an example of a computer-implemented method 600 for performing reachability searching for a data graph in accordance with embodiments described herein. At step 601, the method comprises receiving a data graph comprising a plurality of vertices and a plurality of edges. At step 602, the method comprises receiving a set of queries, each query indicating a respective source vertex of the plurality of vertices from which to perform a reachability search to compute other vertices of the plurality of vertices that are reachable from the respective source vertex via one or more of the plurality of edges. At step 603, the method comprises, for a first query indicating a first source vertex, determining a set of vertices of the plurality of vertices that are reachable from the first source vertex by sharing computation with a second query indicating a second source vertex, wherein the set of vertices comprises an intermediate vertex that is at a different depth level from the first source vertex than from the second source vertex and the computation shared with the second query comprises computation of one or more vertices that are reachable from the intermediate vertex. Suitably, the method can run the first query and the second query (and additional queries) simultaneously. The intermediate vertex is reachable from the second source vertex for the second query and the computation shared with the second query comprises computation of one or more vertices that are reachable from the intermediate vertex, such that the set of vertices further comprises the one or more vertices that are reachable from the intermediate vertex. Fig. 7 is a schematic representation of an apparatus 700 configured to implement the system described above and to perform the methods described herein. The apparatus 700 may be part of a computing device, such as a laptop, tablet, smart phone or TV. The apparatus 700 comprises a processor 701. For example, the processor 701 may be implemented as a computer program running on a programmable device such as a Central Processing Unit (CPU). The apparatus 700 also comprises a memory 702 which is arranged to communicate with the processor 701. Memory 702 may be a non-volatile memory. The processor 701 may also comprise a cache (not shown in Fig. 7), which may be used to temporarily store data from memory 702. The system may comprise more than one processor and more than one memory. The memory may store data that is executable by the processor. The processor may be configured to operate in accordance with a computer program stored in non-transitory form on a machine-readable storage medium. The computer program may store instructions for causing the processor to perform its methods in the manner described herein. The approach described herein allows for fast answering of a batch of multiple reachability queries over the same data graph, which is important for emerging applications such as money laundering detection over financial networks, and route planning over road networks. The capability of carrying out reachability computation efficiently is critical to multiple applications which process data as graphs and employ reachability queries. Multi-source reachability is particularly key to large-scale service providers that deal with large volume of graph queries over huge data graphs. Indeed, since the data graphs in emerging applications like above are typically very huge, and the applications also require answering reachability queries over those huge graphs in a timely manner. For example, it is common for a Location Search or POI service system to receive hundreds or thousands of reachability queries from the users in a very short time frame, and it is important for the search engine to fast process those batches of queries and return query results to users. Reachability queries may be used, for example, to identify connected bank accounts for money laundering detection over financial transaction networks; to find places that are reachable from a location over road networks; to test the reachability to some Internet Protocol (IP) destinations from the local host over IP networks; and to check whether some people are connected for crime detection over social networks. These applications which rely on reachability queries can easily benefit from the approach described herein to improve the efficiency for processing batches of reachability queries coming within in a short time frame. As mentioned above, currently, a common way for a query engine to answer them is to iteratively call the single-source BFS algorithm to process the queries one-by-one independently. However, this can be costly over large data graphs. Since multiple queries may visit the same vertices multiple times during the traversal, and it does not explore any computation sharing when processing those queries one-by-one independently, leading to lots of redundant computation. Prior approaches such as MS-BFS that answer multiple reachability queries for the same data graph in one shot are efficient over dense data graphs but inefficient over sparse data graphs. This is because MS-BFS misses lots of common computation sharing opportunities during the traversal when answering multiple reachability queries, and this phenomenon is more obvious over sparse graphs, when the chances of computation sharing is inherently lower than over dense graphs. Using the MS-RCH approach described herein, multiple query instances for the same data graph can be processed in one go (i.e. one shot), and common sub-traversal computation can be shared across multiple query instances, avoiding any redundant computation and therefore achieving high efficiency by exploring common computation sharing across multiple query instances. This MS-RCH approach achieves high efficiency by maximizing common computation sharing across multiple query instances, i.e., merging traversals at vertices that are both at the same depth level and between different depth levels from sources, thus allowing to answer a batch of reachability queries efficiently over not only dense graphs but also sparse graphs over which it is inherently difficult for exploring computation sharing. The applicant hereby discloses in isolation each individual feature described herein and any combination of two or more such features, to the extent that such features or combinations are capable of being carried out based on the present specification as a whole in the light of the common general knowledge of a person skilled in the art, irrespective of whether such features or combinations of features solve any problems disclosed herein, and without limitation to the scope of the claims. The applicant indicates that aspects of the present invention may consist of any such individual feature or combination of features. In view of the foregoing description it will be evident to a person skilled in the art that various modifications may be made within the scope of the invention.

Claims

CLAIMS 1. An apparatus (700) for performing reachability searching in data graphs, the apparatus comprising one or more processors (701) configured to: receive (601) a data graph (300) comprising a plurality of vertices (301, 302, 303, 304, 305, 306) and a plurality of edges (307); receive (602) a set of queries, each query indicating a respective source vertex of the plurality of vertices from which to perform a reachability search to compute other vertices of the plurality of vertices that are reachable from the respective source vertex via one or more of the plurality of edges; and for a first query indicating a first source vertex, determine (603) a set of vertices of the plurality of vertices that are reachable from the first source vertex by sharing computation with a second query indicating a second source vertex, wherein the set of vertices comprises an intermediate vertex that is at a different depth level from the first source vertex than from the second source vertex and the computation shared with the second query comprises computation of one or more vertices that are reachable from the intermediate vertex.

2. The apparatus (700) as claimed in any preceding claim, wherein the one or more processors are configured to run the first query and the second query simultaneously.

3. The apparatus (700) as claimed in any preceding claim, wherein the intermediate vertex is between the first source vertex and an end vertex of the plurality of vertices on a traversal path between the first source vertex and the end vertex.

4. The apparatus (700) as claimed in any of claims 1 to 3, wherein the set of vertices further comprises the one or more vertices that are reachable from the intermediate vertex.

5. The apparatus (700) as claimed in any preceding claim, wherein the intermediate vertex is reachable from the second source vertex.

6. The apparatus (700) as claimed in any preceding claim, wherein the one or more processors are configured to maintain a respective status for each of the plurality of vertices of the graph,the respective status indicating those queries that have determined a respective vertex as being reachable from the respective source vertex of those queries.

7. The apparatus (700) as claimed in claim 6, wherein the one or more processors are configured to indicate each status using one or more bits.

8. The apparatus (700) as claimed in any preceding claim, wherein the one or more processors are configured to perform an iterative process comprising multiple rounds, wherein in each round, one vertex of the plurality of vertices of the graph is explored to determine which queries have determined the neighbour vertices of that one vertex as being reachable from its respective source vertex.

9. The apparatus (700) as claimed in claim 8, wherein the vertex to be explored in each round is output from a queue.

10. The apparatus (700) as claimed in claim 9, wherein the queue is in the form of a list or an array.

11. The apparatus (700) as claimed in any preceding claim, wherein the set of queries comprises a third query indicating a third source vertex and wherein the set of vertices is determined by sharing computation with the third query, wherein the set of vertices comprises a second intermediate vertex that is at a same depth level from the first source vertex than from the third source vertex.

12. The apparatus (700) as claimed in any preceding claim, wherein the plurality of edges are directed or undirected edges.

13. The apparatus (700) as claimed in any preceding claim, wherein the apparatus is further configured to output the set of vertices for processing in an application, wherein the application is a social network, a road network or an Internet Protocol network.

14. A computer-implemented method (600) for performing reachability searching in data graphs, the method comprising:receiving (601) a data graph (300) comprising a plurality of vertices (301, 302, 303, 304, 305, 306) and a plurality of edges (307); receiving (602) a set of queries, each query indicating a respective source vertex of the plurality of vertices from which to perform a reachability search to compute other vertices of the plurality of vertices that are reachable from the respective source vertex via one or more of the plurality of edges; and for a first query indicating a first source vertex, determining (603) a set of vertices of the plurality of vertices that are reachable from the first source vertex by sharing computation with a second query indicating a second source vertex, wherein the set of vertices comprises an intermediate vertex that is at a different depth level from the first source vertex than the from second source vertex and the computation shared with the second query comprises computation of one or more vertices that are reachable from the intermediate vertex.

15. A computer-readable storage medium (702) having stored thereon computer readable instructions that when executed by a computer cause the computer to perform the method (600) of claim 14.

Citation Information

Patent Citations

  • System for handling concurrent property graph queries

    US20210004374A1