Local Similarity Search on Geolocated Time Series Using Hybrid Indexing

Geolocated time series, i.e., time series associated with certain locations, abound in many modern applications. In this paper, we consider hybrid queries for retrieving geolocated time series based on filters that combine spatial distance and time series similarity. For the latter, unlike existing work, we allow filtering based on local similarity, which is computed based on subsequences rather than the entire length of each series, thus allowing the discovery of more fine-grained trends and patterns. To efficiently support such queries, we first leverage the state-of-the-art BTSR-tree index, which utilizes bounds over both the locations and the shapes of time series to prune the search space. Moreover, we propose optimizations that check at specific timestamps to identify candidate time series that may exceed the required local similarity threshold. To further increase pruning power, we introduce the SBTSR-tree index, an extension to BTSR-tree, which additionally segments the time series temporally, allowing the construction of tighter bounds. Our experimental results on several real-world datasets demonstrate that SBTSR-tree can provide answers much faster for all examined query types. This paper has been published in the 27th International Conference on Advances in Geographic Information Systems (ACM SIGSPATIAL 2019).


Introduction
A time series is a time-ordered sequence of data points. Time series are ubiquitous in many application domains. They can represent various types of measurements, such as user check-ins at various Points of Interest, energy consumption in smart buildings, PM2.5 particle concentration measured by air pollution sensors, etc. Analyzing and mining time series data is highly important for discovering trends and patterns in such phenomena, and has attracted extensive research interest over the last years [8,13,20].
However, what is usually overlooked is that the phenomena represented by time series are often also associated with geographic locations, e.g., time series generated by sensors installed at fixed positions. In such cases, spatial distance also plays an important role in the analysis, since discovery of trends and patterns may depend not only on time series similarity but also on geographic proximity. Motivated by this observation, in previous work [6,5] we introduced the concept of geolocated time series and we proposed hybrid indexing techniques that efficiently support the retrieval of time series based on both spatial distance and time series similarity.
In particular, we introduced the BTSR-tree [6], a hybrid index that first builds an R-tree over the locations of the time series data. It then enhances each node with appropriate upper-and lower-bounding time series (MBTS) that enclose the subset of time series represented by it. Combining MBTSs and MBRs, the query evaluation algorithm can simultaneously prune the search space based on time series similarity and spatial distance while traversing the index. To further increase its pruning power, the BTSR-tree groups together similar time series within each node to derive tighter bounds.
This existing approach for hybrid search over geolocated time series using the BTSR-tree supports only global time series similarity, i.e., similarity measured across the entire length of time series. Specifically, as in other works in this area [8,11,2,3], the distance between two time series is measured by aggregating the pairwise Euclidean distance of their respective values across the entire sequences. However, in many cases, more fine-grained trends and patterns may exist, which are missed under this global similarity measure. For example, consider two time series representing the hourly energy consumption of two nearby buildings over a week, and assume that the two buildings exhibit a similar consumption pattern during working days but a different one in weekends. A query imposing a similarity threshold over the entire week would fail to identify these two geolocated time series as similar. However, it may be useful to discover that there is a period of up to 5 days during which these two time series are actually similar.
Motivated by this observation, in this work we extend our previous approach on hybrid queries over geolocated time series to support local similarity of time series, thus allowing more flexible and fine-grained queries and analyses. The local similarity score between two time series T i and T j is defined as the maximum number of consecutive timestamps during which the respective values of T i and T j do not differ by more than a user-specified threshold . Notice that, compared to global similarity, this condition is more relaxed, in the sense that it is applied to subsequences of length lower than T i and T j , but at the same time stricter, in the sense that the threshold is required to be satisfied at each individual timestamp during the selected period rather than on the aggregate distance over all timestamps.
Combining this local similarity constraint with a filter on spatial distance leads to a novel set of hybrid queries. Figure 1 shows an example with a query time series T q searching over a set of time series T 1 , . . . , T 9 for those within radius ρ from its location and also locally similar to T q . In particular, with respect to a given , results should also be locally similar to T q for at least 5 consecutive timestamps. Qualifying results include T 2 with local similarity score σ 2 = 5 (bottom chart), and T 7 with σ 7 = 7 (top chart).
It turns out that such hybrid queries involving local similarity can still be evaluated using the BTSR-tree index. We first present a baseline method employing a sweep-line algorithm to check for local similarity, and then describe how this can be optimized by using appropriately placed checkpoints, based on the local similarity score threshold specified by the query, in order to skip unnecessary comparisons. Despite the fact that this saves some computations, the resulting time savings are relatively small, since the number of index nodes that need to be probed is not essentially reduced. To overcome this problem, we introduce an improvement to the BTSR-tree index, which is based on temporally segmenting the time series bounds within each node and deriving tighter bounds per segment. Once the time series bounds in each node become more fine-grained, pruning the search space for local similarity queries proves much more effective.
Summarizing, our main contributions are as follows: • We extend our previous work on hybrid queries for geolocated time series to support local time series similarity. We consider both range and top-k queries, including combined criteria for spatial distance and local time series distance.
• We present how such queries can be answered efficiently exploiting the previously introduced BTSR-tree index.
• To achieve greater savings in execution time by further reducing node accesses, we propose an enhanced variant of BTSR-tree, called SBTSR-tree, which additionally employs temporal segmentation in each node to derive tighter, more fine-grained time series bounds.
• We experimentally evaluate our methods using real-world datasets from different application domains, showing that BTSR-tree can efficiently handle hybrid queries under local similarity search, while SBTSR-tree achieves even higher performance due to the additional temporal segmentation.
The remainder of the paper is structured as follows. Section 2 reviews related work. Section 3 formally defines the problem. Section 4 presents how query evaluation under local time series similarity can be executed using the BTSR-tree, while Section 5 presents the enhanced SBTSR-tree. Section 6 reports our experimental results, and Section 7 concludes the paper.

Related Work
Similarity search over time series has provided a wide range of algorithmic approaches; a detailed survey with experimental evaluation is available in [8]. Initially, the focus was mostly on wavelet-based methods [4] to reduce the dimensionality of time series and generate an index based on the transformed sequences. In contrast, state-of-the-art approaches for time series indexing are based on the Symbolic Aggregate Approximation (SAX) representation [11]. The first index in this family was iSAX [17], offering multi-resolution representations for time series. Further extensions like iSAX 2.0 [2], iSAX2+ [3], ADS+ [21], Coconut [10], DPiSAX [18], and ParIS [14] provided a wide range of advanced capabilities. These indices support global similarity search, i.e., the similarity score is computed over the entire length of the compared time series, as opposed to local similarity, which allows to consider similar subsequences. The most recent addition to this SAX-based family is ULISSE [12], which can answer similarity search queries of varying length. However, this still differs from our setting, since in ULISSE the goal is to build an index that supports similarity search for queries of any length within a given range [ min , max ]. Furthermore, none of the aforementioned approaches supports geolocated time series, and thus cannot efficiently process hybrid queries combining conditions on spatial distance and time series similarity.
The problem of subsequence matching over time series is to identify matches of a (relatively short) query subsequence across one or more (relatively long) time series. The UCR suite [15] offers a framework comprising various optimizations regarding subsequence similarity search. Matrix Profile [19] includes methods for detecting, for each subsequence of a time series, its nearest neighbor subsequence, by keeping track of Euclidean distances among candidate pairs. Applying such approaches in our setting is not straightforward. First, they involve Euclidean or DTW distances, which are different from our definition of local similarity score, hence the pruning heuristics do not hold in our case. Second, they do not consider geolocated time series, thus spatial filtering has to be carried out independently, which reduces pruning opportunities.
To the best of our knowledge, the only index that supports searching over geolocated time series is the BTSR-tree [6,5]. This hybrid index follows a similar rationale set by spatio-textual indices [7] that can facilitate evaluation of queries combining location-based predicates with keyword search. In a similar spirit, BTSR-tree is a spatial-first index based on the R-tree that can additionally compute bounds on similarity of time series instead of a textual similarity between documents. Apart from an MBR, each node also stores bounds over the time series indexed in its subtree. Thus, it offers increased pruning capabilities for range and top-k queries involving both time series similarity and spatial proximity. In the current work, we show how BTSR-tree can be used for another family of hybrid queries involving local similarity of time series. Furthermore, we introduce a variant structure, called SBTSR-tree, which constructs tighter bounds over temporally segmented time series to offer stronger pruning power.

Local Similarity Search on Geolocated Time Series
Next, we briefly present some background on geolocated time series and the BTSR-tree index, and then formally define the problem.  a location, denoted by T.loc. The spatial distance d between two geolocated time series is the Euclidean distance of their respective locations.

Preliminaries
The BTSR-tree Index. In [6], we have introduced the BTSR-tree index, which is based on the notion of Minimum Bounding Time Series (MBTS). In a similar manner that an MBR encloses a set of geometries, an MBTS encloses a set of time series T using a pair of bounds that fully contain all of them. Figure A BTSR-tree index is initialized as an R-tree [9] built on the spatial attributes of the given geolocated time series dataset, as depicted in the example of Figure 3. Besides MBRs, each node is enhanced to also store MBTSs, shown as colored strips per node in Figure 3c. This enables efficient pruning of the search space when evaluating hybrid queries combining time series similarity with spatial proximity. For each child, a node stores a pre-specified number of MBTSs. Each MBTS is calculated according to Eq. 1. Construction and maintenance of the BTSR-tree follow the procedures of the R-tree for data insertion, deletion and node splitting. Objects (i.e., geolocated time series) are inserted into leaf nodes and any resulting changes are propagated upwards. Once the nodes have been populated, the MBTS of each node are calculated bottom-up, relying on k-means clustering according to their Euclidean distance in the time series domain. The example in Figure 2 depicts the k = 2 MBTSs (as two bands with a thick outline) obtained for a set of time series (shown as thin polylines). In a BTSR-tree, each parent node receives all the MBTSs of its children and computes its own k MBTSs. The process continues upwards, until reaching the root.

Problem Definition
We first define the local similarity between time series, and then present the query variants we consider in this paper.

Definition 1 (Local Time Series Similarity)
The local similarity score σ between two time series T and T is the maximum count of consecutive timestamps during which the respective values of T and T do not differ by more than a given margin , i.e., σ(T, T , ) = |I max |, where I max is the longest consecutive time interval I such that In this work, our goal is to efficiently support hybrid queries on geolocated time series that retrieve the results based both on spatial proximity and local similarity. Specifically, we focus on the following types of queries (hereafter referred to as LS-queries): • Q rr (T q , ρ, , δ): Given a geolocated time series T q , retrieve every geolocated time series T such that T is located within range ρ from T q , i.e., d(T q , T ) ≤ ρ and has local similarity to T q at least δ, i.e., σ(T q , T ) ≥ δ.
• Q kr (T q , k, , δ): Given a geolocated time series T q , retrieve the spatial k-nearest neighbors to T q that also have local similarity to T q at least δ.
• Q rk (T q , ρ, , k): Given a geolocated time series T q , retrieve the top-k geolocated time series that have the highest local similarity to T q with respect to and are located within range ρ from T q .
Example 1 Figure 1 depicts an example of the Q rr (T q , ρ, , δ) query. Given the geolocated time series T q as query, we seek the spatially close ones (i.e., within a circle of radius ρ) that are also locally similar within margin for at least δ timestamps. In this example, despite five geolocated time series being within range, only T 2 and T 7 qualify for the final result, since these are the ones that are also locally similar for at least one time interval of length at least δ.

LS-Queries Using the BTSR-tree
A straightforward approach for answering LS-queries would be to use a spatial index to first filter by spatial distance and then perform a sequential scan across each result to filter out those having local similarity score below the given threshold. This suffers from generating an unnecessarily large number of intermediate results which are then discarded. Instead, we propose to process LS-queries by leveraging the BTSR-tree index [6], which can prune the search space simultaneously according to both criteria.
While traversing the BTSR-tree, spatial filtering is performed at each node N by computing the bounding distance mindist sp between the location of T q and the MBR of N , as in R-Trees [16].
For time series similarity, we exploit the MBTS stored within each node. Considering an MBTS at a node N , we calculate its distance mindist i ts from T q at each timestamp i as: where B i N and B i N are the upper and lower values of the MBTS at timestamp i. By definition of MBTS, no time series indexed under N can differ from T q by less than mindist i ts at timestamp i. Hence, only at those timestamps that mindist i ts ≤ , it is possible that a time series indexed under N is locally similar to T q . Subsequently, we can compute a local similarity bound σ B : that reflects the maximum interval I of consecutive timestamps where the distance computed by Eq. 2 does not exceed margin . This value is an upper bound of the local similarity scores of T q with any time series enclosed in this MBTS.  shows that T q deviates from the given MBTS by no more than during two intervals: one consisting of |I 1 | = 5 consecutive timestamps and a smaller one with only |I 2 | = 2 timestamps (shown as square points). So, the local similarity bound for this MBTS is σ B = 5.
By construction, the MBTSs of a child node N get tighter bounds compared to those of its parent N as we descend the BTSR-tree. It is easy to verify that hence local similarity bounds can only diminish when descending the index. This bound provides a useful pruning condition during search with a cutoff threshold δ. Any node where all its MBTSs have local similarity bound σ B below δ can be safely pruned.
Next, we describe a baseline approach that employs a sequential scan over MBTSs, and then we present an optimization that prioritizes selected checkpoints to avoid many point-wise comparisons.

Sweep Line Approach
We explain how the BTSR-tree can be used, in conjunction with a simple sweep-line algorithm, to answer each of the three LS-queries, taking advantage of the two types of bounds, mindist sp and mindist ts , described above.
Q rr (T q , ρ, , δ): We traverse the BTSR-tree starting from its root. At each inner node N , we first check whether mindist sp (T q , M BR N ) ≤ ρ. If so, we employ a sweep line across the time axis to compute the local similarity bound σ B (T q , M BT S N , ) for every MBTS included in N . If all resulting bounds σ B are below δ, the subtree under N is pruned. Otherwise, the search continues at the children. Upon reaching a leaf node, we fetch the geolocated time series contained therein, and verify the query constraints against each one. Each T such that d(T q .loc, T.loc) ≤ ρ and σ(T q , T, ) ≥ δ is added to the results.
Q kr (T q , k, , δ): We maintain a priority queue P containing both inner nodes (sorted by ascending mindist sp ) and geolocated time series (sorted by ascending spatial distance to T q ). We start by adding to P the root of BTSR-tree.
In each iteration, we retrieve the top element from P . If it is an inner node, we visit its children to calculate local similarity bounds σ B according to Eq. 3. For any child N that σ B of one of its MBTSs satisfies threshold δ, we search the subtree of N . Then, we calculate the corresponding spatial distance (mindist sp for a node N or Euclidean distance for a geolocated time series T ) and insert it back to P . Once we encounter a geolocated time series T at the top of P , we add it to the results. The process terminates once k geolocated time series have been obtained.
Q rk (T q , ρ, , k): This query is evaluated similarly to the previous one, with two differences. The first difference is that the priority queue P is now sorted based on local similarity bounds in descending order, instead of spatial distance bounds in ascending order. The second is that before inserting an item (node or time series) to P , its spatial distance (mindist sp or exact) is calculated, and if it is higher than ρ the item is skipped. The traversal starts again from the (a) Checkpoints placed every δ timestamps.
(b) Local similarity starting before checkpoint at t .
(c) Local similarity ending after checkpoint at t . root, and terminates once k time series have been retrieved from the top of P . These are the top-k results with respect to local similarity (if another time series T had higher local similarity, it would have been retrieved from P first), and they are located within range ρ from T q (otherwise, they would not have been admitted to P ).

Checkpoint Approach
The drawback of the sweep-line approach is that it needs to perform a comparison for each individual timestamp to eventually determine the exact or maximum local similarity of a given time series or node, respectively. In the following, we explain how we can use checkpoints along the time axis to avoid this exhaustive search. These checkpoints prioritize specific timestamps when checking for candidate matches to eagerly filter out non-qualifying items.
Assume a query with local similarity threshold δ. We can place checkpoints at every δ timestamps, and only apply the local similarity filter (i.e., |T i q − T i | ≤ ) at those. If no checkpoint satisfies the condition, this item can be safely pruned since it cannot have local similarity to T q at least δ (as this would require the condition to be true for at least δ consecutive timestamps, thus crossing at least one checkpoint). Figure 5a shows an example with checkpoints placed along the time axis every δ = 5 timestamps. For clarity, we consider a single time series T . Assume a checkpoint at timestamp t and a minimal duration δ starting at timestamp t − δ + 1 for asserting local similarity with query T q , as shown with the grey strip in Figure 5b. This interval cannot have smaller duration, as it would not satisfy the δ constraint. Thus, the local similarity condition will evaluate to true at checkpoint t . Similarly, if such an interval ends at timestamp t + δ − 1 (Figure 5c), it will be detected at the checkpoint at t . This observation entails that it suffices to check for local similarity only at checkpoints, i.e., every δ timestamps. We denote the set of checkpoints as C, determined at query time. If a checkpoint satisfies the condition, then we need to scan both forward and backward from it to determine the actual local similarity score, i.e., to find the exact extent of the time interval for which the condition holds. Figure 6 exemplifies the use of checkpoints for comparing T q to an MBTS of a node for δ = 5 timestamps. Instead of sequentially performing 11 comparisons until verifying that local similarity score σ is at least δ (i.e., we stop the verification at t = 11, once σ = 5), we check only around the checkpoints. At the leftmost checkpoint c 1 , no local similarity is found (T q is farther than from the MBTS), so we skip directly to checkpoint c 2 . Since T q differs by less than at c 2 , we need to compare values backward and forward, up to the previous and next checkpoint, respectively. This requires only 6 comparisons instead of 11 to decide that this node may contain candidates. Next, we describe how probing with checkpoints is applied during evaluation of LS-queries.
Q rr (T q , ρ, , δ): Algorithm 1 outlines the procedure. Initially, we obtain the children of the root node in a list and place the checkpoints every δ timestamps (Lines 1-3). We iterate over each item N in this list. If N is an inner node, we have to examine whether both constraints with respect to ρ and δ are met for each of its children. Verification of MBTS against query T q will be discussed shortly. If this is the case, we traverse the sub-tree of each child in the same manner, by adding it to the list (Lines 7-11), thus descending the tree. If the examined node is a leaf (Line 12), we iterate over each contained time series T to check the constraints ρ and δ. If T qualifies, it is added to the results (Lines 13-15). Note that now the calculation of local similarity scores for geolocated time series is based on checkpoints (Line 14), as discussed above.
Verification of MBTS against the local similarity constraints , δ is applied using checkpoints (Lines 17-38). This verification concerns each MBTS in a given node N . At each checkpoint c, we first verify whether its mindist c ts to query T q is at most (Line 20). If so, we first scan backward to inspect whether there are at least δ consecutive timestamps where T q deviates by at most from this MBTS (Lines 22-29). Similarly, we probe forward from checkpoint c (Lines 30-37). In either case, once local similarity no longer holds at a timestamp, probing skips to the next checkpoint. If the check fails for all checkpoints of all MBTSs, then this node cannot contain any results (Line 38).
Q kr (T q , k, , δ): We follow a similar procedure to the one in Section 4.1 for query Q kr , employing the same verification process over MBTSs and time series as in Algorithm 1. Algorithm 2 describes the procedure. We start by adding the root node to a priority queue P based on spatial distance (Line 2). After determining the checkpoints using the given δ (Line 3), we iteratively retrieve elements from P (Line 5). Then, three cases may occur: (i) If this element is a time series (Lines 6-9), it is guarranteed to be a result, given that P is sorted based on spatial distance from T q . Indeed, any subsequent element must be located farther than the current. When list R obtains the required number k of results, the search terminates.
(ii) The element is a leaf node (Lines [10][11][12][13][14]: In this case, we obtain each time series T contained in this leaf, and verify the local similarity score of T against δ. If the condition is met, we calculate the spatial distance of candidate T from query T q and push T into the priority list along with its spatial distance (Lines 10-14).
(iii) If the element is an inner node, we iterate over its children and only push back to the queue the ones whose MBTSs are verified against and δ using checkpoints (Lines [15][16][17][18][19]. Q rk (T q , ρ, , k): The procedure for this query is listed in Algorithm 3. Notice that for employing checkpoints, we need a local similarity threshold δ, so as to determine their placement, but this query does not specify a fixed δ. To be able to obtain one during search, we now maintain two priority queues: P holds inner nodes sorted by local similarity bounds (Eq. 3), while R keeps up to k geolocated time series sorted by local similarity scores (as in Def. 1). We initially set δ = 1, so checkpoints are trivially placed at every timestamp. This implies that computation of local similarity scores with δ = 1 is equivalent to the sweep line approach. However, δ increases with the detection of qualifying results, hence checkpoints will progressively get placed more sparsely. The search starts by adding the BTSR-tree root in P (Line 2). We iteratively poll the top element from P , and there are two possible cases: (i) The top element is a leaf node. Then, we iterate over the contained time series and add the ones that satisfy the spatial condition (ρ) to R, along with their corresponding local similarity score σ if it exceeds the current value of δ (Lines 8-12). Once R exceeds capacity k, its last element is evicted to make room for the newly Algorithm 1: Q rr (T q , ρ, , δ) return F alse inserted one and δ is updated according to the local similarity score σ k of the k-th element in R. In this case, the placement of checkpoints is re-adjusted according to the increased δ value (Lines 13-16).
(ii) The top element is an inner node. In this case, we iterate over each child N and check if mindist sp (T q , M BR N ) ≤ ρ. If N qualifies, we calculate the local similarity bound σ B of all its MBTSs using checkpoints. If the maximum among these bounds max(σ B ) ≥ δ, then N is inserted to P with this maximum score (Lines 17-25).
The process terminates once the top element in P has local similarity less than δ (Lines 6-7). The result is the contents of R.

Index Structure
The BTSR-tree index uses k-means clustering to cluster the time series under each node and then stores the MBTSs of those clusters. However, clustering entire time series typically generates many overlapping MBTSs, incurring much dead space. This has a negative impact on the pruning power of the index, especially when considering local similarities. Figure 7a depicts such a case of six time series indexed in a node. A k-means clustering with k = 3 will form the depicted MBTSs denoted with shaded colors. As a result, the dark area A represents the overlap between mbts.1 and mbts.2 and actually makes those bounds less tight. Hence, such MBTSs inflate estimates for local similarity bounds, and thus lead to unnecessarily descending further down the index.
To reduce the amount of overlap within the MBTSs of nodes, we introduce an extended version of the BTSR-tree, named SBTSR-tree. SBTSR-tree attempts to eliminate as much overlap as possible, through segmentation of time series. Figure 7b depicts the intuition. If we segment the time series before applying k-means, the resulting MBTSs for each segment tend to be tighter, eliminating the excessive overlap A from Figure 7a. The SBTSR-tree is built similarly to BTSR-tree. The only difference is that the MBTSs of each node are calculated per segment. In this method, we assume a pre-defined number s of segments, but segmentation is orthogonal to our problem and can be carried out by applying existing methods like [1]. Ultimately, SBTSR-tree allows for more aggressive pruning when traversing the index.

Cross-Segment Continuity Via Bit-Vectors
A downside of the segmentation approach is the loss of the MBTS continuity across time, which results in MBTSs enclosing different time series in neighboring segments. For example, in Figure 7b, there are no MBTSs in the right segment containing the same time series as mbts1.1 and mbts1.2, a fact which hinders the calculation of local similarity on the segment boundaries (the vertical line). To overcome this, we introduce a bit-vector V along each MBTS of a segment, having one bit for each MBTS created. If in the current segment a bit in vector V of a given MBTS is set, this indicates that this MBTS encloses at least one common time series with another MBTS in the next segment. In the example shown in Figure 7b, V = 110 for mbts1.1 indicates common time series with mbts2.1 and mbts2.2 in the next segment, while V = 001 for mbts1.3 signifies common time series with only mbts2.3. This way, to calculate local similarity, we can easily identify all the MBTSs that share common time series among two successive segments.
To evaluate LS-queries, traversal of the SBTSR-tree index follows a similar rationale to the procedure in Section 4.2.
For each checkpoint c, we first obtain the segment where it falls in, and we scan each MBTS leftward and rightward from c, as discussed in Section 4.2. If we cross the border to another segment, the available bit-vectors directly identify the MBTS that need be examined in this neighboring segment. This propagates until the local similarity constraints ( and δ) are satisfied. Figure 8 illustrates an example of a node verification. Let us consider a predetermined number of three segments and the corresponding MBTS of each segment for that node. Suppose that there exists a checkpoint c on the second segment. To verify whether this node satisfies the local similarity constraints, we start from checkpoint c and we check leftwards whether mindist i ts ≤ for each timestamp. If the currently examined timestamp falls in the first segment, we fetch the corresponding MBTS and bit-vectors and continue checking whether mindist i ts ≤ in both MBTS (green shaded), as their bit-vectors both indicate common members with the first one in segment 2. A similar procedure is followed rightwards, where we only have to check the first MBTS, according to the bit-vectors.

Experimental Evaluation
Next, we report results from a comprehensive evaluation of our methods against real-world datasets.

Datasets
We use three real-world datasets (Table 1)  Synthetic. To test scalability, we augmented the Flickr dataset by slightly moving each location in a random manner and altering each time series value by a random number between 1 and 10. We produced three additional synthetic datasets each containing ×2, ×3, ×4 the number of time series from the original dataset.

Index and Query Parameters
To evaluate the performance benefits observed in the experiments only based on pruning, we tuned the index parameters to fixed values. The minimum (m) and maximum (M ) number of entries stored in each node are set to 40 and 100, respectively. For both BTSR-tree and SBTSR-tree, the number of MBTS to 10 and for SBTSR-tree, the number of segments s is also set to 10. The query parameters involve the spatial distance and local similarity thresholds, i.e., ρ, , δ and k. The values of these parameters are set differently for each dataset, based on their characteristics; default values are shown in Table 1. The value of ρ is set relatively, by setting the covered area as a percentage of the total area. Similarly, is set as a percentage of the maximum difference between the observed values.

Evaluation Setting
Each experiment is performed using a randomly selected workload of 100 queries for each dataset and we report the average response time. All indices are held in memory, while the leafs contain pointers to files with geolocated time series stored on disk. All methods were developed in Java. Tests were executed on a server with 4 CPUs, each containing 8 cores clocked at 2.13GHz, and 256 GB RAM running Debian Linux.

Query Performance
We compare the average per query execution time for all three queries using sweep line and checkpoint methods on BTSR-tree and the checkpoint method on SBTSR-tree.
6.2.1 Q rr (T q , ρ, , δ) Figure 9 illustrates the query performance for varying thresholds ρ and and the first column of Figure 10 for varying δ, on all three datasets. It is apparent that the SBTSR-tree with the checkpoint approach outperforms the rest in all cases. Its superior pruning power is attributed to the segmentation, which yields tighter bounds within the nodes and consequently less disk accesses. The sweep line and checkpoint methods over BTSR-tree perform similarly in all cases. Both methods access the same nodes, but the checkpoint approach needs to examine significantly less values across time in order to determine local similarities. However, since all local similarity calculations take place inmemory, computation cost does not make a big difference, compared to the lesser node accesses required with the SBTSR-tree.
More specifically, for the crime dataset, relaxing ρ ( Figure 9b) has a negative impact on all three methods as more nodes have to be accessed and pruning depends mostly on the value. SBTSR-tree increasingly outperforms the rest as ρ increases, due to its more aggressive pruning on local similarity. For the case of increasing (Figure 9c), the result is the opposite, as this way the parameter is relaxed and more nodes get accessed. For very large values, pruning is solely based on spatial distance and all approaches perform similarly. Finally, increasing δ (Figure 10b) also increases the difference in performance among the three approaches, while it also reduces the average query response time. This is due to large numbers of subsequences qualifying for small δ values, resulting in more node accesses. As δ increases, pruning is more rapidly improved in the case of SBTSR-tree due to its tighter bounds.
The results are similar but with larger differences for the Flickr dataset (Figures 9d, 9e and 10f). Intuitively, the less periodicity in a dataset, the more the benefit from segmentation; if the time series in the dataset exhibit periodicity, the bounds that will occur from applying k-means clustering on the whole sequences will be relatively tighter than otherwise. The Flickr dataset, due to its nature, is more random than the crime dataset, which justifies the larger differences. This explanation is also supported by the results for the taxi dataset, illustrated in Figures 9b, 9c and 10b. Despite a similar behavior in varying all thresholds, the differences in average query response time among the different approaches are smaller than in the crime and Flickr datasets, due to the high daily periodicity of taxi drop-offs.
6.2.2 Q kr (T q , k, , δ) Figures 10c, 10g and 10k depict the results for the Q kr (T q , k, , δ) query for the three datasets. As k increases, more nodes have to be traversed in order to fetch the additional results, and the execution time increases for all methods. Nevertheless, SBTSR-tree still clearly outperforms the other two algorithms. : Query Q rr (T q , ρ, , δ) for varying ρ and .

Q rk (T q , k, ρ)
Finally, Figures 10d, 10h and 10l depict the results for the Q rk (T q , k, ρ) query. In this case, the performance deterioration as k increases is less abrupt, especially for the crime dataset, as usually the top-k results are spatially closely located and are retrieved quickly. Again, the largest and smallest differences are spotted on the Flickr and taxi datasets, respectively.

Scalability
We performed a scalability evaluation for all three queries using the Flickr-based synthetic datasets, again measuring the average query response time for the same query workload. The results for increasing dataset size (up to four times) are depicted in Figure 10. In all cases, the SBTSR-tree-based approach scales better, especially in the top-k queries (Figures 10i and 10m), where the larger difference observed in Figures 10g and 10h is further augmented.

Conclusions
We have studied three variants of hybrid queries on geolocated time series, involving both range and top-k search, and combining spatial distance with local time series similarity. The latter allows to measure similarity of time series over subsequences instead of their entire length, and thus enables the identification of more fine-grained trends and patterns. The queries are evaluated by hybrid index structures, in order to allow for simultaneous pruning by both  Figure 10: Per column: Q rr (T q , ρ, , δ) for varying δ -Q kr (T q , k, , δ) for varying k -Q rk (T q , k, ρ) for varying k -Scalability.
criteria. We first discuss query evaluation using the previously proposed BTSR-tree, and then we further extend it to derive the SBTSR-tree which exhibits even better performance, by using temporal segmentation of time series to derive tighter bounds. Our evaluation against several real-world datasets has shown that SBTSR-tree can compute results much faster for all query variants.