A Novel Index Method for K Nearest Object Query over Time-Dependent Road Networks

Knearest neighbor (kNN) search is an important problem in location-based services(LBS) and has been well studied on static road networks. However, in real world, road networks are often time-dependent; i.e., the time for traveling through a road always changes over time. Most existing methods forkNN query build various indexes maintaining the shortest distances for some pairs of vertices on static road networks. Unfortunately, these methods cannot be used for the time-dependent road networks because the shortest distances always change over time. To address the problem ofkNN query on time-dependent road networks, we propose a novel voronoi-based index in this paper. Furthermore, we propose a novel balanced tree, namedV-tree, which is a secondary level index on voronoi-based index to make our querying algorithm more efficient. Moreover, we propose an algorithm for preprocessing time-dependent road networks such that the waiting time is not necessary to be considered. We confirm the efficiency of our method through experiments on real-life datasets.


Introduction
With the rapid development of mobile devices, nearest neighbor ( NN) search on road networks has become more and more important in location-based services (LBS) [1][2][3][4]. Given a query location and a set of objects (e.g., restaurants) on a road network, it is to find nearest objects to the query location. NN search problem has been well studied on static road networks. However, road networks are essentially dynamic complex networks but not static in real world [5][6][7][8].
The "dynamic" means that the traveling time on road network is always time-dependent. For example, the Vehicle Information and Communication System (VICS) and the European Traffic Message Channel (TMC) are two transportation systems, which provide real-time traffic information to users. Such road networks are time-dependent; i.e., travel time for a road varies with taking "rush hour" into account.
The existing works propose various index techniques for answering nearest object query on road networks. The main idea behind these indexes is to partition the vertices into several clusters, and then the clusters are organized as a voronoi diagram or a tree (e.g., R-tree, G-tree). All these methods precompute and maintain the shortest distances for some pairs of vertices to facilitate NN query. Unfortunately, these indexes cannot be used for time-dependent road networks. The reason is that the minimum travel time between two vertices often varies with time. For example, and V are in the same cluster for one time period but they may be in two distinct clusters for another time period because of the minimum travel time varying with time. Therefore, the existing index techniques based on the static shortest distance cannot handle the case that the minimum travel time is time-dependent. Moreover, the waiting time is allowed on time-dependent road networks; i.e., someone can wait a time period to find another faster path. When the waiting time is considered, it is more difficult to build an index for NN query by existing methods because it is difficult to estimate an appropriate waiting time for precomputing the minimum travel time between two vertices.

Complexity
Recently, there are some works about NN query on time-dependent graphs [9][10][11][12]. Most of these works utilize A * algorithm to expand the road networks by estimating an upper or lower bound of travel time. There are two main drawbacks of these methods. First, in these works, the FIFO (first in first out) property is required for the networks and the waiting time is not allowed. Second, the indexes proposed by these works are based on the estimated value of travel time. However, these indexes cannot facilitate query effectively for large networks because the deviations are always too large between the estimated and the actual travel time.
In this paper, we study nearest object query on timedependent road networks. A time-dependent road network is modeled as a graph with time information. The weight of every edge is a time function , ( ) which specifies how much time it takes to travel through the edge (V , V ) if departing at time point . The main idea of our method is to precompute minimum travel time functions (or mtt-function for short) instead of concrete values for some pairs of vertices and then design a "dynamic" voronoi-based index based on such functions. Here "dynamic" means that in a time-dependent network it can be easily decided which cluster a vertex should be in for any given time point . Furthermore, a secondary level index is built on voronoi-based index, which makes our querying algorithm more "smart" for nearest objects searching; that is, the nearest objects will be searched and the others will be filtered as early as possible. Different to previous works, our index can facilitate query effectively for large networks. Moreover, our method does not require the FIFO property for networks and we allow waiting time on every vertex.
The main contributions of this paper are summarized as below. First, we propose an algorithm to process , ( ) for every edge such that the waiting time is not necessary to be considered. Let and * be the original graph and the graph after processing , ( ). We can prove that a shortest path with consideration of waiting time on is one-to-one mapped to shortest path without waiting time on * . Furthermore, we show how to compute the mtt-function for two vertices. Second, we propose a novel voronoi-based index for time-dependent road networks and an algorithm to answer NN query using our index. Third, we propose a novel balanced tree structure, named V-tree, which can be considered as the secondary level index on voronoi-based index to make nearest object query more efficient. Finally, we confirm the efficiency of our method through extensive experiments on real-life datasets.
The rest of this paper is organized as follows. Section 2 gives the problem statement. Section 3 decribes how to process , ( ) and compute the mtt-function. Section 4 explains how to build the voronoi-based index for timedependent networks. Section 5 introduces the V-tree and how to answer the nearest object query using it. The experimental results are presented in Section 6. The related work is in Section 7. Finally, we conclude this paper in Section 8.

Problem Statement
Definition (time-dependent road network). A time-dependent road network is a simple directed graph, denoted as ( , , ) (or for short), where is the set of vertices; ⊆ × is the set of edges; and is a set of nonnegative value function. For every edge (V , V ) ∈ , there is a time function , ( ) ∈ , where is a time variable. A time function , ( ) specifies how much time it takes to travel from V to V , if one departs from V at time point .
In this paper, we assume that , ( ) ≥ 0. The assumption is reasonable, because the travel time cannot be less than zero in real applications. Our work can be easily extended to handle undirected graphs. An undirected edge There are several works that study how to construct time function , ( ), which is always modeled as a piecewise linear function [6,7,13] and it can be formalized as follows: Given a path , the travel time of is time-dependent. In order to minimize the travel time, some waiting time is allowed at every vertex V in . That is, when arriving at V , one can wait a time period if the travel time of can be minimized. We use arrive(V ) and depart(V ) to denote the arrival time at V and departure time from V , respectively. For each V in , we have Thus the travel time of path is ( ) = arrive(V ℎ ) − . Given two vertices V and V in , the minimum travel time from V to V with departure time is defined as , ( ) = min{ ( ) | ∈ , }, where , is the set of all the paths from V to V in . Obviously, , ( ) is also a function related to the departure time . We call , ( ) the minimum travel time function (or mtt-function shortly) from V to V . Letting | | be , in the following, we use , + ( ) to represent mtt-function from a vertex V to an object , in order to distinguish from , ( ) from V to a vertex V . Note that an object is also a vertex regarded as V + in the network.
There is a special case that the waiting time is only allowed on a subset of ; that is, people are allowed to wait a time period only when they are at the vertex V ∈ . For this case, we only need to consider that the waiting time is always zero, i.e., ≡ 0, for every vertex V ∈ \ . Therefore, the method proposed in this paper can be extended to handle this case easily.
Next, we give the definition of NN query over timedependent road networks.

Minimum Travel Time Function
We precompute mtt-functions for some pairs of vertices and then build the index to facilitate NN query over time-dependent road networks. In this section, we first describe how to process the time function , ( ) for every edge in such that the waiting time is not necessary to be considered when computing mtt-function and then we explain how to compute mtt-function without waiting time.
. . Preprocessing Time Function for Every Edge. Given a path , the waiting time is allowed for any vertex V ∈ . However, it is not easy to find an appropriate value of for every V ∈ to minimize the travel time of . In this section, we propose an algorithm to convert time function , ( ) to a new function * , ( ) for every edge (V , V ) ∈ . We call * , ( ) the "no waiting time function" of edge (V , V ) (or nwtfunction for short). The waiting time can be considered as zero when nwt-function is used to compute the minimum travel time of path . The nwt-function * , ( ) is defined by the following: * Note that when the waiting time is only allowed on a vertex subset , we only need to calculate nwt-function * , ( ) for every vertex V ∈ . For every vertex V ∈ \ , the nwt-function * , ( ) is exactly the time function , ( ) because ≡ 0; that is, anyone is not allowed to wait a time period at V .
The following theorem guarantees that the nwt-function * , ( ) can be used to compute the minimum travel time for any path in without waiting time. Proof. Let = V 1 → V 2 → ⋅ ⋅ ⋅ → V ℎ be a given path with the departure time . * is the waiting time on V (1 ≤ ≤ ℎ) minimizing the travel time of in . We have depart(V ) = arrive(V ) + * and arrive(V +1 ) = depart(V )+ , +1 (depart(V )). Similarly, we have depart * (V ) = arrive * (V ) and arrive * (V +1 ) = depart * (V )+ * , +1 (depart * (V )) for * . We only need to prove arrive(V ℎ ) = arrive * (V ℎ ). It can be easily proved by induction on V . We omit it due to the space limitation.
. . Computing Minimum Travel Time Function. We adopt a Dijkstra-based algorithm proposed in [13] to compute mttfunction for two vertices V and V in . This algorithm is only used in case the waiting time is not allowed. After converting , ( ) to nwt-function * , ( ) for every edge in by Algorithm 1, this algorithm can be used for timedependent graphs with waiting time.
The main idea of this Dijkstra-based algorithm is to refine a function , ( ) iteratively for every V ∈ , where , ( ) represents the earliest arrival time on V if departing from V at time point . In every iteration, algorithm selects a vertex V ∈ and then refines , ( ) by extending a time domain to a larger , where = [ 0 , ] is a subinterval of the whole time domain . , ( ) is regarded as well refined in if it specifies the earliest arrival time at V from V for any departure time ∈ . The algorithm repeats time-refinement process till , ( ) of destination V has been well refined in the whole time domain and then mtt-function , ( ) can be computed as , ( ) = , ( ) − . The more details about this Dijkstra-based algorithm is given in [13]. As shown in [13], the time and space complexities are (( log + ) ( )) and (( + ) ( )), respectively, where ( ) is the cost required for each function (defined in interval ) operation.

The Novel Voronoi-Based Index
We propose a novel voronoi-based index for NN query over time-dependent road networks. In static road networks, the voronoi diagram divides the network (or space) into a group of disjoint subgraphs (or subspaces) where the nearest object of any vertex inside a subgraph is the object generating this subgraph. However, in time-dependent road networks, the nearest object of a vertex may be dynamic. The nearest object of a vertex V may be for departure time ∈ [ 1 , 2 ] but it may be for ∈ [ 3 , 4 ]. The main idea of our novel voronoibased index is also to divide the vertex set into some vertex subsets and every subset is associated with one object ∈ . Different from static road networks, our voronoibased index is time-dependent; that is, every vertex V inside a subset is with a time interval indicating when the object is nearest to V. Next, we describe what the novel voronoi-based index is and how to construct it.
. . What Is the Voronoi-Based Index? Given a vertex V and an object , (V) is called V's V about if it satisfies the following two conditions: (1) is the nearest object of V for any departure time ∈ (V) and (2) there does not exist another (V) ⊃ (V) satisfying the condition (1). Note that (V) may not be a continuous time interval; that is, if is nearest to V for two disjoint departure time intervals The voronoibased index maintains a set for every object ∈ , where is a set of the tuples (V, (V)) for all the vertices V with nonempty (V), i.e., We call the closest vertex-time pair set (or closest pair set shortly) of . For simplicity, we say V is a vertex in if (V, (V)) ∈ . Next, we give the definition of the border vertex.
The border vertex V of indicates that there exists a time point ∈ , ( (V )) such that is not the nearest object of V if one departs at time point .
We use to denote the set of all the border vertices of . For every , is the set of mtt-functions , + ( ) for all vertices V in , that is, and is a matrix of size | | × | | to maintain mtt-function , ( ) for all pairs of vertex V and border vertex V in , i.e., The . . How to Construct e Voronoi-Based Index? We have explained how to compute mtt-function in Section 3. Next, we describe how to compute and for every ∈ .
For every vertex V ∈ , (V ) is initialized as the whole time domain . We refine (V ) iteratively by removing the subintervals on which , + ( ) is larger than , + ( ) for another object . It means is not the nearest object of V when departure time is in these subintervals. For every vertex V in , if there exists an outgoing neighbor V of V , such that V is not in or , ( (V )) ̸ ⊆ (V ), then V must be a border vertex of and it is inserted into .
. . Query Processing by Voronoi-Based Index. Algorithm 2 describes how to find the nearest objects for a query vertex V with departure time . In Algorithm 2, (V ) is a set to 6 Complexity Input: time-dependent graph * , query vertex V , departure time and Output: the nearest neighbor set (V ) 1: , ← , + * , ( + , ); 10: Let be the set including V when = + , ; 11: if if , + > , + , + ( + , ) then 14: , maintain the objects that have been found so far and is a priority queue to maintain a candidate set of whose is possible to be an object in NN set. All ∈ are sorted in an ascending order by the minimum travel time , + from V to . The top in is with the minimum , + and it can be easily done using Fibonacci Heap. (V ) and are initialized as 0 and { }, respectively, where contains V for the departure time , i.e., (V , (V )) ∈ and ∈ (V ). (V ) is expanded iteratively by inserting objects one by one from until | (V )| = . In each iteration, if | (V )| < , Algorithm 2 first dequeues the top from with the minimum , + . The object of must be one of nearest objects of V . It can be guaranteed by Theorem 8. Then will be inserted into (V ). For every border vertex V in , Algorithm 2 computes , as min{ , + , ( + , ) | V ∈ }, where is the entry set of . The "entry" means any path entering into must go through a vertex in . will be updated when Algorithm 2 runs. For every ∉ (V )) at the time point + , , then V will be inserted into as an entry of . For the object of , , + will be updated as , + , + ( + , ) when , + > , + , + ( + , ). If is not in , then will be enqueued into . Otherwise, has been in and will be updated by with new , + . Algorithm 2 terminates when the size of (V ) is .
Example . We use the example in Figure 2 to illustrate the NN querying process for = 3. In this example, V is the query vertex and it is in 1 for the departure time . and (V ) are initialized as { 1 } and 0, respectively. In the first iteration, 1 is dequeued from and then 1 is inserted into (V ). Because V 1 is a border vertex of 1 and V 3 is an outgoing neighbor of V 1 , Algorithm 2 computes ,1 ( ) and ,3 ( ) = ,1 ( ) + * 1,3 ( + ,1 ( )). Note that V 3 is in 2 when = + ,3 ( ) and then it is an entry of 2 . Therefore, 2 is enqueued into . Similarly, 3 is also enqueued into and = { 2 , 3 }. Assume that 2 is nearer to V than 3 and, in the second iteration, 2 is dequeued and (V ) is updated as { 1 , 2 }. In the same way, 4 will be enqueued into in this iteration. In the final iteration, 3 will be dequeued due to 3 being nearer to V and then (V ) = { 1 , 2 , 3 }. Because | (V )| = 3, Algorithm 2 terminates and returns (V ).
The next theorem guarantees the correctness of Algorithm 2.
Theorem 8. In Algorithm , the object of dequeued from in the -th iteration must be the -th nearest object of query vertex V for the departure time .
Proof. We prove it by induction on .

Complexity 7
Basis. Obviously, is dequeued from in the first iteration. By the definition of , is the nearest object of V when the departure time is .
Induction. Assume that the -th nearest neighbor of V is dequeued from in the -th iteration for < . We need to prove it also holds for = . We prove it by contradiction. Let be the closest pair set dequeued from in the -th iteration and is the object of . Suppose that the -th nearest object of V is and ̸ = . Let be the shortest path from V to with the departure time . Because > 1, then is not and there must exist an entry V of in . Letting V be the predecessor of V in , then V must be a border vertex of at time points + , and ̸ = . There are two cases for the object of : (1) is not in the nearest object set of V and (2) is in the nearest object set of V .
For case (1), by the definition of , is the nearest neighbor of V at time point + , , and then we have Thus is nearer to V than when the departure time is . It means must be in the nearest object set of V , which is a contradiction.
For case (2), letting be the -th ( < ) nearest object of V , by the inductive assumption, is dequeued from inth iteration. According to Algorithm 2, is enqueued into in this iteration. Therefore, will be dequeued from in -th iteration instead of , which is a contradiction. The proof is completed.
Time and Space Complexities. The time and space complexities of Algorithm 2 are given below. Let and be the average size of and , respectively. In every iteration, Algorithm 2 upadates , as min{ , , , + , ( + , )} for every border vertex V in . It will cost ( ) time. For every outgoing neighbor V of border vertex V , Algorithm 2 needs to compute , and then it will cost ( ) time, where is the average outdegree of the vertices in . Therefore, the time complexity of Algorithm 2 is ( ( + )). On the other hand, because Algorithm 2 needs to maintain , and , , then the space complexity is ( ( + )).

Optimization of Voronoi-Based Index
In Section 4, we introduce the voronoi-based index on timedependent graphs and propose Algorithm 2 to find the nearest objects with voronoi-based index. Algorithm 2 dequeues the objects iteratively until all nearest objects have been searched. In each iteration, Algorithm 2 uses a prior queue to maintain a candidate set of whose object may be one of the nearest objects. This candidate set is essentially the set of all the closest pair sets adjacent to all the objects which have been searched in (V ). However, for some closest pair set of , even though are not one of nearest objects, Algorithm 2 also needs to maintain in and update the traveling time to and the border vertices in because is adjacent to an object in (V ). It makes our algorithm not efficient enough for nearest object query.
In this section, we propose a novel balanced tree structure on voronoi-based index, named V-tree, to organize all the closest pair sets . V-tree can be considered as a secondary level index for nearest object query. By V-tree, our algorithm can avoid maintaining the closest pair sets whose objects are not in the set of nearest objects. The main idea of V-tree comes from G-tree, which is a balanced tree structure, proposed in [14]. G-tree cannot be used for nearest object query on time-dependent graphs because of the following reasons: (1) G-tree is built on the static graphs where the weight of every edge is a constant value. However, for timedependent graphs, the weight on every edge is a time function , ( ) which is related to the departure time . The value of , ( ) always changes with the change of departure time. Therefore, it is unfeasible to construct G-tree for time-dependent graphs.
(2) G-tree organizes all the vertices in a tree shape based on the distance of two vertices in a static graphs. Different from G-tree, V-tree is a second-level index based on voronoi-based index. It organizes all the closest pair sets in a tree shape. Therefore, we need to define the distance between two closest pair sets and and then V-tree can be constructed.
(3) Because of above two points, the querying algorithm by G-tree cannot work for our problem; then we propose a novel querying algorithm by V-tree.
In the following, we first introduce what is V-tree and how to construct it based on voronoi-based index. Then we propose a novel querying algorithm for nearest object query by V-tree. Finally, we utilize an example to explain why V-tree is more efficient than voronoi-based index.
. . What Is V-Tree. V-tree is a balanced tree structure to organize all the closest pair sets in voronoi-based index. Specifically, every node in V-tree is a collection of some closest pair sets. We first give the definition of -partition for voronoi-based index.
Definition ( -partition for voronoi-based index). Given a collection C of some closest pair sets, a -partition of C is a set {C 1 ⋅ ⋅ ⋅ C } satisfying three following conditions: Note that every C i is a subset of C and it is also a collection of closest pair sets. Every node in V-tree represents a collection C and has children by -partition on C; i.e., every C i (1 ≤ ≤ ) is a child of C. Next, we introduce how to get an appropriate -partition for a given closest pair set C. An edge (V , V ) is called a crossing edge from the closest pair sets to if V and V are the border vertices of and , respectively, i.e., V ∈ and V ∈ . As our discussion in Section 2, the time function of a crossing edge is modeled 8 Complexity as a piecewise linear function , ( ). We define the expected traveling time , for a crossing edge (V , V ) by the following: where is the whole time interval for time function , ( ), i.e., = − 0 . Because , ( ) is a piecewise linear function, , can be calculated as follows: Note that the expected traveling time , is a constant value to estimate the traveling time for crossing edge (V , V ). Given two closest pair set and , we use , to denote set of all the crossing edges from to , i.e., , = {(V , V ) | V ∈ ∧ V ∈ }. Every closest pair set can be regarded as a super vertex and there is an edge from to if , ̸ = 0. The weight of such edge, denoted as , , is defined by the following: It is worth noting that , is the average value of the expected traveling time for all the crossing edge from to . , is called the weight from to . Therefore, the -partition {C 1 , . . . , C } for a given collection C of some closest pair sets can be converted into a graph partition problem. For a pair of ( , ) with , ̸ = 0, if and are in the same collection C (1 ≤ ≤ ), then it is called an inner edge of C . Otherwise, and are in two different collections C and C , respectively, and then it is called an interedge from C to C . Correspondingly, the weight , is called inner weight or interweight, respectively.
In V-tree, a parent node C is partitioned into children nodes {C 1 , . . . , C }. To facilitate nearest object query, an appropriate partition is expected such that the inner weights are less and the interweights are more. Thus the optimalpartition is to find a group of {C 1 , . . . , C } that minimizes the following objective function: where (C ) = ∑ , ∈C , is the summation of all the inner weights , in C and ({C 1 , . . . , C }) is the summation of (C ) for all C . The optimal -partition on C is similar to the traditional graph partition problem which has been well studied [15][16][17]. However, the objective function is to minimize the sum of the interweights for the traditional graph partition. Therefore, for any pair ( , ) in C, if , ̸ = 0, we assign a new weight , = max − , on it, where max represents the maximum weight for all the inner edges in C. Consider the following objective funtion: where (C , C ) = ∑ ∈C , ∈C , is the summation of , for all the inter edges from to and ({C 1 , . . . , C }) is the summation of (C , C ) for all the pairs of C and C . The following theorem guarantees that the optimal -partition under objective functions (⋅) and (⋅) is the same.

Theorem 10. e -partition minimizing (⋅) is exactly thepartition minimizing (⋅).
Proof. Given a -partition {C 1 , . . . , C } on C, let (C , C ) denote the summation of all the inter weights , from C to C , that is, (C , C ) = ∑ ∈C , ∈C , , and then we have Because (C) is independent of -partition on C, then minimizing ∑ C (C ) is equivalent to maximizing ∑ C ,C (C , C ). On the other hand, because , = max − , and , ≥ 0, then maximizing ∑ C ,C (C , C ) is equivalent to minimizing ∑ C ,C (C , C ). Therefore, the -partition minimizing the objective function (⋅) also minimizes the objective function (⋅).
Thus the optimal -partition under objective function (⋅) is a traditional graph partition problem. In this paper, we adopt the multilevel graph partitioning technique (METIS) proposed by Metis et al. in [15], which is a classic graph partition algorithm.
Next, we introduce the concept of the minimum distance, which is to be maintained in V-tree. For two closest pair set and , if , ̸ = 0, we defined the minimum weight from to , denoted as min , , by the following: where (V x , V ) ∈ , is a crossing edge from to and min { , ( )} is the minimum value of time funtion , ( ). Thus min , is the minimum value of min { , ( )} for all the crossing edge in , . A new graph can be constructed from the voronoi-based index; every closest pair set can be regarded as a super vertex. If , ̸ = 0, there is an edge from to and its weight is min , . Therefore, for any two and , the shortest distance from to in this graph is called the minimum distance from to and we denote it by , . Especially, for a closest pair set and a collection C, the minimum distance from to C is denoted by ( , C) and is the minimum value of , for all in C, i.e., ( , C) = min ∈C { , }. The value of ( , C) can be calculated easily by existing single-source shortest distance algorithm. Note that   ( , C) = 0 when ∈ C. Next, we give the definition of V-tree below.
Definition (V-tree). A V-tree, denoted as T , is a balanced tree T that satisfies the following conditions: (1) Every node in V-tree represents a collection C of some closest pair sets. Specially, the root node represents the collection C root of all the closest pair sets in voronoi-based index; (2) Every nonleaf node C has children {C 1 , . . . , C }. All these children consist of the optimal -partition on C.
(3) Every leaf node C has at most closest pair sets.
In V-tree, every leaf node C is associated with a matrix to maintain the minimum distance from every closest pair set in leaf node C to every node C in V-tree T , i.e., where C and C are different nodes in T . It is because ∈ C and then ( , C) = 0. Note that if C is an ancestor C in T , we also have ( , C ) = 0 directly. Figure 3 illustrates an example of 2-partition on a voronoi-based index. The corresponding V-tree is shown in Figure 4. In this example, C o is the collection of all the closest pair set and it is partitioned into {C 1 , C 2 }. Thus C 1 and C 2 are two children of C in V-tree. Similarly, C 3 and C 4 are two children of C 1 . C 5 and C 6 are two children of C 2 . Because C 3 , C 4 , C 5 , and C 6 are four leaf nodes of V-tree, then / * V-tree T only have one node C as its root * / 2: while ̸ = 0 do 3: C ← Dequeue ( ); 4: if |C| > then 5:

Example .
Children(C) ← Partition (C); 6: inserts Children(C) into T as the children of C; 7: for each C ∈ Children(C) do 8: Enqueue( , C ); 9: for each leaf node C in T do 10: calculates { ( , C ) | ∈ C ∧ C ∈ T V } and maintains it on C; 11: return T Algorithm 3: Construct-Vtree (C , , ). every one of them is associated with a minimum distance matrix. For example, 1 is a closest pair set in C 4 and the minimum distance from 1 to every node C in T is stored in the matrix associated with C 4 . In Figure 4, every matrix maintaining the minimum distance is presented next to every node in V-tree.
. . How to Construct V-Tree. Algorithm 3 describes how to constrcut a V-tree T for a given collection C of all the closest pair sets in a voronoi-based index. To construct Vtree T , Algorithm 3 utilizes a queue to dequeue the nodes in T iteratively and expand the children for every node until V-tree has been constructed. Both and T are initialized as {C }, where C r is the collection of all the closest pair set in voronoi-based index. In each iteration, a node C is dequeued from . If |C| > , C is a nonleaf node and then Algorithm 3 calls function Partition (C) to get the optimal -partition on C. Note that |C| is the number of the closest pair sets in C and Partition (C) is the implementation of METIS algorithm. Assume that the output of Partition (C) is {C 1 , . . . , C }, which will be inserted into T as the children set Children(C) of C. Next, Algorithm 3 enqueues every child C of C into . Note that if |C| ≤ , node C is a leaf node in T and Algorithm 3 will dequeue next top element in . When is empty, the structure of V-tree T has been constructed. Finally, for each leaf node C in T , Algorithm 3 calculates the minimum distance matrix { ( , C ) | ∈ C∧C ∈ T V } and associates it with the leaf node C. Therefore, V-tree is constructed and returned.
Example . We use the example in Figure 3 to show how to construct V-tree in Figure 4. In this example, = 2 and = 3. At the beginning, and T are initialized as {C }; C is the collection of all the closest pair set in Figure 3. In the first iteration, the root node C is dequeued from , because |C | = 11 ≥ and C is partitioned into C 1 and C 2 . Then C 1 and C 2 are inserted into T V as two children of C . Next, C 1 and C 2 are enqueued into . In second and third iteration, C 1 and C 2 are dequeued from , respectively. {C 3 , C 4 } and {C 5 , C 6 } are inserted into T and enqueued into . Algorithm 3 dequeues C 3 , C 4 , C 5 , and C 6 one by one. Finally, the minimum distance matrices on C 3 , C 4 , C 5 , and C 6 are, respectively, computed and maintained in V-tree T . Thus the V-tree shown in Figure 4 has been constructed.
Space Complexity of V-Tree. The space complexities of V-tree are given below. Let ℎ denote the height of a V-tree T . Obviously, (ℎ) = (log (| |/ ) + 1), where | | is the number of objects in . For the -th level of T , there are at most nodes. Thus the number of nodes in a V-tree T is For each leaf node C in T , a matrix is used to maintain the minimum distance from every closest pair set ∈ C to every node C ∈ T . The size of every matrix is ( × | |/ ) = (| |). Because there are at most (| |/ ) leaf nodes in T , then the space complexity of T is (| | 2 / + | |/ ) = (| | 2 / ). For the time complexity of V-tree construction, Algorithm 3 needs to compute -partition using existing partition algorithm for every nonleaf nodes in T . We use ( ) to denote the time complexity of -partition on all the closest pair sets in voronoi-based index. Therefore, constructing the structure of T needs (| |/ × ) time. For every leaf node C in T , the minimum distance needs to be calculated. The minimum distances from one ∈ C to all other can be calculated by single-source and multidestination shortest path algorithm, which can be done in (| | 2 ) time. Then the time complexity for every matrix on leaf node is | | 2 . Therefore, the time complexity of V-tree construction is (| |/ × + | |/ × | | 2 ) = ( | |/ + | | 3 ).
. . Query Processing with V-Tree. In this section, we propose an efficient algorithm for searching nearest objects by Vtree. The pseudocode is shown in Algorithm 4. The same as ( (V )) ← ( (V )) ∪ ; 7: for each V ∈ ( (V )) do 8: if V ∈ or V ∈ + (V ) ∧ V ∈ then 9: updates , ; 10: for each ∈ do 11: if has an entry vertex connected to a border vertex in ( (V )) then 12: updates , + ; 13: else 14: C ← Dequeue ( ); 15: if C is a non-leaf node in T then 16: for each C ∈ Children(C) do 17: Enqueue( , C ); 18: else 19: for each ∈ C do 20: Enqueue( , ); 21: return (V ) Algorithm 4: NN-Query (V , , ). Algorithm 2, (V ) is a set of the objects that have been found up to now. Different from Algorithm 2, Algorithm 4 needs two priority queues and , where is used to maintain some closest pair sets whose is possible to be one of nearest objects and is used to maintain some nodes C of V-tree. All in are sorted in an ascending order by the minimum travel time , + from V to . All C in are sorted in an ascending order by the minimum distance ( , C). Initially, (V ) ← 0, ← 0, and ← {C }. In each iteration, Algorithm 4 first considers the top elements in and, C in , there are two cases: (1) , + ≤ ( , C) and (2) , + > ( , C).
For case (1), is dequeued from with , + ; the object of must be one of nearest objects of V . It can be guaranteed by Theorem 14 and then will be inserted into (V ). Let ( (V )) denote the set of the border vertices for all whose ∈ (V ), i.e., ( (V )) = ⋃ ∈ (V ) . Algorithm 4 first updates ( (V )) by ( (V )) ∪ and then updates the value of , for any V ∈ ( (V )) if V ∈ or V is an outgoing neighbor of V , V ∈ . Next, Algorithm 4 updates , + for any ∈ by the border vertices in ( (V )), if has an entry vertex connected to a border vertex in ( (V )). The order of in is also be updated when , + changes. The process for updating , and , + is the same as that in Algorithm 2. Note that in Algorithm 2, when is dequeued, all , + for its neighboring are needed to be updated, but for Algorithm 4, only some neighboring ∈ are needed to be updated. Therefore, in each iteration, Algorithm 4 only needs to update , + for a small number of in which are a subset of the closest pair sets to be updated in Algorithm 2.
For case (2), C is dequeued from . If C is a nonleaf node in V-tree, the children C (1 ≤ ≤ ) of C will be inserted into with the minimum distance ( , C ). Note that ( , C ) is maintained in the leaf node C containing in V-tree. If C is a leaf node in V-tree, every closest pair set ∈ C will be enqueued into with , + . Algorithm 4 calculates , + by the following: Note that the process to calculate , + is as the same as that in Algorithm 2. Algorithm 4 terminates when the size (V ) is . It means that nearest objects of query vertex V have been found.
Theorem 14 guarantees the correctness of Algorithm 4.

Theorem 14.
In Algorithm , the object node inserted into (V ) at the -th time must be the -th nearest object of query vertex V for the departure time .
Proof. Similar to the proof of Theorem 8, we prove it by induction on .
Basis. Obviously, the object node in is the first object node inserted into (V ). By the definition of and , we know that is indeed the nearest object of V for the departure time .
Induction. Assume that the -th nearest neighbor of V is inserted into the result set (V ) at the -th time for < .
We need to prove it also hold for = . We prove it by contradiction. It can be known that the object node inserted into (V ) at the -th time is the object node that dequeued from the priority queue at the -th time. Let be the closest pair set dequeued from at the -th time. Suppose that the -th nearest object of V is and ̸ = . Let be the shortest path from V to with the departure time . Because > 1, is not and there must exist an entry V of in . Let V be the predecessor of V in ; then V must be a border vertex of at time points + , and ̸ = . Obviously, for the object node of , (1) is not in the nearest object set of V and (2) is in the nearest object set of V .
For case (1), it is similar to this case in Theorem 8; For case (2), it is assumed that is the -th ( < ) nearest object of V . According to Algorithm 4, we know that ( (V )) will be updated, when is inserted into (V ). At this point, , + will be updated by ( (V )) if is in . Otherwise, , + will be updated by ( (V )) when is enqueued in . So will be dequeued from at -th time with an accurate , + , which is a contradiction. The proof is completed.
Time and Space Complexities. We first analyze the time complexity of Algorithm 4. For processing priority queue , the time complexity is the same as Algorithm 2 in the worst case. For processing priority queue , all nodes in T will be dequeued in the worst case; then the time complexity is (| |/ ). Therefore, the time complexity of Algorithm 4 is ( ( + ) + | |/ ). Next, we analyze the space complexity, the same as Algorithm 2; the space complexity of Algorithm 4 is ( ( + )).
. . Effectiveness of V-Tree. We use the example in Figure 3 to show Algorithm 4 with V-tree being more efficient than Algorithm 2 without V-tree. For this example, we set = 3, = 2, and = 3. The red five-pointed star represents the query vertex V which is in 1 for the departure time . The minimum distance , + from V to every object is shown in the table in Figure 3.
For Algorithm 2, is initialized as { 1 }. In the first iteration, 1 is dequeued from . Because 2 , 4 , and 9 are three neighboring closest pair set of 1 , Algorithm 2 will update their , + and then enqueue them into . Similarly, in the second iteration, 2 is dequeued from . 3 and 4 are enqueued into . 3 will be dequeued from in the final iteration. Note that , + for the object in 4 will be updated twice in the first and second iteration, respectively; this is because 4 is the neighboring closest pair set of both Theorem 15. e number of updating , + for all the closest pair sets in Algorithm is no more than that in Algorithm .
Proof. In each iteration, for Algorithm 2, when is dequeued, all , + for its neighboring are needed to be updated. Obviously, for Algorithm 4, it only needs to update , + for a small number of in which are a subset of the closest pair sets to be updated in Algorithm 2. So the number of updating , + for all the closest pair sets in Algorithm 4 is no more than that in Algorithm 2.

Experiements
We compare our V-tree method (marked as VT) and voronoibased index method (marked as VI) with FTTI (Fast-Travel-Time Index) method [11] and TLNI (Tight-and-Loose-Network Index) method [9] on the real-life datasets. FTTI and TLNI are the state of the art index-based methods for NN query over time-dependent road networks. Note that FTTI and TLNI are used on * in which every edge is an nwt-function * , ( ) because FTTI and TLNI do not allow the waiting time. Although some algorithms are proposed in recent works [5,10], they are only to find the nearest object (i.e., = 1) and they cannot be used for general NN query on time-dependent graphs. All the experiments are conducted on a 2.6GHz Intel Core i7 CPU PC with the 16GB main memory, running on Windows 7.

. . Experienmental Results
Exp-. Impact of Network Size. In this group of experiments, we study the impact of time-dependent network size. The number of the vertices increases from 100k to 500k and the number of objects is fixed at 10k. We investigate the querying time for = 7. The number of piecewise intervals of , ( ) is set as 4. As shown in Figures 5(a) and 5(b), the querying time of our method is always less than FTTI and TLNI. Note that our V-tree method has the minimum querying time. Specifically, the querying time of TLNI is always much more than our methods even though TLNI has the smallest index size. The reason TLNI index only maintains the vertices for an object is that the upper bound of travel time to is less than the lower bound to the other objects. It cannnot facilitate query effectively in large networks.
Exp-. Impact of Object Set Size. In this group of experiments, the number of the vertices is fixed at 100k and the number of objects ranges from 10k to 50k. As shown in Figures 6(a) and 6(b), the querying time of our methods is always less than FTTI and TLNI. The querying time decreases with the increasing of the object set size. There are two reasons as follows: (1) the average size of and decreases if the object set size increases; (2) the increasing of object size results in that the objects become nearer to V and then querying time decreases. The index size for VI, FTTI, and TLNI decreases with increasing of the object size. But for V-tree, the index size increases with the object size increasing. This is because more objects result in more nodes in V-tree.
Exp-. Impact of the Time Domain. In Figure 7  Exp-. Impact of the Average Distance to Objects. The impact of the average distance to objects is shown in Figure 9. In this group of experiments, the number of vertices is set as 100k and 500k, respectively. The number of objects is fixed at 10k and = 7. The average distance to objects ranges from 4 to 12.
Note that the distance means the hops from the query vertex to an object. As shown in Figures 9(a) and 9(b), the querying time increases marginally with the increasing of distance. Our methods are always better than FTTI and TLNI.
Exp-. Impact of k. In Figure 10, we study the querying time by varying from 1 to 10 on two different networks with 10k vertices and 50k vertices, respectively. In this group of experiments, the number of objects is fixed at 10k and 50k for two different networks, respectively. As shown in Figures 10(a) and 10(b), the querying time always increases marginally with the increasing of for our index method.
Exp-. Impact of and . In Figure 11, we investigate the impact of the and for V-tree. In this group of experiments, the numbers of the vertices and objects are fixed at 100k and 10k, repectively. The values of and are selected from [2,4,6,8,10] and [10,20,30,40], respectively. The experimental results shows the effectiveness of V-tree is the best when = 4. The querying time increases with the increasing of . But the index size increases with the decreasing of . The index size is not affected by varying.

Related Work
NN query has been well studied on static road networks. Most of the existing works propose various index techniques. The main ideas of these methods are to partition the vertices into several clusters, and then the clusters are organized as a voronoi diagram or a tree (e.g., R-tree) [14,[18][19][20][21][22][23][24][25]. These methods precompute and maintain the shortest distances for some pairs of vertices to facilitate NN query. Unfortunately, these index techniques cannot be used for the timedependent road networks because the minimum travel time between two vertices always varies with time. NN query has also been studied on time-dependent road networks [9][10][11][12]26]. Most of these works are based on A * algorithm. The authors in [5,10] study the problem to find nearest (i.e., = 1) object on time-dependent networks. In [10], a virtual node V is inserted into the graph with the zerocost edges connecting to all the objects. The nearest object can be found on the shortest path from the query vertex to V. The authors in [27] study the problem of finding POIs that minimize the aggregated travel time from a set of query points. The index-based methods are proposed in [9,11]. In [9], a * algorithm is utilized to expand the road networks by estimating an upper or lower bound of travel time. An index is built to facilitate NN query using these estimated bounds. In [11], time domain is divided to several subintervals. For every subinterval, nearest objects of every vertex are found by an estimation of minimum travel time. There are two main drawbacks of these methods. First, in these works, the FIFO (first in first out) property is required for networks and waiting time is not allowed. Second, the indexes proposed by these works are based on the estimated value of travel time. However, these indexes cannot facilitate query effectively for the large networks because the deviations are always too large between the estimated and the actual travel time.
Recently, there are some works about the shortest path query between two given vertices over time-dependent graphs [13,[28][29][30][31][32][33]. However, these works do not study any index that can be used in NN query over time-dependent road networks. Note that, in [32,33], the waiting time is incorporated in arrival function ( ) which represents the earliest arrival time for every vertex V when the departure time is . Different to these works, we propose nwt-function * , ( ) to represent the minimum traveling time for every edge when the waiting time is allowed. The arrival function ( ) cannot be utilized in our voronoi-based index for nearest objects problem. Otherwise, the intuitive meaning behind * , ( ) is more easily comprehended than ( ).

Conclusion
In this paper, we study the problem of nearest object query on time-dependent road networks. We first give an algorithm for processing time-dependent road networks such that the waiting time is not necessary to be considered and then propose a novel voronoi-based index to facilitate NN query. We explain how to construct the index and complete the querying process using our index. Furthermore, we propose a novel balanced tree, named V-tree, which is a secondary level index on voronoi-based index to make our querying algorithm more efficient. We confirm the efficiency of our method through extensive experiments on real-life datasets.

Data Availability
The road network dataset used to support the findings of this study is included within the article. It can be downloaded from http://snap.stanford.edu/data/roadNet-CA.html.