Apparatus and method for forming single-instance and multi-instance graph traversal models
Patent Information
- Application Number
- EP2023711709
- Authority / Receiving Office
- EP · EP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-03-14
- Publication Date
- 2026-01-07
AI Technical Summary
Current graph traversal methods, particularly for multi-instance processing, are inefficient due to redundant computations and limited expressiveness, with one-off algorithms being specific and general-purpose frameworks being less efficient and unable to support complex algorithms.
The apparatus and method form an operation-specific traversal model for data graphs by receiving query instances, vertex ranks, frontier width, and edge functions to determine indices for vertices, forming ranked frontiers, and defining traversal orders, enabling efficient multi-instance processing and computation sharing.
This approach improves efficiency in generating graph traversal models, allowing for simultaneous evaluation of multiple query instances with reduced redundant computations and increased expressiveness, supporting a wide range of graph traversal algorithms.
Smart Images

Figure EP2023056414_19092024_PF_FP_ABST
Abstract
Description
[0001]APPARATUS AND METHOD FOR FORMING SINGLE-INSTANCE AND MULTI- INSTANCE GRAPH TRAVERSAL MODELS TECHNICAL FIELD This present disclosure relates to data graphs, in particular to forming traversal models for such graphs. BACKGROUND Graph traversal queries are widely used in many application scenarios for retrieving information from data graphs. For example, as shown in Figs.1(a)-1(e) respectively, they are extensively used to study the protein-protein interactions in molecular biology networks, to test the reachability of some IP destinations from the local host in IP networks, to find shortest paths to some interesting places from a location in road networks, to check whether some people are connected in social networks and to identify connected bank accounts for money laundering detection in financial transaction networks. In particular, multi-instance processing (MIP) over graphs is of increasing importance due to its applications over large graphs in, for example, applications including social network analysis, bioinformatics, web search and route planning. Specifically, MIP refers to the evaluation of multiple instances of the same graph query over the same data graph but with different source vertices as the input. For example, in road planning it is common to receive shortest path queries from hundreds of vertices at the same time, and it is also routine to compute the distances from hundreds of landmark vertices to accelerate large volumes of path queries, and similarly for graph search, personalized PageRank, and other graph queries. There are currently two main approaches to MIP. The first is forming highly optimized one-off MIP algorithms that compute answers to all sources simultaneously, by aligning and sharing computations among the sources. As such, one-off MIP algorithms are efficient as they avoid many redundant computations. One-off algorithms are often efficient but are tightly coupled to the specific computation they target. They are typically crafted for a specific graph computation and implement heavy optimizations and heuristics to explore computation sharing across sources. The other approach is to employ general-purpose parallel graph frameworks to run query instances one-by-one independently. They can express common graph computing algorithms such as Breadth-First-Search (BFS), Bellman-Ford and PageRank, as long as users follow the programming model of the framework to input some simple code into the user interface. However, general-purpose graph frameworks tend to be less efficient than one-off MIP algorithms because they process a batch of query instances one-by-one independently, and do not explore computation sharing across the query instances. Besides, the existing general- purpose frameworks tend to be not so “general” and generally only express a sub-group of graph traversal algorithms with simple workflow, such as BFS, Bellman-Ford, and Personalized PageRank. They are generally not able to support more complicated algorithms such as Dijkstra’s algorithm. It is desirable to develop an approach for single-instance and multi-instance processing that can overcome at least some of the above issues. SUMMARY According to a first aspect, there is provided an apparatus for forming an operation-specific traversal model for a data graph, the apparatus comprising one or more processors configured to: receive an indication of the data graph, the graph comprising a plurality of vertices and a plurality of edges; receive a set of query instances, each query instance relating to a same type of graph operation as the other queries in the set and having a different source vertex of the plurality of vertices to each of the other queries in the set; receive a set of vertex ranks for each query instance, each set of vertex ranks comprising a respective vertex rank for each of the plurality of vertices of the data graph; receive a frontier width and a frontier structure; receive an edge function defining an operation to be performed on a respective value of a respective edge connecting two neighbouring vertices of the data graph and the respective values of each of the two neighbouring vertices; form a set of frontiers for the data graph by traversing one or more of the vertices of the data graph from each source vertex and determining one or more indices for each of the traversed vertices in dependence on the sets of vertex ranks and the frontier width, each frontier comprising one or more vertices having a respective vertex rank falling within a same frontier domain range; form a set of ranked frontiers in dependence on the formed set of frontiers and the frontier structure; and form the operation- specific traversal model in dependence on the set of ranked frontiers, the operation-specific traversal model defining an order in which the frontiers are traversed for the set of query instances. This approach may allow for improved efficiency in generating graph traversal models, and in particular in generating multi-instance models for processing multiple query instances using operation-specific graph traversal models. The one or more processors may be configured to determine the respective one or more indices for each of the traversed vertices by performing one or more arithmetic operations on the vertex ranks of the traversed vertices. The frontier index may be calculated by dividing the vertex rank of a respective vertex by the frontier width (^), i.e., ^^^^[^][^] / ^. A vertex can be assigned to a frontier with index ^ when ^^^^[^][^] / ^ ∈ [^, ^ + 1), where [^, ^ + 1) is a range. That is, two vertices with different vertex rank values can be assigned to the same frontier if their “^^^^[^][^] / ^” fall into the same range [^, ^ + 1). For example, assume there is a vertex ^ with ^^^^[^][^]=2, and a vertex ^ with ^^^^[^][^]=3, and ^ is 2, which means a frontier with index 0 has a domain range of [^ ∗ ^, (^ + 1) ∗ ^) = [0, 2) and a frontier with index 1 has a domain range of [2, 4). Vertices ^ and ^ can be both assigned to the frontier with index 1, since 2 / 2=1 ∈ [1, 2) and 3 / 2=1.5 ∈ [1, 2). In other words, the vertex rank values for vertices ^ and ^ fall into the same frontier domain range, i.e., 2 ∈ [2, 4) and 3 ∈ [2, 4). A first one of the frontiers may comprise one or more source vertices, each source vertex corresponding to a respective query instance of the set of query instances. The frontiers may be traversed starting with this first one of the frontiers. Each vertex rank may be a real number. Each vertex rank may be one of the identifiers of the vertex in the graph (vid), a number of rounds (#round) and an answer of a query instance (ans[u][i]). Its definition can specify how rank[v][i] is updated when a frontier ranking algorithm visits a vertex v via some edge e = (u, v) for some source ^^(^ ∈ [1, ^]). This may allow a set of indexed frontiers to be formed. The set of query instances may comprise multiple query instances. In other implementations, the set of query instances may contain a single query instance. In general, the set of query instances may comprise one or more query instances. The operation-specific traversal model may be a multi-instance traversal model. This may allow the graph traversal model to evaluate multiple query instances instantaneously. The multi-instance operation-specific traversal model may be configured to share computation between queries when evaluating multiple query instances. This may improve efficiency in evaluating the multiple query instances, as redundant computation can be avoided. There may be k query instances and there may be k vertex ranks for each vertex of the graph, each of the k vertex ranks corresponding to a respective one of the k query instances. This may allow the approach to be used for running multiple query instances simultaneously. The one or more processors may be configured to receive a frontier width and a frontier structure. For each frontier ^, its domain is a range [lb, ub) such that, for any vertex u and any source ^^with ^^^^[^][^] ∈ [^^, ^^), a frontier ranking model can assign u to ^ for source ^^. Frontiers may have domains that are of equal width, where the width of frontier domain [lb, ub), which may be denoted by ^, is measured as |ub-lb|. More specifically, a frontier ^ may have index ^ (^ ∈ ℕ) if its domain is [^ ⋅ ^, (^ + 1) ⋅ ^). Hence, a vertex u with ^^^^[^][^] for source ^^is assigned to frontier ^ with index ^ if ^^^^[^][^] / ^ ∈ [^, ^ + 1). The vertex rank type, the frontier width and the frontier structure may be input by a user via a user interface. This may allow a user to tailor the approach to produce algorithm for a specific application to process multiple queries relating to the same type of graph operation. This may allow the approach to express common graph computations and compose new algorithms for common graph queries by varying the combination of vertex ranks, frontier width and frontier structure. Indeed, this may allow the approach to cover a wide range of common graph traversal algorithms for their single-instance case, more expressive than traditional graph frameworks, and moreover, to compose new algorithms for their multi-instance cases. The edge function may be input by the user via the user interface. This may allow the approach to be tailored based on user input. Therefore, the one or more processors may be configured to receive an indication of a vertex rank type, the frontier width and the frontier structure from a user interface whereby a user can input the vertex rank type, the frontier width and the frontier structure. The one or more processors may be configured to receive the edge function as an input by the user via the user interface. A user may specify vertex rank rank[u][i] for all vertices and all sources by selecting the type of the vertex rank (for example vertex ID, #round or ans). The model can then initialize or update the value of rank[u][i] according to the user-selected vertex rank type. This approach may allow a user to specify traversal logic by declaring vertex ranks, frontier width and frontier structure and express operation-specific computation logic by inputting an edge function, which may be adopted from classic single-instance traversal algorithms. This may allow the approach to synthesize fully functional operation-specific multi-instance traversal models from declared vertex ranks, frontier width, frontier structure and edge functions to process multiple query instances relating to the same type of graph operation. The same type of graph operation may be one of a graph searches, reachability, shortest path, Breadth-First Search, Dijkstra, Bellman-Ford, Delta-Stepping and Personalised PageRank operation. Other operations are possible. The present approach is therefore applicable to all common graph traversal problems. The one or more processors may be further configured to input the set of query instances to the operation-specific traversal model. In doing this, the edge function can be executed only once for each of the set of query instances when traversing to each of the neighbour vertices of each of the vertices of each frontier. This may allow the model to solve each of the set of query instances. Moreover, edge functions can benefit from proper application of single instruction multiple data (SIMD), which may allow for improved efficiency by enabling computation sharing when evaluating multiple query instances. The operation-specific traversal model may be configured to share computation when evaluating multiple query instances. The computation may be shared between two or more of the multiple query instances. This may improve computational efficiency. A frontier ^ may have an index ^ (^ ∈ ℕ) if its domain range is [^ ⋅ ^, (^ + 1) ⋅ ^), and a vertex ^ of the data graph with ^^^^[^][^] for a query instance having a source vertex ^^is assigned to the frontier ^ with index ^ if ^^^^[^][^] / ^ ∈ [^, ^ + 1), where ^ is the frontier width. This may allow traversed vertices of the data graph to be assigned to frontiers. The frontier structure may be a heap, a list or a stack. This may allow a user to specify the form of the frontier structure to be used. This approach may allow a user to produce operation-specific multi-instance traversal model that is configure to share computation when evaluating multiple query instances without the need to understand and implement the low-level subtleties such as aligning and sharing traversals and computations, and proper application of SIMD (single instruction multiple data). According to a second aspect, there is provided a computer-implemented method for forming an operation-specific traversal model for a data graph, the method comprising: receiving an indication of the data graph, the graph comprising a plurality of vertices and a plurality of edges; receiving a set of query instances, each query instance relating to a same type of graph operation as the other queries in the set and having a different source vertex of the plurality of vertices to each of the other queries in the set; receiving a set of vertex ranks for each query instance, each set of vertex ranks comprising a respective vertex rank for each of the plurality of vertices of the data graph; receiving a frontier width and a frontier structure; receiving an edge function defining an operation to be performed on a respective value of a respective edge connecting two neighbouring vertices of the data graph and the respective values of each of the two neighbouring vertices; forming a set of frontiers for the data graph by traversing one or more of the vertices of the data graph from each source vertex and determining one or more indices for each of the traversed vertices in dependence on the sets of vertex ranks and the frontier width, each frontier comprising one or more vertices having a respective vertex rank falling within a same frontier domain range; forming a set of ranked frontiers in dependence on the formed set of frontiers and the frontier structure; and forming the operation-specific traversal model in dependence on the set of ranked frontiers, the operation-specific traversal model defining an order in which the frontiers are traversed for the set of query instances. This method may allow for improved efficiency in processing multiple query instances using operation-specific graph traversal models. 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 disclosure will now be described by way of example with reference to the accompanying drawings. In the drawings: Figs. 1(a) – (e) schematically illustrate applications of graph traversal queries for molecular biology networks, internet protocol networks, road networks, social networks and financial transaction networks respectively. Fig.2 schematically illustrates the operation of a multi-instance frontier-ranking algorithm. Fig.3 shows an example of a prior art algorithm for solving single-instance Bellman-Ford queries for a Single-Source-Shortest-Path query. Fig.4 shows an example of an edge function for solving multi-instance Bellman-Ford queries. Fig.5 shows an example of a multi-instance traversal algorithm with internal functions. Fig.6 shows an example of an edge function for solving multi-instance Breadth-First- Search (BFS) queries. Fig.7 shows an example of an edge function for solving multi-instance Personalized PageRank queries. Fig.8 shows the steps of an exemplary method for forming an operation-specific traversal model for a data graph. Fig.9 shows an example of an apparatus for forming an operation-specific traversal model for a data graph 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. The method described herein can be used for directed graphs and also for undirected graphs by treating each undirected edge (u, v) as a pair of directed edges (u, v) and (v, u). Given a data graph G(V, E) and a source vertex s in G, a graph traversal query from vertex s can be denoted as Q(G, s). Q can be, for example, a Breadth-First-Search (BFS), shortest path (e.g. Dijkstra, Bellman-Ford, Δ-stepping, Dial), Personalized PageRank (PPR), maximum- capacity path, or betweenness / closeness / graph centrality query. Described herein is a graph traversal framework for answering a set of query instances of the same graph query type with different source vertices over the same data graph, i.e., Q(G, S) where S is a set of k source vertices ^^, ⋯ , referred to herein as MITra. The approach can also be used for single query instances, where the number of query instances in a set is equal to 1 (and thus there is one query instance in the set of query instances). This approach can enable the use of a high-level interface similar to that of general-purpose graph frameworks that allows to easily program various graph computations, while, for multi-instance cases, retaining the performance of one-off MIP algorithms by automatically exploring opportunities and optimizations for sharing computations across instances, where applicable. This approach can be used for composing multi-instance graph algorithms that traverse from multiple source vertices simultaneously over a single thread. Underlying the MITra method is an abstraction that separates traversal logic from computation logic via a numeric runtime property called vertex ranks. Based on this, the MITra method can implement an interface that allows users to express traversals by declaring vertex ranks and specify computation logic via an edge function, which is explained in more detail below. It can be used to synthesize multi- instance traversal algorithms from declared vertex ranks and edge functions, which may be adopted from classic single-instance traversal algorithms, and can automatically share computation across sources and benefit from principled optimization and single instruction multiple data (SIMD) instructions. The foundation of the MITra approach described herein is a model called a frontier-ranking algorithm that abstracts the graph traversal logic underlying common graph computations. It provides a systematic approach to viewing and designing graph traversal algorithms, by separating traversal logic from computation logic. It expresses traversal logic via a numeric vertex property called ranks and compresses computation logic as edge functions. While computation logic is often application / query dependent and varies a lot, traversal logic is much more regular and hence can be specified by declaring vertex ranks. Frontier-ranking algorithms interpret traversal logic by organizing vertices into frontiers, and then determining the order in which the frontiers are explored, and can also identify computation sharing opportunities. The process is guided by arithmetic operations over vertex ranks, which is hidden from users. This enables MITra to provide a rather simple, yet powerful, interface for composing multi-instance algorithms. Users can only focus on computation logic from the view of an edge, in an edge function ^(^). MITra synthesizes full MIP algorithms that can track and align traversal progresses of multiple instances via their vertex ranks, invoke ^(^) for the correct set of instances, and automatically extract sharing of edge accesses and invocations to ^(^) without impairing the correctness of each individual instance. By varying vertex ranks, one can compose existing and new graph traversal algorithms for their MIP cases. Indeed, MITra can express common graph computations, even those that are not expressible in existing graph frameworks, such as Dijkstra. The use of numeric vertex properties also gives rise to MITra variant arithmetic operators, with which users can write multi-instance traversal algorithms by adopting textbook single-instance algorithms with minimal efforts. These MITra operators easily benefit from, for example, SIMD from modern processors. Firstly, the method will be explained for single-instance graph computations, before extending to multi-instance computations. As mentioned above, the frontier ranking model serves as the foundation of the MITra framework. Consider a data graph G and a source vertex s in G of query type Q. A single- instance frontier-ranking algorithm ^ traverses G in rounds starting from s. It updates runtime properties associated with a vertex v when it visits v. Intuitively, the frontier-ranking algorithm ^ visits vertices of graph G one by one, starting from a source s. Each time it accesses an edge e = (u, v) from a visited vertex u, carries out some computation ^(^) on edge e, and then marks vertex v as visited. In the course, it maintains a list of runtime properties for each vertex. When accessing e, the edge function ^(^) propagates vertex properties of u to v. ^ abstracts the traversal routine by means of a numeric vertex property called ranks. It groups vertices into frontiers according to their ranks, organizes the traversal by ordering and exploring the frontiers. As will be shown shortly, this allows ^ to express the traversal logic via numeric operations on vertex ranks and separate them from edge functions. Algorithm ^ therefore provides the following parameters: edge function ^(^) , vertex rank rank[v], a frontier width ^ for each frontier ^, and structure ^. These parameters will now be explained in more detail. The edge function ^(^) is a function that can express application-specific graph computation logic. Note that, when ^ visits an edge e = (u, v), u is a vertex in the current frontier. Function ^(^) updates vertex properties of v by propagating those of u according to the computation logic specified by ^(^). For instance, for a Single-Source-Shortest-Path (SSSP) query, ^(^) may update property ans(v), the distance of v from the source vertex, by setting it to min(ans(u) + w(e), ans(v)), where w(e) is the weight of edge e. Vertex rank rank[v] is a reserved runtime property for each vertex in G. For each v of G, rank[v] is a real number. Its definition specifies how rank[v] is updated when ^ visits v via some edge e = (u, v). Common rank definition includes the number of rounds (#round, for example, 1, 2 or 3), vertex ID (vid) or query answers (ans). For each frontier ^, its domain is a range [lb, ub) such that, for any vertex u with ^^^^[^] ∈ [^^, ^^), ^ assigns u to ^. In a particular embodiment, the frontiers are equal-width frontiers, i.e., frontiers with domains that are of equal width, where the width of frontier domain [lb, ub), denoted by ^, is measured as |ub-lb|. More specifically, it can be said that a frontier ^ has index ^ (^ ∈ ℕ) if its domain is [^ ⋅ ^, (^ + 1) ⋅ ^). Hence, a vertex u with ^^^^[^] is assigned to frontier ^ with index ^ if ^^^^[^] / ^ ∈ [^, ^ + 1). Note that there may be multiple unexplored frontiers during traversing. To this end, ^ organizes them in an appropriate structure ^, e.g., a heap or a list. In each round, ^ pops out the “top” frontier for ^ to explore. For instance, when ^ is a list, frontiers may be organized and explored in an FIFO (first-in-first-out) order according to when they are generated and put in ^ by ^. Initially, ^ is empty. When ^ assigns a newly visited vertex v to frontiers in ^ and no frontier in ^ has index ⌊^^^^[^] / ^⌋ , a new frontier ^ is then created for v with index⌊^^^^[^] / ^⌋and is added to ^. Intuitively, the edge function expresses graph computation logic from the view of an edge, while the vertex rank, frontier width and structure together capture the traversal logic by organizing vertices into frontiers and determining the order in which the frontiers are explored. While computation logic varies a lot and is application / query dependent, traversal logic is typically much more regular and hence can be characterized by the model. In each round a frontier ^ is explored and one or more new frontiers are generated. Frontiers are maintained in order via a structure denoted by ^. More specifically, ^ traverses G as follows. ^ starts with frontier consisting of s in the first round. For each round i, it explores the frontier ^ for the current round by exploring each vertex ^ ∈ ^, as follows: for each edge ^ = (^, ^) in ^, it reads in ^, carries out some computation ^(^) on ^, and updates ^^^^[^]. It then assigns ^ to frontier ^′ if ^^^^[^] is changed and falls in the domain of ^′. If such ^′ does not exist in ^, it creates one for ^ and adds it to ^. After exploring all vertices in frontier ^, ^ fetches the next frontier ^′′ from ^ and moves to round i+1 to explore ^′′ . The iteration terminates if no frontiers remain in ^. One can cast common graph computations in frontier-ranking algorithms by just specifying the parameters ^(^), rank[v], frontier width ^ and structure ^. As an example, Table 1 shows how this may be done for common graph queries. Table 1: Graph computations in frontier-ranking algorithms Traversals ^(^ ) rank[v] ^ ^ BFS bfs #round: # of rounds in which ^ is visited 1 list Bellman-Ford distance #round: # of rounds in which ^ is visited 1 list Dijkstra distance vid: ID of vertex ^ ∈ ^ in data graph ^. 1 heap ans: tentative distance to the source; Δ-stepping distance ans(^) = min(ans(^) + ^ (^, ^ ), ans(^) ). Δ heap PPR pagerank#round: # of rounds in which ^ is visited.1 listBy varying parameters, frontier-ranking algorithms can also provide new, sometimes unconventional variants of classic graph algorithms. Such new variants of graph traversals can be advantageous over existing ones when it comes to multi-instance graph computations. Frontier-ranking algorithms therefore provide a systematic approach to viewing and designing graph traversal algorithms, by framing the design space via vertex ranks and related parameters. As will be shown next, this allows us to more accurately confine the impact of multiple instances. The single-instance frontier-ranking model can also be extended for multi-instance graph computations. Consider a data graph G and a set S of k source vertices ^^, ⋯ , ^^of query type Q. ^ can be used for S over G as one multi-instance frontier-ranking algorithm ^^that allows to align and share computations across the instances. Similar to the single-instance frontier- ranking algorithms described above, the multi-instance frontier-ranking algorithm ^^traverses G in rounds such that in each round a frontier is explored and new frontiers are generated for future rounds. Different from the single-instance case, multiple instances may be visiting the same vertices in a frontier simultaneously, which provides opportunities for computation sharing. In a round, (a) not all instances may progress, i.e., some instances may not be visiting any of the frontier vertices for the round; and (b) for those instances that are activated for the round, they may not visit all the frontier vertices being explored for the round. To deal with the situation of multi-instance computations, the frontier-ranking algorithm can be extended as follow. The rank of each vertex u, i.e., rank[u], is populated to an array of length k such that rank[u][i] is the rank of u for source ^^, for each ^ ∈ [1, ^]; similarly for other vertex properties. Each frontier ^ maintains, for each vertex v in ^, all sources that are currently visiting v when ^ is being explored. More specifically, this is done via a structure track. In this example, track[v] is a bool array of length k such that track[v][i] is True if and only if source ^^is visiting v. Fig. 2 illustrates the operation of a multi-instance frontier-ranking algorithm. Vertices are organized into frontiers according to vertex ranks and frontier domains. Frontiers are organized and explored in an order determined by ^. Edge traversal is shared when exploring vertex v if rank[v][i] for multiple sources ^^fall in the domain of the same frontier ^. With these, as shown in Fig.2, the multi-instance frontier-ranking algorithm ^^traverses G as follows. ^^starts with a frontier that comprises the source vertices ^^(^ ∈ [1, ^]) of the multiple queries. For each round ^ (^ ∈ [1, ^]), it explores a frontier ^^(^ ∈ [0, ^]) for each vertex ^ ∈ ^^. For each edge ^ = (^, ^) in ^, it carries out computation ^(^) on ^ for all sources ^^(^ ∈ [1, ^]) that are currently visiting ^ via ^, i.e., track[u][y]=True, and updates rank[v][y]. For each source ^^, it assigns ^ to some frontiers in ^ if rank[v][y] is changed, the same as how vertices are "ranked" to future frontiers in ^. Note that ^ may be assigned to multiple frontiers for different sources. For example, as shown in Fig. 2, after exploring vertex ^^in ^^and traversing through one of its adjacent edges ^^= (^^, ^^) to one of its neighbour vertices ^^in ^, ^^is assigned to ^^for source ^^and ^^, and is assigned to ^^for source ^^. After exploring all vertices in frontier ^^, ^^fetches the next frontier from ^ and moves to round ^+1 to explore that frontier. The iteration terminates if no frontiers remain in ^. Intuitively, ^^groups edge accesses to ^ = (^, ^) from multiple sources ^^as long as they are visiting ^ in the same round, i.e., track[u][i]=True. This “shares” the cost for visiting ^ for such sources, which includes e.g., access to ^ and the invocation of ^(^). Similar to single-instance frontier-ranking algorithms, traversals from multiple sources are organized in rounds via frontiers. However, coordination is required as not all sources progress at the same rate. The construction and ordering of the frontiers are specified by the parameters of ^^, rank[v], frontier width ^ and structure ^), which largely determine the extent of computation sharing and the efficiency of the traversals. Described below are some properties of ^^, namely expressiveness, sharing and abstraction. For any graph algorithms that are captured by the single-instance frontier-ranking model ^, their multi-instance version can be expressed in ^^by populating the vertex properties (e.g., ranks) of ^ for multiple source vertices, each source vertex corresponding to a respective query instance. Hence, using the same vertex rank and frontier specifications in Table 1, ^^can express the MIP version of common graph algorithms. Indeed, ^^can also express one- off MIP algorithms that are specifically designed for multi-instance graph computations. A key benefit of ^^is that it groups edge traversals when exploring a frontier, which allows sharing edge access and computations (e.g., the computation of ^(^)) when multiple instances visit ^ in the same round, without comprising correctness for each individual source vertex. The model therefore employs a “super” data structure ^ which organizes / ranks all frontiers in a specific order. Frontiers are indexed as 0,1,2,3 etc, but they are not organized in this order. Instead, they are organized / ranked in the order decided by the structure type which is configured by the user as an input parameter, i.e., the frontier structure ^, which can be, for example, a list or heap. In each round, the model pops out the “top” frontier F from ^. By exploring a vertex u in F, it accesses each of its adjacent edges (u, v) and traverses to each of its neighbour vertices v, executes the user-input edge function ^(^)over edge (u, v), and updates the vertex rank (i.e., rank[v][i]) of v for sources that are currently visiting v via edge (u, v), i.e., track[u][i]=True, and updates rank[v][i]. Finally, it computes the frontier index using the updated vertex rank of v for each corresponding source ^^, and assigns v to that frontier for ^^. Thus, frontiers are indexed and ranked independently of vertex ranks and ^^determines the frontier index for the neighbours of the vertices of each respective frontier. The expressiveness of multi-instance frontier-ranking algorithms provides an opportunity to abstract a high-level interface with a “declarative” flavour for implementing multi-instance graph computations. Moreover, the capability of enabling traversal sharing among the sources indicates that such an interface is highly desirable due to the potential to automate the optimizations of traversal sharing that are often brittle, case specific and error-prone. Based on the frontier-ranking model described above, the MITra framework realizes an interface for forming multi-instance frontier-ranking algorithms based on the multi-instance frontier-ranking model and can be used to form concise application-specific graph traversal algorithms for single and multiple query instances. The MITra approach uses edge-centric programming: users can specify the computation logic via edge function ^(^) over an edge ^ = (^, ^), which is defined over vertex properties of vertices ^ and ^ and is independent of the traversal logic. MITra can automate multi-instance graph traversals by automatically synthesizing a fully functional frontier-ranking multi-instance algorithm from ^(^) that is application-specific. The interface of MITra therefore comprises two parts: (a) a preamble that declares frontier parameters and vertex properties, and (b) an edge function to express computation logic for a specific application. MITra thus allows users to declare frontier specification and vertex properties in the preamble. Frontier specification includes the definition of frontier structure ^, frontier width ^ and vertex ranks, which together instruct MITra the traversal logic that user wants to perform. Users may also additionally declare any number of runtime vertex properties. Among them, ans records answers of each vertex, e.g., distance to the sources for SSSP. Similar to rank, each property X of a vertex ^, denoted by X[^], is an array of values such that X[^][^] is the X-property of ^ for source ^^. In the following, EdgeFunc is an interface that allows users to specify an edge function to express computation logic on edges ^ = (^, ^) by instructing how vertex properties are propagated from ^ to ^. The key to EdgeFunc is to express MIP computations over ^ = (^, ^) for multiple source vertices that are visiting ^ from ^ in the same step, enabling computation sharing over ^. To assist this, MITra automatically maintains an internal structure called track that records those sources that are traversing ^, and uses it to apply computation logic of EdgeFunc to only those sources that are visiting ^ from ^, with a single invocation to EdgeFunc on ^. As shown in Table 1 above, by specifying EdgeFunc (^(^)), vertex ranks, ^ and ^, MITra can express various multi-instance graph computations. As an example, a multi-instance Bellman-Ford algorithm for SSSP operations can be composed using the MITra framework. To aid understanding, it can be seen that the textbook Bellman-Ford (Algorithm 1 shown in Fig.3) first initializes the answer ans[^] for each vertex ^, i.e., the distance from source ^ to ^, to +∞. It then repeatedly carries out an edge relaxation operation on each edge ^ = (^, ^) via EdgeFunc (grey shaded in Algorithm 1) to propagate ans[^] + ^(^, ^) to ans[^] when this reduces ans[^]. It terminates when no distance (ans[^]) can be further reduced for all vertices ^, e.g., relax all edges for |^ |−1 times. As shown in Algorithm 2 (Fig.4), a Bellman-Ford algorithm formed using the present approach comprises (a) a preamble that declares three frontier parameters and vertex property ans (lines 1-2); and (b) an edge function (lines 3-5), which is the same as the edge function in the textbook Bellman-Ford (Algorithm 1) except that the arithmetic operators i.e., Add and Min, are replaced with their MITra versions i.e., mitra_Add and mitra_Min. Given a MITra user program, e.g., Algorithm 2 (Fig.4), MITra can automatically synthesize a fully functional multi-instance frontier-ranking algorithm on-the-fly to compute the answers to all the instances. The multi-instance version of common arithmetic operators, e.g., mitra_Add and mitra_Min are shown for the MITra Bellman-Ford in Algorithm 2. Consider mitra_Add(track[^], ans[^], ^(^, ^)) of Algorithm 2. Recall that ans[^] is an ^-size array such that ans[^][^] records distance of ^ to source ^^(^∈[1, ^]). It returns a ^-size array temp such that temp[^] is ans[^][^] + ^(^, ^) if track[^][^] = True, i.e., ^^visits ^ from ^; similarly for mitra_Min. This allows MITra to progress multiple instances with a single EdgeFunc invocation. To realize this, MITra maintains track, which is an internal structure that records, when a vertex ^ of a frontier ^ is being explored, those sources that are exploring ^: track[^][^] = True if and only if source ^^is exploring ^. Note that track is local to ^ since, according to the multi- instance frontier-ranking model, ^ may exist in multiple frontiers simultaneously for different sources. With track, MITra implements the MITra variant of common arithmetic operators, e.g., mitra_Div, mitra_Add and mitra_Set. Users can use them to convert classic single-instance edge functions (computation logic) to EdgeFunc for their MITra programs. MITra can advantageously synthesize multi-instance traversals from a MITra user program. Algorithm 3 (see Fig.5) is a full multi-instance frontier-ranking algorithm that MITra internally executes. After registering frontier parameters and vertex properties that are declared in the preamble of MITra program (lines 1-4), MITra explores frontiers in rounds via MTraverse, by following the frontier-ranking model (lines 5-8). MTraverse explores vertices ^ in frontier ^ one by one (lines 10-14). It visits neighbours of ^ for sources that are currently visiting ^. When it visits a neighbour ^ of ^, it records the current ans[^] (line 12), invokes user provided EdgeFunc (line 13), and assigns ^ to future frontiers according to the updated rank[^] (line 14). Finally, it retrieves the frontier for the next round from ^ (line 15). A key component in MTraverse is procedure UpdateF that updates frontiers when ^ is visited by EdgeFunc(^, ^) and ultimately connects the computation logic EdgeFunc and the traversal logic. Specifically, UpdateF first identifies sources for which the answers for ^ have just been updated by EdgeFunc(^, ^) (line 17). For each such source ^^, it updates ^ to the frontier according to the updated rank[^][^], by (a) removing ^ from previous frontiers for ^^(line 22), and (b) assigning ^ to the new frontier for ^^(line 26); if no existing frontier has domain that covering the updated rank[^][^], UpdateF creates a new frontier for ^ and adds it to ^ (lines 23- 25). One may also optionally specify a vertex function ^^(^) that enables MITra to express traversals that, e.g., only explore a frontier vertex ^ when certain conditions are met. MITra also allows postround, a post-hoc function that operates at the end of each round. This is helpful when the computation logic (e.g., PageRank) requires to aggregate over properties of vertices visited in a round before moving on to the next. The frontier-ranking model gives MITra effective yet principled optimizations. MITra arithmetic operators naturally benefit from SIMD. Indeed, MITra operations can be implemented using e.g., Intel SIMD intrinsics that support vectorized mask operations, by treating track[^] as masks. For instance, mitra_Add(track[^], ans[^], ^(^, ^)) is implemented as _mm256_mask_add_epi32(inf, track[u], ans[u], _mm256_set1_epi32(^(^, ^))). With this, when EdgeFunc is invoked on edge ^ for multiple sources, the computation over ^ is shared across the instances. Recall that MITra can track the traversal progress of all sources via the structure track, and uses it in MITra arithmetic operations to update vertex properties of ^ when exploring a frontier vertex ^ for only those sources that are visiting (^, ^). However, there exist algorithms for which such explicit traversal progress tracking is not necessary. For such cases, MITra implements tracking-free traversal (TrackFree), an optimization that enables to bypass references to track and propagate vertex properties of ^ to ^ for all sources via a standard SIMD operation (without mask track). This allows sources that are not currently visiting the vertices to take “free rides” of those that are currently visiting the vertices, without extra costs. The benefit of this is two- fold. Bypassing track eliminates the noticeable tolls for maintaining track, yielding reduced overhead. By updating vertex ranks earlier via free riding on SIMD, one may yield earlier termination due to quicker convergence, leading to reduced edge accesses and edge function invocations. Some embodiments exemplifying the use of the above approach for forming application- specific algorithms will now be described. In one embodiment, the approach may be used for Breadth-First-Search (BFS) graph operations. For the classic single-instance BFS algorithm, given a data graph (^, ^) and a source vertex ^ ∈ ^, BFS explores all vertices in levels, starting from ^, where each level coincides with the frontier in the frontier-ranking model. Specifically, BFS uses two data structures, Visit and nextVisit, to record vertices being explored in the current BFS level and gather their unseen neighbours to be visited in the next level, respectively. In each iteration, each vertex ^ in Visit is explored by invoking an edge function ^^for each edge (^, ^) in ^. After the current BFS level, nextVisit is assigned to Visit for the next iteration. The classic BFS edge function ^^maintains two properties for each vertex ^: (a) status[^], a Boolean value that indicates whether ^ has been visited or not, and (b) ans[^], recording ^ when ^ is visited from ^. Given any edge ^ = (^, ^), ^^works in three steps when invoked on ^: (1) ^^first checks whether ^ has not been visited, i.e., status[^] is False; (2) If status[^] = False, it marks ^ as visited by setting status[^] to True and (3) records ^ in ans[^]. The MITra program for multi-instance BFS follows the same logic flow of the classic single- instance BFS edge function, but observes that there are ^ different source vertices, one for each of the multiple instances. As shown in Algorithm 4 in Fig.6, in the preamble (lines 1-2) it registers ans and status for each source vertex as in classic BFS; additionally, it uses #round as rank. The EdgeFunc exactly populates the three steps of classic BFS edge function ^^for all the sources. Over an edge (^, ^), (1) it first decides, for each source ^^, whether ^^is exploring ^ and has not yet visited ^, by checking if track[^][^] = True and status[^][^] = False (line 4). (2) It then marks status[^][^] as True for those sources ^^passing the condition of (1) (line 5), and (3) sets ans[^][^] to ^ (line 6). Via the track structure maintained by MITra, EdgeFunc benefits from bitwise and SIMD operations in all three steps. In another embodiment, the approach may be used for Single-Source-Shortest Path (SSSP) graph operations. Given a data graph (^, ^) and a source vertex ^ ∈ ^, SSSP computes the shortest-path distance from ^ to each vertex in ^. Classic SSSP algorithms include Bellman- Ford, Dijkstra and Δ-stepping. All three of these SSSP algorithms work by “relaxing” the upper bound (ans) on the distance of a shortest path from source ^ to ^. As shown in Algorithm 1, this relaxing operation is the edge function ^(^) and is determined by the query (SSSP) logic. All three algorithms initialize ans[^] to +∞ for each ^ except that ans[^] is set to 0, and then repeatedly relax edges via ^(^). They differ only in their traversal logic, i.e., how and in which order they relax the edges. For Dijkstra, only the vertex that is closest to the source is relaxed in each round. For Bellman- Ford, all vertices relax their neighbours in each round (Algorithm 1). In a more efficient variant, only vertices whose ans value has changed in round ^ − 1 are relaxed in round ^. For Δ- stepping, vertices in distance range [^∗Δ, (^+1)∗Δ) are relaxed until no further distance changes in round ^; it then proceeds to the next distance range, repeating until the shortest-path distances for all reachable vertices are set. With MITra, the differences in traversal logics are reflected by their vertex ranks, ^ and ^ as specified in Table 1. With their respective specifications as the preambles and the EdgeFunc of MITra Bellman-Ford (Algorithm 2) as their edge functions, MITra Dijkstra and MITra Δ- stepping can be formed as well. In another embodiment, the approach can be used for Personalized PageRank (PPR) graph operations. PPR has been used as the appropriate ego-centric equivalent of PageRank for Personalized Social Search and Community Detection. Given a directed graph (^, ^) and a source vertex ^ ∈ ^, for each vertex ^ ∈ ^, its PPR value for ^, denoted by ^^, is the probability that a random walk in ^ from ^ terminates at ^. More specifically, ^^is measured as the stationary distribution of the following random walk starting from source vertex ^: at each step, return to ^ with probability ^, and otherwise move to a random neighbour of the current vertex. The personalized PageRank algorithm iteratively updates ^^as follows: where ^ is damping factor, ^^^(^) is the degree of ^, and ^^is the identity of ^ (^^is 1 when ^ is ^ and 0 otherwise). The process starts by setting ^^for each ^ according to ^^, and iterates until the sum of changes of two consecutive iterations is below a threshold or a predefined superstep number has been reached. Multi-instance PPR computes for each vertex ^ in ^, given a set ^ of source vertices, the PPR value of ^ for each source ^ ∈ ^. A multi-instance PPR program with MITra is shown in Algorithm 5 in Fig. 7. In the preamble, it declares vertex ranks and configures frontiers according to Table 1 (line 1). It also registers ^^^^^^, ^^^^^^^and ^^^ as the vertex properties, where ^^^^^^[^] is the PPR values of ^ from the last round and ^^^^^^^[^] is its PPR value updated by EdgeFunc in the current round. ^^^ is set according to ^^, i.e., ^^^[^][^] is 1 if ^ is source ^^∈ ^ and 0 otherwise. Initially, ^^^^^^is the same as ^^^ and ^^^^^^^is 0 for all vertices and all sources (line 2). The edge function (lines 3-4) of MITra PPR is almost the same as the classic single-instance version, following the definition of ^^formulated earlier. More specifically, upon visiting ^ through edge (^, ^), it firstly divides ^^^^^^[^] by the degree ^^^(^) of vertex ^ and stores the value in array temp (line 3), and then adds temp to ^^^^^^^[^] (line 4). In addition, MITra also specifies the post-hoc function postround to execute the specific application logic in PPR for each round (lines 5-13). After exploring all the frontier vertices in a round, postround normalizes the PPR value for each vertex ^ (lines 6-10) and resets ^^^^^^[^] (line 10). After that, ^^^^^^and ^^^^^^^are switched for the next round (line 11). The whole iteration continues until a predefined maximum iteration number ^ is reached (lines 12-13). Generally, Fig.8 shows an example of a computer-implemented method 800 for forming an operation-specific traversal model for a data graph. At step 801, the method comprises receiving an indication of the data graph, the graph comprising a plurality of vertices and a plurality of edges. At step 802, the method comprises receiving a set of query instances, each query instance relating to a same type of graph operation as the other queries in the set and having a different source vertex of the plurality of vertices to each of the other queries in the set. At step 803, the method comprises receiving a set of vertex ranks for each query instance, each set of vertex ranks comprising a respective vertex rank for each of the plurality of vertices of the data graph. At step 804, the method comprises receiving a frontier width and a frontier structure. At step 805, the method comprises receiving an edge function defining an operation to be performed on a respective value of a respective edge connecting two neighbouring vertices of the data graph and the respective values of each of the two neighbouring vertices. At step 806, the method comprises forming a set of frontiers for the data graph by traversing one or more of the vertices of the data graph from each source vertex and determining one or more indices for each of the traversed vertices in dependence on the sets of vertex ranks and the frontier width, each frontier comprising one or more vertices having a respective vertex rank falling within a same frontier domain range. At step 807, the method comprises forming a set of ranked frontiers in dependence on the formed set of frontiers and the frontier structure. At step 808, the method comprises forming the operation-specific traversal model in dependence on the set of ranked frontiers, the operation-specific traversal model defining an order in which the frontiers are traversed for the set of query instances. The model can be used to process the set of query instances by executing the edge function when traversing to each of the neighbour vertices of each of the vertices of each frontier. Fig.9 is a schematic representation of an apparatus 900 configured to implement the system described above and to perform the methods described herein. The apparatus 900 may be part of a computing device, such as a laptop, tablet, smart phone or TV. The apparatus 900 comprises a processor 901. For example, the processor 901 may be implemented as a computer program running on a programmable device such as a Central Processing Unit (CPU). The apparatus 900 also comprises a memory 902 which is arranged to communicate with the processor 901. Memory 902 may be a non-volatile memory. The processor 901 may also comprise a cache (not shown in Fig. 9), which may be used to temporarily store data from memory 902. 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 is easy to use. Users can configure the traversal logic through three frontier parameters rank[v], frontier width ^ and structure ^, and specify an edge function ^(^) to express the computation logic on a single edge, hiding away from complex computations that organize traversals for multiple instances. Once users input an edge function, it automatically synthesizes a fully functional multi-instance algorithm from the edge function that executes the complex multi-instance traversal logic for a specific application including identifying sharing, hidden from users. With MITra, users can focus on the computation logic on a single edge. MITra Dijkstra and Δ- stepping applications share the same edge function as MITra Bellman-Ford, since they share the same computation logic for SSSP, although they have different traversal logic. This significantly simplifies the implementation of MIP algorithms. In addition, one can simply re- use edge functions of classic single-instance algorithms and populate them for MITra, by replacing arithmetic operators with their MITra versions. MITra uses automated sharing and invokes the edge function only once on an edge ^ for multiple instances that visit ^ in the same round. This automatically shares edge accesses and computations across multiple instances by using track, which is automatically maintained by MITra behind the scene without any user interference. The described frontier-ranking model can uniformly abstract single- / multi-instance graph traversal logics. It expresses traversal logic via a numeric vertex property called ranks and compresses computation logic as edge functions. The entire traversal process including organizing frontiers and identifying computation sharing is then guided by arithmetic operations over vertex ranks, hidden from users. The approach can express common graph computations and compose new algorithms for common graph queries by varying vertex ranks and associated frontier configurations. By virtue of the frontier-ranking model, the MITra approach described herein covers a wide range of graph algorithms and is more expressive than traditional frameworks. Indeed, the single- instance frontier-ranking model has more expressive power than traditional single-instance graph frameworks. The multi-instance frontier-ranking model which has single-instance frontier-ranking model as its special case therefore also has good expressive power. With MITra, one can compose common graph traversal algorithms for their MIP cases. Moreover, by varying vertex ranks and associated frontier configurations, it can compose new algorithms that are particularly efficient for MIP. It groups edge traversals when exploring a frontier, which allows sharing edge access and computations when multiple instances visit the edge in the same round, without comprising correctness for each individual source. Edge functions in MITra can also benefit from SIMD so that shared edge access among the instances leads to shared computation cost. Furthermore, MITra can benefit from principled optimization with provable correctness and effectiveness, e.g., SIMD and tracking-free traversal, which demonstrates substantial performance improvement for common multi-instance computations. MITra arithmetic operations can be implemented with SIMD operators if the underlying machines support and hence can exploit modern compilers and processors via shared edge accesses, as well as improving efficiency. The present approach can be used for a variety of application utilizing graph traversal queries, such as identifying connected bank accounts for money laundering detection in financial transaction networks, testing the reachability of some IP destinations from the local host in IP networks and computing shortest paths to destination IP addresses from a localhost according to routing protocols on IP network graphs, measuring the importance of some nodes in network analysis, checking whether people are connected for crime detection in social networks, searching reachable places and computing shortest paths to destination places from a particular location on road network graphs in route planning or POI (Point of Interest) service systems, performing search queries for search engines to build web page indexes for connected pages through links from a source page in web crawlers, performing reachability searches to disclose “peers” in peer-to-peer networks, and studying the protein-protein interactions in molecular biology networks. Multi-instance traversals are therefore 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 graph queries over those huge graphs in a timely manner. For example, it is common for a route planning search engine to receive hundreds or thousands of shortest-path queries from the users in a very short time frame, and it is important for the search engine to fast process the batches of queries and return query results to users. These applications can easily benefit from the present approach to improve the efficiency for processing batches of graph queries coming within in a short time frame. With MITra, one can process all the query instances in one go, and share common sub-traversal computation across multiple query instances, avoiding any redundant computation and therefore improving efficiency. Therefore, instead of developing specialized one-off algorithms, the present approach is a general approach that is algorithm independent and provides a programming framework for outputting MIP algorithms which are applicable for all common graph traversals, while automatically exploring opportunities and optimizations for sharing computations across query instances. 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 disclosure 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 disclosure.
Claims
CLAIMS 1. An apparatus (900) for forming an operation-specific traversal model for a data graph, the apparatus comprising one or more processors configured to: receive (801) an indication of the data graph, the graph comprising a plurality of vertices and a plurality of edges; receive (802) a set of query instances, each query instance relating to a same type of graph operation as the other queries in the set and having a different source vertex of the plurality of vertices to each of the other queries in the set; receive (803) a set of vertex ranks for each query instance, each set of vertex ranks comprising a respective vertex rank for each of the plurality of vertices of the data graph; receive (804) a frontier width and a frontier structure; receive (805) an edge function defining an operation to be performed on a respective value of a respective edge connecting two neighbouring vertices of the data graph and the respective values of each of the two neighbouring vertices; form (806) a set of frontiers for the data graph by traversing one or more of the vertices of the data graph from each source vertex and determining one or more indices for each of the traversed vertices in dependence on the sets of vertex ranks and the frontier width, each frontier comprising one or more vertices having a respective vertex rank falling within a same frontier domain range; form (807) a set of ranked frontiers in dependence on the formed set of frontiers and the frontier structure; and form (808) the operation-specific traversal model in dependence on the set of ranked frontiers, the operation-specific traversal model defining an order in which the frontiers are traversed for the set of query instances.
2. The apparatus (900) as claimed in claim 1, wherein the one or more processors are further configured to process the set of query instances using the operation-specific graph traversal model by executing the edge function when traversing to each of the neighbour vertices of each of the vertices of each frontier.
3. The apparatus (900) as claimed in claim 1 or claim 2, wherein the one or more processors are configured to determine the respective one or more indices for each of the traversed vertices by performing one or more arithmetic operations on the vertex ranks of the traversed vertices.
4. The apparatus (900) as claimed in any preceding claim, wherein a first one of the frontiers comprises one or more source vertices, each source vertex corresponding to a respective query instance of the set of query instances.
5. The apparatus (900) as claimed in any preceding claim, wherein each vertex rank is a real number.
6. The apparatus (900) as claimed in any preceding claim, wherein the vertex rank is one of the identifiers of the vertex in the graph, a number of rounds and an answer of a query instance.
7. The apparatus (900) as claimed in any preceding claim, wherein the set of query instances comprises multiple query instances and wherein the operation-specific traversal model is a multi-instance traversal model.
8. The apparatus (900) as claimed in claim 7, wherein the multi-instance operation-specific traversal model is configured to share computation between queries when evaluating multiple query instances.
9. The apparatus (900) as claimed in any preceding claim, wherein there are k query instances and wherein there are k vertex ranks for each vertex of the graph, each of the k vertex ranks corresponding to a respective one of the k query instances.
10. The apparatus (900) as claimed in any preceding claim, wherein the one or more processors are configured to receive an indication of a vertex rank type, the frontier width and the frontier structure from a user interface whereby a user can input the vertex rank type, the frontier width and the frontier structure.
11. The apparatus (900) as claimed in claim 10, wherein the one or more processors are configured to receive the edge function as an input by the user via the user interface.
12. The apparatus (900) as claimed in any preceding claim, wherein the same type of graph operation is one of a graph searches, reachability, shortest path, Breadth-First Search, Dijkstra, Bellman-Ford, Delta-Stepping and Personalised PageRank operation.
13. The apparatus (900) as claimed in any preceding claim, wherein a frontier ^ has index ^ (^ ∈ ℕ) if its domain range is [^ ⋅ ^, (^ + 1) ⋅ ^) , and a vertex ^ of the data graph with ^^^^[^][^] for a query instance having a source vertex ^^is assigned to the frontier ^ with index ^ if ^^^^[^][^] / ^ ∈ [^, ^ + 1), where ^ is the frontier width.
14. The apparatus (900) as claimed in any preceding claim, wherein the frontier structure is a heap, a list or a stack.
15. A computer-implemented method (800) for forming an operation-specific traversal model for a data graph, the method comprising: receiving (801) an indication of the data graph, the graph comprising a plurality of vertices and a plurality of edges; receiving (802) a set of query instances, each query instance relating to a same type of graph operation as the other queries in the set and having a different source vertex of the plurality of vertices to each of the other queries in the set; receiving (803) a set of vertex ranks for each query instance, each set of vertex ranks comprising a respective vertex rank for each of the plurality of vertices of the data graph receiving (804) a frontier width and a frontier structure; receiving (805) an edge function defining an operation to be performed on a respective value of a respective edge connecting two neighbouring vertices of the data graph and the respective values of each of the two neighbouring vertices; forming (806) a set of frontiers for the data graph by traversing one or more of the vertices of the data graph from each source vertex and determining one or more indices for each of the traversed vertices in dependence on the sets of vertex ranks and the frontier width, each frontier comprising one or more vertices having a respective vertex rank falling within a same frontier domain range; forming (807) a set of ranked frontiers in dependence on the formed set of frontiers and the frontier structure; and forming (808) the operation-specific traversal model in dependence on the set of ranked frontiers, the operation-specific traversal model defining an order in which the frontiers are traversed for the set of query instances.
16. A computer-readable storage medium (902) having stored thereon computer readable instructions that when executed by a computer cause the computer to perform the method (800) of claim 15.