Skip to content

Horae is a graph stream summarization structure for efficient temporal range queries. Horae can deal with temporal queries with arbitrary and elastic range while guaranteeing one-sided and controllable errors. More to the point, Horae provides a worst query time of O(log L), where L is the length of query range. Hoare leverages multi-layer stora…

License

Notifications You must be signed in to change notification settings

CGCL-codes/Horae

Repository files navigation

Horae: A Graph Stream Summarization Structure for Efficient Temporal Range Query

Horae is a graph stream summarization structure for efficient temporal range queries. Horae can deal with temporal queries with arbitrary and elastic range while guaranteeing one-sided and controllable errors. More to the point, Horae provides a worst query time of O(log L), where L is the length of query range. Hoare leverages multi-layer storage and Binary Range Decomposition (BRD) algorithm to decompose the temporal range query to logarithmic time interval queries and executes these queries in corresponding layers.

Introduction

The emerging graph stream represents an evolving graph formed as a timing sequence of elements (updated edges) through a continuous stream. Each element in a graph stream is formally denoted as (si, di,wi, ti) (i ≥ 0), meaning the directed edge of a graph G = (V, E), i.e., sidi (siV, diV, sidiE), is produced at time ti with a weight value wi. An edge can appear multiple times at different time instants with different weights. Such a general data form is widely used in big data applications, such as user behavior analysis in social networks, close contact tracking in epidemic prevention, and vehicle surveillance in smart cities.

Real-world big data applications can create tremendously large-scale graph stream data. The enormous data scale makes the management of graph streams extremely challenging, especially in the aspects of (1) storing the continuously produced and large-scale datasets, and (2) supporting queries relevant to both graph topology and temporal information. To address these issues, recent research has mainly focused on graph stream summarization techniques which aim at achieving practicable storage and supporting various queries relevant to graph topology at the cost of slight accuracy sacrifice.

However, existing summarization structures are unable to store the temporal information in a graph stream and thus fail to support temporal queries. In this work, we propose Horae, a novel graph stream summarization structure to efficiently support temporal range queries. By exploring a time prefix embedded multi-layer summarization structure, Horae can effectively handle a temporal range query of an arbitrary range length L with a worst query processing time of O(log L). The basic idea of Horae's time prefix embedded multi-layer summarization structure is as follows.

An arbitrary temporal range of length L can be decomposed to at most 2log L sub-ranges, where all the time points in each sub-range have the same binary code prefix. For example, [t8, t13] = [t8, t11] + [t12, t13], where all the time points between t8 (i.e., 1000) and t11 (i.e., 1011) have the same common prefix '10', while all the time points between t12 (i.e., 1100) and t13 (i.e., 1101) have the same prefix '110'. Here, we define the prefix size as the number of binary digits in the common prefix (e.g., the prefix size of '10' is two while that of '110' is three).

A Horae structure contains a number of l = ⌈ log2(tu + 1) ⌉ + 1 layers, where tu is the current time point of a graph stream. To cope with the infinity in the time dimension, the number of layers in Horae dynamically increases as tu grows. Horae arranges the layers according to different prefix sizes. Each layer leverages a matrix to store the complete graph stream data aggregated by the sub-ranges with the same prefix size. Consider the example with tu = t7, Horae has four layers. The first layer contains eight sub-ranges {[t0] ([0000]), [t1] ([0001]), ..., [t7] ([0111])} with prefix size of four; the second layer contains four sub-ranges {[t0, t1] ([0000, 0001]), [t2, t3] ([0010, 0011]), ..., [t6, t7] ([0110, 0111])} with prefix size of three, and so on. Formally, the pth layer aggregates the graph stream data by the sub-ranges {[{q ⋅ 2p - 1}, {(q + 1) ⋅ 2p - 1} - 1] (q ≥ 0)} with prefix size l - p + 1. The sub-ranges of each layer have the same prefix size, i.e., the same range length. In a nutshell, each layer of the structure represents a summarization of a graph stream with carefully selected granularity (corresponds to a prefix size). During the construction of each layer, Horae combines each edge with the time prefix of the corresponding size for inserting the edge information to the corresponding matrix. Similarly, Horae combines an edge/node and the sub-range prefix to perform a sub-range query.

To efficiently evaluate temporal range queries on top of the Horae structure, we further design a novel Binary Range Decomposition (BRD) algorithm. The BRD algorithm decomposes a temporal range query with an arbitrary length L into at most O(log L) sub-range queries against different layers of the structure. Therefore, Horae reduces the query processing time to a logarithmic scale. Experimental results show that Horae reduces the latency of temporal range queries by two to three orders of magnitude compared to existing designs.

Horae Structure

Horae-structure

The Horae structure contains l = ⌈ log2(Tu + 1) ⌉ + 1 layers. It starts with a single layer initially and creates one new layer whenever the current time slice of the graph stream increases to a larger power of two (Tu = 2i, i ≥ 0). Horae arranges the layers based on different prefix sizes. Each layer aggregates the complete graph stream data by a corresponding prefix size. In the snapshot, the 1st layer contains four sub-ranges {[T0] (000), [T1] (001), ..., [T3] (011)}, all with the prefix size of three; the 2nd layer contains two sub-ranges {[T0, T1] (000, 001), [T2, T3] (010, 011)}, both with the prefix size of two; the 3rd layer contains one sub-range {[T0, T3] (000, 011)} with the prefix size of one. Formally, the pth layer aggregates the graph stream data by the sub-ranges {[0, 2p - 1 - 1], [2p - 1, 2 ⋅ 2p - 1 - 1], ...} with the same prefix size of l - p + 1. All the sub-ranges of the pth layer have the same range length 2p - 1. We define the same range length of each sub-range in the pth layer as the granularity of the pth layer. In a word, the pth layer of Horae represents a graph stream summarization of granularity 2p - 1.

Binary Range Decomposition

Horae-BRD-3cases
We design the BRD algorithm to quickly decompose an arbitrary time range query to multiple window queries of different layers. For any time range of length L, we can find an m which satisfies 2mL < 2m + 1 (i.e., m = ⌊ log2 L ⌋). The granularity of the (m + 1)th layer is 2m. BRD is based on the observation: if the time range aligns with one side of a window in the (m + 1)th layer, decomposing the range equals decomposing its length, i.e., converting L to binary form.

For convenience, we call a sub-range of each layer a window. We use the notation Wpq to denote the window with prefix q in the pth layer, and more generally Wpq = [q ⋅ 2p - 1, (q + 1) ⋅ 2p - 1 - 1]. For example, we have W22 = [T4, T5]. For a window [Ti, Tj] of length N, [Ti, Tj] = W(log2N+1)Ti/N = W(log2N+1)Tj/N. The windows of the pth and (p + 1)th layers have the following relationship: the two adjacent windows can be merged into a larger window of the upper layer. Formally, Wp2i + Wp2i + 1 = Wp + 1i (i ≥ 0), where Wp2i and Wp2i + 1 are called sibling windows.

Given an arbitrary query range [Tb, Te] with the length L = Te - Tb + 1, we formalize the decomposition result as follows: DE([Tb, Te]) = Wp1q1 + Wp2q2 + ... + Wpfqf, where Wpiqi and Wpjqj cannot be sibling windows for any two i, j ∈ [1, f] and ij. Here, we identify an important property of the window: for a time range [Ti, Tj] of length N (N = 2k (k ≥ 0)), it is a window if and only if (Tj + 1) % N = 0.

For an arbitrary time range, it may align perfectly with a window, align with one side of a window, or not align with any window in the (m + 1)th layer. Accordingly, we summarize the following three cases and apply different strategies. The figure above shows examples of the three cases (4 ≤ L < 8 and m = 2).

Optimization

Horae-BRD
To reduce the memory cost, we propose the compacted Horae. In Horae, the matrix of each layer stores complete graph stream data and has the same size. In this way, Horae can achieve a logarithmic scale query processing time. To further improve the space efficiency, the compacted Horae selects partial data to store. The above figure shows the scheme. The compacted Horae still has l layers. The first layer stores all the window data as before, and the other layers only maintain the window with odd prefixes, i.e., each layer except the first layer only stores nearly half of the graph stream data. We set the size of Mp (p > 1) to half of that of M1, which reduces the memory cost by half. For convenience, we use Horae-cpt to represent the compacted Horae.

Insert of Horae-cpt performs as follows. For each element ei , if it belongs to the window with an even prefix in the pth (p > 1) layer, Horae-cpt does not perform the insert operation in this layer. Otherwise, it inserts the element into the corresponding layer like Horae. Horae-cpt performs the extend operation only when the first element of Ti (i = 2l) appears. Moreover, Horae-cpt does not perform the data copy operation because the data of the upper layer is not complete.

Horae-cpt also decomposes the time range into multiple windows of different layers and then executes the window queries in the corresponding layers. The decomposition process consists of two rounds. Given a time range, we first decompose it into multiple windows by performing BRD once. In the second round, we decompose the windows (length > 1) with even prefixes. Suppose [Ts, Te] (Te > Ts) is a window with an even prefix. We divide it into [Ts] and [Ts + 1, Te] and then perform BRD on [Ts + 1, Te]. Note that the result windows of DE([Ts + 1, Te]) are all prefixed with odd numbers. The above figure shows an example in detail. In the first round, DE([T0, T6]) = [T0, T3] + [T4, T5]+[T6]. In the second round, [T0, T3] is decomposed into [T0], [T1], and [T2, T3] while [T4, T5] is decomposed into [T4] and [T5]. All the windows after the first round decomposition may need binary range decomposition again. Hence, Horae-cpt can achieve O(log2L) query latency in the worst case. Horae-cpt achieves a good trade-off between memory cost and query performance.

Evaluation Result

Horae-Eva

Here, we show some evaluation results on the dataset caida, this dataset contains partial anonymized passive traffic traces from CAIDA's equinox-Chicago monitor in 2015. A node represents an IP address and an edge denotes a communication. The weight of each edge represents the size of the transmitted data. The collected eleven minutes trace contains 2,121,486 nodes, 403,436,907 edges. We set gl to 50 ms and obtain 13,200 time slices.

Temporal edge weight queries. Figure (1) shows the average query time of temporal edge weight queries for the dataset caida. Horae and Horae-cpt both greatly reduce the average latency of GSS and TCM by over two orders of magnitude.

Temporal edge existence queries. We examine the non-existence queries where the edges do not appear within the corresponding time ranges. Figure (2) shows the FPR of the non-existence queries for the dataset caida. The FPR increases significantly for GSS and TCM as L increases. In contrast, it maintains stable in Horae.

Temporal node queries. We use the temporal node-out (resp. node-in) query to represent the temporal source (resp. destination) node query. Figure (3) plots the average time of temporal node-in and node-out queries with different lengths for the dataset caida. Horae reduces the latency of TCM by three to four orders of magnitude when the length is considerable while it reduces that of GSS more. The latency of Horae-cpt is slightly larger than that of Horae. Figure (4) illustrates the ARE of the temporal node queries with different lengths. Horae reduces the ARE of GSS by almost two orders of magnitude for both the temporal node-out queries and the temporal node-in queries. The ARE of temporal node query of TCM is high because it lacks a collision avoidance mechanism. The ARE of node query in Horae-cpt is close to that in Horae.

Memory cost. In the experiment, we configure Horae, GSS, and TCM with the same amount of memory. The result in Figure (5) shows that Horae-cpt greatly reduces the memory cost of Horae by 50%.

Insert throughput. Figure (6) shows the insert throughput of GSS, TCM, and Horae for the four datasets. Horae-para and Horae-seq denote the parallel insert operation and the sequential insert operation, respectively. The parallel insert operation greatly improves the throughput compared to the sequential one. The throughput of Horae-cpt-para is close to those of GSS and TCM.

Source Code

The source code of our design Horae is in the folder "Horae", the "readme.md" file in that folder shows how to build and execute the program horae and horae-compacted. Besides, we also provide the baseline codes, tcm+timeslice (in folder TCM+Timeslice), gss+timeslice (in folder GSS+Timeslice) and segment tree version (in folder DynamicSegmentTree), and we provide "readme.md" files to each folder to illustrate how to build them and run these codes.

Publications

If you want to know more detailed information, please refer to this paper:

Ming Chen, Renxiang Zhou, Hanhua Chen, Jiang Xiao, Hai Jin, Bo Li. Horae: A Graph Stream Summarization Structure for Efficient Temporal Range Query. in Proceedings of the 38th IEEE International Conference on Data Engineering (ICDE 2022), Virtual Event, Kuala Lumpur, Malaysia, May 9-12, 2022.

Authors and Copyright

Horae is developed in National Engineering Research Center for Big Data Technology and System, Cluster and Grid Computing Lab, Services Computing Technology and System Lab, School of Computer Science and Technology, Huazhong University of Science and Technology, Wuhan, China by Ming Chen ([email protected]), Renxiang Zhou ([email protected]), Hanhua Chen ([email protected]), Jiang Xiao ([email protected]), Hai Jin ([email protected]).

Copyright (C) 2020, STCS & CGCL and Huazhong University of Science and Technology.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

Horae is a graph stream summarization structure for efficient temporal range queries. Horae can deal with temporal queries with arbitrary and elastic range while guaranteeing one-sided and controllable errors. More to the point, Horae provides a worst query time of O(log L), where L is the length of query range. Hoare leverages multi-layer stora…

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages