Efficient Processing of Moving k-Range Nearest Neighbor Queries in Directed and Dynamic Spatial Networks

A k-range nearest neighbor (kRNN) query in a spatial network finds the k closest objects to each point in the query region. The essential nature of the kRNNquery is significant in location-based services (LBSs), where location-aware queries with query regions such as kRNN queries are frequently used because of the issue of location privacy and the imprecision of the associated positioning techniques. Existing studies focus on reducing computation costs at the server side while processing kRNN queries. They also consider snapshot queries that are evaluated once and terminated, as opposed to moving queries that require constant updating of their results. However, little attention has been paid to evaluating moving kRNN queries in directed and dynamic spatial networks where every edge is directed and its weight changes in accordance with the traffic conditions. In this paper, we propose an efficient algorithm called MORAN that evaluates moving k-range nearest neighbor (MkRNN) queries in directed and dynamic spatial networks.The results of a simulation conducted using real-life roadmaps indicate thatMORAN ismore effective than a competitive method based on a shared execution approach.


Introduction
Recently, positioning devices such as global positioning system (GPS) have become very popular.The use of navigation systems in automobiles is already widespread and this, together with mobile communications, facilitates new exciting applications [1,2].In these systems, points of interest (POIs), for example, hotels, campsites, and fuel stations, provided by online map services are located in a spatial network, and their proximity can be defined by the length, for example, the travel time, of the shortest path connecting them [3,4].A k-range nearest neighbor (kRNN) query finds the  closest objects to each point inside a query range, as opposed to a query point [5][6][7][8].Figure 1 gives an example of a kRNN query in a spatial network, where a query object  is located inside a query region  denoted by a rectangle for presentation convenience.Note that the numbers on the arrows in the figure indicate the order of the steps.kRNN queries are widely used in the context of location privacy and location uncertainty in location-based services (LBSs).More specifically, when using a potentially untrusted LBS server, users are reluctant to expose their exact location to the server because of the possibility of privacy leakages [9,10].As a result, many privacy-preserving techniques that blur the user location into a spatial region corresponding to query region  have been proposed.Indeed, location uncertainty is inherent in LBSs because of the imprecision of the utilized positioning system [5].
Depending on the query lifetime, a location-aware query can be classified as either a snapshot query or a moving query.A snapshot query returns a result only once, whereas a moving query returns results continuously for a designated period.Existing algorithms focus on evaluating snapshot RNN queries.They primarily consider undirected and static spatial networks where every edge is undirected and its weight does not change over time [5][6][7][8].However, their (1) q submits a kRNN query for a query region Q (2) Server returns a set of candidate objects for q ∈ Q q Q LBS server problem scenarios based on undirected and static spatial networks fail to provide a sufficient level of realism for many applications of interest when query objects move freely and constantly.
In this paper, we present a new approach for evaluating moving RNN queries (MRNN) in directed and dynamic spatial networks where each edge has a particular orientation and its weight changes in accordance with the traffic conditions.Clearly, directed and dynamic spatial network models provide more realistic modeling of urban road networks than undirected and static spatial network models.For example, after entering a highway, a driver must remain on that highway until he/she has reached an exit point, even if he/she has chosen an incorrect path.Thus, a highway can be represented using directed edges.Furthermore, the travel time to a destination selected by a query user frequently changes in accordance with the traffic conditions.In moving objects databases, a safe segment (or safe region) is a popular technique used in the processing of moving queries [11][12][13][14][15][16][17].A safe segment (or safe region) indicates a segment (or region) in which the movement of a query object does not cause the current query result to change.This helps to reduce communication and computation costs.
In this paper, we propose an efficient algorithm, called MORAN, for processing moving k-range nearest neighbor queries in directed and dynamic spatial networks, under the assumption that query objects move freely on spatial networks and that data objects are stationary.In our approach, a query region  is partitioned into safe segments, which are maintained in directed and dynamic spatial networks.Clearly, unless the safe segments are used, the query object should evaluate a kNN query at its location using the kRNN query result provided by the server whenever it moves inside the query region.This simple approach places an excessive computational burden on the client side with a high computation frequency.Another considerable approach that can be used to solve this problem is to predict the movement of the query object in order to create the query results beforehand [18,19].However, in this paper, we consider a more realistic scenario, in which the query object moves arbitrarily and its path is not known in advance.
The contributions made in this paper can be summarized as follows.
(i) We propose a new algorithm called MORAN that partitions query regions into safe segments to facilitate efficient processing of MkRNN queries in directed and dynamic spatial networks.
(ii) We also propose a method that preserves the validity of the safe segments when traffic conditions are updated.
(iii) We outline extensive experiments conducted to demonstrate the effectiveness and efficiency of MORAN under various conditions.
The remainder of this paper is organized as follows.Section 2 reviews related studies.Section 3 defines the primary terms used in this paper and formulates the research problem.Section 4 presents our proposed method for dividing query regions into safe segments in directed spatial networks.Section 5 presents our proposed method for maintaining the safe segments in dynamic spatial networks.Section 6 analyzes the extensive experimental results obtained.Finally, Section 7 provides concluding remarks regarding the proposed method.

Related Work
To ensure location privacy in pervasive computing, mobile users frequently issue kRNN queries using cloaked regions, corresponding to the query regions in this study [5][6][7][8]20].Then, a server performs query processing, assuming that the user can be at any location inside the query region, and thus not knowing the exact location of the query issuer.Several studies on processing of kRNN queries in Euclidean space have been conducted.Kalnis et al. [21] developed a new algorithm for computing kRNN queries based on circular regions that reduce the number of redundant results, as well as the communication cost.Chow et al. [22] proposed a new approximate range NN query processing algorithm that enables the user to tune the tradeoff between the query response time and the quality of the query answers.The algorithm allows the user to specify an approximation tolerance level, where an answer set A is returned such that each object in A is one of the kNNs of every point in the query region.Xu et al. [23] developed an efficient algorithm for evaluating circular-region-based kNN queries that applies a filter method based on a distance measure to prune out POIs effectively.However, these techniques based on Euclidean distance cannot be applied to our problem concerning network-constrained mobile users and network distance-based queries.
kRNN queries have also been widely studied in the context of privacy-preserving LBSs based on spatial network distance, where the exact location of the query issuer is blurred into the query region [5][6][7][8].The basic idea underlying the processing of a kRNN query is to execute a range query to retrieve data objects within the query region and execute kNN queries at the boundary points of the query region.Ku et al. [6] developed a privacy-aware spatial network nearest neighbor query algorithm that retrieves all POIs inside a given cloaked region and finds POIs outside the cloaked region using spatial network expansion.Naturally, issuing kNN queries multiple times in order to process kRNN queries leads to a huge redundant search overhead.To rectify this problem, Bao et al. [5] proposed an efficient kRNN query processing algorithm that employs a shared execution approach to eliminate the redundant search overhead.
Existing algorithms such as [5][6][7][8] deal with snapshot kRNN queries as opposed to the moving kRNN queries considered in this study.Consequently, they focus on reducing the computation time of the server as well as communication costs between the server and query objects.Thus, while processing snapshot kRNN queries, existing algorithms do not have to consider the computation time of the query objects that evaluate the exact kNN set using a set of candidate data objects provided by the server.This is because in processing snapshot kRNN queries, the computation time of the query objects is very small compared to the computation time of the server.However, very little research has focused on supporting MkRNN queries in directed and dynamic spatial networks where the computation time of the query objects is not negligible.
Nutanong et al. [16] developed an incremental saferegion-based technique, called the  * -Diagram, for answering moving kNN queries in Euclidean space as well as in undirected spatial networks.However,  * -Diagram is not appropriate in our problem scenarios because the distance is transitive in both Euclidean space and undirected spatial networks, whereas the distance is not transitive in directed spatial networks.Yung et al. [17] proposed an algorithm for computing the boundary, referred to as safe exits, of the safe region of moving range queries in spatial networks.Their solution focuses on moving range queries (e.g., find gas stations within  = 3 km for the next 10 minutes) and is thus inapplicable for the processing of MkRNN queries.
MORAN differs from existing studies in several aspects: first, it considers MkRNN queries in directed and dynamic spatial networks; second, it focuses on reducing the computation time and frequency of the query object; and finally, it efficiently determines and maintains safe segments within a query region.In recent years, various types of queries on moving objects have also been studied extensively.They include range queries [14,17], kNN queries with two predicates [24], and obstructed kNN queries [25].The associated studies have different problem scenarios from those in our study and their solutions are not appropriate.
Finally, Table 1 compares our problem scenario with related work in terms of query type, space domain, and mobility of query objects and data objects.Because of space limitations, we shorten the terms "undirected and static spatial network" to "USSN" and "directed and dynamic spatial network" to DDSN.

Background
Section 3.1 defines the terms and notations used in this paper.Section 3.2 formulates the problem by using an example.Clearly, all edges in the same edge sequence have the same direction.The length of an edge sequence is the total weight of the edges in the edge sequence.One part of an edge sequence is called a segment.Note that by definition, an edge sequence is also a segment defined by the boundary nodes of the edge sequence.To simplify the presentation, Notations and Their Definitions summarizes the notations used in this paper.The distance between two points in a directed spatial network  is not symmetric; that is, for two points  1 ,  2 ∈ , there is no guarantee that dist( 1 ,  2 ) equals dist( 2 ,  1 ).Note that if the algorithms for MORAN operate in the same manner for undirected and directed spatial segments, an undirected segment is used for convenience to describe the algorithms.

Definition of
Figure 2 depicts the distances and segment length between two objects  1 and  2 in a directed spatial network.In this figure, the shortest path from  1 to  2 is  1 →  2 →  5 →  2 and thus the distance from  1 to  2 is dist( 1 ,  2 ) = 6.Conversely, the shortest path from  2 to  1 is  2 →  4 →  3 →  1 and thus the distance from  2 to  1 is dist( 2 ,  1 ) = 9.This proves that the network distance is not symmetric in a directed spatial network.The segment connecting  1 and  2 in the same edge sequence ←    2  3  4  5 becomes  1 →  3 →  4 →  2 and thus its length is len( 1 ,  2 ) = 9.Recall that len( 1 ,  2 ) is defined if and only if the two points,  1 and  2 , are located in the same edge sequence.
3.2.Problem Formulation.Figure 3 shows an example of an MRNN query in a directed and dynamic spatial network.Here, data objects  1 through  5 are represented by the rectangles and a query region  is represented by a set of bold line segments; that is,  = { ←    1  3 ,  2  3 , ←    3  4 }.The boundary point of a query region indicates the point where the query region and nonquery region meet.In this example, query region  has four boundary points,  1 through  4 .The number next to an edge indicates the distance between the two adjacent objects.Suppose that a query object  in query region  requests two NNs from the server, while hiding its location from the server.Then, the kRNN query result for  should include the two closest data objects to each point in query region .The query result can be represented by a set of ⟨, ⟩ tuples, where  is a safe segment in  and  is the query result for the safe segment .As shown in Figure 3(a), query region  can be partitioned into four safe segments; that is, As shown in Figure 3(b), if the weight of an edge   →  1  1 represented by the bold dotted line is updated from 3 to 5 at time   , this update may affect the safe segments computed at time   , which leads to nullifying the kNN set of  ∈ .
The query region  consists of a set   of  segments and a set   of  boundary points; that is,   = { 1 ,  2 , . . .,   } and   = { 1 ,  2 , . . .,   }.Clearly, a query object  is located inside query region , while hiding its exact location from the server to ensure location privacy.Note that we use the terms "query object " and "query point " interchangeably for convenience of discussion.Clearly, for a query point  ∈ , refers to a set of NNs at a boundary point   ∈   and (  ) refers to a set of objects inside a segment   ∈   .It should be noted that processing kRNN queries at the server is orthogonal to this study.Therefore, any kRNN query processing algorithms (e.g., [5,6]) can be used to evaluate the kRNN queries at the server.The server evaluates a kRNN query for a query region  and then provides a set of candidate data objects to query object .Finally,  determines safe segments using a set of candidate data objects for the query region .Recall that given a safe segment , for two points  1 ,  2 ∈ , Figure 4 illustrates three scenarios that can arise when a query object  issues kRNN queries.As shown in Figure 4(a), at time   , a query object  submits a kRNN query for a query region   to the server.On receiving the query, the server evaluates the kRNN query and returns the query result to  ∈   .Clearly,  determines safe segments inside query region   using the kRNN query result.As shown in Figure 4(b), when  leaves the query region   at time   , it submits a kRNN query for an updated query region   to the server.Then, the server evaluates the kRNN query and returns the query result to  ∈   .Clearly,  determines safe segments inside query region   .As shown in Figure 4(c), while  is inside   at time   , a query region   overlaps a traffic congestion area , marked by a gray rectangle, in which the weight of the edges changes.The server realizes that the traffic congestion area  invalidates the kRNN query result for   and thus requests that  updates the query region.Consequently,  submits a kRNN query for an updated query region   to the server, which evaluates the kRNN query and returns the query result to  ∈   .Clearly,  determines the safe segments inside query region   .In Section 5, we elaborate on a method to verify that an updated traffic condition invalidates current kRNN query results.

Processing MkRNN Queries in Directed Spatial Networks
In Section 4.1, we give an overview of MORAN.In Section 4.2, we present an algorithm for determining safe segments in a query region.Finally, in Section 4.3, we discuss the construction of the safe segments of an MkRNN query for the example of directed spatial network.

Overview.
As stated before, we focus on query processing at the client side while processing MkRNN queries in a directed and dynamic spatial network.If either of the two  Q i q (1) q submits kRNN query for a query region Q i (2) Server returns a set of candidate objects to q ∈ Q i LBS server (a)  submits a RNN query for a query region   to the server at time   , where  ∈   q Q j (1) q submits kRNN query for a query region Q j (2) Server returns a set of candidate objects to q ∈ Q j LBS server (b)  submits a RNN query for an updated query region   to the server when  leaves   at   q Q j T (1) Server requests that q updates the query region (2) q submits kRNN query for an updated query region Q k

LBS server
(c) Server requests that  updates the query region when a set of candidate objects is invalidated at   the server, it should reevaluate safe segments inside the query region.Using safe segments reduces the computation time and frequency because the query object does not have to evaluate kNN queries while inside the safe segments.Algorithm 1 outlines the process of determining the safe segments in a query region  in a directed spatial network.The algorithm starts by initializing Ω to an empty set, which stores the safe segments found thus far.Each segment  in query region  is explored sequentially to find the safe segments in segment .For this purpose, MORAN evaluates two kNN queries issued at boundary points  and  of segment .The query results are stored to    and    , respectively.The objects in  are explored and stored to ().The function find safe segments is called with    ,    , and () in order to find safe segments in segment .The found safe segments are added to the result set Ω. When all the segments in  have been examined, a set Ω of safe segments in query region  is returned to the query issuer.It should be noted that if updates in the weight of edges frequently occur in a spatial network, it is better to determine the safe segments in the current segment including the query point rather than all the safe segments in the query region.We employ a shared execution approach [5], which is widely used to avoid multiple visits to the same nodes and edges.This clearly reduces the query processing time while determining safe segments in a query region.We first explore the change in a network distance dist(, ) for a qualifying object  ∈    ∪    ∪ () when a query point  is located in an undirected segment  [13,14].Figure 6 shows the change in dist(, ) for three   Table 2 summarizes the evaluation of dist(, ) for  ∈  and  ∈    ∪    ∪ (), where MIN returns the minimum of the values in the input array.Because a qualifying object  belongs to a combination of    ,    , or (), a total of seven possible cases are considered.Note that dist(, ), dist(, ), len(, ), and len(, ) are given constants and dist(, ) is the length of the shortest path among multiple paths from  and .

Partitioning
Figure 7 shows an example of the change in dist(, ) depending on the location of query point  ∈  2  5  6  3 .For simplicity, we assume that the number of NNs requested at query point  is  = 1.Then, as shown in Figure 7  if q ∈ n 2 n 5 n 6 len(q, n 3 ) + 3 otherwise Note that the dotted lines indicate that no paths exist from  to  for the corresponding intervals, which are denoted by dist(, ) = ∞.For object  ∈    , as shown in Figure 8(a),  →  and is thus determined using Table 2 in the same way as  ∈ .Figure 9 shows an example of the change in dist(, ) depending on the location of query point  ∈   →  2  5  3 .For simplicity, we assume that the number of NNs requested at query point  is  = 1.Then, as shown in Figure 9(a),

Partitioning Example Query Region into Safe Segments.
We now discuss the construction of safe segments for query region  in Figure 3(a).Recall that the number of requested NNs is  = 2 and the query region includes three segments; that is,  = { ←    1  3 ,  2  3 , ←    3  4 }.Table 3 summarizes the computation of the safe segments in query region .Clearly, the kNN set at a node  3 is evaluated only once, and it is reused multiple times.
Figure 11 illustrates the partitioning of a segment ←    1  3 into three safe segments using dist(, ) for each object  ∈ shows the plot of dist(, ) for each object  ∈ { 1 ,  2 ,  3 ,  4 }.Note that, to simplify the presentation, the interval in which dist(, ) = ∞ holds is not represented.When a query point  moves in a segment ←    1  3 , its th NN  th is determined using Algorithm 2 and is represented by the bold lines in Figure 11(b  hold.Figure 13 illustrates the partitioning of a segment  2  3 into two safe segments using dist(, ) for each object  ∈

Monitoring Safe Segments in Dynamic Spatial Networks
Figure 14 illustrates an example of changing the weight of an edge   →  1  1 in a spatial network where it is assumed that  = 2 is given.For convenience, we consider the query region  that consists of an edge ←    1  3 ; that is,  = { ←    1  3 }.As shown in Figure 14(b), when the weight of an edge   →  1  1 has been updated from 3 to 5 at time   , this update may invalidate the safe segments in the query region .Therefore, it is necessary to monitor the validity of safe segments in a query region when the change occurs.To this end, we introduce an influential region to monitor the validity of safe segments.The influential region Ψ  for a query point  is defined as a set of points  such that dist(, ) ≤ dist(,  th ) holds.If the weight of an edge changes inside influential region Ψ  , the kNN query at query point  should be reevaluated to reflect the change in the weight.However, if the weight of an edge changes outside influential region Ψ  , the change can be safely ignored.Suppose that a query region  is represented by a set   of  connected segments and a set   of  boundary points; that is,   = { 1 ,  2 , . . .,   } and   = { 1 ,  2 , . . .,   }.Then, the influential region Ψ  for query region  becomes the union of the influential region for each query point  ∈ ; that is, Ψ  = ⋃ ∈ Ψ  .This can be represented simply as Ψ  = ∪(⋃  =1 Ψ   ), where Ψ   refers to the influential region at each boundary point   of the query region .Specifically, Ψ   is the set of points  such that dist(  , ) ≤ dist(  ,    th ) holds.Here,    th is the farthest answer object from boundary point   ; that  Figure 15(a) illustrates the influential region for the query region  at time   , where the dotted line and square brackets mark the influential region and its boundary points, respectively.A set of the two NNs at boundary point  1 is Thus, the distance from  1 to its th NN  1 is dist( 1 ,  1 ) = 3 and thus the influential region Ψ  1 for a boundary point  1 becomes  15(b), updating the weight of edge   →  1  1 from 3 to 5 may affect the safe segments for the query region .This is because updated edge   →  1  1 overlaps the influential region Ψ  for query region .In this case, the server reevaluates the qualifying objects for query region  and provides updated qualifying objects so that the user can update safe segments.If the safe segments are updated, the influential region should be also updated accordingly.Thus, the influential region for query region  is updated at time   , as shown in Figure 15(b).Finally, updates to the weights of the edges, for example, ←    2  1 ,  2  5 , ←    3  4 , and  4  6 , that do not overlap the influential region can be safely ignored.Algorithm 3 monitors the validity of safe segments in a query region when the weight of edges changes over time.Assume that the weight of edge     is updated.Subsequently, the server checks if edge     overlaps the influential region Ψ  for query region .If the edge with the updated weight does not overlap the influential region, the update is safely ignored (lines (1)-( 2)).Otherwise (i.e., Ψ  ∩     ̸ = 0), the server requests that query object  updates the query region (line (4)).Consequently,  submits a kRNN query for updated query region  upd .The server then evaluates the kRNN query for  upd and returns the kRNN query result Σ  upd to  (line (5)).The query object then determines safe segments using Σ  upd (line (6)).Finally, the server updates the influential region accordingly (line ( 7)).

Performance Evaluation
We describe our experimental settings in Section 6.1 and present the results of our experiments using real-life road maps in Section 6.2.

Experimental Settings.
In the experiments, we use two real-life road maps, obtained from [27], to explore the impact For the first road map NA, the number of edge sequences and their average length are 12,416 and 29,052 m, respectively.For the second road map SJ, the number of edge sequences and their average length are 20,040 and 248 m, respectively.Table 4 summarizes the parameters used in the experiments.In each experiment, we vary a single parameter in the range shown and set the other parameters to the default values marked in bold.We simulate moving query points using a network-based moving objects generator [28].
The number of query objects is set to 1,000.The size of a query region is determined by the number of edge sequences that constitute the query region.The directed and updated edge sequences are selected randomly, irrespective of the locations of the data and query objects.The length of an updated edge sequence is selected randomly to be between 0.1 and 10 times the original length.For example, if  upd is set to 0.5% and the number of edge sequences is 12,416, then 62 edge sequences are selected randomly every timestamp and their weights are updated.
As a benchmark against MORAN, we use kRNN-E [5] without information of the precomputed shortest distances, based on a shared execution paradigm to remove the redundant search overhead.We choose kRNN-E instead of kRNN-F [5] with information of all the precomputed shortest distances, although kRNN-F typically outperforms kRNN-E.The reason for this is that the precomputed distances among nodes are frequently invalidated by the updates to the weights of the edges, which makes it difficult to maintain the precomputed distances.To make kRNN-F applicable to our problem scenarios, we can consider applying hierarchical and goal-directed speed-up techniques [29] for Dijkstra's algorithm.This approach can help to reduce the computation time only at the server side and thus would not affect our experimental results.Recall that the query processing at the server is orthogonal to this study and that MORAN focuses on reducing the computation frequency and time taken at the client side to evaluate MkRNN queries.Our experimental results provide the average values per timestamp while 1,000 query points run for 600 timestamps.Note that, for road map NA, the speed of the query points is 100 km/h by default, whereas, for road map SJ, the speed is 60 km/h by default.
All algorithms are implemented in C++ and executed on a desktop PC with a 3.4 GHz processor and 16 GB of memory.

Experimental Results.
Figure 16 shows a comparison of the query processing times at the client side of MORAN and kRNN-E for evaluating MkRNN queries in road map NA, where each chart illustrates the effect of varying a single parameter in Table 4.The values in the parentheses indicate the computation frequency per timestamp.Clearly, the computation frequency of kRNN-E equals the number of query points and thus is omitted.It should be noted that the server evaluates the MkRNN queries whenever the query points exit their query regions and thus the query processing times at the server side are the same for MORAN and kRNN-E.Therefore, we focus on comparing the query processing times at the client side.
Figure 16(a) shows the query processing time as a function of the number of requested NNs, that is, k.Clearly, the query processing time at the client side increases with k.However, the query processing time of MORAN is significantly shorter than that of kRNN-E for all cases.The reason for this is that kRNN-E evaluates kNN queries whenever query points move.Conversely, MORAN determines safe segments when query points enter new edge sequences or when the query results provided by the server become invalidated because of updated traffic conditions.
Figure 16(b) shows the query processing time as a function of the ratio of directed edge sequences to the total number of edge sequences, that is,  dir .Clearly,  dir = 0% refers to an undirected spatial network.The query processing times at the client side of both methods are insensitive to the value of  dir .The query processing time of MORAN is shorter than that of kRNN-E, regardless of the value of  dir .
Figure 16(c) shows the query processing time as a function of the ratio of updated edge sequences to the total number of edge sequences per timestamp, that is,  upd .Here,  upd = 0% refers to a static spatial network.The length of an updated edge sequence is selected randomly from between 0.1 and 10 times the original length.Clearly, the query processing time of kRNN-E is almost constant regardless of the value of  upd because query points in kRNN-E issue kNN queries at each timestamp.However, the query processing time of MORAN increases linearly with  upd because the probability that the influential region of a query region overlaps any updated edge sequence increases with  upd .Therefore, a larger value of  upd leads to a longer query processing time.
Figure 16(d) shows the query processing time as a function of the size of the query region, that is,  sz .Clearly, the query processing time increases with  sz .However, the query processing time of MORAN is clearly shorter than that of kRNN-E, regardless of the value of  sz .
Figure 16(e) shows the query processing time as a function of the number of data points, that is,  data .In general, as  data increases, the search space decreases, and thus, the query processing time at the server side decreases accordingly.However, the query processing time at the client side increases with  data .This is because the number of qualifying data points handled at the client side increases with  data .
Although the query processing time of MORAN increases more rapidly with  data than that of kRNN-E, the query processing time of MORAN is still shorter than that of kRNN-E for 10 k ≤  data ≤ 70 k.However, for  data = 100 k, the query processing time of MORAN is 1.29 times longer than that of kRNN-E.
Figure 16(f) shows the query processing time as a function of the speed of the query points, that is,  qry .The query processing time of MORAN is more sensitive to  qry than that of kRNN-E.However, the query processing time of MORAN is clearly shorter than that of kRNN-E for all cases.
Figure 17 shows a comparison of the query processing times at the client side of MORAN and kRNN-E for evaluating MkRNN queries in road map SJ.As when road map NA is used, when road map SJ is used, the query processing time of MORAN is clearly shorter than that of kRNN-E.As shown in Figure 17(a), the query processing time increases with k for the same reason as discussed earlier in the case of Figure 16(a).As shown in Figure 17(b), the query processing times are not sensitive to the value of  dir .As shown in Figure 17(c), the query processing time of kRNN-E remains stable regardless of the value of  upd .Conversely, the query processing time of MORAN increases with  upd , because a larger value of  upd affects the influential regions of more query points.As shown in Figure 17(d), the query processing time increases with  sz , because the number of qualifying data points handled at the client side also increases with  sz .As shown in Figure 17(e), as  data increases, the query processing times decrease.This is closely related to the size of the influential regions.Specifically, as  data increases, the influential region decreases and thus updating weights of edge sequences affects the influential regions of more query points.As shown in Figure 17(f), the query processing time of MORAN increases with  qry for the same reason as discussed earlier in the case of Figure 16(f), whereas the query processing time of kRNN-E remains stable, regardless of the value of  qry .

Conclusion
We proposed a new algorithm, called MORAN, for processing MkRNN queries in directed and dynamic spatial networks.Existing studies focus on reducing redundant computation costs at the server side while processing snapshot kRNN queries in undirected and static spatial networks.However, MORAN clearly decreases the computation time and frequency at the client side by dividing the query region into safe segments while processing MkRNN queries in directed and dynamic spatial networks.The influential region for a query region is introduced to monitor the impact of the updated traffic conditions on the safe segments.The results of experiments using real-life road maps demonstrate that MORAN clearly outperforms kRNN-E for various workloads in terms of the computation time and frequency.We plan to extend our approach to processing sophisticated queries such as kNN joins and top-k spatial preference queries in directed and dynamic spatial networks.

Figure 1 :
Figure 1: Example of a RNN query whose region is denoted by .

Figure 3 :
Figure 3: Example of MkRNN query in a spatial network, where  = 2 and   <   .

Figure 13
(a)  shows the plot of dist(, ) for each object  ∈ { 3 ,  4 ,  5 }.When a query point  moves in a segment  2  3 , its th NN  th is represented by the bold lines in Figure13(b), where a point  marked by a five-pointed star indicates the middle of the segment  2  3

Figure 13 :
Figure 13: Partitioning of a segment  2  3 into two safe segments.

Figure 14 :
Figure 14: Changing the weight of an edge in a dynamic spatial network, where   <   .

Figure 15 :
Figure 15: Updating the influence region for .

Figure 16 :
Figure 16: Comparison of CPU time at the client side for road map NA.

Figure 17 :
Figure 17: Comparison of CPU time at the client side for road map SJ.

Table 1 :
Classification of related work.
Terms and Notations.Now, we define the terms and notations used in this paper for clarification.    denotes an undirected edge, where   and   are adjacent nodes, whereas   →     or ←       denotes a directed edge.The arrow above the edge denotes the associated direction.Edge Sequence and Segment.An edge sequence, denoted by either    +1 ⋅ ⋅ ⋅   or   →    +1 ⋅ ⋅ ⋅   , refers to a path connecting two nodes,   and   , such that   (or   ) is either an intersection or terminal node, and the other nodes in the path are intermediate nodes.The two end nodes,   and   , are called boundary nodes.
Query Region into Safe Segments.We consider an undirected segment  followed by a directed Here,    and    refer to sets of NNs at boundary points  and , respectively, and () refers to a set of objects inside segment .An object  that belongs to the union of    , , and (). , segment  becomes a safe segment.Otherwise, it has two or more safe segments.

Table 2 :
Computation of dist(, ), where  ∈  and  ∈    ∪ and ←    3  4 .It is clear that adjacent safe segments with the same query result can be merged.Recall that we can draw dist(, ) by using a query point  ∈  and an object  ∈    ∪   1 ), dist(,  2 ), dist(,  3 ), and dist(,  4 ), respectively.Recall that  1 ∈ 1  3 ), and  4 ∈   3  hold.To partition a segment  into safe segments, it is essential to identify the th NN  th at a query point  ∈  among the qualifying objects  ∈    ∪    ∪ ().