research article distributed continuous k nearest neighbors...

21
Hindawi Publishing Corporation International Journal of Distributed Sensor Networks Volume 2013, Article ID 125145, 20 pages http://dx.doi.org/10.1155/2013/125145 Research Article Distributed Continuous k Nearest Neighbors Search over Moving Objects on Wireless Sensor Networks Chuan-Ming Liu and Chuan-Chi Lai Department of Computer Science and Information Engineering, National Taipei University of Technology, Taipei 10608, Taiwan Correspondence should be addressed to Chuan-Ming Liu; [email protected] Received 29 June 2013; Accepted 20 October 2013 Academic Editor: Chang Wu Yu Copyright © 2013 C.-M. Liu and C.-C. Lai. is is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. Continuous k-nearest neighbor (CkNN) search is a variation of kNN search that the system persistently reports k nearest moving objects to a user. For example, system continuously returns 3 nearest moving sensors to the user. Many query processing approaches for CkNN search have been proposed in traditional environments. However, the existing client-server approaches for CkNN search are sensitive to the number of moving objects. When the moving objects quickly move, the processing load on the server will be heavy due to the overwhelming data. In this thesis, we propose a distributed CkNN search algorithm (DCkNN) on wireless sensor networks (WSNs) based on the Voronoi diagram. ere are four features about DCkNN: (1) each moving object constructs a local Voronoi cell and keeps the local information; (2) in order to keep the reliability of system, the query message will be propagated to related objects; (3) using the idea of safe time, the number of updates is reduced; (4) an equation to estimate a more accurate safe time is provided. Last, we present our findings through intensive experiments and the results validate our proposed approach, DCkNN. 1. Introduction e mobile sensors have been widely used in recent years. For example, the smartphone, Samsung Galaxy S4, includes a barometer, thermometer, and hygrometer (to measure humidity)—the first major smartphone to do so. By using these sensors, people can easily use their mobile devices to obtain environmental information. On the other hand, the popularization of global positioning system (GPS) and the miniaturization of mobile devices, equipped with a wireless network module, make location-based services (LBSs) no longer expensive. us, with the combination of the mobile sensors and the GPS, more and more interesting applications and issues gradually emerged. In general, one can regard each mobile device (sensor) as a moving object in wireless mobile sensor networks. Each user (object) can use the GPS and sensors to provide the environmental information, such as location, temperature, and humidity, to the information systems which are built by the manufacturers. ese systems can sink user’s information and send the user’s location through the mobile networks. Mobile users can immediately access the information related to the location and geographic information. Many manufac- turers even provide different telecommunication services to the users, e multiple types of information services make life more convenient. For example, if a user issues a query and wants to know the temperature at a specific location, the neighboring mobile objects of this location will return the measured temperature information to the user. Another example is the temperature monitoring system where a mobile sink may move around to collect the temperature around it. In these cases, the query may move. As the above examples, the mobile query oſten selects nearest neighbors (NN) [1] around itself to obtain the average of the measured temperatures. Moreover, the mobile query may monitor the environmental information for a period of time. Each moving object thus needs to continu- ously reply to the mobile query with measured environmental information and location. Such an application actually is the continuous nearest neighbors (CNN) query [2, 3], which is used to derive the nearest neighbor sensors and then get the average of the received information continuously. In this

Upload: others

Post on 03-Oct-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Research Article Distributed Continuous k Nearest Neighbors ...downloads.hindawi.com/journals/ijdsn/2013/125145.pdfmobile environments like WSNs, which consist of a number of mobile

Hindawi Publishing CorporationInternational Journal of Distributed Sensor NetworksVolume 2013 Article ID 125145 20 pageshttpdxdoiorg1011552013125145

Research ArticleDistributed Continuous k Nearest Neighbors Search overMoving Objects on Wireless Sensor Networks

Chuan-Ming Liu and Chuan-Chi Lai

Department of Computer Science and Information Engineering National Taipei University of Technology Taipei 10608 Taiwan

Correspondence should be addressed to Chuan-Ming Liu cmliucsientutedutw

Received 29 June 2013 Accepted 20 October 2013

Academic Editor Chang Wu Yu

Copyright copy 2013 C-M Liu and C-C Lai This is an open access article distributed under the Creative Commons AttributionLicense which permits unrestricted use distribution and reproduction in any medium provided the original work is properlycited

Continuous k-nearest neighbor (CkNN) search is a variation of kNN search that the system persistently reports k nearest movingobjects to a user For example system continuously returns 3 nearest moving sensors to the userMany query processing approachesfor CkNN search have been proposed in traditional environments However the existing client-server approaches for CkNN searchare sensitive to the number of moving objects When the moving objects quickly move the processing load on the server will beheavy due to the overwhelming data In this thesis we propose a distributed CkNN search algorithm (DCkNN) on wireless sensornetworks (WSNs) based on the Voronoi diagram There are four features about DCkNN (1) each moving object constructs a localVoronoi cell and keeps the local information (2) in order to keep the reliability of system the query message will be propagatedto related objects (3) using the idea of safe time the number of updates is reduced (4) an equation to estimate a more accuratesafe time is provided Last we present our findings through intensive experiments and the results validate our proposed approachDCkNN

1 Introduction

The mobile sensors have been widely used in recent yearsFor example the smartphone Samsung Galaxy S4 includesa barometer thermometer and hygrometer (to measurehumidity)mdashthe first major smartphone to do so By usingthese sensors people can easily use their mobile devices toobtain environmental information On the other hand thepopularization of global positioning system (GPS) and theminiaturization of mobile devices equipped with a wirelessnetwork module make location-based services (LBSs) nolonger expensive Thus with the combination of the mobilesensors and the GPS more and more interesting applicationsand issues gradually emerged

In general one can regard each mobile device (sensor)as a moving object in wireless mobile sensor networks Eachuser (object) can use the GPS and sensors to provide theenvironmental information such as location temperatureand humidity to the information systems which are built bythemanufacturersThese systems can sink userrsquos informationand send the userrsquos location through the mobile networks

Mobile users can immediately access the information relatedto the location and geographic information Many manufac-turers even provide different telecommunication services tothe users The multiple types of information services makelife more convenient For example if a user issues a queryand wants to know the temperature at a specific locationthe neighboring mobile objects of this location will returnthe measured temperature information to the user Anotherexample is the temperature monitoring system where amobile sink may move around to collect the temperaturearound it In these cases the query may move

As the above examples the mobile query often selects119896 nearest neighbors (119896NN) [1] around itself to obtain theaverage of the measured temperatures Moreover the mobilequery may monitor the environmental information for aperiod of time Each moving object thus needs to continu-ously reply to themobile querywithmeasured environmentalinformation and location Such an application actually is thecontinuous 119896 nearest neighbors (C119896NN) query [2 3] which isused to derive the 119896 nearest neighbor sensors and then getthe average of the received information continuously In this

2 International Journal of Distributed Sensor Networks

paper we consider the mobile environment where the dataobjects and queries can move

Spatial queries such as 119896 nearest neighbors query andcontinuous 119896 nearest neighbors query have attracted manyresearchersrsquo interest and also have been discussed on manydifferent applicationsMost of the existingmethods about the119896NN or C119896NN search in the considered mobile environmentstill use the client-server architecture and rely on a centralserver for processing queries Each moving object needsto continuously obtain the location information of itselfby GPS and send the information back to the server forupdating the database Thus if we use the existing methodsunder a specific scenario that the position status of objectschanges frequently the server must receive a huge amount ofinformation stream for updating each objectrsquos location in ashort time thus causing the server system to be overloadedBesides the large amount of messages for updates occupiesquite a lot of bandwidth We hence propose an effective andnoncentralized approach for supporting C119896NN query in amobile environment

In this work we consider the continuous 119896 nearestneighbors query in WSNs or some other distributed andmobile environments like WSNs which consist of a numberof mobile devices (sensors) and propose a new distributedapproach DC119896NN for processing C119896NN query efficientlyFrom the objectrsquos point of view the distributed architectureusing local computation can effectively reduce the updatingcost since the update messages in the client-server architec-ture may need more hops to arrive to the server Even worsethe long delay of the update messages can make the answerof the C119896NN inaccurate On the other hand the distributedarchitecture can avoid the long response time caused by theoverload of the server In our considered environments eachmobile device also called moving sensor or moving objectcan obtain its location information by the GPS equipmentBesides each moving object is equipped with enough storageand a cpu for storing the local information and processingsimple 2D functions respectively

In our proposed approach each moving object will sendmessages to its one-hop neighbors when necessary to avoidthe wrong information for processing spatial queries Whenfinding the 119896NN our method uses the incremental strategyon the number of hops based on the Voronoi diagram (VD)[4] In order to estimate the movement of a moving objectaccurately we consider the speed of each moving object andadapt the concept of safe region [5] to our proposed approachdistributed continuous 119896 nearest neighbors (DC119896NN)

In this paper we address the problem of efficiently pro-cessing continuous 119896 nearest neighbors over moving objectswith updates and make the following contributions

(i) We identify the continuous 119896nearest neighbors searchproblem on mobile ad hoc networks and categorizesome detailed existing works about this issue

(ii) We provide a novel approach using local Voronoidiagram for efficiently and precisely collecting thelocation of each object in a distributed way

(iii) With the combination of local Voronoi diagram wepropose a model for accurately estimating the safe-time (safe-region) of continuous 119896 nearest neighborsquery which can lead to a short response timefewer number of messages less update cost and highaccuracy

(iv) We perform a simulated experimental evaluation andthe results show the superiority of our solution overthe adaptation of state-of-the-art solutions [5] givento the similar issues

The rest of this paper is organized as follows In Section 2we review the related work The performance metrics andconsidered issues are introduced in Section 3 Section 4presents the proposed solution using localized Voronoi dia-gram and how to derive the accurate safe time Section 5gives some analysis and comparisons between the proposedDC119896NNmethod and different existing methods The discus-sion on the experimental simulation is in Section 6 Finallywe give the conclusion remarks in Section 7

2 Related Work

The existing works for C119896NN search can be categorized intothe following categories according to the ways for accessingor managing data (1) pull-based approach (2) push-basedapproach and (3) distributed andmobile approachThe pull-based approach uses the traditional client-server architecture[6ndash8] A given central server is responsible for processingthe spatial queries from the user devices and all the dataare stored in the server Whenever a client wants someinformation the client will send a query to the server Inmany applications the amount of spatial data needed to beprocessed could be very large and hence the spatial data isusually saved in the external storages such as disks Thusthe existing approaches for C119896NN search using the pull-based approach focus on optimizing the number of IOrsquosOf course the computation time (CPU time) is still animportant performance metric when the size of spatial dataneeded to be processed is not large As a result the abovetwo measurements the number of IOrsquos and CPU time areusually used to validate the effectiveness of the proposedalgorithms for processing 119896NNandC119896NNqueries using pull-based approach However the bandwidth of communicationbetween the clients and servers is asymmetric In other wordsthe uplink bandwidth is limited and much smaller than thebandwidth of downlink This phenomenon in wireless com-munication will cause the bottleneck [9] when the numberof queries increases if the pull-based approach is applied foraccessing data

In order to overcome the bottleneck problem causedby the pull-based approach in wireless environment thepush-based approach is proposed and also referred to asdata broadcasting approach Data broadcasting has attracteda lot of research attention in the past decades and manyapproaches or protocols for different types of spatial querieshave been proposed [10ndash13] In the data broadcasting envi-ronment the data are broadcast in the air by the serverand the clients execute the query process by listening to

International Journal of Distributed Sensor Networks 3

the broadcast channel The load for processing data on theserver is dramatically decreased and relieves the bottleneckproblem Instead the computation load on the clients isincreased From the userrsquos point of view the fewer batterypower each device consumes the better experience eachuser has Thus the existing works [10 11 13ndash15] in generaldiscuss the performance of data broadcasting protocol interms of latency and tuning time Latency is the time a clientexperiences from issuing query to receiving the completeanswer The tuning time is the amount of time actually spenton listening to the broadcastThe latency indicates the qualityof service (QoS) provided by the system and the tuning timecan represent the power consumption of mobile clients

Many works [16ndash18] have discussed the 119896NN and C119896NNqueries on the distributed and mobile environments likemobile ad hoc NETworks (MANETs) and wireless sensorsnetworks (WSN) MANETs and WSNs are self-configuringinfrastructure-less networks consisting of mobile devices andsensors connected by wireless communication Each devicein such networks is free to move independently in anydirection and will thus change its links to other devicesfrequently Each device can forward the traffic unrelated toits own use and act as a router In contrast to the client-serverand data broadcasting environments there is no centralserver that handles the spatial queries or broadcasts spatialdata in MANETs or WSNs Accordingly the informationsystem based on the above infrastructure-less networks hasto process the queries in a distributed way Each mobile node(or device) in such a system cooperates and exchanges spatialdata with each other and then derives the answer for thespatial queries

In spatiotemporal data applications the datasets consistof data objects and the data as well as queries might moveover time In order to process a great volume of spatial dataand queries efficiently some decomposition methods suchas grid and Voronoi diagram have been used in the existingworks [7 19 20] Xiong et al [20] focused on multiple 119896NNqueries and proposed an incremental search technique basedon hashing objects into a regular grid and keeping CPUtime in mind The main objective of this work on disk-resident data is to minimize disk IO operations The CPUtime is considered only as a secondary objective Zhao et al[21] proposed a Voronoi-based approach for C119870NN queryAlthough this work provided a navigation service to mobiledevices the query processing is still operated on a centralserver

Mouratidis et al [22] proposed a threshold-based algo-rithm to help the server processing continuous nearest neigh-bor queries from geographically distributed clients Within agiven threshold the 119896 nearest neighbors of the query pointwill not change However this work still needs a centralserver for monitoring the 119896NN objects maintaining thehuge spatial data and broadcasting each objectrsquos informationChatzimilioudis et al [16] proposed a proximity algorithmto answer all 119896-nearest neighbor queries continuously Insuch an environment many stations called query processorsare placed to monitor all the objects in the radio regionThen different query processors can exchange the monitoredspatial information to calculate the 119896nearest neighbor answerto the user (query point)

f

gb

a

c

d

e

q

k = 2Data pointsQuery point

Figure 1 A 2NN search with query point 119902 where 2NN(119902) = 119886 119887

In contrast to most of the above approaches Kim et al[5] proposed a decentralized method to support continuous119896 nearest neighbor query Each query object predicts a safetime as a threshold for reducing the cost of informationupdate This method assumes that there is a maximumspeedMaxSpeed of each object in the environment and useDI119870NN algorithm [23] to find the initial 119896 nearest neighborsBy monitoring the 119896th and (119896 + 1)th NN the mobile querycan know the influence region and use this region to filtermoving objects thus reducing a great amount of update costHowever this work only considered the stationary query nota moving query We will discuss the accuracy of this methodlater in details Before introducing the proposed algorithmwe first give some background and terminologies

3 Preliminaries

In this section we present some concepts and techniques thatare generally used when solving the spatial data queries onmoving objects The metrics generally used to evaluate thequery process will also be introduced

31 Spatial Query The 119896 nearest neighbor search (119896NNsearch) is one of the important types of spatial queriesSuppose that the distance between two points V and 119906 isdist(V 119906) and assume that there is a given dataset 119863 with aquery point 119902 The 119896 nearest neighbor search is to find the 119896

nearest data objects in dataset119863 A simple example in Figure 1illustrates the 2NNof the given query point 119902 and data objects119886 and 119887 are the two data objects closest to 119902 In this casewe will say 2NN(119902) = 119886 119887 The definition of the 119896 nearestneighbor search problem thus can be defined as follow

Definition 1 (119896NN search problem) Given a query point 119902

and an integer 119896 the 119896 NN search problem is to find a subset119896NN(119902) sube 119863 with |119896NN(119902)| = 119896 such that any data object119901 isin 119896NN(119902) and dist(119901 119902) le min

119900dist(119902 119900) where 119900 isin

(119863-119896NN(119902))The continuous 119896 nearest neighbors search (C119896NN

Search) [3] is a variation of 119896NN query C119896NN search isextended from 119896NN search and the system will continuouslyreturn the 119896NN answer in a time interval In a mobile envi-ronment the mobile devices are regarded as moving objectsThus the result of a C119896NN search may change over time dueto the movement of the queries and data objects We can

4 International Journal of Distributed Sensor Networks

s

b

ac

d

h

e

f

g

s1 s2 s3

Figure 2 An example of C119896NN 119896 = 1 where the output is⟨119886 [119904 119904

1]⟩ ⟨119888 [119904

1 1199042]⟩ ⟨119891 [119904

2 1199043]⟩ ⟨ℎ [119904

3 119890]⟩ for 119902 = [119904 119890]

model the moving pattern of the query as a path consistingof consecutive line segments and then consider the linesegments for C119896NN search Let119863 be a dataset of data objectsand 119902 = [119904 119890] be a query line segment A continuous 119896 nearestneighbors (C119896NN) query retrieves 119896 nearest neighbors ofevery point in the line segment 119902 = [119904 119890] The result containsa set of ⟨119877 119879⟩ tuples where 119877 is the resulting 119896NN withinthe time interval119879 on [119904 119890] Consider Figure 2 as an examplewhere 119863 = 119886 119887 119888 119889 119890 119891 119892 ℎ and 119896 = 1 The outputof the query is the set of tuples ⟨119886 [119904 119904

1]⟩ ⟨119888 [119904

1 1199042]⟩

⟨119891 [1199042 1199043]⟩ and ⟨ℎ [119904

3 119890]⟩ Tuple ⟨119886 [119904 119904

1]⟩ indicates

that 119886 is the 119896NN(119902) (119896 = 1) for interval [119904 1199041] and so on

We then can define the continuous 119896 nearest neighbor searchproblem as below

Definition 2 (C119896NN search problem) Given a line segment[119904 119890] and an integer 119896 for any data object 119901 if 119900

119896isin

C119896NN([119904 119890]) is one of the 119896 nearest neighbor then for anyobject 1199001015840 isin (119863-C119896NN([119904 119890])) dist(119901 119900

1015840

) ge dist(119901 119900119896)

32 Voronoi Diagram Using Voronoi diagram (VD) forC119896NN search is proposed in the pull-based approach [7]Consider a set 119875 of 119899 distinct data points called sites inthe plane The Voronoi diagram of 119875 denoted by VD(119875) isdefined as the subdivision of the plane into 119899 cells one foreach site in 119875 and each cell corresponding to a site 119901 isin 119875 isdefined to be the area of all points in the plane closer to119901 thanto any other point in 119875 Figure 3 shows the Voronoi diagramof 16 data points 119901

1 1199012 119901

16in the plane Actually the

boundary between two points is the perpendicular bisectorof those two points The method proposed in [7] uses thecharacteristics of the perpendicular bisector (the distancesfrom any point on this line to both neighboring pointsare the same) to determine the nearest neighbors of thecurrent query point Let us use Figure 3 as an example Theneach solid line is the perpendicular bisector between twoneighboring data objects Suppose that the solid line witharrows denotes a path for the query point from position 119878

to position 1198631and the dotted line with arrows is the path

from 119878 to 1198632 For the path from 119878 to 119863

1 it is very easy to

determine the answer set of the continuous nearest neighborsusing Voronoi diagram and 119901

9 1199018 11990111

11990112

11990110

is the resultOn the other hand for the dotted path from 119878 to119863

2 since the

query does not move to another Voronoi cell the answer setof continuous nearest neighbor is always 119901

9

p16

p2p1

p3

p4 p5p6

p7 p8

p10

p11

p12

p13p14

p15

p9

D1

D2

s

Figure 3 A continuous nearest neighbor search example usingVoronoi diagram

Using the Voronoi diagram one can easily find the NNfor a query point To find the 119896NN for an arbitrary 119896 gt 1we can extend the concept of Voronoi diagram to have theorder-119896 Voronoi diagram [24] Using the order-119896 Voronoidiagram one can find the 119896NN for a query point by locatingthe query point in some order-119896 Voronoi cell Patroumpas etal proposed a method [25] which approximates the order-119896Voronoi cells by limited data objects to support continuous119896 nearest neighbor query Figure 4 shows the process ofconstructing an approximate order-3 Voronoi cell Before theconstruction all the 119896 nearest neighbors are known Initiallythe system assumes that approximate cell VC1015840 containing 119902

is equal to the entire universe of interest where any possiblelocation is being recorded The system regards query point119902 as the center point divides the whole region into eightquadrants and finds the 3NN(119902) = 119899

1 1198992 1198993 as shown in

Figure 4(a) For each closest point 119898119894to 119902 in each quadrant

the system delineates all its 119896 bisectors with the 119896NN pointsand then produces the approximate order-119896 Voronoi cell ofthe 119896NN point with respect to 119902 But for reducing processingcost even further the system chooses bisector 119887

119894that is closest

to 119902 and thus bounds the cell most tightly (Figure 4(b))Accordingly by taking the most restrictive bisector 119887

119894for

each quadrant in counter-clockwise order the system cangradually crop entire universe and obtain the approximateorder-119896 Voronoi cell VC1015840 as shown from Figures 4(b) to 4(i)The gray region in Figure 4(i) is the resulting approximateorder-3 Voronoi cell No matter the query moves in thisregion 3NN(119902) = 119899

1 1198992 1198993

33 Safe-Time In the wireless sensor network the idea ofsafe-time is proposed by Kim et al [5] This method firstassumes that there is a maximum speed MaxSpeed of eachobject in the environment and then uses DI119896NN algorithm[23] to find the initial 119896 nearest neighbors As Figure 5 showsthe user located at 119878 issues a query with 119902 as the centerpoint of this query The system will first inquiry object 119899

119901

the nearest neighbor of the query point 119902 Then the processsearches the initial 119896NN counter-clockwise on the concentric

International Journal of Distributed Sensor Networks 5

n1

n2n3

q120579

(a)

n1b1

b9984001 b9984009984001

n2n3

q

m1

(b)

n1

b1

n2n3

q

m1

(c)

n1

n2n3

q

m1

m3

b1

b3

(d)

n1b1

b4 b3

n2n3

q

m1m4

m3

(e)

n1b1

b5 b4 b3

n2n3

q

m4

m5

m3

m1

(f)

n1

b1

b3b4b5

b6

n2n3

q

m1

m6

m5

m4

m3

(g)

n1b1

b6

b7

b5 b4 b3

n2n3

q

m3

m1m4

m5

m6 m7

(h)

n1

b1

b6

b7

b8

b5 b4 b3

n2n3

q

m3

m1m4

m5

m6

m8

m7

(i)

Figure 4 The construction of an approximate order-3 Voronoi cell where 119902 is the query point

Q-node

D-node

Itinerary

(a)

s

q

np

w

(b)

Figure 5 The 119896NN search on WSNs (a) Q-node is the first object receiving the query and D-node is the sink node which is responsible forcollecting data and (b) presents the multihops routing path for the 119896NN process

6 International Journal of Distributed Sensor Networks

A 3-nearest neighbor at t0Not a 3-nearest neighbor at t0

CDk = 3

q1

q1 o1

o1 o2

o2

o3

o3

o4

o4

o5

o5

CD2Broadcast range

New CD

t = t0 + ST

(a)

(b)

t = t0

(c)

o1

o2

o3o4

o5

CDq1

CD2

Figure 6 Update process using safe-time for 3NN search on WSNs (a) shows the CD between the third and fourth closest data points (b)presents the maximum influenced distance for update using broadcast (c) indicates the area for broadcasting to update

circles incremental with an distance 119908 The query message isforwarded in hop by hop manner as shown in Figure 5(b)Finally the system can obtain the initial 119896NN from the lastobject which finished the query processing and derive thedistance cross-distance (CD) between the 119896th and (119896 + 1)thnearest neighbors As Figure 6(a) shows the system then cancompute a safe time = CD(2 lowast MaxSpeed) by the cross-distance between the 119896th and (119896 + 1)th nearest neighborsThis indicates that the system ensures that the order of 119896thand (119896 + 1)th nearest neighbors will not exchange in the safe-time periodThus the resulting 119896NNdoes not need to updateIn addition the maximum moving distance of each objectis limited in the safe-time so we can predict the maximuminfluenced region after the movement of 119896th and (119896 + 1)thnearest neighbors as shown in Figures 6(b) and 6(c) to obtainthe safe region (the dark rings in the figure) The system willignore the objects which locate outside the safe region thusreducing the cost of updating each objectrsquos information

34 Performance Metrics In order to evaluate the proposedDC119896NN approach we consider the following performancemetrics including update cost number of messages accuracyand response time

341 Update Cost The update cost is to measure the numberof updates during the query process We sometimes use thefrequency to denote it Since the sensors (objects) and eventhe query will move the status of the sensors should bemaintained in order to have the accurate results However thecost for one update is high in the distributed environmentHence one of the objectives of the designed algorithmDC119896NN is to minimize the update cost for the C119896NN query

342 Number ofMessages Except for the number of updatesthere are some other kinds of messages for the queryprocess in the distributed andmobile environment includingthe messages for query and information passing The totalnumber of messages used during the query process can be

used to indicate the throughput over the networks and theenergy consumption So the proposed DC119896NN is towardsminimizing the total number of messages for the query

343 Accuracy By using the pull-based approach the timeinterval for routing updatemessages to the server depends onthe distance between the data object and the server It thus cannot ensure that the location information of each object savedin the server is the latest Hence the results may be timelyincorrect when deriving the answers for a query due to themobilityThis situation becomes worse in the distributed andmobile environments In our design the proposed approachcan avoid redundant updates and keep the accuracy of theresults

344 Response Time The complicated query process thedelay time for message communication and the numberof users will affect the response time of the system toprocess the query Long response time is unbearable andmayreturn obsoletely invalid query results Even worse the longresponse time may cause important information missing orfinancial loss Thus the system response time is also one ofthe important issues that must be considered when designingthe method for continuous queries

4 Distributed Continuous 119896 NearestNeighbors Search

In the mobile and distributed environments like WSNs orMANETS the pull-based approach may not be a goodmatchfor C119896NN search due to the problems discussed in Section 2We thus propose a distributed algorithm DC119896NN for C119896NNsearch in the mobile and distributed environments Thedistributed approach using a better safe-time can reduce theupdate cost relieve the load for server shorten the responsetime and make the result more accurate There are threephases in DC119896NN initialization phase query processingphase and information update phase In the initialization

International Journal of Distributed Sensor Networks 7

query DC119896NN search()(1) broadcast a query 119902(119896 ℎ119900119901119888) ℎ119900119901119888 is initial to 1(2) get the Voronoi cells or objectrsquos information(3) if (119896 = 1) then(4) show LVC(5) find 119904119886119891119890119905119894119898119890 of DC1NN (with LVC)(6) elseif (119896 gt 1) then(7) while the received information is insufficient do(8) broadcast the query 119902(119896 ℎ119900119901119888 + 1) to ask more hops of neighbor nodes(9) run normal 119896NNSearch to find 119896NN set(10) show LVC according to 119896NNset and 119868119899119891119900(11) find 119904119886119891119890119905119894119898119890 of DC119896NN (with LVC)(12)while (119904119886119891119890119905119894119898119890 = 0)(13) wait

Algorithm 1 The DC119896NN algorithm on the query (sink) node

phase each moving object exchanges the location informa-tion and builds a local Voronoi cell (LVC) as well as calculatesthe safe time for the LVC The query processing phasecollects sufficient location and environmental informationof neighboring neighbors for exploring the result of thegiven C119896NN query The last information update phase is tomaintain the latest information for the moving objects andthe result of the continuous 119896 nearest neighbor query Thefollowing will explain each phase in details

41 Phase 1 Initialization (119896=1) During system initializationeach mobile sensor (moving object) exchanges locationinformation with its neighbors derives the local Voronoi cell(LVC) calculates the safe time of LVC and then stores theLVC and safe time in the memory

When a user issues an NN query 119876 and broadcasts thequery message 119902(119896 ℎ119900119901119888) (case 119896 = 1) where 119896 is the numberof the nearest neighbors the query wants to find and ℎ119900119901119888

is the hop counter and sets to one initially When the querypoint 119876rsquos neighboring objects receive the query message119902(119896 ℎ119900119901119888) they will determine whether 119876 is located in theirVoronoi Cells (VCs) If a neighboring object replies true itmeans that this neighboring object is the nearest neighbor ofthe query point 119876 and this neighboring object will transmitthe Voronoi cell (VC) information of itself to the query point119876 including the neighboring object boundaries locationdirection and speed of movement and some environmentalinformation On the other hand if a neighboring objectreturns false this neighboring object will check whetherquery point119876moves towards it or not If the query point119876 ismoving towards a neighboring object then this neighboringobject also will send its VC information to the 119876 otherwisethe query message will be ignored After the initializationphase eachmoving object will maintain the LVC informationand safe time The update process will be executed for thelatest LVC information only when the safe time decreases tozero Assume that each object has 119889 neighbors in averageSince the bisector between two objects costs 119874(1) time theLVC construction (Initialization phase) can be finished in119874(119889) time

42 Phase 2 C119896NN Query Processing The pseudocodeQuery DC119896NN Search() in Algorithm 1 shows the wholequery process on the query point The operations fromLine 6 to the end of Query DC119896NN Search() do the queryprocessing of C119896NN (119896 gt 1) When a query point119876 wants tofind the 119896 nearest neighbors where 119896 gt 1 119876 first broadcastsmessages 119902(119896 ℎ119900119901119888) (case 119896 gt 1) and gets the local Voronoicell (LVC) information from the nearest neighboring (NN)object The nearest neighboring object of 119876 is responsiblefor routing messages to its neighboring objects collectingthe local Voronoi cell (LVC) information of the neighboringobjects and sending information back to query point 119876Basically if the received information is insufficient to derivethe 119896NN answer the query point 119876 will repeatedly sends thequery message 119902 with one more hop (ie ℎ119900119901119888 = ℎ119900119901119888 + 1) tothe specific neighboring objects to obtain more neighboringVC information until the received information is enough toget 119896NN answer

When the received information is enough to derive theresults of 119896NN the query point 119876 will use the approximatemethod we modified from [25] to calculate the approximateorder-119896 LVC in which the query point 119876 locates By usingthe modified method the query point 119876 has to partitionthe plane into 120582 equal sectors and selects an additionalnearest neighboring object in each sector excluded from119896NN objects Thus the query point 119876 needs to collect atleast 119896 + 120582 neighboring objectsrsquo information to build theapproximate order-119896 LVC Note that the information of theadditional 120582 objects can be learned from the informationof the received neighboring objects In comparison with thecentralized approach for constructing the approximate order-119896 Voronoi cell the modified approximate method only needsto consider the 119896nearest neighboring objects and120582 additionalnearest neighboring objects instead of considering all objectsin the wireless environment The computation time is thusmuch better than the traditional centralized approach andcan be derived as119874(120582) + 119874(120582) times 119874(119896) = 119874(120582(119896 + 1)) where119874(120582) is the time for selecting the 120582 additional neighboringobjects In the end 119874(120582119896) is the time for determining theboundary of the approximate order-119896 LVC For more detailsabout the analysis of the computation time please refer to

8 International Journal of Distributed Sensor Networks

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

(a)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q

(b)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q

(c)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q

(d)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

q

(e)

Figure 7 An example of DCNN where (a) each sensor exchanges information in the initial step (b) each sensor builds its LVC (c) a queryat object 119902 is issued and sensor 119900

1returns the information of its LVC to 119902 since 119902 is located in the Voronoi cell associated with 119900

1 (d) object

119902 knows which sensor will be reached next and can derive the safe time by the LVC information of 1199001 and (e) the query result to 119902 can be

updated seamlessly when it moves to 1199006

[25] After the query point 119876 calculates the approximateorder-119896 LVC a safe time of the query 119902 can be derived Thesafe time of the query 119902 is regarded as the time limit forstarting the next location information updating process andupdating the C119896NN answer

Figure 7 gives an example for the case of 119896 = 1 Asshown in Figure 7(a) there are 16moving sensors 119900

1 119900

16

in the system and each sensor has the location informationabout itself In the initial phase each sensor broadcasts themessage with its location information and receives the loca-tion information from its neighbors The local Voronoi cell(LVC) of each sensor then can be calculated and stored Theoverall calculatedVoronoi diagram is depicted in Figure 7(b)Afterwards if the locations of the sensors change as movingeach sensor will broadcast new location information to itsneighbors and each sensor can derive a new LVC by thereceived updating messages In Figure 7(c) a continuous NNquery is issued by some query object 119902 with its locationIn order to know the Voronoi cell where 119902 locates 119902 firstbroadcasts the query message to the neighboring sensors(in dashed circle) After receiving the query message theneighboring sensor will check whether the query 119902 is locatedin its associated cell If 119902 is not in the cell the sensor willignore the querymessage In Figure 7(c) sensor 119900

1will return

the result to the query 119902 saying that object 1199001is the nearest

neighbor of 119902 for the time being If 119902 moves in the directionas indicated by the solid arrow in Figure 7(d) to object 119900

6

119902 can know that it moves towards the boundary of 1199001and

1199006by the LVC stored in 119900

6and then derive the safe time

When approaching the boundary (ie the safe time is almostpassed) a query message to 119900

6will be issued by 119902 in advance

Sensor 1199006will reply to 119902with the cell information to maintain

the accuracy of the query result Figure 7(e) shows the resultafter 119902moves into the associated cell of sensor 119900

6

Figure 8 demonstrates an example of DC119896NN for 119896 gt

1 The initial phase is the same as the previous DCNNexample Each sensor derives the corresponding LVC withthe information from the neighboring sensors The queryis issued by a moving object 119902 with its location Object 119902

locates itself and knows that it is in the VC of 1199001after sensor

1199001replies to 119902 with its LVC information Suppose 119896 = 3

After the initialization 119902 is located in 1199001and has the LVC

information of 1199001 Having such information 119902 can derive the

NN but 3NN cannot be decided yet So 119902 will broadcast thequery message to all of its one-hop neighboring sensors say1199001 1199002 1199003 1199008 and 119900

9in Figure 8(a) to request information

The neighboring sensors will reply to 119902 the information abouttheir LVCs Object 119902 then can derive the resulting 3NN forthe time being say 119900

1 1199008 and 119900

9in the example With

these replied information 119902 can build the approximate order-3 Voronoi cell as shown in Figure 8(b) Then 119902 uses theapproximate order-3 Voronoi cell to derive the safe time inorder to maintain the continuous query result Now if 119896 =

10 the information received from the one-hop neighboringsensors is not enough to derive the result Then the querymessage will be broadcast to 119902rsquos two-hop neighboring sensorsas Figure 8(c) shows If the information is not enough toderive the resulting 119896NN the querymessagewill be broadcast

International Journal of Distributed Sensor Networks 9

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q n1n2

n3

n4(k + 1)

(a)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5qn1

n2

n3

(b)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o3o4

o5q

o9

o2

(c)

o1

o6

o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q

n11(k + 1)

n1

n4n5

n6

n10

n7

n8

n2n9

n3

(d)

o1

o6

o7

o8

o11o10

o12

o13o14o15

o16o9

o2 o3o4

o5q n1n2

n4n5

n6

n7

n3

n9n10

n8

(e)

Figure 8 An example of DC119896NN for 119896 gt 1 where the initialization phase is the same as previous DCNN example and (a) 1199001 1199008 and 119900

9are

the 3NN to the query object 119902 (b) the approximate order-3 Voronoi cell can be built with enough information received (c) the information isnot enough for 10NN query and two-hop neighboring sensors are requested (d) the resulting 10NN can be derived and (e) the approximateorder-10 Voronoi cell can be calculated with information received

to one more hop neighboring sensor Such process will berepeated with an increment on the hop count After havingenough information 119902 can calculate the resulting 10NN andthe approximate order-10 Voronoi cell as shown in Figures8(d) and 8(e) respectively Using the approximate order-10Voronoi cell the safe time can be derived In the followingwe will discuss how to derive the safe time for maintainingthe result of the continuous 119896NN query

43 Phase 3 Information Updates In the distributed andmobile environments it is challenging for a mobile nodeto maintain the location information of the other mobilenodes effectively If a mobile node sends the update messagesfrequently it will consume much network resource andpower Furthermore the result of themoving query should beeffectively maintained For different roles nodes and querywe propose effective ways respectively in our DC119896NN queryprocess to update the location information and maintain thequery result

431 The Safe Time of Each Object In the proposed appro-ach DC119896NN each object cooperates with each other andexchanges information to update the location information ofeach object In order to monitor and obtain the continuousanswer of a continuous 119896 nearest neighbors query we usea safe distance between each object and query Then wecan derive the safe time of each object for location updatesby estimating the maximum speed of that object Supposethat the sensing area is partitioned into a grid for location

management There are three possible methods for derivingthe safe distance The first one is the grid-based safe distanceEach object directly uses the minimum distance betweenitself and the boundary of the grid cell where the objectlocates Simply using the grid-based safe distance may causesome problems about the imprecise updates The secondmethod VD-based safe distance uses VD to obtain the safedistance In order to predict the safe distance more preciselywe can consider the previous two distances simultaneouslyand then select the smaller one So the last method propersafe distance will return a better safe distance by comparisonsHaving the safe distance the safe time then can be derived byestimating the maximum speed of the considered object

In Figure 9 the sensing area is divided into a grid andthe Voronoi diagram formed by the sensors is also shownFor sensor 119900

1in Figure 9(a) the grid-based safe distance and

VD-based safe distance are presented respectively and theproper safe distance will be the VD-based safe distance afterthe comparison On the contrary for sensor 119900

3in Figure 9(b)

the proper safe distance will be the grid-based safe distance

432The Safe Time of EachQuery For themoving query it isimportant to know when the result will change To derive thesafe time during which the result will not change we referto the characteristics of Voronoi diagram In the traditionalenvironment with static objects the system only uses theminimum distance from the query to the boundary of theVoronoi cell where the query locates as the safe distance Thethe safe time can be obtained by the estimated maximum

10 International Journal of Distributed Sensor Networks

o1

o7

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

o6o8

(a)

o1

o7

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

o6o8

(b)

Figure 9 An illustration for different safe distances (a) sensor 1199001uses the VD-based safe distance as the proper safe distance and (b) sensor

1199003uses the grid-based safe distance as the proper safe distance

L L

A

B

Safe distance

Query

B

A

120579

New safe distance

QueryA998400

L998400

B998400

Figure 10 An example showing the impact on the safe distancecaused by object movement

speed of that query During the safe time no update isnecessary thus saving the update cost

Unfortunately in the moving object environment theabove method cannot obtain the right safe time As shownin Figure 10 the left part shows the static case where 119871 is theVoronoi cell boundary between objects 119860 and 119861 and the safedistance of the query can be calculated as the figure showsHowever for the moving objects the original safe distancebetween the 119871 and query cannot be directly used to calculatethe safe time because the object movement will cause thedistance form query to 119871 to be nonlinearly increasing ordecreasing As the right part of Figure 10 shows after themovement of object 119860 and object 119861 119871 becomes 119871

1015840 and thesafe distance changes Thus if we want to use the boundariesof Voronoi cell to estimate more accurate safe time we needto consider the relative movements between the objects andquery

In order to derive the precise safe distance we considerthe movements of objects and query simultaneously and useFigure 11 to illustrate Initially 119876119860 and 119876119861 are the distancesfrom the query to objects 119860 and 119861 respectively The linebetween 119860 and 119861 is the boundary of the Voronoi cellsassociated with 119860 and 119861 and the query is located in thecell of 119860 as Figure 11(a) shows When objects and the querymove as in Figure 11(b) the query may touch the boundaryThis indicates that the query will enter another cell and theresult of the query should be updated The time from thebeginning to the moment of touching the boundary is theprecise safe time for the query According to the properties

of Voronoi diagram when the query is on the boundary119876119860 = 119876119861 We hence can use the condition of 119876119860 = 119876119861

to decide whether the query is on the boundary With thisproperty even though the objects and querymove frequentlythe query only needs the speeds directions and locationsof the neighboring objects to predict the safe time easilyWithin the safe time the query will not touch the boundaryIn Figure 11(c) the query meets the boundary at 119905

1and the

safe time is 1199051

In the following we present the way to calculate the safetime when 119876119860 = 119876119861 Assume that the initial location of themoving query is (119909

119902 119910119902) and the speed is (119881

119909119902 119881119910119902

) Supposethe initial location of object 119860(119861) is (119909

119860 119910119860)((119909119861 119910119861)) with

the speed being (119881119909119860

119881119910119860

)((119881119909119861

119881119910119861

)) The equation to findwhen the querymeets the boundary can be derived accordingto the property of perpendicular bisector Since119876119860 = 119876119861 wecan have

([(119909119902+ 119881119909119902

lowast 119905) minus (119909119860

+ 119881119909119860

lowast 119905)]2

+[(119910119902+ 119881119910119902

lowast 119905) minus (119910119860

+ 119881119910119860

lowast 119905)]2

)

12

= ([(119909119902+ 119881119909119902

lowast 119905) minus (119909119861

+ 119881119909119861

lowast 119905)]2

+[(119910119902+ 119881119910119902

lowast 119905) minus (119910119861

+ 119881119910119861

lowast 119905)]2

)

12

(1)

Then

0 = [1198812

119909119860

+ 1198812

119910119860

minus 1198812

119909119861

minus 1198812

119910119861

minus 2 lowast 119881119909119902

119881119909119860

minus2 lowast 119881119910119902

119881119910119860

+ 2 lowast 119881119909119902

119881119909119861

+ 2 lowast 119881119910119902

119881119910119861

] lowast 1199052

+ 2 [(119909119902minus 119909119860) (119881119909119902

minus 119881119909119860

) + (119910119902minus 119910119860) (119881119910119902

minus 119881119910119860

)

minus (119909119902minus119909119861) (119881119909119902

minus119881119909119861

) minus (119910119902minus119910119861) (119881119910119902

minus119881119910119861

)] lowast 119905

+ [(119909119902minus 119909119860)2

+ (119910119902minus 119910119860)2

minus (119909119902minus 119909119861)2

minus (119910119902minus119910119861)2

]

(2)

International Journal of Distributed Sensor Networks 11

A

B

Query

(x3 y3)

(x2 y2) (x1 y1)QA

QB

(Vx2 Vy2)

(Vx3 Vy3)

(Vx1 Vy1)

(a)

A

B

Query

(x3 y3)

(x2 y2)(x1 y1)

QA

QB

(Vx2 Vy2)

(Vx3 Vy3)

(Vx1 Vy1)

(b)

A

B

d

t1 t2 t3 t

(c)

Figure 11 The precise safe-time for moving objects 119860 and 119861 and the moving query where (a) shows the beginning state (b) presents themoment when the moving query meets the boundary and (c) gives the diagram for the change on the safe distance with time 119905

o1

o2

o3o4

o5

CDq1

CD2

(a)

o1

o2

o3o4

o5

CDq1

CD2

q9984001

(b)

Figure 12 The phenomenon when using the original safe-time methods to (a) stationary query and (b) moving query

Equation (2) is a quadratic equation Since a generalquadratic equation can be written in the following form1198861199092

+ 119887119909 + 119888 = 0 recall that the discriminant of a quadraticequation is Δ = 119887

2

minus 4119886119888 If Δ gt 0 there are two distinct realroots if Δ = 0 there is exactly one real root if Δ lt 0 thereare two distinct (non-real) complex roots In (2)

119886 = 1198812

119909119860

+ 1198812

119910119860

minus 1198812

119909119861

minus 1198812

119910119861

minus 2 lowast 119881119909119902

119881119909119860

minus 2 lowast 119881119910119902

119881119910119860

+ 2 lowast 119881119909119902

119881119909119861

+ 2 lowast 119881119910119902

119881119910119861

119887 = 2 [(119909119902minus 119909119860) (119881119909119902

minus 119881119909119860

) + (119910119902minus 119910119860) (119881119910119902

minus 119881119910119860

)

minus (119909119902minus 119909119861) (119881119909119902

minus 119881119909119861

) minus (119910119902minus 119910119861) (119881119910119902

minus 119881119910119861

)]

119888 = (119909119902minus 119909119860)2

+ (119910119902minus 119910119860)2

minus (119909119902minus 119909119861)2

minus (119910119902minus 119910119861)2

(3)

and then we can derive the safe time 119905 according to thediscriminant

119905 =

[minus119887 + (1198872

minus 4119886119888)12

]

2119886or

[minus119887 minus (1198872

minus 4119886119888)12

]

2119886

(4)

Finally we select the minimum value of 119905 gt 0 as the safetime

Additionally assuming that 119889 is the distance between theobject and the query and 119905 is the time 119876119860 = 119876119861 can be

converted into a function of 119905 and 119889 as shown in Figure 11(c)Then we can obtain the safe time 119905

1which is the time when

119876119860 = 119876119861 Furthermore the object 119861 will be closest to thequery at the time 119905

3

5 Comparisons with Previous Approaches

In this section we compare the proposed DC119896NN approachthe Safe-time with stationary query approach [5] and thenaıve way used pull-based approach in terms of safe timespace and accuracy

51 Safe Time The original safe-time with stationary query[5] (safe-time(S)) does not support moving queries Anexample of C3NN is shown in Figure 12 where 119902

1is the query

point triangles are the 3NN objects the pentagons representthe other individual objects and 119900

4is 4th NN Figure 12(a)

shows the original result for safe-time(S) After obtaining the119896th and (119896 + 1)th objects (119900

2and 1199004in the figure) the cross-

distance (CD) of 119896th and (119896 + 1)th objects can be calculatedRecall that the cross distance of two data objects 119860 and 119861 isthe difference on the distances of119860 and119861 to the center (or thequery point) For the next update (after a safe-time period)all the objects in this region should be checked

We adapt the safe-time(S) method for moving queryThe adapted approach will result in a higher update cost

12 International Journal of Distributed Sensor Networks

Figure 12(b) presents a case that the query moves towardobject 119900

3(119896th NN) and away from object 119900

4((119896 + 1)th NN)

When the query 1199021moves to the point 1199021015840

1 the most outside

concentric circle increases and becomes as large as the mostoutside dotted concentric circle On the contrary the mostinside concentric circle decreases and becomes as small as themost inside dotted concentric circle Thus the cross-distanceincreases and more number of objects will be examined

In addition according to the Figure 12(b) we can knowthat the original Safe-time method safe-time(S) is notappropriate for moving queries since the calculation of Safe-time(S) method does not consider the speed of query safe-time(S) directly uses twofold of the maximum speed of the119896th and (119896+1)thNNobjects to divide theCD to derive the safetime The cost for updates increases when the CD becomeslarger since the average checked area becomes bigger Besidesthe obtained 119896NNanswer cannot be guaranteed to be correctOn the contrary the cross-distance when the query movestowards object 119900

4((119896 + 1)th NN) and away from object 119900

3

(119896th NN) in this case the order of the 119896th and (119896 + 1)th NNobjectmay be changed but the update does not perform thusresulting in incorrect results

We modify the Safe-time to fully support the movingquery In order to support and maintain the accuracy ofmoving query the maximum speed (Maxspeed) used in thesafe time calculation is required to be modified and replacedby the maximum relative speed between the query and theobjects Because of using the relative speed the adaptedsafe-time method safe-time(M) needs twofold maximumrelative speed (2 lowast 119872119886119909119904119901119890119890119889) to calculate the safe time forguaranteeing the accurate resultsThe safe time derived is lessthan the one derived in safe-time(S) due to the relative speedHence the update frequency of safe-time(M) is higher thanthe update frequency of safe-time(S)

52 Space In DC119896NN each object and query only need tomaintain the information of LVC The information to bestored includes the location of neighboring objects and theobject information of order-119896rsquos local Voronoi diagram Thetotal amount of stored information is not significant on eachobjectThus the use of storage space does not need to be verysubstantial

53 Accuracy The safe-time (S) [5] considers the stationaryquery When applying it to the moving query some adaptionshould bemade According to our experimental results whenthe value of 119896 increases with a moving query the accuracy ofthe result will be reduced In our simulation we modify theoriginal Safe-time(S) as Safe time(M) for moving query andconsider the relative distance in detail caused by the movingquery and objects Although the correctness of the answer canbe increased the update frequency increases thus increasingthe number of delivered messages

DC119896NNuses Voronoi and grid cell boundary to calculatethe safe time and updates the information of related objectsbefore the end of the safe time In fact the boundary ofthe Voronoi cell represents the boundary of moving 119896NNquery After the safe time period the query will collect the

information of related neighboring objects Having such real-time information the query can have the resultmore accuratein time Similar to safe-time(M) DC119896NN uses the 119896th and(119896 + 1)th nearest moving objects to derive the safe time So itis able to maintain the correctness of the answer

6 Simulation Experiments

In the simulation we compare the following methods NaıveDC119896NN safe-time (S) and safe-time (M)TheNaıvemethodis centralized and used as a benchmark for the comparisonAll the mobile sensors will send the location informationto the central server to update the information The othermethods DC119896NN Safe-time(S) and Safe-time(M) are dis-tributed and used in the considered mobile wireless sensornetwork where each object knows its position has the abilityto perform some calculation and stores the information oflocalized Voronoi cell (LVC)We assume that each object cantransmit amessage to its one-hopneighbor so that each objectcan communicate with at least one object For Safe-time(S)and the safe-time(M) a maximum speed (MaxSpeed) is setin order to estimate relative speed and distance for safe-timecalculation

In the simulation all the compared approaches areperformed under the same environmental conditions forfairness The initial location and speed of moving objectsare uniformly randomly distributed Since we focus on theperformance of the query process of the proposed DC119896NNapproach we further assume that the transmission quality isideal and no congestion and communication delays occurThe metrics measured include the update frequency for aquery the total number of messages response time andaccuracy The update frequency for a query is the averagenumber of update messages sent by the data objects relatedto the query per minute The total number of messages isall the amount of messages sent from all objects during thequery process The accuracy of each method is measuredby comparing the results to the real answers Since thequery is continuous and the update occurs subsequently themeasured response time is mainly the time required fromsending a query to obtaining the first result

All the experiments are simulated so the results aboutthe response time may not show the practical cases exactlybut can reflect the trends on the performance among all thecompared approaches relatively In order to have the responsetime in our simulation we thus use the total number of hopsfor deriving the result tomultiply the average time for one hopin the simulation system to present the response time Thusthe response time is proportional to the total number of hopsin our simulation program In addition because the maindifference between Safe-time(S) and the Safe-time(M) is theway for deriving the safe time the measured response timeof these two methods is the same The simulation programis implemented with Java The setting of our simulation isshown in Table 1 with a default value for each parameter Inall the simulation experiments the final results are reportedwith the average of 100 queries The duration of each query is60 seconds

International Journal of Distributed Sensor Networks 13

200 400 600 800 10000

10

20

30

40

50

60

Edge length of sensing area (m)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

200 400 600 800 10000

100

200

300

400

500

600

700

Edge length of sensing area (m)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

200 400 600 800 100075

80

85

90

95

100

105

Edge length of sensing area (m)

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

200 400 600 800 1000Edge length of sensing area (m)

Aver

age r

espo

nse t

ime (

s)

DCkNNSafe-time(S)Safe-time(M)

095

1

105

11

(d) Response time

Figure 13 The effects of different sensing areas on (a) update frequency (b) number of messages (c) accuracy and (d) response time

Table 1 Simulation parameters

Parameter Range Default valueEdge length of sensingarea (m) 200 400 600 800 1000 600

Edge length of grid (m) 50 100 150 50Number of objects 20 30 40 50 60 30Transmission range (m) 125 125119896 1 3 5 10 20 3Moving objects () 20 40 60 80 100 20Speed (ms) 2 4 6 8 10 4

61 Effects of Sensing Area Sensing area affects the numberof update and query messages since if the area becomes

greater with the fixed number of objects relatively thedensity of the objects becomes sparse For example when thesensing areas are 200lowast200 400lowast400 600lowast600 800lowast800 and1000lowast1000 the densities are 188 047 021 012 and 008respectively Figure 13(a) shows that DC119896NN has the lowestnumber of updates with all the different areas and the numberof updates for Safe-time(S) is the highest (worst) becauseDC119896NN considers the moving direction and speed of thequeries and objects and selects the proper safe-distance toderive the safe-time Safe-time(S) the Safe-time(M) estimatethe safe time according to the maximum speed of the objectsso more number of updates can be expected AdditionallySafe-time(M) is updated more frequently than Safe-time(S)Recall that Safe-time(M) considers the query movement

14 International Journal of Distributed Sensor Networks

50 75 100 150 2000

5

10

15

20

25

Edge length of grid (m)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

50 75 100 150 2000

50

100

150

200

250

300

350

Edge length of grid (m)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

50 75 100 150 2000

20

40

60

80

100

120

Edge length of grid (m)

Accu

racy

()

DCkNN(G)DCkNN(V)

(c) Accuracy

50 75 100 150 2001

101

102

103

104

105

106

Edge length of grid (m)

Aver

age r

espo

nse t

ime (

s)

DCkNN(G)DCkNN(V)

(d) Response time

Figure 14 The comparisons of using grid-based and VD-base safe distances to derive the safe-time (a) update frequency (b) number ofmessages (c) accuracy and (d) response time

The average safe-distance becomes shorter thus leading tomore updates Besides when the sensing area increasesfrom 200lowast200 to 600lowast600 the update frequency dropsdramaticallyThe curve becomes flatter when the area is from600lowast600 to 1000lowast1000 since the difference on the densitiesof the areas from 600lowast600 to 1000lowast1000 is not much Thenumber of updates is less as the safe-time becomes largerThetotal number of transmitted messages of naıve approach isfixed at about 1800 packets All the other distributedmethodsuse fewer number of messages than naıve

To monitor the results DC119896NN only needs to check therelated objects in the local Voronoi cell at the proper safe-time thus reducing a lot of redundant update messages Safe-time(S) and Safe-time(M) use the maximum speed of theobjects to calculate the safe time so the total number of

transmitted messages of both approaches is more than that ofDC119896NN Figure 13(b) shows that more than 30 of the totalnumber of transmitted messages can be saved by DC119896NN incomparison with Safe-time(M)

For the accuracy since Safe-time(S) does not considerthe query movement the safe-time may be inaccurate Fur-thermore due to the mobility when the density is high theestimated results become more inaccurate So Safe-time(S)performs worst as shown in Figure 13(c) Safe-time(M) isrevised from Safe-time(S) by considering the query move-ment and the safe-distance is less in average for guaranteeingbetter results Hence Safe-time(M) has a better accuracy andalmost the same as DC119896NN The accuracy of Safe-time(M)and DC119896NN is almost about 100 correct and the gap maybe caused by arithmetical errors in the experiments

International Journal of Distributed Sensor Networks 15

10 20 30 40 50 60 700

5

10

15

20

25

30

35

40

45

Number of objects

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

10 20 30 40 50 60 70100

150

200

250

300

350

400

450

Number of objects

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

10 20 30 40 50 60 7080

85

90

95

100

105

Number of objects

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

10 20 30 40 50 60 70Number of objects

Aver

age r

espo

nse t

ime (

s)

096

098

1

102

104

106

108

11

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 15 The effects of the number of objects on (a) update frequency (b) number of messages (c) accuracy and (d) response time

When the area becomes larger the density becomeslower So the number of objects in each objectrsquos transmissionrange is fewer Under such a circumstance DC119896NN usesless computation and the response time is shorter as shownin Figure 13(d) In contrast the Safe-time(S) and the Safe-time(M) need to collect information before performing eachnew query and cause longer response time Since Safe-time(M) and Safe-time(S) use the same method and proce-dure to handle the first query the response time of these twomethods will be almost the same

62 Effects of Grid Size In this simulation experiment setwe want to observe the update efficiency of each object inthe third phase of DC119896NN Recall that we consider the grid-based and VD-base safe distances to derive a proper safe-time In this experiment DC119896NN(G) uses grid-based safe

distance to determine the safe time for the next update andDC119896NN(V) uses VD-base safe distance to derive the safetime The sensing area is fixed to 600lowast600m2 and there are30 data objects We compare DC119896NN(V) with DC119896NN(G)by observing the impacts of different grid sizes All theother settings have the similar trends in our experimentalresults In Figure 14(a) the update frequency of the objectsin DC119896NN(G) is high when the grid size is 50lowast50m2 andbecomes less when the grid size decreases Since the sensingarea is 600lowast600m2 and 30 objects are given the averagedistance between an object and the boundary of a Voronoicell is about 25 to 50 meters With the setting of grid size50lowast50m2 the average distance obtained in DC119896NN(G) isabout 25 meters Thus the safe time of DC119896NN(V) is longerIn general as Figures 14(a) and 14(b) show the update

16 International Journal of Distributed Sensor Networks

1 3 5 10 200

10

20

30

40

50

60

k

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

1 3 5 10 200

100

200

300

400

500

600

700

800

k

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

1 3 5 10 2080

85

90

95

100

105

k

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

1 3 5 10 20k

Aver

age r

espo

nse t

ime (

s)

08

09

1

11

12

13

14

15

16

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 16 The impacts of different values of 119896 on (a) update frequency (b) number of messages (c) accuracy and (d) response time

frequency of the objects and the number of messages sentby the objects decrease as the grid size increases

When the grid size is large the safe time becomes longand less number of updates are issued Hence the resultsbecome more inaccurate As shown in Figure 14(c) whenthe grid sizes are 50lowast50m2 75lowast75m2 100lowast100m2 and150lowast150m2 the corresponding accuracies are 95 9285 and 78 respectively While the grid size increases to200lowast200m2 the accuracy is significantly reduced to 69and the right answer thus can not be guaranteed On theother hand Figure 14(d) shows that the response times ofDC119896NN(G) and DC119896NN(V) are not much different becausethe size of grid is not the major factor to influence thecomplexity of obtaining information for the first query

63 Number of Objects In this subsection we discuss theresults as the number of data objects varies The area in thepresented experiment set is 600lowast600 (m2) with grid size of50lowast50 (m2) As shown in Figure 15(a) when the number ofobjects increases the number of updates in DC119896NN is stillrelatively less than the ones in Safe-time(S) and Safe-time(M)If the number of objects increases the number of repliedmessages per second to the central server in naıve will growdramatically With 20 to 60 objects the number of repliedmessages to the server is from 1200 to 3600 (packetsmin)By observing the results in Figures 15(b) and 15(c) as moreobjects are in the area the number of messages increasesfor the other three methods and the accuracy reduces inSafe-time(S) These match the trends for different areas we

International Journal of Distributed Sensor Networks 17

20 40 60 80 1000

5

10

15

20

25

30

35

40

45

Moving objects ()

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

20 40 60 80 1000

100

200

300

400

500

600

Moving objects ()

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

20 40 60 80 100

80

70

75

85

90

95

100

105

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

Moving objects ()

(c) Accuracy

20 40 60 80 100

Aver

age r

espo

nse t

ime (

s)

09

095

1

11

105

115

12

125

13

DCkNNSafe-time(S)Safe-time(M)

Moving objects ()

(d) Response time

Figure 17 The effects of the moving objects on (a) update frequency (b) number of messages (c) accuracy and (d) response time

discussed earlier due to the density Similarly the responsetime can be expected as shown in Figure 15(d) where theresponse time of DC119896NN is still the shortest

64 Different Values of 119896 It is obvious that the value of119896 affects the performance of query processing significantlyWhen the value of 119896 becomes larger the number of relatedobjects required to be checked also increases In other wordswe need to spend more cost to find out which 119896 objectsare currently in the result for the C119896NN query Thereforethe changes in the value of 119896 mainly affect the amountof data required for the first query and the update costfor maintaining the 119896th and the (119896 + 1)th objects So inFigure 16(a) when the value of 119896 is large more updates arenecessary for all the three methods As Figure 16(b) shows

the influence on the number of transmitted messages inSafe-time(M) is more serious than the one in Safe-time(S)Due to the mobility the number of influenced objects inSafe-time(M) will increase as the value of 119896 increases Inparticular the update frequency in Safe-time(M) becomesnearly twofold the update frequency in Safe-time(S)

Figure 16(c) presents the impact on the accuracy fordifferent values of 119896 With a larger value of 119896 an object inSafe-time(S) will have a higher chance to derive the incorrectsafe time thus causing lower accuracy When the value of 119896increases the response time of all threemethods will increasesignificantly as shown in Figure 16(d) The reason is thatall DC119896NN Safe-time(S) and Safe-time(M) need to searchmore objects and collect more information for answering thequery when the value of 119896 increases to a certain number For

18 International Journal of Distributed Sensor Networks

2 4 6 8 100

10

20

30

40

50

60

Speed (ms)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

2 4 6 8 100

100

200

300

400

500

600

700

800

Speed (ms)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

2 4 6 8 1070

75

80

85

90

95

100

105

Speed (ms)

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

2 4 6 8 1009

095

1

105

11

115

12

125

13

Speed (ms)

Aver

age r

espo

nse t

ime (

s)

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 18 The impacts of speed on (a) update frequency (b) number of messages (c) accuracy and (d) response time

DC119896NN DC119896NN only needs to store local Voronoi diagramwhere the information required is less than required in Safe-time(S) and Safe-time(M) so the response time of DC119896NN isthe shortest

65 The Effect of Moving Objects In this experiment set weconsider different percentages of moving objects in all thedata objects The default value is 20 which means that ifthere is a total of 30 objects then there are sixmoving objectsIn Figures 17(a) and 17(b) as the percentage ofmoving objectsincreases the overall number of updates required between theobjects increases relatively and the change rate of answer totheDC119896NNaccelerates thus increasing the update frequencyof the query and the number of messages However DC119896NNstill keeps the best performance Figure 17(c) shows the accu-racy of the result for different percentage of moving objectsDC119896NN and Safe-time(M) both have higher accuracy and

Safe-time(S) is still the worst The safe time of each object inSafe-time(S) is calculated using the maximum speed of theobjects Hence whether the object is moving or not does notdirectly result in the incorrectness of the answer collectionIn fact in Safe-time(S) one of the main reasons to affectthe accuracy is the directions of moving objects Last asFigure 17(d) shows the percentage of moving objects doesnot impact the response time too much

66 Effects of Speed If each object moves faster the relativevelocities between objects may also become faster This willmake the safe time shorter and the update frequency ofeach object and query increases The safe time used inSafe-time(S) and Safe-time(M) is directly affected by themaximum speed of objects and does not consider the direc-tion of each objectrsquos movement and the speed of individualmovement No matter the objects move or not and move

International Journal of Distributed Sensor Networks 19

fast or slow both of the above methods directly use themaximum speed of objects to calculate the safe time forupdating On the other hand DC119896NN considers the movingdirection of objects and the proper safe-time for updatesIn this experiment the number of moving objects is 20of all the objects As Figure 18(a) shows as the movingobjects speed up the update cost increases and DC119896NN stillperforms best As the speed increases the safe-time in Safe-time(S) and the Safe-time(M) becomes much shorter due toa larger maximum speed among all the objects The trendbecomes even worse as the speed increases

Figure 18(b) shows the trend about the number of trans-mitted messages when the speed is up DC119896NN still hasthe best performance on the number of messages There are42781 messages sent in average when the speed of object is10ms However the Safe-time(M) needs 67913 messagesThe accuracy will not be effected as the speed changesfor DC119896NN and Safe-time(M) because both of them aredesigned or adapted for themoving objects and queries Safe-time(S) will have more inaccurate results as the speed is highas shown in Figure 18(c) However the response time doesnot have a significant impact on the response time for all thethree methods Figure 18(d) presents this trend

7 Conclusions

In this paper we propose a new approach DC119896NN whichuses the local Voronoi diagram and proper safe-time toeffectively process the C119896NNquery in distributed andmobileenvironments such as wireless sensor networks The propersafe-time can be quickly derived by a simple formulaBy comparing our proposed DC119896NN with other existingapproaches Safe-time(S) DC119896NN can effectively improvesearch efficiency reduce response time and the numberof messages and keep the accuracy of the result highAdditionally DC119896NN reduces more 30 of transmissionmessages than Safe-time(M) because the characteristics of theVoronoi diagram are used and each objectrsquos moving directionis considered instead of directly using the maximum speedof the objects as Safe-time method The derived safe-timeis more precise As a result DC119896NN needs less updatefrequency reduces a great number of messages transmittedand yields more accurate results In this work simulationexperiments are also performed The experimental resultsvalidate the proposed DC119896NN approach for the continuous119896 nearest neighbor query in distributed and mobile environ-ments where all the data objects and query can move

Acknowledgment

This work is partially supported by NSC under the Grant98-2220-E-027-007 100-2221-E-027-087-MY2 and 102-2221-E-027-088-

References

[1] O Bohl S Manouchehri and U Winand ldquoMobile informationsystems for the private everyday liferdquo Mobile InformationSystems vol 3 no 3-4 pp 135ndash152 2007

[2] Y Tao andD Papadias ldquoTime-parameterized queries in spatio-temporal databasesrdquo in Proceedings of the ACM SIGMODInternational Conference on Managment of Data pp 334ndash345June 2002

[3] Y Tao D Papadias and Q Shen ldquoContinuous nearest neighborsearchrdquo in Proceedings of the 28th International Conference onVery Large Data Bases (VLDB rsquo02) pp 287ndash298 2002

[4] F Aurenhammer ldquoVoronoi diagramsmdasha survey of a fundamen-tal geometric data structurerdquo ACM Computing Surveys vol 23no 3 pp 345ndash405 1991

[5] K Kim Y Cai andW Tavanapong ldquoSafe-time distributed real-time monitoring of cKNN in mobile peer-to-peer networksrdquo inProceedings of the 9th IEEE International Conference on MobileData Management (MDM rsquo08) pp 124ndash131 April 2008

[6] M Kolahdouzan and C Shahabi ldquoVoronoi-based k nearest nei-ghbor search for spatial network databasesrdquo in Proceedings ofthe 30th International Conference on Very Large Data Bases vol30 pp 840ndash851 2004

[7] M R Kolahdouzan and C Shahabi ldquoAlternative solutions forcontinuous K nearest neighbor queries in spatial networkdatabasesrdquo GeoInformatica vol 9 no 4 pp 321ndash341 2005

[8] D Papadias Y Tao K Mouratidis and C K Hui ldquoAggregatenearest neighbor queries in spatial databasesrdquo ACM Transac-tions on Database Systems vol 30 no 2 pp 529ndash576 2005

[9] T Imielinski S Viswanathan and B R Badrinath ldquoData on airorganization and accessrdquo IEEE Transactions on Knowledge andData Engineering vol 9 no 3 pp 353ndash372 1997

[10] S Hambrusch C-M Liu and S Prabhakar ldquoBroadcasting andquerying multi-dimensional index trees in a multi-channelenvironmentrdquo Information Systems vol 31 no 8 pp 870ndash8862006

[11] C-M Liu and K-F Lin ldquoDisseminating dependent data inwireless broadcast environmentsrdquo Distributed and ParallelDatabases vol 22 no 1 pp 1ndash25 2007

[12] T-C Su and C-M Liu ldquoOn-demand data broadcasting for dataitems with time constraints on multiple broadcast channelsrdquo inDatabase Systems for Advanced Applications vol 6193 of LectureNotes in Computer Science pp 458ndash469 2010

[13] B Zheng J Xu W-C Lee and D L Lee ldquoGrid-partition ind-ex a hybrid method for nearest-neighbor queries in wirelesslocation-based servicesrdquo The VLDB Journal vol 15 no 1 pp21ndash39 2006

[14] B Gedik A Singh and L Liu ldquoEnergy efficient exact kNN sear-ch in wireless broadcast environmentsrdquo in Proceedings of the12th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo04) pp 137ndash146 November 2004

[15] KMouratidis S Bakiras and D Papadias ldquoContinuousmonit-oring of spatial queries in wireless broadcast environmentsrdquoIEEE Transactions onMobile Computing vol 8 no 10 pp 1297ndash1311 2009

[16] G Chatzimilioudis D Zeinalipour-Yazti W-C Lee and M DDikaiakos ldquoContinuous all k-nearest-neighbor querying insmartphone networksrdquo in Proceedings of the 13th IEEE Interna-tional Conference on Mobile Data Management (MDM rsquo12) pp79ndash88 2012

[17] T-Y Fu W-C Peng and W-C Lee ldquoParallelizing itinerary-basedKNNquery processing inwireless sensor networksrdquo IEEETransactions on Knowledge and Data Engineering vol 22 no 5pp 711ndash729 2010

[18] T P Nghiem A B Waluyo and D Taniar ldquoA pure peer-to-peerapproach for kNNquery processing inmobile ad hoc networksrdquo

20 International Journal of Distributed Sensor Networks

Personal and Ubiquitous Computing vol 17 no 5 pp 973ndash9852013

[19] HD Chon D Agrawal andA El Abbadi ldquoRange and kNNqu-ery processing for moving objects in Grid modelrdquo MobileNetworks and Applications vol 8 no 4 pp 401ndash412 2003

[20] X Xiong M F Mokbel and W G Aref ldquoSEA-CNN scalableprocessing of continuous K-nearest neighbor queries in spatio-temporal databasesrdquo in Proceedings of the 21st InternationalConference on Data Engineering (ICDE rsquo05) pp 643ndash654 April2005

[21] G Zhao K XuanW Rahayu et al ldquoVoronoi-based continuous120581 nearest neighbor search in mobile navigationrdquo IEEE Transac-tions on Industrial Electronics vol 58 no 6 pp 2247ndash2257 2011

[22] KMouratidis D Papadias S Bakiras and Y Tao ldquoA threshold-based algorithm for continuous monitoring of k nearest neigh-borsrdquo IEEE Transactions on Knowledge and Data Engineeringvol 17 no 11 pp 1451ndash1464 2005

[23] S-H Wu K-T Chuang C-M Chen and M-S Chen ldquoDIK-NN an itinerary-based KNN query processing algorithm formobile sensor networksrdquo inProceedings of the 23rd InternationalConference on Data Engineering (ICDE rsquo07) pp 456ndash465 April2007

[24] D T Lee ldquoOn k-nearest neighbor voronoi diagrams in the pla-nerdquo IEEE Transactions on Computers vol 31 no 6 pp 478ndash4871982

[25] K Patroumpas TMinogiannis andT Sellis ldquoApproximate ord-er-k Voronoi cells over positional streamsrdquo in Proceedings of the15th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo07) pp 276ndash283 November 2007

International Journal of

AerospaceEngineeringHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

RoboticsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Active and Passive Electronic Components

Control Scienceand Engineering

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

RotatingMachinery

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

Journal ofEngineeringVolume 2014

Submit your manuscripts athttpwwwhindawicom

VLSI Design

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Shock and Vibration

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawi Publishing Corporation httpwwwhindawicom

Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

SensorsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Navigation and Observation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

DistributedSensor Networks

International Journal of

Page 2: Research Article Distributed Continuous k Nearest Neighbors ...downloads.hindawi.com/journals/ijdsn/2013/125145.pdfmobile environments like WSNs, which consist of a number of mobile

2 International Journal of Distributed Sensor Networks

paper we consider the mobile environment where the dataobjects and queries can move

Spatial queries such as 119896 nearest neighbors query andcontinuous 119896 nearest neighbors query have attracted manyresearchersrsquo interest and also have been discussed on manydifferent applicationsMost of the existingmethods about the119896NN or C119896NN search in the considered mobile environmentstill use the client-server architecture and rely on a centralserver for processing queries Each moving object needsto continuously obtain the location information of itselfby GPS and send the information back to the server forupdating the database Thus if we use the existing methodsunder a specific scenario that the position status of objectschanges frequently the server must receive a huge amount ofinformation stream for updating each objectrsquos location in ashort time thus causing the server system to be overloadedBesides the large amount of messages for updates occupiesquite a lot of bandwidth We hence propose an effective andnoncentralized approach for supporting C119896NN query in amobile environment

In this work we consider the continuous 119896 nearestneighbors query in WSNs or some other distributed andmobile environments like WSNs which consist of a numberof mobile devices (sensors) and propose a new distributedapproach DC119896NN for processing C119896NN query efficientlyFrom the objectrsquos point of view the distributed architectureusing local computation can effectively reduce the updatingcost since the update messages in the client-server architec-ture may need more hops to arrive to the server Even worsethe long delay of the update messages can make the answerof the C119896NN inaccurate On the other hand the distributedarchitecture can avoid the long response time caused by theoverload of the server In our considered environments eachmobile device also called moving sensor or moving objectcan obtain its location information by the GPS equipmentBesides each moving object is equipped with enough storageand a cpu for storing the local information and processingsimple 2D functions respectively

In our proposed approach each moving object will sendmessages to its one-hop neighbors when necessary to avoidthe wrong information for processing spatial queries Whenfinding the 119896NN our method uses the incremental strategyon the number of hops based on the Voronoi diagram (VD)[4] In order to estimate the movement of a moving objectaccurately we consider the speed of each moving object andadapt the concept of safe region [5] to our proposed approachdistributed continuous 119896 nearest neighbors (DC119896NN)

In this paper we address the problem of efficiently pro-cessing continuous 119896 nearest neighbors over moving objectswith updates and make the following contributions

(i) We identify the continuous 119896nearest neighbors searchproblem on mobile ad hoc networks and categorizesome detailed existing works about this issue

(ii) We provide a novel approach using local Voronoidiagram for efficiently and precisely collecting thelocation of each object in a distributed way

(iii) With the combination of local Voronoi diagram wepropose a model for accurately estimating the safe-time (safe-region) of continuous 119896 nearest neighborsquery which can lead to a short response timefewer number of messages less update cost and highaccuracy

(iv) We perform a simulated experimental evaluation andthe results show the superiority of our solution overthe adaptation of state-of-the-art solutions [5] givento the similar issues

The rest of this paper is organized as follows In Section 2we review the related work The performance metrics andconsidered issues are introduced in Section 3 Section 4presents the proposed solution using localized Voronoi dia-gram and how to derive the accurate safe time Section 5gives some analysis and comparisons between the proposedDC119896NNmethod and different existing methods The discus-sion on the experimental simulation is in Section 6 Finallywe give the conclusion remarks in Section 7

2 Related Work

The existing works for C119896NN search can be categorized intothe following categories according to the ways for accessingor managing data (1) pull-based approach (2) push-basedapproach and (3) distributed andmobile approachThe pull-based approach uses the traditional client-server architecture[6ndash8] A given central server is responsible for processingthe spatial queries from the user devices and all the dataare stored in the server Whenever a client wants someinformation the client will send a query to the server Inmany applications the amount of spatial data needed to beprocessed could be very large and hence the spatial data isusually saved in the external storages such as disks Thusthe existing approaches for C119896NN search using the pull-based approach focus on optimizing the number of IOrsquosOf course the computation time (CPU time) is still animportant performance metric when the size of spatial dataneeded to be processed is not large As a result the abovetwo measurements the number of IOrsquos and CPU time areusually used to validate the effectiveness of the proposedalgorithms for processing 119896NNandC119896NNqueries using pull-based approach However the bandwidth of communicationbetween the clients and servers is asymmetric In other wordsthe uplink bandwidth is limited and much smaller than thebandwidth of downlink This phenomenon in wireless com-munication will cause the bottleneck [9] when the numberof queries increases if the pull-based approach is applied foraccessing data

In order to overcome the bottleneck problem causedby the pull-based approach in wireless environment thepush-based approach is proposed and also referred to asdata broadcasting approach Data broadcasting has attracteda lot of research attention in the past decades and manyapproaches or protocols for different types of spatial querieshave been proposed [10ndash13] In the data broadcasting envi-ronment the data are broadcast in the air by the serverand the clients execute the query process by listening to

International Journal of Distributed Sensor Networks 3

the broadcast channel The load for processing data on theserver is dramatically decreased and relieves the bottleneckproblem Instead the computation load on the clients isincreased From the userrsquos point of view the fewer batterypower each device consumes the better experience eachuser has Thus the existing works [10 11 13ndash15] in generaldiscuss the performance of data broadcasting protocol interms of latency and tuning time Latency is the time a clientexperiences from issuing query to receiving the completeanswer The tuning time is the amount of time actually spenton listening to the broadcastThe latency indicates the qualityof service (QoS) provided by the system and the tuning timecan represent the power consumption of mobile clients

Many works [16ndash18] have discussed the 119896NN and C119896NNqueries on the distributed and mobile environments likemobile ad hoc NETworks (MANETs) and wireless sensorsnetworks (WSN) MANETs and WSNs are self-configuringinfrastructure-less networks consisting of mobile devices andsensors connected by wireless communication Each devicein such networks is free to move independently in anydirection and will thus change its links to other devicesfrequently Each device can forward the traffic unrelated toits own use and act as a router In contrast to the client-serverand data broadcasting environments there is no centralserver that handles the spatial queries or broadcasts spatialdata in MANETs or WSNs Accordingly the informationsystem based on the above infrastructure-less networks hasto process the queries in a distributed way Each mobile node(or device) in such a system cooperates and exchanges spatialdata with each other and then derives the answer for thespatial queries

In spatiotemporal data applications the datasets consistof data objects and the data as well as queries might moveover time In order to process a great volume of spatial dataand queries efficiently some decomposition methods suchas grid and Voronoi diagram have been used in the existingworks [7 19 20] Xiong et al [20] focused on multiple 119896NNqueries and proposed an incremental search technique basedon hashing objects into a regular grid and keeping CPUtime in mind The main objective of this work on disk-resident data is to minimize disk IO operations The CPUtime is considered only as a secondary objective Zhao et al[21] proposed a Voronoi-based approach for C119870NN queryAlthough this work provided a navigation service to mobiledevices the query processing is still operated on a centralserver

Mouratidis et al [22] proposed a threshold-based algo-rithm to help the server processing continuous nearest neigh-bor queries from geographically distributed clients Within agiven threshold the 119896 nearest neighbors of the query pointwill not change However this work still needs a centralserver for monitoring the 119896NN objects maintaining thehuge spatial data and broadcasting each objectrsquos informationChatzimilioudis et al [16] proposed a proximity algorithmto answer all 119896-nearest neighbor queries continuously Insuch an environment many stations called query processorsare placed to monitor all the objects in the radio regionThen different query processors can exchange the monitoredspatial information to calculate the 119896nearest neighbor answerto the user (query point)

f

gb

a

c

d

e

q

k = 2Data pointsQuery point

Figure 1 A 2NN search with query point 119902 where 2NN(119902) = 119886 119887

In contrast to most of the above approaches Kim et al[5] proposed a decentralized method to support continuous119896 nearest neighbor query Each query object predicts a safetime as a threshold for reducing the cost of informationupdate This method assumes that there is a maximumspeedMaxSpeed of each object in the environment and useDI119870NN algorithm [23] to find the initial 119896 nearest neighborsBy monitoring the 119896th and (119896 + 1)th NN the mobile querycan know the influence region and use this region to filtermoving objects thus reducing a great amount of update costHowever this work only considered the stationary query nota moving query We will discuss the accuracy of this methodlater in details Before introducing the proposed algorithmwe first give some background and terminologies

3 Preliminaries

In this section we present some concepts and techniques thatare generally used when solving the spatial data queries onmoving objects The metrics generally used to evaluate thequery process will also be introduced

31 Spatial Query The 119896 nearest neighbor search (119896NNsearch) is one of the important types of spatial queriesSuppose that the distance between two points V and 119906 isdist(V 119906) and assume that there is a given dataset 119863 with aquery point 119902 The 119896 nearest neighbor search is to find the 119896

nearest data objects in dataset119863 A simple example in Figure 1illustrates the 2NNof the given query point 119902 and data objects119886 and 119887 are the two data objects closest to 119902 In this casewe will say 2NN(119902) = 119886 119887 The definition of the 119896 nearestneighbor search problem thus can be defined as follow

Definition 1 (119896NN search problem) Given a query point 119902

and an integer 119896 the 119896 NN search problem is to find a subset119896NN(119902) sube 119863 with |119896NN(119902)| = 119896 such that any data object119901 isin 119896NN(119902) and dist(119901 119902) le min

119900dist(119902 119900) where 119900 isin

(119863-119896NN(119902))The continuous 119896 nearest neighbors search (C119896NN

Search) [3] is a variation of 119896NN query C119896NN search isextended from 119896NN search and the system will continuouslyreturn the 119896NN answer in a time interval In a mobile envi-ronment the mobile devices are regarded as moving objectsThus the result of a C119896NN search may change over time dueto the movement of the queries and data objects We can

4 International Journal of Distributed Sensor Networks

s

b

ac

d

h

e

f

g

s1 s2 s3

Figure 2 An example of C119896NN 119896 = 1 where the output is⟨119886 [119904 119904

1]⟩ ⟨119888 [119904

1 1199042]⟩ ⟨119891 [119904

2 1199043]⟩ ⟨ℎ [119904

3 119890]⟩ for 119902 = [119904 119890]

model the moving pattern of the query as a path consistingof consecutive line segments and then consider the linesegments for C119896NN search Let119863 be a dataset of data objectsand 119902 = [119904 119890] be a query line segment A continuous 119896 nearestneighbors (C119896NN) query retrieves 119896 nearest neighbors ofevery point in the line segment 119902 = [119904 119890] The result containsa set of ⟨119877 119879⟩ tuples where 119877 is the resulting 119896NN withinthe time interval119879 on [119904 119890] Consider Figure 2 as an examplewhere 119863 = 119886 119887 119888 119889 119890 119891 119892 ℎ and 119896 = 1 The outputof the query is the set of tuples ⟨119886 [119904 119904

1]⟩ ⟨119888 [119904

1 1199042]⟩

⟨119891 [1199042 1199043]⟩ and ⟨ℎ [119904

3 119890]⟩ Tuple ⟨119886 [119904 119904

1]⟩ indicates

that 119886 is the 119896NN(119902) (119896 = 1) for interval [119904 1199041] and so on

We then can define the continuous 119896 nearest neighbor searchproblem as below

Definition 2 (C119896NN search problem) Given a line segment[119904 119890] and an integer 119896 for any data object 119901 if 119900

119896isin

C119896NN([119904 119890]) is one of the 119896 nearest neighbor then for anyobject 1199001015840 isin (119863-C119896NN([119904 119890])) dist(119901 119900

1015840

) ge dist(119901 119900119896)

32 Voronoi Diagram Using Voronoi diagram (VD) forC119896NN search is proposed in the pull-based approach [7]Consider a set 119875 of 119899 distinct data points called sites inthe plane The Voronoi diagram of 119875 denoted by VD(119875) isdefined as the subdivision of the plane into 119899 cells one foreach site in 119875 and each cell corresponding to a site 119901 isin 119875 isdefined to be the area of all points in the plane closer to119901 thanto any other point in 119875 Figure 3 shows the Voronoi diagramof 16 data points 119901

1 1199012 119901

16in the plane Actually the

boundary between two points is the perpendicular bisectorof those two points The method proposed in [7] uses thecharacteristics of the perpendicular bisector (the distancesfrom any point on this line to both neighboring pointsare the same) to determine the nearest neighbors of thecurrent query point Let us use Figure 3 as an example Theneach solid line is the perpendicular bisector between twoneighboring data objects Suppose that the solid line witharrows denotes a path for the query point from position 119878

to position 1198631and the dotted line with arrows is the path

from 119878 to 1198632 For the path from 119878 to 119863

1 it is very easy to

determine the answer set of the continuous nearest neighborsusing Voronoi diagram and 119901

9 1199018 11990111

11990112

11990110

is the resultOn the other hand for the dotted path from 119878 to119863

2 since the

query does not move to another Voronoi cell the answer setof continuous nearest neighbor is always 119901

9

p16

p2p1

p3

p4 p5p6

p7 p8

p10

p11

p12

p13p14

p15

p9

D1

D2

s

Figure 3 A continuous nearest neighbor search example usingVoronoi diagram

Using the Voronoi diagram one can easily find the NNfor a query point To find the 119896NN for an arbitrary 119896 gt 1we can extend the concept of Voronoi diagram to have theorder-119896 Voronoi diagram [24] Using the order-119896 Voronoidiagram one can find the 119896NN for a query point by locatingthe query point in some order-119896 Voronoi cell Patroumpas etal proposed a method [25] which approximates the order-119896Voronoi cells by limited data objects to support continuous119896 nearest neighbor query Figure 4 shows the process ofconstructing an approximate order-3 Voronoi cell Before theconstruction all the 119896 nearest neighbors are known Initiallythe system assumes that approximate cell VC1015840 containing 119902

is equal to the entire universe of interest where any possiblelocation is being recorded The system regards query point119902 as the center point divides the whole region into eightquadrants and finds the 3NN(119902) = 119899

1 1198992 1198993 as shown in

Figure 4(a) For each closest point 119898119894to 119902 in each quadrant

the system delineates all its 119896 bisectors with the 119896NN pointsand then produces the approximate order-119896 Voronoi cell ofthe 119896NN point with respect to 119902 But for reducing processingcost even further the system chooses bisector 119887

119894that is closest

to 119902 and thus bounds the cell most tightly (Figure 4(b))Accordingly by taking the most restrictive bisector 119887

119894for

each quadrant in counter-clockwise order the system cangradually crop entire universe and obtain the approximateorder-119896 Voronoi cell VC1015840 as shown from Figures 4(b) to 4(i)The gray region in Figure 4(i) is the resulting approximateorder-3 Voronoi cell No matter the query moves in thisregion 3NN(119902) = 119899

1 1198992 1198993

33 Safe-Time In the wireless sensor network the idea ofsafe-time is proposed by Kim et al [5] This method firstassumes that there is a maximum speed MaxSpeed of eachobject in the environment and then uses DI119896NN algorithm[23] to find the initial 119896 nearest neighbors As Figure 5 showsthe user located at 119878 issues a query with 119902 as the centerpoint of this query The system will first inquiry object 119899

119901

the nearest neighbor of the query point 119902 Then the processsearches the initial 119896NN counter-clockwise on the concentric

International Journal of Distributed Sensor Networks 5

n1

n2n3

q120579

(a)

n1b1

b9984001 b9984009984001

n2n3

q

m1

(b)

n1

b1

n2n3

q

m1

(c)

n1

n2n3

q

m1

m3

b1

b3

(d)

n1b1

b4 b3

n2n3

q

m1m4

m3

(e)

n1b1

b5 b4 b3

n2n3

q

m4

m5

m3

m1

(f)

n1

b1

b3b4b5

b6

n2n3

q

m1

m6

m5

m4

m3

(g)

n1b1

b6

b7

b5 b4 b3

n2n3

q

m3

m1m4

m5

m6 m7

(h)

n1

b1

b6

b7

b8

b5 b4 b3

n2n3

q

m3

m1m4

m5

m6

m8

m7

(i)

Figure 4 The construction of an approximate order-3 Voronoi cell where 119902 is the query point

Q-node

D-node

Itinerary

(a)

s

q

np

w

(b)

Figure 5 The 119896NN search on WSNs (a) Q-node is the first object receiving the query and D-node is the sink node which is responsible forcollecting data and (b) presents the multihops routing path for the 119896NN process

6 International Journal of Distributed Sensor Networks

A 3-nearest neighbor at t0Not a 3-nearest neighbor at t0

CDk = 3

q1

q1 o1

o1 o2

o2

o3

o3

o4

o4

o5

o5

CD2Broadcast range

New CD

t = t0 + ST

(a)

(b)

t = t0

(c)

o1

o2

o3o4

o5

CDq1

CD2

Figure 6 Update process using safe-time for 3NN search on WSNs (a) shows the CD between the third and fourth closest data points (b)presents the maximum influenced distance for update using broadcast (c) indicates the area for broadcasting to update

circles incremental with an distance 119908 The query message isforwarded in hop by hop manner as shown in Figure 5(b)Finally the system can obtain the initial 119896NN from the lastobject which finished the query processing and derive thedistance cross-distance (CD) between the 119896th and (119896 + 1)thnearest neighbors As Figure 6(a) shows the system then cancompute a safe time = CD(2 lowast MaxSpeed) by the cross-distance between the 119896th and (119896 + 1)th nearest neighborsThis indicates that the system ensures that the order of 119896thand (119896 + 1)th nearest neighbors will not exchange in the safe-time periodThus the resulting 119896NNdoes not need to updateIn addition the maximum moving distance of each objectis limited in the safe-time so we can predict the maximuminfluenced region after the movement of 119896th and (119896 + 1)thnearest neighbors as shown in Figures 6(b) and 6(c) to obtainthe safe region (the dark rings in the figure) The system willignore the objects which locate outside the safe region thusreducing the cost of updating each objectrsquos information

34 Performance Metrics In order to evaluate the proposedDC119896NN approach we consider the following performancemetrics including update cost number of messages accuracyand response time

341 Update Cost The update cost is to measure the numberof updates during the query process We sometimes use thefrequency to denote it Since the sensors (objects) and eventhe query will move the status of the sensors should bemaintained in order to have the accurate results However thecost for one update is high in the distributed environmentHence one of the objectives of the designed algorithmDC119896NN is to minimize the update cost for the C119896NN query

342 Number ofMessages Except for the number of updatesthere are some other kinds of messages for the queryprocess in the distributed andmobile environment includingthe messages for query and information passing The totalnumber of messages used during the query process can be

used to indicate the throughput over the networks and theenergy consumption So the proposed DC119896NN is towardsminimizing the total number of messages for the query

343 Accuracy By using the pull-based approach the timeinterval for routing updatemessages to the server depends onthe distance between the data object and the server It thus cannot ensure that the location information of each object savedin the server is the latest Hence the results may be timelyincorrect when deriving the answers for a query due to themobilityThis situation becomes worse in the distributed andmobile environments In our design the proposed approachcan avoid redundant updates and keep the accuracy of theresults

344 Response Time The complicated query process thedelay time for message communication and the numberof users will affect the response time of the system toprocess the query Long response time is unbearable andmayreturn obsoletely invalid query results Even worse the longresponse time may cause important information missing orfinancial loss Thus the system response time is also one ofthe important issues that must be considered when designingthe method for continuous queries

4 Distributed Continuous 119896 NearestNeighbors Search

In the mobile and distributed environments like WSNs orMANETS the pull-based approach may not be a goodmatchfor C119896NN search due to the problems discussed in Section 2We thus propose a distributed algorithm DC119896NN for C119896NNsearch in the mobile and distributed environments Thedistributed approach using a better safe-time can reduce theupdate cost relieve the load for server shorten the responsetime and make the result more accurate There are threephases in DC119896NN initialization phase query processingphase and information update phase In the initialization

International Journal of Distributed Sensor Networks 7

query DC119896NN search()(1) broadcast a query 119902(119896 ℎ119900119901119888) ℎ119900119901119888 is initial to 1(2) get the Voronoi cells or objectrsquos information(3) if (119896 = 1) then(4) show LVC(5) find 119904119886119891119890119905119894119898119890 of DC1NN (with LVC)(6) elseif (119896 gt 1) then(7) while the received information is insufficient do(8) broadcast the query 119902(119896 ℎ119900119901119888 + 1) to ask more hops of neighbor nodes(9) run normal 119896NNSearch to find 119896NN set(10) show LVC according to 119896NNset and 119868119899119891119900(11) find 119904119886119891119890119905119894119898119890 of DC119896NN (with LVC)(12)while (119904119886119891119890119905119894119898119890 = 0)(13) wait

Algorithm 1 The DC119896NN algorithm on the query (sink) node

phase each moving object exchanges the location informa-tion and builds a local Voronoi cell (LVC) as well as calculatesthe safe time for the LVC The query processing phasecollects sufficient location and environmental informationof neighboring neighbors for exploring the result of thegiven C119896NN query The last information update phase is tomaintain the latest information for the moving objects andthe result of the continuous 119896 nearest neighbor query Thefollowing will explain each phase in details

41 Phase 1 Initialization (119896=1) During system initializationeach mobile sensor (moving object) exchanges locationinformation with its neighbors derives the local Voronoi cell(LVC) calculates the safe time of LVC and then stores theLVC and safe time in the memory

When a user issues an NN query 119876 and broadcasts thequery message 119902(119896 ℎ119900119901119888) (case 119896 = 1) where 119896 is the numberof the nearest neighbors the query wants to find and ℎ119900119901119888

is the hop counter and sets to one initially When the querypoint 119876rsquos neighboring objects receive the query message119902(119896 ℎ119900119901119888) they will determine whether 119876 is located in theirVoronoi Cells (VCs) If a neighboring object replies true itmeans that this neighboring object is the nearest neighbor ofthe query point 119876 and this neighboring object will transmitthe Voronoi cell (VC) information of itself to the query point119876 including the neighboring object boundaries locationdirection and speed of movement and some environmentalinformation On the other hand if a neighboring objectreturns false this neighboring object will check whetherquery point119876moves towards it or not If the query point119876 ismoving towards a neighboring object then this neighboringobject also will send its VC information to the 119876 otherwisethe query message will be ignored After the initializationphase eachmoving object will maintain the LVC informationand safe time The update process will be executed for thelatest LVC information only when the safe time decreases tozero Assume that each object has 119889 neighbors in averageSince the bisector between two objects costs 119874(1) time theLVC construction (Initialization phase) can be finished in119874(119889) time

42 Phase 2 C119896NN Query Processing The pseudocodeQuery DC119896NN Search() in Algorithm 1 shows the wholequery process on the query point The operations fromLine 6 to the end of Query DC119896NN Search() do the queryprocessing of C119896NN (119896 gt 1) When a query point119876 wants tofind the 119896 nearest neighbors where 119896 gt 1 119876 first broadcastsmessages 119902(119896 ℎ119900119901119888) (case 119896 gt 1) and gets the local Voronoicell (LVC) information from the nearest neighboring (NN)object The nearest neighboring object of 119876 is responsiblefor routing messages to its neighboring objects collectingthe local Voronoi cell (LVC) information of the neighboringobjects and sending information back to query point 119876Basically if the received information is insufficient to derivethe 119896NN answer the query point 119876 will repeatedly sends thequery message 119902 with one more hop (ie ℎ119900119901119888 = ℎ119900119901119888 + 1) tothe specific neighboring objects to obtain more neighboringVC information until the received information is enough toget 119896NN answer

When the received information is enough to derive theresults of 119896NN the query point 119876 will use the approximatemethod we modified from [25] to calculate the approximateorder-119896 LVC in which the query point 119876 locates By usingthe modified method the query point 119876 has to partitionthe plane into 120582 equal sectors and selects an additionalnearest neighboring object in each sector excluded from119896NN objects Thus the query point 119876 needs to collect atleast 119896 + 120582 neighboring objectsrsquo information to build theapproximate order-119896 LVC Note that the information of theadditional 120582 objects can be learned from the informationof the received neighboring objects In comparison with thecentralized approach for constructing the approximate order-119896 Voronoi cell the modified approximate method only needsto consider the 119896nearest neighboring objects and120582 additionalnearest neighboring objects instead of considering all objectsin the wireless environment The computation time is thusmuch better than the traditional centralized approach andcan be derived as119874(120582) + 119874(120582) times 119874(119896) = 119874(120582(119896 + 1)) where119874(120582) is the time for selecting the 120582 additional neighboringobjects In the end 119874(120582119896) is the time for determining theboundary of the approximate order-119896 LVC For more detailsabout the analysis of the computation time please refer to

8 International Journal of Distributed Sensor Networks

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

(a)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q

(b)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q

(c)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q

(d)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

q

(e)

Figure 7 An example of DCNN where (a) each sensor exchanges information in the initial step (b) each sensor builds its LVC (c) a queryat object 119902 is issued and sensor 119900

1returns the information of its LVC to 119902 since 119902 is located in the Voronoi cell associated with 119900

1 (d) object

119902 knows which sensor will be reached next and can derive the safe time by the LVC information of 1199001 and (e) the query result to 119902 can be

updated seamlessly when it moves to 1199006

[25] After the query point 119876 calculates the approximateorder-119896 LVC a safe time of the query 119902 can be derived Thesafe time of the query 119902 is regarded as the time limit forstarting the next location information updating process andupdating the C119896NN answer

Figure 7 gives an example for the case of 119896 = 1 Asshown in Figure 7(a) there are 16moving sensors 119900

1 119900

16

in the system and each sensor has the location informationabout itself In the initial phase each sensor broadcasts themessage with its location information and receives the loca-tion information from its neighbors The local Voronoi cell(LVC) of each sensor then can be calculated and stored Theoverall calculatedVoronoi diagram is depicted in Figure 7(b)Afterwards if the locations of the sensors change as movingeach sensor will broadcast new location information to itsneighbors and each sensor can derive a new LVC by thereceived updating messages In Figure 7(c) a continuous NNquery is issued by some query object 119902 with its locationIn order to know the Voronoi cell where 119902 locates 119902 firstbroadcasts the query message to the neighboring sensors(in dashed circle) After receiving the query message theneighboring sensor will check whether the query 119902 is locatedin its associated cell If 119902 is not in the cell the sensor willignore the querymessage In Figure 7(c) sensor 119900

1will return

the result to the query 119902 saying that object 1199001is the nearest

neighbor of 119902 for the time being If 119902 moves in the directionas indicated by the solid arrow in Figure 7(d) to object 119900

6

119902 can know that it moves towards the boundary of 1199001and

1199006by the LVC stored in 119900

6and then derive the safe time

When approaching the boundary (ie the safe time is almostpassed) a query message to 119900

6will be issued by 119902 in advance

Sensor 1199006will reply to 119902with the cell information to maintain

the accuracy of the query result Figure 7(e) shows the resultafter 119902moves into the associated cell of sensor 119900

6

Figure 8 demonstrates an example of DC119896NN for 119896 gt

1 The initial phase is the same as the previous DCNNexample Each sensor derives the corresponding LVC withthe information from the neighboring sensors The queryis issued by a moving object 119902 with its location Object 119902

locates itself and knows that it is in the VC of 1199001after sensor

1199001replies to 119902 with its LVC information Suppose 119896 = 3

After the initialization 119902 is located in 1199001and has the LVC

information of 1199001 Having such information 119902 can derive the

NN but 3NN cannot be decided yet So 119902 will broadcast thequery message to all of its one-hop neighboring sensors say1199001 1199002 1199003 1199008 and 119900

9in Figure 8(a) to request information

The neighboring sensors will reply to 119902 the information abouttheir LVCs Object 119902 then can derive the resulting 3NN forthe time being say 119900

1 1199008 and 119900

9in the example With

these replied information 119902 can build the approximate order-3 Voronoi cell as shown in Figure 8(b) Then 119902 uses theapproximate order-3 Voronoi cell to derive the safe time inorder to maintain the continuous query result Now if 119896 =

10 the information received from the one-hop neighboringsensors is not enough to derive the result Then the querymessage will be broadcast to 119902rsquos two-hop neighboring sensorsas Figure 8(c) shows If the information is not enough toderive the resulting 119896NN the querymessagewill be broadcast

International Journal of Distributed Sensor Networks 9

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q n1n2

n3

n4(k + 1)

(a)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5qn1

n2

n3

(b)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o3o4

o5q

o9

o2

(c)

o1

o6

o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q

n11(k + 1)

n1

n4n5

n6

n10

n7

n8

n2n9

n3

(d)

o1

o6

o7

o8

o11o10

o12

o13o14o15

o16o9

o2 o3o4

o5q n1n2

n4n5

n6

n7

n3

n9n10

n8

(e)

Figure 8 An example of DC119896NN for 119896 gt 1 where the initialization phase is the same as previous DCNN example and (a) 1199001 1199008 and 119900

9are

the 3NN to the query object 119902 (b) the approximate order-3 Voronoi cell can be built with enough information received (c) the information isnot enough for 10NN query and two-hop neighboring sensors are requested (d) the resulting 10NN can be derived and (e) the approximateorder-10 Voronoi cell can be calculated with information received

to one more hop neighboring sensor Such process will berepeated with an increment on the hop count After havingenough information 119902 can calculate the resulting 10NN andthe approximate order-10 Voronoi cell as shown in Figures8(d) and 8(e) respectively Using the approximate order-10Voronoi cell the safe time can be derived In the followingwe will discuss how to derive the safe time for maintainingthe result of the continuous 119896NN query

43 Phase 3 Information Updates In the distributed andmobile environments it is challenging for a mobile nodeto maintain the location information of the other mobilenodes effectively If a mobile node sends the update messagesfrequently it will consume much network resource andpower Furthermore the result of themoving query should beeffectively maintained For different roles nodes and querywe propose effective ways respectively in our DC119896NN queryprocess to update the location information and maintain thequery result

431 The Safe Time of Each Object In the proposed appro-ach DC119896NN each object cooperates with each other andexchanges information to update the location information ofeach object In order to monitor and obtain the continuousanswer of a continuous 119896 nearest neighbors query we usea safe distance between each object and query Then wecan derive the safe time of each object for location updatesby estimating the maximum speed of that object Supposethat the sensing area is partitioned into a grid for location

management There are three possible methods for derivingthe safe distance The first one is the grid-based safe distanceEach object directly uses the minimum distance betweenitself and the boundary of the grid cell where the objectlocates Simply using the grid-based safe distance may causesome problems about the imprecise updates The secondmethod VD-based safe distance uses VD to obtain the safedistance In order to predict the safe distance more preciselywe can consider the previous two distances simultaneouslyand then select the smaller one So the last method propersafe distance will return a better safe distance by comparisonsHaving the safe distance the safe time then can be derived byestimating the maximum speed of the considered object

In Figure 9 the sensing area is divided into a grid andthe Voronoi diagram formed by the sensors is also shownFor sensor 119900

1in Figure 9(a) the grid-based safe distance and

VD-based safe distance are presented respectively and theproper safe distance will be the VD-based safe distance afterthe comparison On the contrary for sensor 119900

3in Figure 9(b)

the proper safe distance will be the grid-based safe distance

432The Safe Time of EachQuery For themoving query it isimportant to know when the result will change To derive thesafe time during which the result will not change we referto the characteristics of Voronoi diagram In the traditionalenvironment with static objects the system only uses theminimum distance from the query to the boundary of theVoronoi cell where the query locates as the safe distance Thethe safe time can be obtained by the estimated maximum

10 International Journal of Distributed Sensor Networks

o1

o7

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

o6o8

(a)

o1

o7

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

o6o8

(b)

Figure 9 An illustration for different safe distances (a) sensor 1199001uses the VD-based safe distance as the proper safe distance and (b) sensor

1199003uses the grid-based safe distance as the proper safe distance

L L

A

B

Safe distance

Query

B

A

120579

New safe distance

QueryA998400

L998400

B998400

Figure 10 An example showing the impact on the safe distancecaused by object movement

speed of that query During the safe time no update isnecessary thus saving the update cost

Unfortunately in the moving object environment theabove method cannot obtain the right safe time As shownin Figure 10 the left part shows the static case where 119871 is theVoronoi cell boundary between objects 119860 and 119861 and the safedistance of the query can be calculated as the figure showsHowever for the moving objects the original safe distancebetween the 119871 and query cannot be directly used to calculatethe safe time because the object movement will cause thedistance form query to 119871 to be nonlinearly increasing ordecreasing As the right part of Figure 10 shows after themovement of object 119860 and object 119861 119871 becomes 119871

1015840 and thesafe distance changes Thus if we want to use the boundariesof Voronoi cell to estimate more accurate safe time we needto consider the relative movements between the objects andquery

In order to derive the precise safe distance we considerthe movements of objects and query simultaneously and useFigure 11 to illustrate Initially 119876119860 and 119876119861 are the distancesfrom the query to objects 119860 and 119861 respectively The linebetween 119860 and 119861 is the boundary of the Voronoi cellsassociated with 119860 and 119861 and the query is located in thecell of 119860 as Figure 11(a) shows When objects and the querymove as in Figure 11(b) the query may touch the boundaryThis indicates that the query will enter another cell and theresult of the query should be updated The time from thebeginning to the moment of touching the boundary is theprecise safe time for the query According to the properties

of Voronoi diagram when the query is on the boundary119876119860 = 119876119861 We hence can use the condition of 119876119860 = 119876119861

to decide whether the query is on the boundary With thisproperty even though the objects and querymove frequentlythe query only needs the speeds directions and locationsof the neighboring objects to predict the safe time easilyWithin the safe time the query will not touch the boundaryIn Figure 11(c) the query meets the boundary at 119905

1and the

safe time is 1199051

In the following we present the way to calculate the safetime when 119876119860 = 119876119861 Assume that the initial location of themoving query is (119909

119902 119910119902) and the speed is (119881

119909119902 119881119910119902

) Supposethe initial location of object 119860(119861) is (119909

119860 119910119860)((119909119861 119910119861)) with

the speed being (119881119909119860

119881119910119860

)((119881119909119861

119881119910119861

)) The equation to findwhen the querymeets the boundary can be derived accordingto the property of perpendicular bisector Since119876119860 = 119876119861 wecan have

([(119909119902+ 119881119909119902

lowast 119905) minus (119909119860

+ 119881119909119860

lowast 119905)]2

+[(119910119902+ 119881119910119902

lowast 119905) minus (119910119860

+ 119881119910119860

lowast 119905)]2

)

12

= ([(119909119902+ 119881119909119902

lowast 119905) minus (119909119861

+ 119881119909119861

lowast 119905)]2

+[(119910119902+ 119881119910119902

lowast 119905) minus (119910119861

+ 119881119910119861

lowast 119905)]2

)

12

(1)

Then

0 = [1198812

119909119860

+ 1198812

119910119860

minus 1198812

119909119861

minus 1198812

119910119861

minus 2 lowast 119881119909119902

119881119909119860

minus2 lowast 119881119910119902

119881119910119860

+ 2 lowast 119881119909119902

119881119909119861

+ 2 lowast 119881119910119902

119881119910119861

] lowast 1199052

+ 2 [(119909119902minus 119909119860) (119881119909119902

minus 119881119909119860

) + (119910119902minus 119910119860) (119881119910119902

minus 119881119910119860

)

minus (119909119902minus119909119861) (119881119909119902

minus119881119909119861

) minus (119910119902minus119910119861) (119881119910119902

minus119881119910119861

)] lowast 119905

+ [(119909119902minus 119909119860)2

+ (119910119902minus 119910119860)2

minus (119909119902minus 119909119861)2

minus (119910119902minus119910119861)2

]

(2)

International Journal of Distributed Sensor Networks 11

A

B

Query

(x3 y3)

(x2 y2) (x1 y1)QA

QB

(Vx2 Vy2)

(Vx3 Vy3)

(Vx1 Vy1)

(a)

A

B

Query

(x3 y3)

(x2 y2)(x1 y1)

QA

QB

(Vx2 Vy2)

(Vx3 Vy3)

(Vx1 Vy1)

(b)

A

B

d

t1 t2 t3 t

(c)

Figure 11 The precise safe-time for moving objects 119860 and 119861 and the moving query where (a) shows the beginning state (b) presents themoment when the moving query meets the boundary and (c) gives the diagram for the change on the safe distance with time 119905

o1

o2

o3o4

o5

CDq1

CD2

(a)

o1

o2

o3o4

o5

CDq1

CD2

q9984001

(b)

Figure 12 The phenomenon when using the original safe-time methods to (a) stationary query and (b) moving query

Equation (2) is a quadratic equation Since a generalquadratic equation can be written in the following form1198861199092

+ 119887119909 + 119888 = 0 recall that the discriminant of a quadraticequation is Δ = 119887

2

minus 4119886119888 If Δ gt 0 there are two distinct realroots if Δ = 0 there is exactly one real root if Δ lt 0 thereare two distinct (non-real) complex roots In (2)

119886 = 1198812

119909119860

+ 1198812

119910119860

minus 1198812

119909119861

minus 1198812

119910119861

minus 2 lowast 119881119909119902

119881119909119860

minus 2 lowast 119881119910119902

119881119910119860

+ 2 lowast 119881119909119902

119881119909119861

+ 2 lowast 119881119910119902

119881119910119861

119887 = 2 [(119909119902minus 119909119860) (119881119909119902

minus 119881119909119860

) + (119910119902minus 119910119860) (119881119910119902

minus 119881119910119860

)

minus (119909119902minus 119909119861) (119881119909119902

minus 119881119909119861

) minus (119910119902minus 119910119861) (119881119910119902

minus 119881119910119861

)]

119888 = (119909119902minus 119909119860)2

+ (119910119902minus 119910119860)2

minus (119909119902minus 119909119861)2

minus (119910119902minus 119910119861)2

(3)

and then we can derive the safe time 119905 according to thediscriminant

119905 =

[minus119887 + (1198872

minus 4119886119888)12

]

2119886or

[minus119887 minus (1198872

minus 4119886119888)12

]

2119886

(4)

Finally we select the minimum value of 119905 gt 0 as the safetime

Additionally assuming that 119889 is the distance between theobject and the query and 119905 is the time 119876119860 = 119876119861 can be

converted into a function of 119905 and 119889 as shown in Figure 11(c)Then we can obtain the safe time 119905

1which is the time when

119876119860 = 119876119861 Furthermore the object 119861 will be closest to thequery at the time 119905

3

5 Comparisons with Previous Approaches

In this section we compare the proposed DC119896NN approachthe Safe-time with stationary query approach [5] and thenaıve way used pull-based approach in terms of safe timespace and accuracy

51 Safe Time The original safe-time with stationary query[5] (safe-time(S)) does not support moving queries Anexample of C3NN is shown in Figure 12 where 119902

1is the query

point triangles are the 3NN objects the pentagons representthe other individual objects and 119900

4is 4th NN Figure 12(a)

shows the original result for safe-time(S) After obtaining the119896th and (119896 + 1)th objects (119900

2and 1199004in the figure) the cross-

distance (CD) of 119896th and (119896 + 1)th objects can be calculatedRecall that the cross distance of two data objects 119860 and 119861 isthe difference on the distances of119860 and119861 to the center (or thequery point) For the next update (after a safe-time period)all the objects in this region should be checked

We adapt the safe-time(S) method for moving queryThe adapted approach will result in a higher update cost

12 International Journal of Distributed Sensor Networks

Figure 12(b) presents a case that the query moves towardobject 119900

3(119896th NN) and away from object 119900

4((119896 + 1)th NN)

When the query 1199021moves to the point 1199021015840

1 the most outside

concentric circle increases and becomes as large as the mostoutside dotted concentric circle On the contrary the mostinside concentric circle decreases and becomes as small as themost inside dotted concentric circle Thus the cross-distanceincreases and more number of objects will be examined

In addition according to the Figure 12(b) we can knowthat the original Safe-time method safe-time(S) is notappropriate for moving queries since the calculation of Safe-time(S) method does not consider the speed of query safe-time(S) directly uses twofold of the maximum speed of the119896th and (119896+1)thNNobjects to divide theCD to derive the safetime The cost for updates increases when the CD becomeslarger since the average checked area becomes bigger Besidesthe obtained 119896NNanswer cannot be guaranteed to be correctOn the contrary the cross-distance when the query movestowards object 119900

4((119896 + 1)th NN) and away from object 119900

3

(119896th NN) in this case the order of the 119896th and (119896 + 1)th NNobjectmay be changed but the update does not perform thusresulting in incorrect results

We modify the Safe-time to fully support the movingquery In order to support and maintain the accuracy ofmoving query the maximum speed (Maxspeed) used in thesafe time calculation is required to be modified and replacedby the maximum relative speed between the query and theobjects Because of using the relative speed the adaptedsafe-time method safe-time(M) needs twofold maximumrelative speed (2 lowast 119872119886119909119904119901119890119890119889) to calculate the safe time forguaranteeing the accurate resultsThe safe time derived is lessthan the one derived in safe-time(S) due to the relative speedHence the update frequency of safe-time(M) is higher thanthe update frequency of safe-time(S)

52 Space In DC119896NN each object and query only need tomaintain the information of LVC The information to bestored includes the location of neighboring objects and theobject information of order-119896rsquos local Voronoi diagram Thetotal amount of stored information is not significant on eachobjectThus the use of storage space does not need to be verysubstantial

53 Accuracy The safe-time (S) [5] considers the stationaryquery When applying it to the moving query some adaptionshould bemade According to our experimental results whenthe value of 119896 increases with a moving query the accuracy ofthe result will be reduced In our simulation we modify theoriginal Safe-time(S) as Safe time(M) for moving query andconsider the relative distance in detail caused by the movingquery and objects Although the correctness of the answer canbe increased the update frequency increases thus increasingthe number of delivered messages

DC119896NNuses Voronoi and grid cell boundary to calculatethe safe time and updates the information of related objectsbefore the end of the safe time In fact the boundary ofthe Voronoi cell represents the boundary of moving 119896NNquery After the safe time period the query will collect the

information of related neighboring objects Having such real-time information the query can have the resultmore accuratein time Similar to safe-time(M) DC119896NN uses the 119896th and(119896 + 1)th nearest moving objects to derive the safe time So itis able to maintain the correctness of the answer

6 Simulation Experiments

In the simulation we compare the following methods NaıveDC119896NN safe-time (S) and safe-time (M)TheNaıvemethodis centralized and used as a benchmark for the comparisonAll the mobile sensors will send the location informationto the central server to update the information The othermethods DC119896NN Safe-time(S) and Safe-time(M) are dis-tributed and used in the considered mobile wireless sensornetwork where each object knows its position has the abilityto perform some calculation and stores the information oflocalized Voronoi cell (LVC)We assume that each object cantransmit amessage to its one-hopneighbor so that each objectcan communicate with at least one object For Safe-time(S)and the safe-time(M) a maximum speed (MaxSpeed) is setin order to estimate relative speed and distance for safe-timecalculation

In the simulation all the compared approaches areperformed under the same environmental conditions forfairness The initial location and speed of moving objectsare uniformly randomly distributed Since we focus on theperformance of the query process of the proposed DC119896NNapproach we further assume that the transmission quality isideal and no congestion and communication delays occurThe metrics measured include the update frequency for aquery the total number of messages response time andaccuracy The update frequency for a query is the averagenumber of update messages sent by the data objects relatedto the query per minute The total number of messages isall the amount of messages sent from all objects during thequery process The accuracy of each method is measuredby comparing the results to the real answers Since thequery is continuous and the update occurs subsequently themeasured response time is mainly the time required fromsending a query to obtaining the first result

All the experiments are simulated so the results aboutthe response time may not show the practical cases exactlybut can reflect the trends on the performance among all thecompared approaches relatively In order to have the responsetime in our simulation we thus use the total number of hopsfor deriving the result tomultiply the average time for one hopin the simulation system to present the response time Thusthe response time is proportional to the total number of hopsin our simulation program In addition because the maindifference between Safe-time(S) and the Safe-time(M) is theway for deriving the safe time the measured response timeof these two methods is the same The simulation programis implemented with Java The setting of our simulation isshown in Table 1 with a default value for each parameter Inall the simulation experiments the final results are reportedwith the average of 100 queries The duration of each query is60 seconds

International Journal of Distributed Sensor Networks 13

200 400 600 800 10000

10

20

30

40

50

60

Edge length of sensing area (m)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

200 400 600 800 10000

100

200

300

400

500

600

700

Edge length of sensing area (m)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

200 400 600 800 100075

80

85

90

95

100

105

Edge length of sensing area (m)

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

200 400 600 800 1000Edge length of sensing area (m)

Aver

age r

espo

nse t

ime (

s)

DCkNNSafe-time(S)Safe-time(M)

095

1

105

11

(d) Response time

Figure 13 The effects of different sensing areas on (a) update frequency (b) number of messages (c) accuracy and (d) response time

Table 1 Simulation parameters

Parameter Range Default valueEdge length of sensingarea (m) 200 400 600 800 1000 600

Edge length of grid (m) 50 100 150 50Number of objects 20 30 40 50 60 30Transmission range (m) 125 125119896 1 3 5 10 20 3Moving objects () 20 40 60 80 100 20Speed (ms) 2 4 6 8 10 4

61 Effects of Sensing Area Sensing area affects the numberof update and query messages since if the area becomes

greater with the fixed number of objects relatively thedensity of the objects becomes sparse For example when thesensing areas are 200lowast200 400lowast400 600lowast600 800lowast800 and1000lowast1000 the densities are 188 047 021 012 and 008respectively Figure 13(a) shows that DC119896NN has the lowestnumber of updates with all the different areas and the numberof updates for Safe-time(S) is the highest (worst) becauseDC119896NN considers the moving direction and speed of thequeries and objects and selects the proper safe-distance toderive the safe-time Safe-time(S) the Safe-time(M) estimatethe safe time according to the maximum speed of the objectsso more number of updates can be expected AdditionallySafe-time(M) is updated more frequently than Safe-time(S)Recall that Safe-time(M) considers the query movement

14 International Journal of Distributed Sensor Networks

50 75 100 150 2000

5

10

15

20

25

Edge length of grid (m)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

50 75 100 150 2000

50

100

150

200

250

300

350

Edge length of grid (m)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

50 75 100 150 2000

20

40

60

80

100

120

Edge length of grid (m)

Accu

racy

()

DCkNN(G)DCkNN(V)

(c) Accuracy

50 75 100 150 2001

101

102

103

104

105

106

Edge length of grid (m)

Aver

age r

espo

nse t

ime (

s)

DCkNN(G)DCkNN(V)

(d) Response time

Figure 14 The comparisons of using grid-based and VD-base safe distances to derive the safe-time (a) update frequency (b) number ofmessages (c) accuracy and (d) response time

The average safe-distance becomes shorter thus leading tomore updates Besides when the sensing area increasesfrom 200lowast200 to 600lowast600 the update frequency dropsdramaticallyThe curve becomes flatter when the area is from600lowast600 to 1000lowast1000 since the difference on the densitiesof the areas from 600lowast600 to 1000lowast1000 is not much Thenumber of updates is less as the safe-time becomes largerThetotal number of transmitted messages of naıve approach isfixed at about 1800 packets All the other distributedmethodsuse fewer number of messages than naıve

To monitor the results DC119896NN only needs to check therelated objects in the local Voronoi cell at the proper safe-time thus reducing a lot of redundant update messages Safe-time(S) and Safe-time(M) use the maximum speed of theobjects to calculate the safe time so the total number of

transmitted messages of both approaches is more than that ofDC119896NN Figure 13(b) shows that more than 30 of the totalnumber of transmitted messages can be saved by DC119896NN incomparison with Safe-time(M)

For the accuracy since Safe-time(S) does not considerthe query movement the safe-time may be inaccurate Fur-thermore due to the mobility when the density is high theestimated results become more inaccurate So Safe-time(S)performs worst as shown in Figure 13(c) Safe-time(M) isrevised from Safe-time(S) by considering the query move-ment and the safe-distance is less in average for guaranteeingbetter results Hence Safe-time(M) has a better accuracy andalmost the same as DC119896NN The accuracy of Safe-time(M)and DC119896NN is almost about 100 correct and the gap maybe caused by arithmetical errors in the experiments

International Journal of Distributed Sensor Networks 15

10 20 30 40 50 60 700

5

10

15

20

25

30

35

40

45

Number of objects

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

10 20 30 40 50 60 70100

150

200

250

300

350

400

450

Number of objects

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

10 20 30 40 50 60 7080

85

90

95

100

105

Number of objects

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

10 20 30 40 50 60 70Number of objects

Aver

age r

espo

nse t

ime (

s)

096

098

1

102

104

106

108

11

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 15 The effects of the number of objects on (a) update frequency (b) number of messages (c) accuracy and (d) response time

When the area becomes larger the density becomeslower So the number of objects in each objectrsquos transmissionrange is fewer Under such a circumstance DC119896NN usesless computation and the response time is shorter as shownin Figure 13(d) In contrast the Safe-time(S) and the Safe-time(M) need to collect information before performing eachnew query and cause longer response time Since Safe-time(M) and Safe-time(S) use the same method and proce-dure to handle the first query the response time of these twomethods will be almost the same

62 Effects of Grid Size In this simulation experiment setwe want to observe the update efficiency of each object inthe third phase of DC119896NN Recall that we consider the grid-based and VD-base safe distances to derive a proper safe-time In this experiment DC119896NN(G) uses grid-based safe

distance to determine the safe time for the next update andDC119896NN(V) uses VD-base safe distance to derive the safetime The sensing area is fixed to 600lowast600m2 and there are30 data objects We compare DC119896NN(V) with DC119896NN(G)by observing the impacts of different grid sizes All theother settings have the similar trends in our experimentalresults In Figure 14(a) the update frequency of the objectsin DC119896NN(G) is high when the grid size is 50lowast50m2 andbecomes less when the grid size decreases Since the sensingarea is 600lowast600m2 and 30 objects are given the averagedistance between an object and the boundary of a Voronoicell is about 25 to 50 meters With the setting of grid size50lowast50m2 the average distance obtained in DC119896NN(G) isabout 25 meters Thus the safe time of DC119896NN(V) is longerIn general as Figures 14(a) and 14(b) show the update

16 International Journal of Distributed Sensor Networks

1 3 5 10 200

10

20

30

40

50

60

k

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

1 3 5 10 200

100

200

300

400

500

600

700

800

k

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

1 3 5 10 2080

85

90

95

100

105

k

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

1 3 5 10 20k

Aver

age r

espo

nse t

ime (

s)

08

09

1

11

12

13

14

15

16

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 16 The impacts of different values of 119896 on (a) update frequency (b) number of messages (c) accuracy and (d) response time

frequency of the objects and the number of messages sentby the objects decrease as the grid size increases

When the grid size is large the safe time becomes longand less number of updates are issued Hence the resultsbecome more inaccurate As shown in Figure 14(c) whenthe grid sizes are 50lowast50m2 75lowast75m2 100lowast100m2 and150lowast150m2 the corresponding accuracies are 95 9285 and 78 respectively While the grid size increases to200lowast200m2 the accuracy is significantly reduced to 69and the right answer thus can not be guaranteed On theother hand Figure 14(d) shows that the response times ofDC119896NN(G) and DC119896NN(V) are not much different becausethe size of grid is not the major factor to influence thecomplexity of obtaining information for the first query

63 Number of Objects In this subsection we discuss theresults as the number of data objects varies The area in thepresented experiment set is 600lowast600 (m2) with grid size of50lowast50 (m2) As shown in Figure 15(a) when the number ofobjects increases the number of updates in DC119896NN is stillrelatively less than the ones in Safe-time(S) and Safe-time(M)If the number of objects increases the number of repliedmessages per second to the central server in naıve will growdramatically With 20 to 60 objects the number of repliedmessages to the server is from 1200 to 3600 (packetsmin)By observing the results in Figures 15(b) and 15(c) as moreobjects are in the area the number of messages increasesfor the other three methods and the accuracy reduces inSafe-time(S) These match the trends for different areas we

International Journal of Distributed Sensor Networks 17

20 40 60 80 1000

5

10

15

20

25

30

35

40

45

Moving objects ()

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

20 40 60 80 1000

100

200

300

400

500

600

Moving objects ()

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

20 40 60 80 100

80

70

75

85

90

95

100

105

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

Moving objects ()

(c) Accuracy

20 40 60 80 100

Aver

age r

espo

nse t

ime (

s)

09

095

1

11

105

115

12

125

13

DCkNNSafe-time(S)Safe-time(M)

Moving objects ()

(d) Response time

Figure 17 The effects of the moving objects on (a) update frequency (b) number of messages (c) accuracy and (d) response time

discussed earlier due to the density Similarly the responsetime can be expected as shown in Figure 15(d) where theresponse time of DC119896NN is still the shortest

64 Different Values of 119896 It is obvious that the value of119896 affects the performance of query processing significantlyWhen the value of 119896 becomes larger the number of relatedobjects required to be checked also increases In other wordswe need to spend more cost to find out which 119896 objectsare currently in the result for the C119896NN query Thereforethe changes in the value of 119896 mainly affect the amountof data required for the first query and the update costfor maintaining the 119896th and the (119896 + 1)th objects So inFigure 16(a) when the value of 119896 is large more updates arenecessary for all the three methods As Figure 16(b) shows

the influence on the number of transmitted messages inSafe-time(M) is more serious than the one in Safe-time(S)Due to the mobility the number of influenced objects inSafe-time(M) will increase as the value of 119896 increases Inparticular the update frequency in Safe-time(M) becomesnearly twofold the update frequency in Safe-time(S)

Figure 16(c) presents the impact on the accuracy fordifferent values of 119896 With a larger value of 119896 an object inSafe-time(S) will have a higher chance to derive the incorrectsafe time thus causing lower accuracy When the value of 119896increases the response time of all threemethods will increasesignificantly as shown in Figure 16(d) The reason is thatall DC119896NN Safe-time(S) and Safe-time(M) need to searchmore objects and collect more information for answering thequery when the value of 119896 increases to a certain number For

18 International Journal of Distributed Sensor Networks

2 4 6 8 100

10

20

30

40

50

60

Speed (ms)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

2 4 6 8 100

100

200

300

400

500

600

700

800

Speed (ms)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

2 4 6 8 1070

75

80

85

90

95

100

105

Speed (ms)

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

2 4 6 8 1009

095

1

105

11

115

12

125

13

Speed (ms)

Aver

age r

espo

nse t

ime (

s)

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 18 The impacts of speed on (a) update frequency (b) number of messages (c) accuracy and (d) response time

DC119896NN DC119896NN only needs to store local Voronoi diagramwhere the information required is less than required in Safe-time(S) and Safe-time(M) so the response time of DC119896NN isthe shortest

65 The Effect of Moving Objects In this experiment set weconsider different percentages of moving objects in all thedata objects The default value is 20 which means that ifthere is a total of 30 objects then there are sixmoving objectsIn Figures 17(a) and 17(b) as the percentage ofmoving objectsincreases the overall number of updates required between theobjects increases relatively and the change rate of answer totheDC119896NNaccelerates thus increasing the update frequencyof the query and the number of messages However DC119896NNstill keeps the best performance Figure 17(c) shows the accu-racy of the result for different percentage of moving objectsDC119896NN and Safe-time(M) both have higher accuracy and

Safe-time(S) is still the worst The safe time of each object inSafe-time(S) is calculated using the maximum speed of theobjects Hence whether the object is moving or not does notdirectly result in the incorrectness of the answer collectionIn fact in Safe-time(S) one of the main reasons to affectthe accuracy is the directions of moving objects Last asFigure 17(d) shows the percentage of moving objects doesnot impact the response time too much

66 Effects of Speed If each object moves faster the relativevelocities between objects may also become faster This willmake the safe time shorter and the update frequency ofeach object and query increases The safe time used inSafe-time(S) and Safe-time(M) is directly affected by themaximum speed of objects and does not consider the direc-tion of each objectrsquos movement and the speed of individualmovement No matter the objects move or not and move

International Journal of Distributed Sensor Networks 19

fast or slow both of the above methods directly use themaximum speed of objects to calculate the safe time forupdating On the other hand DC119896NN considers the movingdirection of objects and the proper safe-time for updatesIn this experiment the number of moving objects is 20of all the objects As Figure 18(a) shows as the movingobjects speed up the update cost increases and DC119896NN stillperforms best As the speed increases the safe-time in Safe-time(S) and the Safe-time(M) becomes much shorter due toa larger maximum speed among all the objects The trendbecomes even worse as the speed increases

Figure 18(b) shows the trend about the number of trans-mitted messages when the speed is up DC119896NN still hasthe best performance on the number of messages There are42781 messages sent in average when the speed of object is10ms However the Safe-time(M) needs 67913 messagesThe accuracy will not be effected as the speed changesfor DC119896NN and Safe-time(M) because both of them aredesigned or adapted for themoving objects and queries Safe-time(S) will have more inaccurate results as the speed is highas shown in Figure 18(c) However the response time doesnot have a significant impact on the response time for all thethree methods Figure 18(d) presents this trend

7 Conclusions

In this paper we propose a new approach DC119896NN whichuses the local Voronoi diagram and proper safe-time toeffectively process the C119896NNquery in distributed andmobileenvironments such as wireless sensor networks The propersafe-time can be quickly derived by a simple formulaBy comparing our proposed DC119896NN with other existingapproaches Safe-time(S) DC119896NN can effectively improvesearch efficiency reduce response time and the numberof messages and keep the accuracy of the result highAdditionally DC119896NN reduces more 30 of transmissionmessages than Safe-time(M) because the characteristics of theVoronoi diagram are used and each objectrsquos moving directionis considered instead of directly using the maximum speedof the objects as Safe-time method The derived safe-timeis more precise As a result DC119896NN needs less updatefrequency reduces a great number of messages transmittedand yields more accurate results In this work simulationexperiments are also performed The experimental resultsvalidate the proposed DC119896NN approach for the continuous119896 nearest neighbor query in distributed and mobile environ-ments where all the data objects and query can move

Acknowledgment

This work is partially supported by NSC under the Grant98-2220-E-027-007 100-2221-E-027-087-MY2 and 102-2221-E-027-088-

References

[1] O Bohl S Manouchehri and U Winand ldquoMobile informationsystems for the private everyday liferdquo Mobile InformationSystems vol 3 no 3-4 pp 135ndash152 2007

[2] Y Tao andD Papadias ldquoTime-parameterized queries in spatio-temporal databasesrdquo in Proceedings of the ACM SIGMODInternational Conference on Managment of Data pp 334ndash345June 2002

[3] Y Tao D Papadias and Q Shen ldquoContinuous nearest neighborsearchrdquo in Proceedings of the 28th International Conference onVery Large Data Bases (VLDB rsquo02) pp 287ndash298 2002

[4] F Aurenhammer ldquoVoronoi diagramsmdasha survey of a fundamen-tal geometric data structurerdquo ACM Computing Surveys vol 23no 3 pp 345ndash405 1991

[5] K Kim Y Cai andW Tavanapong ldquoSafe-time distributed real-time monitoring of cKNN in mobile peer-to-peer networksrdquo inProceedings of the 9th IEEE International Conference on MobileData Management (MDM rsquo08) pp 124ndash131 April 2008

[6] M Kolahdouzan and C Shahabi ldquoVoronoi-based k nearest nei-ghbor search for spatial network databasesrdquo in Proceedings ofthe 30th International Conference on Very Large Data Bases vol30 pp 840ndash851 2004

[7] M R Kolahdouzan and C Shahabi ldquoAlternative solutions forcontinuous K nearest neighbor queries in spatial networkdatabasesrdquo GeoInformatica vol 9 no 4 pp 321ndash341 2005

[8] D Papadias Y Tao K Mouratidis and C K Hui ldquoAggregatenearest neighbor queries in spatial databasesrdquo ACM Transac-tions on Database Systems vol 30 no 2 pp 529ndash576 2005

[9] T Imielinski S Viswanathan and B R Badrinath ldquoData on airorganization and accessrdquo IEEE Transactions on Knowledge andData Engineering vol 9 no 3 pp 353ndash372 1997

[10] S Hambrusch C-M Liu and S Prabhakar ldquoBroadcasting andquerying multi-dimensional index trees in a multi-channelenvironmentrdquo Information Systems vol 31 no 8 pp 870ndash8862006

[11] C-M Liu and K-F Lin ldquoDisseminating dependent data inwireless broadcast environmentsrdquo Distributed and ParallelDatabases vol 22 no 1 pp 1ndash25 2007

[12] T-C Su and C-M Liu ldquoOn-demand data broadcasting for dataitems with time constraints on multiple broadcast channelsrdquo inDatabase Systems for Advanced Applications vol 6193 of LectureNotes in Computer Science pp 458ndash469 2010

[13] B Zheng J Xu W-C Lee and D L Lee ldquoGrid-partition ind-ex a hybrid method for nearest-neighbor queries in wirelesslocation-based servicesrdquo The VLDB Journal vol 15 no 1 pp21ndash39 2006

[14] B Gedik A Singh and L Liu ldquoEnergy efficient exact kNN sear-ch in wireless broadcast environmentsrdquo in Proceedings of the12th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo04) pp 137ndash146 November 2004

[15] KMouratidis S Bakiras and D Papadias ldquoContinuousmonit-oring of spatial queries in wireless broadcast environmentsrdquoIEEE Transactions onMobile Computing vol 8 no 10 pp 1297ndash1311 2009

[16] G Chatzimilioudis D Zeinalipour-Yazti W-C Lee and M DDikaiakos ldquoContinuous all k-nearest-neighbor querying insmartphone networksrdquo in Proceedings of the 13th IEEE Interna-tional Conference on Mobile Data Management (MDM rsquo12) pp79ndash88 2012

[17] T-Y Fu W-C Peng and W-C Lee ldquoParallelizing itinerary-basedKNNquery processing inwireless sensor networksrdquo IEEETransactions on Knowledge and Data Engineering vol 22 no 5pp 711ndash729 2010

[18] T P Nghiem A B Waluyo and D Taniar ldquoA pure peer-to-peerapproach for kNNquery processing inmobile ad hoc networksrdquo

20 International Journal of Distributed Sensor Networks

Personal and Ubiquitous Computing vol 17 no 5 pp 973ndash9852013

[19] HD Chon D Agrawal andA El Abbadi ldquoRange and kNNqu-ery processing for moving objects in Grid modelrdquo MobileNetworks and Applications vol 8 no 4 pp 401ndash412 2003

[20] X Xiong M F Mokbel and W G Aref ldquoSEA-CNN scalableprocessing of continuous K-nearest neighbor queries in spatio-temporal databasesrdquo in Proceedings of the 21st InternationalConference on Data Engineering (ICDE rsquo05) pp 643ndash654 April2005

[21] G Zhao K XuanW Rahayu et al ldquoVoronoi-based continuous120581 nearest neighbor search in mobile navigationrdquo IEEE Transac-tions on Industrial Electronics vol 58 no 6 pp 2247ndash2257 2011

[22] KMouratidis D Papadias S Bakiras and Y Tao ldquoA threshold-based algorithm for continuous monitoring of k nearest neigh-borsrdquo IEEE Transactions on Knowledge and Data Engineeringvol 17 no 11 pp 1451ndash1464 2005

[23] S-H Wu K-T Chuang C-M Chen and M-S Chen ldquoDIK-NN an itinerary-based KNN query processing algorithm formobile sensor networksrdquo inProceedings of the 23rd InternationalConference on Data Engineering (ICDE rsquo07) pp 456ndash465 April2007

[24] D T Lee ldquoOn k-nearest neighbor voronoi diagrams in the pla-nerdquo IEEE Transactions on Computers vol 31 no 6 pp 478ndash4871982

[25] K Patroumpas TMinogiannis andT Sellis ldquoApproximate ord-er-k Voronoi cells over positional streamsrdquo in Proceedings of the15th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo07) pp 276ndash283 November 2007

International Journal of

AerospaceEngineeringHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

RoboticsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Active and Passive Electronic Components

Control Scienceand Engineering

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

RotatingMachinery

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

Journal ofEngineeringVolume 2014

Submit your manuscripts athttpwwwhindawicom

VLSI Design

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Shock and Vibration

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawi Publishing Corporation httpwwwhindawicom

Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

SensorsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Navigation and Observation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

DistributedSensor Networks

International Journal of

Page 3: Research Article Distributed Continuous k Nearest Neighbors ...downloads.hindawi.com/journals/ijdsn/2013/125145.pdfmobile environments like WSNs, which consist of a number of mobile

International Journal of Distributed Sensor Networks 3

the broadcast channel The load for processing data on theserver is dramatically decreased and relieves the bottleneckproblem Instead the computation load on the clients isincreased From the userrsquos point of view the fewer batterypower each device consumes the better experience eachuser has Thus the existing works [10 11 13ndash15] in generaldiscuss the performance of data broadcasting protocol interms of latency and tuning time Latency is the time a clientexperiences from issuing query to receiving the completeanswer The tuning time is the amount of time actually spenton listening to the broadcastThe latency indicates the qualityof service (QoS) provided by the system and the tuning timecan represent the power consumption of mobile clients

Many works [16ndash18] have discussed the 119896NN and C119896NNqueries on the distributed and mobile environments likemobile ad hoc NETworks (MANETs) and wireless sensorsnetworks (WSN) MANETs and WSNs are self-configuringinfrastructure-less networks consisting of mobile devices andsensors connected by wireless communication Each devicein such networks is free to move independently in anydirection and will thus change its links to other devicesfrequently Each device can forward the traffic unrelated toits own use and act as a router In contrast to the client-serverand data broadcasting environments there is no centralserver that handles the spatial queries or broadcasts spatialdata in MANETs or WSNs Accordingly the informationsystem based on the above infrastructure-less networks hasto process the queries in a distributed way Each mobile node(or device) in such a system cooperates and exchanges spatialdata with each other and then derives the answer for thespatial queries

In spatiotemporal data applications the datasets consistof data objects and the data as well as queries might moveover time In order to process a great volume of spatial dataand queries efficiently some decomposition methods suchas grid and Voronoi diagram have been used in the existingworks [7 19 20] Xiong et al [20] focused on multiple 119896NNqueries and proposed an incremental search technique basedon hashing objects into a regular grid and keeping CPUtime in mind The main objective of this work on disk-resident data is to minimize disk IO operations The CPUtime is considered only as a secondary objective Zhao et al[21] proposed a Voronoi-based approach for C119870NN queryAlthough this work provided a navigation service to mobiledevices the query processing is still operated on a centralserver

Mouratidis et al [22] proposed a threshold-based algo-rithm to help the server processing continuous nearest neigh-bor queries from geographically distributed clients Within agiven threshold the 119896 nearest neighbors of the query pointwill not change However this work still needs a centralserver for monitoring the 119896NN objects maintaining thehuge spatial data and broadcasting each objectrsquos informationChatzimilioudis et al [16] proposed a proximity algorithmto answer all 119896-nearest neighbor queries continuously Insuch an environment many stations called query processorsare placed to monitor all the objects in the radio regionThen different query processors can exchange the monitoredspatial information to calculate the 119896nearest neighbor answerto the user (query point)

f

gb

a

c

d

e

q

k = 2Data pointsQuery point

Figure 1 A 2NN search with query point 119902 where 2NN(119902) = 119886 119887

In contrast to most of the above approaches Kim et al[5] proposed a decentralized method to support continuous119896 nearest neighbor query Each query object predicts a safetime as a threshold for reducing the cost of informationupdate This method assumes that there is a maximumspeedMaxSpeed of each object in the environment and useDI119870NN algorithm [23] to find the initial 119896 nearest neighborsBy monitoring the 119896th and (119896 + 1)th NN the mobile querycan know the influence region and use this region to filtermoving objects thus reducing a great amount of update costHowever this work only considered the stationary query nota moving query We will discuss the accuracy of this methodlater in details Before introducing the proposed algorithmwe first give some background and terminologies

3 Preliminaries

In this section we present some concepts and techniques thatare generally used when solving the spatial data queries onmoving objects The metrics generally used to evaluate thequery process will also be introduced

31 Spatial Query The 119896 nearest neighbor search (119896NNsearch) is one of the important types of spatial queriesSuppose that the distance between two points V and 119906 isdist(V 119906) and assume that there is a given dataset 119863 with aquery point 119902 The 119896 nearest neighbor search is to find the 119896

nearest data objects in dataset119863 A simple example in Figure 1illustrates the 2NNof the given query point 119902 and data objects119886 and 119887 are the two data objects closest to 119902 In this casewe will say 2NN(119902) = 119886 119887 The definition of the 119896 nearestneighbor search problem thus can be defined as follow

Definition 1 (119896NN search problem) Given a query point 119902

and an integer 119896 the 119896 NN search problem is to find a subset119896NN(119902) sube 119863 with |119896NN(119902)| = 119896 such that any data object119901 isin 119896NN(119902) and dist(119901 119902) le min

119900dist(119902 119900) where 119900 isin

(119863-119896NN(119902))The continuous 119896 nearest neighbors search (C119896NN

Search) [3] is a variation of 119896NN query C119896NN search isextended from 119896NN search and the system will continuouslyreturn the 119896NN answer in a time interval In a mobile envi-ronment the mobile devices are regarded as moving objectsThus the result of a C119896NN search may change over time dueto the movement of the queries and data objects We can

4 International Journal of Distributed Sensor Networks

s

b

ac

d

h

e

f

g

s1 s2 s3

Figure 2 An example of C119896NN 119896 = 1 where the output is⟨119886 [119904 119904

1]⟩ ⟨119888 [119904

1 1199042]⟩ ⟨119891 [119904

2 1199043]⟩ ⟨ℎ [119904

3 119890]⟩ for 119902 = [119904 119890]

model the moving pattern of the query as a path consistingof consecutive line segments and then consider the linesegments for C119896NN search Let119863 be a dataset of data objectsand 119902 = [119904 119890] be a query line segment A continuous 119896 nearestneighbors (C119896NN) query retrieves 119896 nearest neighbors ofevery point in the line segment 119902 = [119904 119890] The result containsa set of ⟨119877 119879⟩ tuples where 119877 is the resulting 119896NN withinthe time interval119879 on [119904 119890] Consider Figure 2 as an examplewhere 119863 = 119886 119887 119888 119889 119890 119891 119892 ℎ and 119896 = 1 The outputof the query is the set of tuples ⟨119886 [119904 119904

1]⟩ ⟨119888 [119904

1 1199042]⟩

⟨119891 [1199042 1199043]⟩ and ⟨ℎ [119904

3 119890]⟩ Tuple ⟨119886 [119904 119904

1]⟩ indicates

that 119886 is the 119896NN(119902) (119896 = 1) for interval [119904 1199041] and so on

We then can define the continuous 119896 nearest neighbor searchproblem as below

Definition 2 (C119896NN search problem) Given a line segment[119904 119890] and an integer 119896 for any data object 119901 if 119900

119896isin

C119896NN([119904 119890]) is one of the 119896 nearest neighbor then for anyobject 1199001015840 isin (119863-C119896NN([119904 119890])) dist(119901 119900

1015840

) ge dist(119901 119900119896)

32 Voronoi Diagram Using Voronoi diagram (VD) forC119896NN search is proposed in the pull-based approach [7]Consider a set 119875 of 119899 distinct data points called sites inthe plane The Voronoi diagram of 119875 denoted by VD(119875) isdefined as the subdivision of the plane into 119899 cells one foreach site in 119875 and each cell corresponding to a site 119901 isin 119875 isdefined to be the area of all points in the plane closer to119901 thanto any other point in 119875 Figure 3 shows the Voronoi diagramof 16 data points 119901

1 1199012 119901

16in the plane Actually the

boundary between two points is the perpendicular bisectorof those two points The method proposed in [7] uses thecharacteristics of the perpendicular bisector (the distancesfrom any point on this line to both neighboring pointsare the same) to determine the nearest neighbors of thecurrent query point Let us use Figure 3 as an example Theneach solid line is the perpendicular bisector between twoneighboring data objects Suppose that the solid line witharrows denotes a path for the query point from position 119878

to position 1198631and the dotted line with arrows is the path

from 119878 to 1198632 For the path from 119878 to 119863

1 it is very easy to

determine the answer set of the continuous nearest neighborsusing Voronoi diagram and 119901

9 1199018 11990111

11990112

11990110

is the resultOn the other hand for the dotted path from 119878 to119863

2 since the

query does not move to another Voronoi cell the answer setof continuous nearest neighbor is always 119901

9

p16

p2p1

p3

p4 p5p6

p7 p8

p10

p11

p12

p13p14

p15

p9

D1

D2

s

Figure 3 A continuous nearest neighbor search example usingVoronoi diagram

Using the Voronoi diagram one can easily find the NNfor a query point To find the 119896NN for an arbitrary 119896 gt 1we can extend the concept of Voronoi diagram to have theorder-119896 Voronoi diagram [24] Using the order-119896 Voronoidiagram one can find the 119896NN for a query point by locatingthe query point in some order-119896 Voronoi cell Patroumpas etal proposed a method [25] which approximates the order-119896Voronoi cells by limited data objects to support continuous119896 nearest neighbor query Figure 4 shows the process ofconstructing an approximate order-3 Voronoi cell Before theconstruction all the 119896 nearest neighbors are known Initiallythe system assumes that approximate cell VC1015840 containing 119902

is equal to the entire universe of interest where any possiblelocation is being recorded The system regards query point119902 as the center point divides the whole region into eightquadrants and finds the 3NN(119902) = 119899

1 1198992 1198993 as shown in

Figure 4(a) For each closest point 119898119894to 119902 in each quadrant

the system delineates all its 119896 bisectors with the 119896NN pointsand then produces the approximate order-119896 Voronoi cell ofthe 119896NN point with respect to 119902 But for reducing processingcost even further the system chooses bisector 119887

119894that is closest

to 119902 and thus bounds the cell most tightly (Figure 4(b))Accordingly by taking the most restrictive bisector 119887

119894for

each quadrant in counter-clockwise order the system cangradually crop entire universe and obtain the approximateorder-119896 Voronoi cell VC1015840 as shown from Figures 4(b) to 4(i)The gray region in Figure 4(i) is the resulting approximateorder-3 Voronoi cell No matter the query moves in thisregion 3NN(119902) = 119899

1 1198992 1198993

33 Safe-Time In the wireless sensor network the idea ofsafe-time is proposed by Kim et al [5] This method firstassumes that there is a maximum speed MaxSpeed of eachobject in the environment and then uses DI119896NN algorithm[23] to find the initial 119896 nearest neighbors As Figure 5 showsthe user located at 119878 issues a query with 119902 as the centerpoint of this query The system will first inquiry object 119899

119901

the nearest neighbor of the query point 119902 Then the processsearches the initial 119896NN counter-clockwise on the concentric

International Journal of Distributed Sensor Networks 5

n1

n2n3

q120579

(a)

n1b1

b9984001 b9984009984001

n2n3

q

m1

(b)

n1

b1

n2n3

q

m1

(c)

n1

n2n3

q

m1

m3

b1

b3

(d)

n1b1

b4 b3

n2n3

q

m1m4

m3

(e)

n1b1

b5 b4 b3

n2n3

q

m4

m5

m3

m1

(f)

n1

b1

b3b4b5

b6

n2n3

q

m1

m6

m5

m4

m3

(g)

n1b1

b6

b7

b5 b4 b3

n2n3

q

m3

m1m4

m5

m6 m7

(h)

n1

b1

b6

b7

b8

b5 b4 b3

n2n3

q

m3

m1m4

m5

m6

m8

m7

(i)

Figure 4 The construction of an approximate order-3 Voronoi cell where 119902 is the query point

Q-node

D-node

Itinerary

(a)

s

q

np

w

(b)

Figure 5 The 119896NN search on WSNs (a) Q-node is the first object receiving the query and D-node is the sink node which is responsible forcollecting data and (b) presents the multihops routing path for the 119896NN process

6 International Journal of Distributed Sensor Networks

A 3-nearest neighbor at t0Not a 3-nearest neighbor at t0

CDk = 3

q1

q1 o1

o1 o2

o2

o3

o3

o4

o4

o5

o5

CD2Broadcast range

New CD

t = t0 + ST

(a)

(b)

t = t0

(c)

o1

o2

o3o4

o5

CDq1

CD2

Figure 6 Update process using safe-time for 3NN search on WSNs (a) shows the CD between the third and fourth closest data points (b)presents the maximum influenced distance for update using broadcast (c) indicates the area for broadcasting to update

circles incremental with an distance 119908 The query message isforwarded in hop by hop manner as shown in Figure 5(b)Finally the system can obtain the initial 119896NN from the lastobject which finished the query processing and derive thedistance cross-distance (CD) between the 119896th and (119896 + 1)thnearest neighbors As Figure 6(a) shows the system then cancompute a safe time = CD(2 lowast MaxSpeed) by the cross-distance between the 119896th and (119896 + 1)th nearest neighborsThis indicates that the system ensures that the order of 119896thand (119896 + 1)th nearest neighbors will not exchange in the safe-time periodThus the resulting 119896NNdoes not need to updateIn addition the maximum moving distance of each objectis limited in the safe-time so we can predict the maximuminfluenced region after the movement of 119896th and (119896 + 1)thnearest neighbors as shown in Figures 6(b) and 6(c) to obtainthe safe region (the dark rings in the figure) The system willignore the objects which locate outside the safe region thusreducing the cost of updating each objectrsquos information

34 Performance Metrics In order to evaluate the proposedDC119896NN approach we consider the following performancemetrics including update cost number of messages accuracyand response time

341 Update Cost The update cost is to measure the numberof updates during the query process We sometimes use thefrequency to denote it Since the sensors (objects) and eventhe query will move the status of the sensors should bemaintained in order to have the accurate results However thecost for one update is high in the distributed environmentHence one of the objectives of the designed algorithmDC119896NN is to minimize the update cost for the C119896NN query

342 Number ofMessages Except for the number of updatesthere are some other kinds of messages for the queryprocess in the distributed andmobile environment includingthe messages for query and information passing The totalnumber of messages used during the query process can be

used to indicate the throughput over the networks and theenergy consumption So the proposed DC119896NN is towardsminimizing the total number of messages for the query

343 Accuracy By using the pull-based approach the timeinterval for routing updatemessages to the server depends onthe distance between the data object and the server It thus cannot ensure that the location information of each object savedin the server is the latest Hence the results may be timelyincorrect when deriving the answers for a query due to themobilityThis situation becomes worse in the distributed andmobile environments In our design the proposed approachcan avoid redundant updates and keep the accuracy of theresults

344 Response Time The complicated query process thedelay time for message communication and the numberof users will affect the response time of the system toprocess the query Long response time is unbearable andmayreturn obsoletely invalid query results Even worse the longresponse time may cause important information missing orfinancial loss Thus the system response time is also one ofthe important issues that must be considered when designingthe method for continuous queries

4 Distributed Continuous 119896 NearestNeighbors Search

In the mobile and distributed environments like WSNs orMANETS the pull-based approach may not be a goodmatchfor C119896NN search due to the problems discussed in Section 2We thus propose a distributed algorithm DC119896NN for C119896NNsearch in the mobile and distributed environments Thedistributed approach using a better safe-time can reduce theupdate cost relieve the load for server shorten the responsetime and make the result more accurate There are threephases in DC119896NN initialization phase query processingphase and information update phase In the initialization

International Journal of Distributed Sensor Networks 7

query DC119896NN search()(1) broadcast a query 119902(119896 ℎ119900119901119888) ℎ119900119901119888 is initial to 1(2) get the Voronoi cells or objectrsquos information(3) if (119896 = 1) then(4) show LVC(5) find 119904119886119891119890119905119894119898119890 of DC1NN (with LVC)(6) elseif (119896 gt 1) then(7) while the received information is insufficient do(8) broadcast the query 119902(119896 ℎ119900119901119888 + 1) to ask more hops of neighbor nodes(9) run normal 119896NNSearch to find 119896NN set(10) show LVC according to 119896NNset and 119868119899119891119900(11) find 119904119886119891119890119905119894119898119890 of DC119896NN (with LVC)(12)while (119904119886119891119890119905119894119898119890 = 0)(13) wait

Algorithm 1 The DC119896NN algorithm on the query (sink) node

phase each moving object exchanges the location informa-tion and builds a local Voronoi cell (LVC) as well as calculatesthe safe time for the LVC The query processing phasecollects sufficient location and environmental informationof neighboring neighbors for exploring the result of thegiven C119896NN query The last information update phase is tomaintain the latest information for the moving objects andthe result of the continuous 119896 nearest neighbor query Thefollowing will explain each phase in details

41 Phase 1 Initialization (119896=1) During system initializationeach mobile sensor (moving object) exchanges locationinformation with its neighbors derives the local Voronoi cell(LVC) calculates the safe time of LVC and then stores theLVC and safe time in the memory

When a user issues an NN query 119876 and broadcasts thequery message 119902(119896 ℎ119900119901119888) (case 119896 = 1) where 119896 is the numberof the nearest neighbors the query wants to find and ℎ119900119901119888

is the hop counter and sets to one initially When the querypoint 119876rsquos neighboring objects receive the query message119902(119896 ℎ119900119901119888) they will determine whether 119876 is located in theirVoronoi Cells (VCs) If a neighboring object replies true itmeans that this neighboring object is the nearest neighbor ofthe query point 119876 and this neighboring object will transmitthe Voronoi cell (VC) information of itself to the query point119876 including the neighboring object boundaries locationdirection and speed of movement and some environmentalinformation On the other hand if a neighboring objectreturns false this neighboring object will check whetherquery point119876moves towards it or not If the query point119876 ismoving towards a neighboring object then this neighboringobject also will send its VC information to the 119876 otherwisethe query message will be ignored After the initializationphase eachmoving object will maintain the LVC informationand safe time The update process will be executed for thelatest LVC information only when the safe time decreases tozero Assume that each object has 119889 neighbors in averageSince the bisector between two objects costs 119874(1) time theLVC construction (Initialization phase) can be finished in119874(119889) time

42 Phase 2 C119896NN Query Processing The pseudocodeQuery DC119896NN Search() in Algorithm 1 shows the wholequery process on the query point The operations fromLine 6 to the end of Query DC119896NN Search() do the queryprocessing of C119896NN (119896 gt 1) When a query point119876 wants tofind the 119896 nearest neighbors where 119896 gt 1 119876 first broadcastsmessages 119902(119896 ℎ119900119901119888) (case 119896 gt 1) and gets the local Voronoicell (LVC) information from the nearest neighboring (NN)object The nearest neighboring object of 119876 is responsiblefor routing messages to its neighboring objects collectingthe local Voronoi cell (LVC) information of the neighboringobjects and sending information back to query point 119876Basically if the received information is insufficient to derivethe 119896NN answer the query point 119876 will repeatedly sends thequery message 119902 with one more hop (ie ℎ119900119901119888 = ℎ119900119901119888 + 1) tothe specific neighboring objects to obtain more neighboringVC information until the received information is enough toget 119896NN answer

When the received information is enough to derive theresults of 119896NN the query point 119876 will use the approximatemethod we modified from [25] to calculate the approximateorder-119896 LVC in which the query point 119876 locates By usingthe modified method the query point 119876 has to partitionthe plane into 120582 equal sectors and selects an additionalnearest neighboring object in each sector excluded from119896NN objects Thus the query point 119876 needs to collect atleast 119896 + 120582 neighboring objectsrsquo information to build theapproximate order-119896 LVC Note that the information of theadditional 120582 objects can be learned from the informationof the received neighboring objects In comparison with thecentralized approach for constructing the approximate order-119896 Voronoi cell the modified approximate method only needsto consider the 119896nearest neighboring objects and120582 additionalnearest neighboring objects instead of considering all objectsin the wireless environment The computation time is thusmuch better than the traditional centralized approach andcan be derived as119874(120582) + 119874(120582) times 119874(119896) = 119874(120582(119896 + 1)) where119874(120582) is the time for selecting the 120582 additional neighboringobjects In the end 119874(120582119896) is the time for determining theboundary of the approximate order-119896 LVC For more detailsabout the analysis of the computation time please refer to

8 International Journal of Distributed Sensor Networks

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

(a)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q

(b)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q

(c)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q

(d)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

q

(e)

Figure 7 An example of DCNN where (a) each sensor exchanges information in the initial step (b) each sensor builds its LVC (c) a queryat object 119902 is issued and sensor 119900

1returns the information of its LVC to 119902 since 119902 is located in the Voronoi cell associated with 119900

1 (d) object

119902 knows which sensor will be reached next and can derive the safe time by the LVC information of 1199001 and (e) the query result to 119902 can be

updated seamlessly when it moves to 1199006

[25] After the query point 119876 calculates the approximateorder-119896 LVC a safe time of the query 119902 can be derived Thesafe time of the query 119902 is regarded as the time limit forstarting the next location information updating process andupdating the C119896NN answer

Figure 7 gives an example for the case of 119896 = 1 Asshown in Figure 7(a) there are 16moving sensors 119900

1 119900

16

in the system and each sensor has the location informationabout itself In the initial phase each sensor broadcasts themessage with its location information and receives the loca-tion information from its neighbors The local Voronoi cell(LVC) of each sensor then can be calculated and stored Theoverall calculatedVoronoi diagram is depicted in Figure 7(b)Afterwards if the locations of the sensors change as movingeach sensor will broadcast new location information to itsneighbors and each sensor can derive a new LVC by thereceived updating messages In Figure 7(c) a continuous NNquery is issued by some query object 119902 with its locationIn order to know the Voronoi cell where 119902 locates 119902 firstbroadcasts the query message to the neighboring sensors(in dashed circle) After receiving the query message theneighboring sensor will check whether the query 119902 is locatedin its associated cell If 119902 is not in the cell the sensor willignore the querymessage In Figure 7(c) sensor 119900

1will return

the result to the query 119902 saying that object 1199001is the nearest

neighbor of 119902 for the time being If 119902 moves in the directionas indicated by the solid arrow in Figure 7(d) to object 119900

6

119902 can know that it moves towards the boundary of 1199001and

1199006by the LVC stored in 119900

6and then derive the safe time

When approaching the boundary (ie the safe time is almostpassed) a query message to 119900

6will be issued by 119902 in advance

Sensor 1199006will reply to 119902with the cell information to maintain

the accuracy of the query result Figure 7(e) shows the resultafter 119902moves into the associated cell of sensor 119900

6

Figure 8 demonstrates an example of DC119896NN for 119896 gt

1 The initial phase is the same as the previous DCNNexample Each sensor derives the corresponding LVC withthe information from the neighboring sensors The queryis issued by a moving object 119902 with its location Object 119902

locates itself and knows that it is in the VC of 1199001after sensor

1199001replies to 119902 with its LVC information Suppose 119896 = 3

After the initialization 119902 is located in 1199001and has the LVC

information of 1199001 Having such information 119902 can derive the

NN but 3NN cannot be decided yet So 119902 will broadcast thequery message to all of its one-hop neighboring sensors say1199001 1199002 1199003 1199008 and 119900

9in Figure 8(a) to request information

The neighboring sensors will reply to 119902 the information abouttheir LVCs Object 119902 then can derive the resulting 3NN forthe time being say 119900

1 1199008 and 119900

9in the example With

these replied information 119902 can build the approximate order-3 Voronoi cell as shown in Figure 8(b) Then 119902 uses theapproximate order-3 Voronoi cell to derive the safe time inorder to maintain the continuous query result Now if 119896 =

10 the information received from the one-hop neighboringsensors is not enough to derive the result Then the querymessage will be broadcast to 119902rsquos two-hop neighboring sensorsas Figure 8(c) shows If the information is not enough toderive the resulting 119896NN the querymessagewill be broadcast

International Journal of Distributed Sensor Networks 9

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q n1n2

n3

n4(k + 1)

(a)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5qn1

n2

n3

(b)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o3o4

o5q

o9

o2

(c)

o1

o6

o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q

n11(k + 1)

n1

n4n5

n6

n10

n7

n8

n2n9

n3

(d)

o1

o6

o7

o8

o11o10

o12

o13o14o15

o16o9

o2 o3o4

o5q n1n2

n4n5

n6

n7

n3

n9n10

n8

(e)

Figure 8 An example of DC119896NN for 119896 gt 1 where the initialization phase is the same as previous DCNN example and (a) 1199001 1199008 and 119900

9are

the 3NN to the query object 119902 (b) the approximate order-3 Voronoi cell can be built with enough information received (c) the information isnot enough for 10NN query and two-hop neighboring sensors are requested (d) the resulting 10NN can be derived and (e) the approximateorder-10 Voronoi cell can be calculated with information received

to one more hop neighboring sensor Such process will berepeated with an increment on the hop count After havingenough information 119902 can calculate the resulting 10NN andthe approximate order-10 Voronoi cell as shown in Figures8(d) and 8(e) respectively Using the approximate order-10Voronoi cell the safe time can be derived In the followingwe will discuss how to derive the safe time for maintainingthe result of the continuous 119896NN query

43 Phase 3 Information Updates In the distributed andmobile environments it is challenging for a mobile nodeto maintain the location information of the other mobilenodes effectively If a mobile node sends the update messagesfrequently it will consume much network resource andpower Furthermore the result of themoving query should beeffectively maintained For different roles nodes and querywe propose effective ways respectively in our DC119896NN queryprocess to update the location information and maintain thequery result

431 The Safe Time of Each Object In the proposed appro-ach DC119896NN each object cooperates with each other andexchanges information to update the location information ofeach object In order to monitor and obtain the continuousanswer of a continuous 119896 nearest neighbors query we usea safe distance between each object and query Then wecan derive the safe time of each object for location updatesby estimating the maximum speed of that object Supposethat the sensing area is partitioned into a grid for location

management There are three possible methods for derivingthe safe distance The first one is the grid-based safe distanceEach object directly uses the minimum distance betweenitself and the boundary of the grid cell where the objectlocates Simply using the grid-based safe distance may causesome problems about the imprecise updates The secondmethod VD-based safe distance uses VD to obtain the safedistance In order to predict the safe distance more preciselywe can consider the previous two distances simultaneouslyand then select the smaller one So the last method propersafe distance will return a better safe distance by comparisonsHaving the safe distance the safe time then can be derived byestimating the maximum speed of the considered object

In Figure 9 the sensing area is divided into a grid andthe Voronoi diagram formed by the sensors is also shownFor sensor 119900

1in Figure 9(a) the grid-based safe distance and

VD-based safe distance are presented respectively and theproper safe distance will be the VD-based safe distance afterthe comparison On the contrary for sensor 119900

3in Figure 9(b)

the proper safe distance will be the grid-based safe distance

432The Safe Time of EachQuery For themoving query it isimportant to know when the result will change To derive thesafe time during which the result will not change we referto the characteristics of Voronoi diagram In the traditionalenvironment with static objects the system only uses theminimum distance from the query to the boundary of theVoronoi cell where the query locates as the safe distance Thethe safe time can be obtained by the estimated maximum

10 International Journal of Distributed Sensor Networks

o1

o7

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

o6o8

(a)

o1

o7

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

o6o8

(b)

Figure 9 An illustration for different safe distances (a) sensor 1199001uses the VD-based safe distance as the proper safe distance and (b) sensor

1199003uses the grid-based safe distance as the proper safe distance

L L

A

B

Safe distance

Query

B

A

120579

New safe distance

QueryA998400

L998400

B998400

Figure 10 An example showing the impact on the safe distancecaused by object movement

speed of that query During the safe time no update isnecessary thus saving the update cost

Unfortunately in the moving object environment theabove method cannot obtain the right safe time As shownin Figure 10 the left part shows the static case where 119871 is theVoronoi cell boundary between objects 119860 and 119861 and the safedistance of the query can be calculated as the figure showsHowever for the moving objects the original safe distancebetween the 119871 and query cannot be directly used to calculatethe safe time because the object movement will cause thedistance form query to 119871 to be nonlinearly increasing ordecreasing As the right part of Figure 10 shows after themovement of object 119860 and object 119861 119871 becomes 119871

1015840 and thesafe distance changes Thus if we want to use the boundariesof Voronoi cell to estimate more accurate safe time we needto consider the relative movements between the objects andquery

In order to derive the precise safe distance we considerthe movements of objects and query simultaneously and useFigure 11 to illustrate Initially 119876119860 and 119876119861 are the distancesfrom the query to objects 119860 and 119861 respectively The linebetween 119860 and 119861 is the boundary of the Voronoi cellsassociated with 119860 and 119861 and the query is located in thecell of 119860 as Figure 11(a) shows When objects and the querymove as in Figure 11(b) the query may touch the boundaryThis indicates that the query will enter another cell and theresult of the query should be updated The time from thebeginning to the moment of touching the boundary is theprecise safe time for the query According to the properties

of Voronoi diagram when the query is on the boundary119876119860 = 119876119861 We hence can use the condition of 119876119860 = 119876119861

to decide whether the query is on the boundary With thisproperty even though the objects and querymove frequentlythe query only needs the speeds directions and locationsof the neighboring objects to predict the safe time easilyWithin the safe time the query will not touch the boundaryIn Figure 11(c) the query meets the boundary at 119905

1and the

safe time is 1199051

In the following we present the way to calculate the safetime when 119876119860 = 119876119861 Assume that the initial location of themoving query is (119909

119902 119910119902) and the speed is (119881

119909119902 119881119910119902

) Supposethe initial location of object 119860(119861) is (119909

119860 119910119860)((119909119861 119910119861)) with

the speed being (119881119909119860

119881119910119860

)((119881119909119861

119881119910119861

)) The equation to findwhen the querymeets the boundary can be derived accordingto the property of perpendicular bisector Since119876119860 = 119876119861 wecan have

([(119909119902+ 119881119909119902

lowast 119905) minus (119909119860

+ 119881119909119860

lowast 119905)]2

+[(119910119902+ 119881119910119902

lowast 119905) minus (119910119860

+ 119881119910119860

lowast 119905)]2

)

12

= ([(119909119902+ 119881119909119902

lowast 119905) minus (119909119861

+ 119881119909119861

lowast 119905)]2

+[(119910119902+ 119881119910119902

lowast 119905) minus (119910119861

+ 119881119910119861

lowast 119905)]2

)

12

(1)

Then

0 = [1198812

119909119860

+ 1198812

119910119860

minus 1198812

119909119861

minus 1198812

119910119861

minus 2 lowast 119881119909119902

119881119909119860

minus2 lowast 119881119910119902

119881119910119860

+ 2 lowast 119881119909119902

119881119909119861

+ 2 lowast 119881119910119902

119881119910119861

] lowast 1199052

+ 2 [(119909119902minus 119909119860) (119881119909119902

minus 119881119909119860

) + (119910119902minus 119910119860) (119881119910119902

minus 119881119910119860

)

minus (119909119902minus119909119861) (119881119909119902

minus119881119909119861

) minus (119910119902minus119910119861) (119881119910119902

minus119881119910119861

)] lowast 119905

+ [(119909119902minus 119909119860)2

+ (119910119902minus 119910119860)2

minus (119909119902minus 119909119861)2

minus (119910119902minus119910119861)2

]

(2)

International Journal of Distributed Sensor Networks 11

A

B

Query

(x3 y3)

(x2 y2) (x1 y1)QA

QB

(Vx2 Vy2)

(Vx3 Vy3)

(Vx1 Vy1)

(a)

A

B

Query

(x3 y3)

(x2 y2)(x1 y1)

QA

QB

(Vx2 Vy2)

(Vx3 Vy3)

(Vx1 Vy1)

(b)

A

B

d

t1 t2 t3 t

(c)

Figure 11 The precise safe-time for moving objects 119860 and 119861 and the moving query where (a) shows the beginning state (b) presents themoment when the moving query meets the boundary and (c) gives the diagram for the change on the safe distance with time 119905

o1

o2

o3o4

o5

CDq1

CD2

(a)

o1

o2

o3o4

o5

CDq1

CD2

q9984001

(b)

Figure 12 The phenomenon when using the original safe-time methods to (a) stationary query and (b) moving query

Equation (2) is a quadratic equation Since a generalquadratic equation can be written in the following form1198861199092

+ 119887119909 + 119888 = 0 recall that the discriminant of a quadraticequation is Δ = 119887

2

minus 4119886119888 If Δ gt 0 there are two distinct realroots if Δ = 0 there is exactly one real root if Δ lt 0 thereare two distinct (non-real) complex roots In (2)

119886 = 1198812

119909119860

+ 1198812

119910119860

minus 1198812

119909119861

minus 1198812

119910119861

minus 2 lowast 119881119909119902

119881119909119860

minus 2 lowast 119881119910119902

119881119910119860

+ 2 lowast 119881119909119902

119881119909119861

+ 2 lowast 119881119910119902

119881119910119861

119887 = 2 [(119909119902minus 119909119860) (119881119909119902

minus 119881119909119860

) + (119910119902minus 119910119860) (119881119910119902

minus 119881119910119860

)

minus (119909119902minus 119909119861) (119881119909119902

minus 119881119909119861

) minus (119910119902minus 119910119861) (119881119910119902

minus 119881119910119861

)]

119888 = (119909119902minus 119909119860)2

+ (119910119902minus 119910119860)2

minus (119909119902minus 119909119861)2

minus (119910119902minus 119910119861)2

(3)

and then we can derive the safe time 119905 according to thediscriminant

119905 =

[minus119887 + (1198872

minus 4119886119888)12

]

2119886or

[minus119887 minus (1198872

minus 4119886119888)12

]

2119886

(4)

Finally we select the minimum value of 119905 gt 0 as the safetime

Additionally assuming that 119889 is the distance between theobject and the query and 119905 is the time 119876119860 = 119876119861 can be

converted into a function of 119905 and 119889 as shown in Figure 11(c)Then we can obtain the safe time 119905

1which is the time when

119876119860 = 119876119861 Furthermore the object 119861 will be closest to thequery at the time 119905

3

5 Comparisons with Previous Approaches

In this section we compare the proposed DC119896NN approachthe Safe-time with stationary query approach [5] and thenaıve way used pull-based approach in terms of safe timespace and accuracy

51 Safe Time The original safe-time with stationary query[5] (safe-time(S)) does not support moving queries Anexample of C3NN is shown in Figure 12 where 119902

1is the query

point triangles are the 3NN objects the pentagons representthe other individual objects and 119900

4is 4th NN Figure 12(a)

shows the original result for safe-time(S) After obtaining the119896th and (119896 + 1)th objects (119900

2and 1199004in the figure) the cross-

distance (CD) of 119896th and (119896 + 1)th objects can be calculatedRecall that the cross distance of two data objects 119860 and 119861 isthe difference on the distances of119860 and119861 to the center (or thequery point) For the next update (after a safe-time period)all the objects in this region should be checked

We adapt the safe-time(S) method for moving queryThe adapted approach will result in a higher update cost

12 International Journal of Distributed Sensor Networks

Figure 12(b) presents a case that the query moves towardobject 119900

3(119896th NN) and away from object 119900

4((119896 + 1)th NN)

When the query 1199021moves to the point 1199021015840

1 the most outside

concentric circle increases and becomes as large as the mostoutside dotted concentric circle On the contrary the mostinside concentric circle decreases and becomes as small as themost inside dotted concentric circle Thus the cross-distanceincreases and more number of objects will be examined

In addition according to the Figure 12(b) we can knowthat the original Safe-time method safe-time(S) is notappropriate for moving queries since the calculation of Safe-time(S) method does not consider the speed of query safe-time(S) directly uses twofold of the maximum speed of the119896th and (119896+1)thNNobjects to divide theCD to derive the safetime The cost for updates increases when the CD becomeslarger since the average checked area becomes bigger Besidesthe obtained 119896NNanswer cannot be guaranteed to be correctOn the contrary the cross-distance when the query movestowards object 119900

4((119896 + 1)th NN) and away from object 119900

3

(119896th NN) in this case the order of the 119896th and (119896 + 1)th NNobjectmay be changed but the update does not perform thusresulting in incorrect results

We modify the Safe-time to fully support the movingquery In order to support and maintain the accuracy ofmoving query the maximum speed (Maxspeed) used in thesafe time calculation is required to be modified and replacedby the maximum relative speed between the query and theobjects Because of using the relative speed the adaptedsafe-time method safe-time(M) needs twofold maximumrelative speed (2 lowast 119872119886119909119904119901119890119890119889) to calculate the safe time forguaranteeing the accurate resultsThe safe time derived is lessthan the one derived in safe-time(S) due to the relative speedHence the update frequency of safe-time(M) is higher thanthe update frequency of safe-time(S)

52 Space In DC119896NN each object and query only need tomaintain the information of LVC The information to bestored includes the location of neighboring objects and theobject information of order-119896rsquos local Voronoi diagram Thetotal amount of stored information is not significant on eachobjectThus the use of storage space does not need to be verysubstantial

53 Accuracy The safe-time (S) [5] considers the stationaryquery When applying it to the moving query some adaptionshould bemade According to our experimental results whenthe value of 119896 increases with a moving query the accuracy ofthe result will be reduced In our simulation we modify theoriginal Safe-time(S) as Safe time(M) for moving query andconsider the relative distance in detail caused by the movingquery and objects Although the correctness of the answer canbe increased the update frequency increases thus increasingthe number of delivered messages

DC119896NNuses Voronoi and grid cell boundary to calculatethe safe time and updates the information of related objectsbefore the end of the safe time In fact the boundary ofthe Voronoi cell represents the boundary of moving 119896NNquery After the safe time period the query will collect the

information of related neighboring objects Having such real-time information the query can have the resultmore accuratein time Similar to safe-time(M) DC119896NN uses the 119896th and(119896 + 1)th nearest moving objects to derive the safe time So itis able to maintain the correctness of the answer

6 Simulation Experiments

In the simulation we compare the following methods NaıveDC119896NN safe-time (S) and safe-time (M)TheNaıvemethodis centralized and used as a benchmark for the comparisonAll the mobile sensors will send the location informationto the central server to update the information The othermethods DC119896NN Safe-time(S) and Safe-time(M) are dis-tributed and used in the considered mobile wireless sensornetwork where each object knows its position has the abilityto perform some calculation and stores the information oflocalized Voronoi cell (LVC)We assume that each object cantransmit amessage to its one-hopneighbor so that each objectcan communicate with at least one object For Safe-time(S)and the safe-time(M) a maximum speed (MaxSpeed) is setin order to estimate relative speed and distance for safe-timecalculation

In the simulation all the compared approaches areperformed under the same environmental conditions forfairness The initial location and speed of moving objectsare uniformly randomly distributed Since we focus on theperformance of the query process of the proposed DC119896NNapproach we further assume that the transmission quality isideal and no congestion and communication delays occurThe metrics measured include the update frequency for aquery the total number of messages response time andaccuracy The update frequency for a query is the averagenumber of update messages sent by the data objects relatedto the query per minute The total number of messages isall the amount of messages sent from all objects during thequery process The accuracy of each method is measuredby comparing the results to the real answers Since thequery is continuous and the update occurs subsequently themeasured response time is mainly the time required fromsending a query to obtaining the first result

All the experiments are simulated so the results aboutthe response time may not show the practical cases exactlybut can reflect the trends on the performance among all thecompared approaches relatively In order to have the responsetime in our simulation we thus use the total number of hopsfor deriving the result tomultiply the average time for one hopin the simulation system to present the response time Thusthe response time is proportional to the total number of hopsin our simulation program In addition because the maindifference between Safe-time(S) and the Safe-time(M) is theway for deriving the safe time the measured response timeof these two methods is the same The simulation programis implemented with Java The setting of our simulation isshown in Table 1 with a default value for each parameter Inall the simulation experiments the final results are reportedwith the average of 100 queries The duration of each query is60 seconds

International Journal of Distributed Sensor Networks 13

200 400 600 800 10000

10

20

30

40

50

60

Edge length of sensing area (m)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

200 400 600 800 10000

100

200

300

400

500

600

700

Edge length of sensing area (m)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

200 400 600 800 100075

80

85

90

95

100

105

Edge length of sensing area (m)

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

200 400 600 800 1000Edge length of sensing area (m)

Aver

age r

espo

nse t

ime (

s)

DCkNNSafe-time(S)Safe-time(M)

095

1

105

11

(d) Response time

Figure 13 The effects of different sensing areas on (a) update frequency (b) number of messages (c) accuracy and (d) response time

Table 1 Simulation parameters

Parameter Range Default valueEdge length of sensingarea (m) 200 400 600 800 1000 600

Edge length of grid (m) 50 100 150 50Number of objects 20 30 40 50 60 30Transmission range (m) 125 125119896 1 3 5 10 20 3Moving objects () 20 40 60 80 100 20Speed (ms) 2 4 6 8 10 4

61 Effects of Sensing Area Sensing area affects the numberof update and query messages since if the area becomes

greater with the fixed number of objects relatively thedensity of the objects becomes sparse For example when thesensing areas are 200lowast200 400lowast400 600lowast600 800lowast800 and1000lowast1000 the densities are 188 047 021 012 and 008respectively Figure 13(a) shows that DC119896NN has the lowestnumber of updates with all the different areas and the numberof updates for Safe-time(S) is the highest (worst) becauseDC119896NN considers the moving direction and speed of thequeries and objects and selects the proper safe-distance toderive the safe-time Safe-time(S) the Safe-time(M) estimatethe safe time according to the maximum speed of the objectsso more number of updates can be expected AdditionallySafe-time(M) is updated more frequently than Safe-time(S)Recall that Safe-time(M) considers the query movement

14 International Journal of Distributed Sensor Networks

50 75 100 150 2000

5

10

15

20

25

Edge length of grid (m)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

50 75 100 150 2000

50

100

150

200

250

300

350

Edge length of grid (m)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

50 75 100 150 2000

20

40

60

80

100

120

Edge length of grid (m)

Accu

racy

()

DCkNN(G)DCkNN(V)

(c) Accuracy

50 75 100 150 2001

101

102

103

104

105

106

Edge length of grid (m)

Aver

age r

espo

nse t

ime (

s)

DCkNN(G)DCkNN(V)

(d) Response time

Figure 14 The comparisons of using grid-based and VD-base safe distances to derive the safe-time (a) update frequency (b) number ofmessages (c) accuracy and (d) response time

The average safe-distance becomes shorter thus leading tomore updates Besides when the sensing area increasesfrom 200lowast200 to 600lowast600 the update frequency dropsdramaticallyThe curve becomes flatter when the area is from600lowast600 to 1000lowast1000 since the difference on the densitiesof the areas from 600lowast600 to 1000lowast1000 is not much Thenumber of updates is less as the safe-time becomes largerThetotal number of transmitted messages of naıve approach isfixed at about 1800 packets All the other distributedmethodsuse fewer number of messages than naıve

To monitor the results DC119896NN only needs to check therelated objects in the local Voronoi cell at the proper safe-time thus reducing a lot of redundant update messages Safe-time(S) and Safe-time(M) use the maximum speed of theobjects to calculate the safe time so the total number of

transmitted messages of both approaches is more than that ofDC119896NN Figure 13(b) shows that more than 30 of the totalnumber of transmitted messages can be saved by DC119896NN incomparison with Safe-time(M)

For the accuracy since Safe-time(S) does not considerthe query movement the safe-time may be inaccurate Fur-thermore due to the mobility when the density is high theestimated results become more inaccurate So Safe-time(S)performs worst as shown in Figure 13(c) Safe-time(M) isrevised from Safe-time(S) by considering the query move-ment and the safe-distance is less in average for guaranteeingbetter results Hence Safe-time(M) has a better accuracy andalmost the same as DC119896NN The accuracy of Safe-time(M)and DC119896NN is almost about 100 correct and the gap maybe caused by arithmetical errors in the experiments

International Journal of Distributed Sensor Networks 15

10 20 30 40 50 60 700

5

10

15

20

25

30

35

40

45

Number of objects

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

10 20 30 40 50 60 70100

150

200

250

300

350

400

450

Number of objects

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

10 20 30 40 50 60 7080

85

90

95

100

105

Number of objects

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

10 20 30 40 50 60 70Number of objects

Aver

age r

espo

nse t

ime (

s)

096

098

1

102

104

106

108

11

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 15 The effects of the number of objects on (a) update frequency (b) number of messages (c) accuracy and (d) response time

When the area becomes larger the density becomeslower So the number of objects in each objectrsquos transmissionrange is fewer Under such a circumstance DC119896NN usesless computation and the response time is shorter as shownin Figure 13(d) In contrast the Safe-time(S) and the Safe-time(M) need to collect information before performing eachnew query and cause longer response time Since Safe-time(M) and Safe-time(S) use the same method and proce-dure to handle the first query the response time of these twomethods will be almost the same

62 Effects of Grid Size In this simulation experiment setwe want to observe the update efficiency of each object inthe third phase of DC119896NN Recall that we consider the grid-based and VD-base safe distances to derive a proper safe-time In this experiment DC119896NN(G) uses grid-based safe

distance to determine the safe time for the next update andDC119896NN(V) uses VD-base safe distance to derive the safetime The sensing area is fixed to 600lowast600m2 and there are30 data objects We compare DC119896NN(V) with DC119896NN(G)by observing the impacts of different grid sizes All theother settings have the similar trends in our experimentalresults In Figure 14(a) the update frequency of the objectsin DC119896NN(G) is high when the grid size is 50lowast50m2 andbecomes less when the grid size decreases Since the sensingarea is 600lowast600m2 and 30 objects are given the averagedistance between an object and the boundary of a Voronoicell is about 25 to 50 meters With the setting of grid size50lowast50m2 the average distance obtained in DC119896NN(G) isabout 25 meters Thus the safe time of DC119896NN(V) is longerIn general as Figures 14(a) and 14(b) show the update

16 International Journal of Distributed Sensor Networks

1 3 5 10 200

10

20

30

40

50

60

k

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

1 3 5 10 200

100

200

300

400

500

600

700

800

k

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

1 3 5 10 2080

85

90

95

100

105

k

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

1 3 5 10 20k

Aver

age r

espo

nse t

ime (

s)

08

09

1

11

12

13

14

15

16

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 16 The impacts of different values of 119896 on (a) update frequency (b) number of messages (c) accuracy and (d) response time

frequency of the objects and the number of messages sentby the objects decrease as the grid size increases

When the grid size is large the safe time becomes longand less number of updates are issued Hence the resultsbecome more inaccurate As shown in Figure 14(c) whenthe grid sizes are 50lowast50m2 75lowast75m2 100lowast100m2 and150lowast150m2 the corresponding accuracies are 95 9285 and 78 respectively While the grid size increases to200lowast200m2 the accuracy is significantly reduced to 69and the right answer thus can not be guaranteed On theother hand Figure 14(d) shows that the response times ofDC119896NN(G) and DC119896NN(V) are not much different becausethe size of grid is not the major factor to influence thecomplexity of obtaining information for the first query

63 Number of Objects In this subsection we discuss theresults as the number of data objects varies The area in thepresented experiment set is 600lowast600 (m2) with grid size of50lowast50 (m2) As shown in Figure 15(a) when the number ofobjects increases the number of updates in DC119896NN is stillrelatively less than the ones in Safe-time(S) and Safe-time(M)If the number of objects increases the number of repliedmessages per second to the central server in naıve will growdramatically With 20 to 60 objects the number of repliedmessages to the server is from 1200 to 3600 (packetsmin)By observing the results in Figures 15(b) and 15(c) as moreobjects are in the area the number of messages increasesfor the other three methods and the accuracy reduces inSafe-time(S) These match the trends for different areas we

International Journal of Distributed Sensor Networks 17

20 40 60 80 1000

5

10

15

20

25

30

35

40

45

Moving objects ()

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

20 40 60 80 1000

100

200

300

400

500

600

Moving objects ()

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

20 40 60 80 100

80

70

75

85

90

95

100

105

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

Moving objects ()

(c) Accuracy

20 40 60 80 100

Aver

age r

espo

nse t

ime (

s)

09

095

1

11

105

115

12

125

13

DCkNNSafe-time(S)Safe-time(M)

Moving objects ()

(d) Response time

Figure 17 The effects of the moving objects on (a) update frequency (b) number of messages (c) accuracy and (d) response time

discussed earlier due to the density Similarly the responsetime can be expected as shown in Figure 15(d) where theresponse time of DC119896NN is still the shortest

64 Different Values of 119896 It is obvious that the value of119896 affects the performance of query processing significantlyWhen the value of 119896 becomes larger the number of relatedobjects required to be checked also increases In other wordswe need to spend more cost to find out which 119896 objectsare currently in the result for the C119896NN query Thereforethe changes in the value of 119896 mainly affect the amountof data required for the first query and the update costfor maintaining the 119896th and the (119896 + 1)th objects So inFigure 16(a) when the value of 119896 is large more updates arenecessary for all the three methods As Figure 16(b) shows

the influence on the number of transmitted messages inSafe-time(M) is more serious than the one in Safe-time(S)Due to the mobility the number of influenced objects inSafe-time(M) will increase as the value of 119896 increases Inparticular the update frequency in Safe-time(M) becomesnearly twofold the update frequency in Safe-time(S)

Figure 16(c) presents the impact on the accuracy fordifferent values of 119896 With a larger value of 119896 an object inSafe-time(S) will have a higher chance to derive the incorrectsafe time thus causing lower accuracy When the value of 119896increases the response time of all threemethods will increasesignificantly as shown in Figure 16(d) The reason is thatall DC119896NN Safe-time(S) and Safe-time(M) need to searchmore objects and collect more information for answering thequery when the value of 119896 increases to a certain number For

18 International Journal of Distributed Sensor Networks

2 4 6 8 100

10

20

30

40

50

60

Speed (ms)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

2 4 6 8 100

100

200

300

400

500

600

700

800

Speed (ms)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

2 4 6 8 1070

75

80

85

90

95

100

105

Speed (ms)

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

2 4 6 8 1009

095

1

105

11

115

12

125

13

Speed (ms)

Aver

age r

espo

nse t

ime (

s)

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 18 The impacts of speed on (a) update frequency (b) number of messages (c) accuracy and (d) response time

DC119896NN DC119896NN only needs to store local Voronoi diagramwhere the information required is less than required in Safe-time(S) and Safe-time(M) so the response time of DC119896NN isthe shortest

65 The Effect of Moving Objects In this experiment set weconsider different percentages of moving objects in all thedata objects The default value is 20 which means that ifthere is a total of 30 objects then there are sixmoving objectsIn Figures 17(a) and 17(b) as the percentage ofmoving objectsincreases the overall number of updates required between theobjects increases relatively and the change rate of answer totheDC119896NNaccelerates thus increasing the update frequencyof the query and the number of messages However DC119896NNstill keeps the best performance Figure 17(c) shows the accu-racy of the result for different percentage of moving objectsDC119896NN and Safe-time(M) both have higher accuracy and

Safe-time(S) is still the worst The safe time of each object inSafe-time(S) is calculated using the maximum speed of theobjects Hence whether the object is moving or not does notdirectly result in the incorrectness of the answer collectionIn fact in Safe-time(S) one of the main reasons to affectthe accuracy is the directions of moving objects Last asFigure 17(d) shows the percentage of moving objects doesnot impact the response time too much

66 Effects of Speed If each object moves faster the relativevelocities between objects may also become faster This willmake the safe time shorter and the update frequency ofeach object and query increases The safe time used inSafe-time(S) and Safe-time(M) is directly affected by themaximum speed of objects and does not consider the direc-tion of each objectrsquos movement and the speed of individualmovement No matter the objects move or not and move

International Journal of Distributed Sensor Networks 19

fast or slow both of the above methods directly use themaximum speed of objects to calculate the safe time forupdating On the other hand DC119896NN considers the movingdirection of objects and the proper safe-time for updatesIn this experiment the number of moving objects is 20of all the objects As Figure 18(a) shows as the movingobjects speed up the update cost increases and DC119896NN stillperforms best As the speed increases the safe-time in Safe-time(S) and the Safe-time(M) becomes much shorter due toa larger maximum speed among all the objects The trendbecomes even worse as the speed increases

Figure 18(b) shows the trend about the number of trans-mitted messages when the speed is up DC119896NN still hasthe best performance on the number of messages There are42781 messages sent in average when the speed of object is10ms However the Safe-time(M) needs 67913 messagesThe accuracy will not be effected as the speed changesfor DC119896NN and Safe-time(M) because both of them aredesigned or adapted for themoving objects and queries Safe-time(S) will have more inaccurate results as the speed is highas shown in Figure 18(c) However the response time doesnot have a significant impact on the response time for all thethree methods Figure 18(d) presents this trend

7 Conclusions

In this paper we propose a new approach DC119896NN whichuses the local Voronoi diagram and proper safe-time toeffectively process the C119896NNquery in distributed andmobileenvironments such as wireless sensor networks The propersafe-time can be quickly derived by a simple formulaBy comparing our proposed DC119896NN with other existingapproaches Safe-time(S) DC119896NN can effectively improvesearch efficiency reduce response time and the numberof messages and keep the accuracy of the result highAdditionally DC119896NN reduces more 30 of transmissionmessages than Safe-time(M) because the characteristics of theVoronoi diagram are used and each objectrsquos moving directionis considered instead of directly using the maximum speedof the objects as Safe-time method The derived safe-timeis more precise As a result DC119896NN needs less updatefrequency reduces a great number of messages transmittedand yields more accurate results In this work simulationexperiments are also performed The experimental resultsvalidate the proposed DC119896NN approach for the continuous119896 nearest neighbor query in distributed and mobile environ-ments where all the data objects and query can move

Acknowledgment

This work is partially supported by NSC under the Grant98-2220-E-027-007 100-2221-E-027-087-MY2 and 102-2221-E-027-088-

References

[1] O Bohl S Manouchehri and U Winand ldquoMobile informationsystems for the private everyday liferdquo Mobile InformationSystems vol 3 no 3-4 pp 135ndash152 2007

[2] Y Tao andD Papadias ldquoTime-parameterized queries in spatio-temporal databasesrdquo in Proceedings of the ACM SIGMODInternational Conference on Managment of Data pp 334ndash345June 2002

[3] Y Tao D Papadias and Q Shen ldquoContinuous nearest neighborsearchrdquo in Proceedings of the 28th International Conference onVery Large Data Bases (VLDB rsquo02) pp 287ndash298 2002

[4] F Aurenhammer ldquoVoronoi diagramsmdasha survey of a fundamen-tal geometric data structurerdquo ACM Computing Surveys vol 23no 3 pp 345ndash405 1991

[5] K Kim Y Cai andW Tavanapong ldquoSafe-time distributed real-time monitoring of cKNN in mobile peer-to-peer networksrdquo inProceedings of the 9th IEEE International Conference on MobileData Management (MDM rsquo08) pp 124ndash131 April 2008

[6] M Kolahdouzan and C Shahabi ldquoVoronoi-based k nearest nei-ghbor search for spatial network databasesrdquo in Proceedings ofthe 30th International Conference on Very Large Data Bases vol30 pp 840ndash851 2004

[7] M R Kolahdouzan and C Shahabi ldquoAlternative solutions forcontinuous K nearest neighbor queries in spatial networkdatabasesrdquo GeoInformatica vol 9 no 4 pp 321ndash341 2005

[8] D Papadias Y Tao K Mouratidis and C K Hui ldquoAggregatenearest neighbor queries in spatial databasesrdquo ACM Transac-tions on Database Systems vol 30 no 2 pp 529ndash576 2005

[9] T Imielinski S Viswanathan and B R Badrinath ldquoData on airorganization and accessrdquo IEEE Transactions on Knowledge andData Engineering vol 9 no 3 pp 353ndash372 1997

[10] S Hambrusch C-M Liu and S Prabhakar ldquoBroadcasting andquerying multi-dimensional index trees in a multi-channelenvironmentrdquo Information Systems vol 31 no 8 pp 870ndash8862006

[11] C-M Liu and K-F Lin ldquoDisseminating dependent data inwireless broadcast environmentsrdquo Distributed and ParallelDatabases vol 22 no 1 pp 1ndash25 2007

[12] T-C Su and C-M Liu ldquoOn-demand data broadcasting for dataitems with time constraints on multiple broadcast channelsrdquo inDatabase Systems for Advanced Applications vol 6193 of LectureNotes in Computer Science pp 458ndash469 2010

[13] B Zheng J Xu W-C Lee and D L Lee ldquoGrid-partition ind-ex a hybrid method for nearest-neighbor queries in wirelesslocation-based servicesrdquo The VLDB Journal vol 15 no 1 pp21ndash39 2006

[14] B Gedik A Singh and L Liu ldquoEnergy efficient exact kNN sear-ch in wireless broadcast environmentsrdquo in Proceedings of the12th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo04) pp 137ndash146 November 2004

[15] KMouratidis S Bakiras and D Papadias ldquoContinuousmonit-oring of spatial queries in wireless broadcast environmentsrdquoIEEE Transactions onMobile Computing vol 8 no 10 pp 1297ndash1311 2009

[16] G Chatzimilioudis D Zeinalipour-Yazti W-C Lee and M DDikaiakos ldquoContinuous all k-nearest-neighbor querying insmartphone networksrdquo in Proceedings of the 13th IEEE Interna-tional Conference on Mobile Data Management (MDM rsquo12) pp79ndash88 2012

[17] T-Y Fu W-C Peng and W-C Lee ldquoParallelizing itinerary-basedKNNquery processing inwireless sensor networksrdquo IEEETransactions on Knowledge and Data Engineering vol 22 no 5pp 711ndash729 2010

[18] T P Nghiem A B Waluyo and D Taniar ldquoA pure peer-to-peerapproach for kNNquery processing inmobile ad hoc networksrdquo

20 International Journal of Distributed Sensor Networks

Personal and Ubiquitous Computing vol 17 no 5 pp 973ndash9852013

[19] HD Chon D Agrawal andA El Abbadi ldquoRange and kNNqu-ery processing for moving objects in Grid modelrdquo MobileNetworks and Applications vol 8 no 4 pp 401ndash412 2003

[20] X Xiong M F Mokbel and W G Aref ldquoSEA-CNN scalableprocessing of continuous K-nearest neighbor queries in spatio-temporal databasesrdquo in Proceedings of the 21st InternationalConference on Data Engineering (ICDE rsquo05) pp 643ndash654 April2005

[21] G Zhao K XuanW Rahayu et al ldquoVoronoi-based continuous120581 nearest neighbor search in mobile navigationrdquo IEEE Transac-tions on Industrial Electronics vol 58 no 6 pp 2247ndash2257 2011

[22] KMouratidis D Papadias S Bakiras and Y Tao ldquoA threshold-based algorithm for continuous monitoring of k nearest neigh-borsrdquo IEEE Transactions on Knowledge and Data Engineeringvol 17 no 11 pp 1451ndash1464 2005

[23] S-H Wu K-T Chuang C-M Chen and M-S Chen ldquoDIK-NN an itinerary-based KNN query processing algorithm formobile sensor networksrdquo inProceedings of the 23rd InternationalConference on Data Engineering (ICDE rsquo07) pp 456ndash465 April2007

[24] D T Lee ldquoOn k-nearest neighbor voronoi diagrams in the pla-nerdquo IEEE Transactions on Computers vol 31 no 6 pp 478ndash4871982

[25] K Patroumpas TMinogiannis andT Sellis ldquoApproximate ord-er-k Voronoi cells over positional streamsrdquo in Proceedings of the15th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo07) pp 276ndash283 November 2007

International Journal of

AerospaceEngineeringHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

RoboticsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Active and Passive Electronic Components

Control Scienceand Engineering

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

RotatingMachinery

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

Journal ofEngineeringVolume 2014

Submit your manuscripts athttpwwwhindawicom

VLSI Design

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Shock and Vibration

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawi Publishing Corporation httpwwwhindawicom

Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

SensorsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Navigation and Observation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

DistributedSensor Networks

International Journal of

Page 4: Research Article Distributed Continuous k Nearest Neighbors ...downloads.hindawi.com/journals/ijdsn/2013/125145.pdfmobile environments like WSNs, which consist of a number of mobile

4 International Journal of Distributed Sensor Networks

s

b

ac

d

h

e

f

g

s1 s2 s3

Figure 2 An example of C119896NN 119896 = 1 where the output is⟨119886 [119904 119904

1]⟩ ⟨119888 [119904

1 1199042]⟩ ⟨119891 [119904

2 1199043]⟩ ⟨ℎ [119904

3 119890]⟩ for 119902 = [119904 119890]

model the moving pattern of the query as a path consistingof consecutive line segments and then consider the linesegments for C119896NN search Let119863 be a dataset of data objectsand 119902 = [119904 119890] be a query line segment A continuous 119896 nearestneighbors (C119896NN) query retrieves 119896 nearest neighbors ofevery point in the line segment 119902 = [119904 119890] The result containsa set of ⟨119877 119879⟩ tuples where 119877 is the resulting 119896NN withinthe time interval119879 on [119904 119890] Consider Figure 2 as an examplewhere 119863 = 119886 119887 119888 119889 119890 119891 119892 ℎ and 119896 = 1 The outputof the query is the set of tuples ⟨119886 [119904 119904

1]⟩ ⟨119888 [119904

1 1199042]⟩

⟨119891 [1199042 1199043]⟩ and ⟨ℎ [119904

3 119890]⟩ Tuple ⟨119886 [119904 119904

1]⟩ indicates

that 119886 is the 119896NN(119902) (119896 = 1) for interval [119904 1199041] and so on

We then can define the continuous 119896 nearest neighbor searchproblem as below

Definition 2 (C119896NN search problem) Given a line segment[119904 119890] and an integer 119896 for any data object 119901 if 119900

119896isin

C119896NN([119904 119890]) is one of the 119896 nearest neighbor then for anyobject 1199001015840 isin (119863-C119896NN([119904 119890])) dist(119901 119900

1015840

) ge dist(119901 119900119896)

32 Voronoi Diagram Using Voronoi diagram (VD) forC119896NN search is proposed in the pull-based approach [7]Consider a set 119875 of 119899 distinct data points called sites inthe plane The Voronoi diagram of 119875 denoted by VD(119875) isdefined as the subdivision of the plane into 119899 cells one foreach site in 119875 and each cell corresponding to a site 119901 isin 119875 isdefined to be the area of all points in the plane closer to119901 thanto any other point in 119875 Figure 3 shows the Voronoi diagramof 16 data points 119901

1 1199012 119901

16in the plane Actually the

boundary between two points is the perpendicular bisectorof those two points The method proposed in [7] uses thecharacteristics of the perpendicular bisector (the distancesfrom any point on this line to both neighboring pointsare the same) to determine the nearest neighbors of thecurrent query point Let us use Figure 3 as an example Theneach solid line is the perpendicular bisector between twoneighboring data objects Suppose that the solid line witharrows denotes a path for the query point from position 119878

to position 1198631and the dotted line with arrows is the path

from 119878 to 1198632 For the path from 119878 to 119863

1 it is very easy to

determine the answer set of the continuous nearest neighborsusing Voronoi diagram and 119901

9 1199018 11990111

11990112

11990110

is the resultOn the other hand for the dotted path from 119878 to119863

2 since the

query does not move to another Voronoi cell the answer setof continuous nearest neighbor is always 119901

9

p16

p2p1

p3

p4 p5p6

p7 p8

p10

p11

p12

p13p14

p15

p9

D1

D2

s

Figure 3 A continuous nearest neighbor search example usingVoronoi diagram

Using the Voronoi diagram one can easily find the NNfor a query point To find the 119896NN for an arbitrary 119896 gt 1we can extend the concept of Voronoi diagram to have theorder-119896 Voronoi diagram [24] Using the order-119896 Voronoidiagram one can find the 119896NN for a query point by locatingthe query point in some order-119896 Voronoi cell Patroumpas etal proposed a method [25] which approximates the order-119896Voronoi cells by limited data objects to support continuous119896 nearest neighbor query Figure 4 shows the process ofconstructing an approximate order-3 Voronoi cell Before theconstruction all the 119896 nearest neighbors are known Initiallythe system assumes that approximate cell VC1015840 containing 119902

is equal to the entire universe of interest where any possiblelocation is being recorded The system regards query point119902 as the center point divides the whole region into eightquadrants and finds the 3NN(119902) = 119899

1 1198992 1198993 as shown in

Figure 4(a) For each closest point 119898119894to 119902 in each quadrant

the system delineates all its 119896 bisectors with the 119896NN pointsand then produces the approximate order-119896 Voronoi cell ofthe 119896NN point with respect to 119902 But for reducing processingcost even further the system chooses bisector 119887

119894that is closest

to 119902 and thus bounds the cell most tightly (Figure 4(b))Accordingly by taking the most restrictive bisector 119887

119894for

each quadrant in counter-clockwise order the system cangradually crop entire universe and obtain the approximateorder-119896 Voronoi cell VC1015840 as shown from Figures 4(b) to 4(i)The gray region in Figure 4(i) is the resulting approximateorder-3 Voronoi cell No matter the query moves in thisregion 3NN(119902) = 119899

1 1198992 1198993

33 Safe-Time In the wireless sensor network the idea ofsafe-time is proposed by Kim et al [5] This method firstassumes that there is a maximum speed MaxSpeed of eachobject in the environment and then uses DI119896NN algorithm[23] to find the initial 119896 nearest neighbors As Figure 5 showsthe user located at 119878 issues a query with 119902 as the centerpoint of this query The system will first inquiry object 119899

119901

the nearest neighbor of the query point 119902 Then the processsearches the initial 119896NN counter-clockwise on the concentric

International Journal of Distributed Sensor Networks 5

n1

n2n3

q120579

(a)

n1b1

b9984001 b9984009984001

n2n3

q

m1

(b)

n1

b1

n2n3

q

m1

(c)

n1

n2n3

q

m1

m3

b1

b3

(d)

n1b1

b4 b3

n2n3

q

m1m4

m3

(e)

n1b1

b5 b4 b3

n2n3

q

m4

m5

m3

m1

(f)

n1

b1

b3b4b5

b6

n2n3

q

m1

m6

m5

m4

m3

(g)

n1b1

b6

b7

b5 b4 b3

n2n3

q

m3

m1m4

m5

m6 m7

(h)

n1

b1

b6

b7

b8

b5 b4 b3

n2n3

q

m3

m1m4

m5

m6

m8

m7

(i)

Figure 4 The construction of an approximate order-3 Voronoi cell where 119902 is the query point

Q-node

D-node

Itinerary

(a)

s

q

np

w

(b)

Figure 5 The 119896NN search on WSNs (a) Q-node is the first object receiving the query and D-node is the sink node which is responsible forcollecting data and (b) presents the multihops routing path for the 119896NN process

6 International Journal of Distributed Sensor Networks

A 3-nearest neighbor at t0Not a 3-nearest neighbor at t0

CDk = 3

q1

q1 o1

o1 o2

o2

o3

o3

o4

o4

o5

o5

CD2Broadcast range

New CD

t = t0 + ST

(a)

(b)

t = t0

(c)

o1

o2

o3o4

o5

CDq1

CD2

Figure 6 Update process using safe-time for 3NN search on WSNs (a) shows the CD between the third and fourth closest data points (b)presents the maximum influenced distance for update using broadcast (c) indicates the area for broadcasting to update

circles incremental with an distance 119908 The query message isforwarded in hop by hop manner as shown in Figure 5(b)Finally the system can obtain the initial 119896NN from the lastobject which finished the query processing and derive thedistance cross-distance (CD) between the 119896th and (119896 + 1)thnearest neighbors As Figure 6(a) shows the system then cancompute a safe time = CD(2 lowast MaxSpeed) by the cross-distance between the 119896th and (119896 + 1)th nearest neighborsThis indicates that the system ensures that the order of 119896thand (119896 + 1)th nearest neighbors will not exchange in the safe-time periodThus the resulting 119896NNdoes not need to updateIn addition the maximum moving distance of each objectis limited in the safe-time so we can predict the maximuminfluenced region after the movement of 119896th and (119896 + 1)thnearest neighbors as shown in Figures 6(b) and 6(c) to obtainthe safe region (the dark rings in the figure) The system willignore the objects which locate outside the safe region thusreducing the cost of updating each objectrsquos information

34 Performance Metrics In order to evaluate the proposedDC119896NN approach we consider the following performancemetrics including update cost number of messages accuracyand response time

341 Update Cost The update cost is to measure the numberof updates during the query process We sometimes use thefrequency to denote it Since the sensors (objects) and eventhe query will move the status of the sensors should bemaintained in order to have the accurate results However thecost for one update is high in the distributed environmentHence one of the objectives of the designed algorithmDC119896NN is to minimize the update cost for the C119896NN query

342 Number ofMessages Except for the number of updatesthere are some other kinds of messages for the queryprocess in the distributed andmobile environment includingthe messages for query and information passing The totalnumber of messages used during the query process can be

used to indicate the throughput over the networks and theenergy consumption So the proposed DC119896NN is towardsminimizing the total number of messages for the query

343 Accuracy By using the pull-based approach the timeinterval for routing updatemessages to the server depends onthe distance between the data object and the server It thus cannot ensure that the location information of each object savedin the server is the latest Hence the results may be timelyincorrect when deriving the answers for a query due to themobilityThis situation becomes worse in the distributed andmobile environments In our design the proposed approachcan avoid redundant updates and keep the accuracy of theresults

344 Response Time The complicated query process thedelay time for message communication and the numberof users will affect the response time of the system toprocess the query Long response time is unbearable andmayreturn obsoletely invalid query results Even worse the longresponse time may cause important information missing orfinancial loss Thus the system response time is also one ofthe important issues that must be considered when designingthe method for continuous queries

4 Distributed Continuous 119896 NearestNeighbors Search

In the mobile and distributed environments like WSNs orMANETS the pull-based approach may not be a goodmatchfor C119896NN search due to the problems discussed in Section 2We thus propose a distributed algorithm DC119896NN for C119896NNsearch in the mobile and distributed environments Thedistributed approach using a better safe-time can reduce theupdate cost relieve the load for server shorten the responsetime and make the result more accurate There are threephases in DC119896NN initialization phase query processingphase and information update phase In the initialization

International Journal of Distributed Sensor Networks 7

query DC119896NN search()(1) broadcast a query 119902(119896 ℎ119900119901119888) ℎ119900119901119888 is initial to 1(2) get the Voronoi cells or objectrsquos information(3) if (119896 = 1) then(4) show LVC(5) find 119904119886119891119890119905119894119898119890 of DC1NN (with LVC)(6) elseif (119896 gt 1) then(7) while the received information is insufficient do(8) broadcast the query 119902(119896 ℎ119900119901119888 + 1) to ask more hops of neighbor nodes(9) run normal 119896NNSearch to find 119896NN set(10) show LVC according to 119896NNset and 119868119899119891119900(11) find 119904119886119891119890119905119894119898119890 of DC119896NN (with LVC)(12)while (119904119886119891119890119905119894119898119890 = 0)(13) wait

Algorithm 1 The DC119896NN algorithm on the query (sink) node

phase each moving object exchanges the location informa-tion and builds a local Voronoi cell (LVC) as well as calculatesthe safe time for the LVC The query processing phasecollects sufficient location and environmental informationof neighboring neighbors for exploring the result of thegiven C119896NN query The last information update phase is tomaintain the latest information for the moving objects andthe result of the continuous 119896 nearest neighbor query Thefollowing will explain each phase in details

41 Phase 1 Initialization (119896=1) During system initializationeach mobile sensor (moving object) exchanges locationinformation with its neighbors derives the local Voronoi cell(LVC) calculates the safe time of LVC and then stores theLVC and safe time in the memory

When a user issues an NN query 119876 and broadcasts thequery message 119902(119896 ℎ119900119901119888) (case 119896 = 1) where 119896 is the numberof the nearest neighbors the query wants to find and ℎ119900119901119888

is the hop counter and sets to one initially When the querypoint 119876rsquos neighboring objects receive the query message119902(119896 ℎ119900119901119888) they will determine whether 119876 is located in theirVoronoi Cells (VCs) If a neighboring object replies true itmeans that this neighboring object is the nearest neighbor ofthe query point 119876 and this neighboring object will transmitthe Voronoi cell (VC) information of itself to the query point119876 including the neighboring object boundaries locationdirection and speed of movement and some environmentalinformation On the other hand if a neighboring objectreturns false this neighboring object will check whetherquery point119876moves towards it or not If the query point119876 ismoving towards a neighboring object then this neighboringobject also will send its VC information to the 119876 otherwisethe query message will be ignored After the initializationphase eachmoving object will maintain the LVC informationand safe time The update process will be executed for thelatest LVC information only when the safe time decreases tozero Assume that each object has 119889 neighbors in averageSince the bisector between two objects costs 119874(1) time theLVC construction (Initialization phase) can be finished in119874(119889) time

42 Phase 2 C119896NN Query Processing The pseudocodeQuery DC119896NN Search() in Algorithm 1 shows the wholequery process on the query point The operations fromLine 6 to the end of Query DC119896NN Search() do the queryprocessing of C119896NN (119896 gt 1) When a query point119876 wants tofind the 119896 nearest neighbors where 119896 gt 1 119876 first broadcastsmessages 119902(119896 ℎ119900119901119888) (case 119896 gt 1) and gets the local Voronoicell (LVC) information from the nearest neighboring (NN)object The nearest neighboring object of 119876 is responsiblefor routing messages to its neighboring objects collectingthe local Voronoi cell (LVC) information of the neighboringobjects and sending information back to query point 119876Basically if the received information is insufficient to derivethe 119896NN answer the query point 119876 will repeatedly sends thequery message 119902 with one more hop (ie ℎ119900119901119888 = ℎ119900119901119888 + 1) tothe specific neighboring objects to obtain more neighboringVC information until the received information is enough toget 119896NN answer

When the received information is enough to derive theresults of 119896NN the query point 119876 will use the approximatemethod we modified from [25] to calculate the approximateorder-119896 LVC in which the query point 119876 locates By usingthe modified method the query point 119876 has to partitionthe plane into 120582 equal sectors and selects an additionalnearest neighboring object in each sector excluded from119896NN objects Thus the query point 119876 needs to collect atleast 119896 + 120582 neighboring objectsrsquo information to build theapproximate order-119896 LVC Note that the information of theadditional 120582 objects can be learned from the informationof the received neighboring objects In comparison with thecentralized approach for constructing the approximate order-119896 Voronoi cell the modified approximate method only needsto consider the 119896nearest neighboring objects and120582 additionalnearest neighboring objects instead of considering all objectsin the wireless environment The computation time is thusmuch better than the traditional centralized approach andcan be derived as119874(120582) + 119874(120582) times 119874(119896) = 119874(120582(119896 + 1)) where119874(120582) is the time for selecting the 120582 additional neighboringobjects In the end 119874(120582119896) is the time for determining theboundary of the approximate order-119896 LVC For more detailsabout the analysis of the computation time please refer to

8 International Journal of Distributed Sensor Networks

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

(a)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q

(b)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q

(c)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q

(d)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

q

(e)

Figure 7 An example of DCNN where (a) each sensor exchanges information in the initial step (b) each sensor builds its LVC (c) a queryat object 119902 is issued and sensor 119900

1returns the information of its LVC to 119902 since 119902 is located in the Voronoi cell associated with 119900

1 (d) object

119902 knows which sensor will be reached next and can derive the safe time by the LVC information of 1199001 and (e) the query result to 119902 can be

updated seamlessly when it moves to 1199006

[25] After the query point 119876 calculates the approximateorder-119896 LVC a safe time of the query 119902 can be derived Thesafe time of the query 119902 is regarded as the time limit forstarting the next location information updating process andupdating the C119896NN answer

Figure 7 gives an example for the case of 119896 = 1 Asshown in Figure 7(a) there are 16moving sensors 119900

1 119900

16

in the system and each sensor has the location informationabout itself In the initial phase each sensor broadcasts themessage with its location information and receives the loca-tion information from its neighbors The local Voronoi cell(LVC) of each sensor then can be calculated and stored Theoverall calculatedVoronoi diagram is depicted in Figure 7(b)Afterwards if the locations of the sensors change as movingeach sensor will broadcast new location information to itsneighbors and each sensor can derive a new LVC by thereceived updating messages In Figure 7(c) a continuous NNquery is issued by some query object 119902 with its locationIn order to know the Voronoi cell where 119902 locates 119902 firstbroadcasts the query message to the neighboring sensors(in dashed circle) After receiving the query message theneighboring sensor will check whether the query 119902 is locatedin its associated cell If 119902 is not in the cell the sensor willignore the querymessage In Figure 7(c) sensor 119900

1will return

the result to the query 119902 saying that object 1199001is the nearest

neighbor of 119902 for the time being If 119902 moves in the directionas indicated by the solid arrow in Figure 7(d) to object 119900

6

119902 can know that it moves towards the boundary of 1199001and

1199006by the LVC stored in 119900

6and then derive the safe time

When approaching the boundary (ie the safe time is almostpassed) a query message to 119900

6will be issued by 119902 in advance

Sensor 1199006will reply to 119902with the cell information to maintain

the accuracy of the query result Figure 7(e) shows the resultafter 119902moves into the associated cell of sensor 119900

6

Figure 8 demonstrates an example of DC119896NN for 119896 gt

1 The initial phase is the same as the previous DCNNexample Each sensor derives the corresponding LVC withthe information from the neighboring sensors The queryis issued by a moving object 119902 with its location Object 119902

locates itself and knows that it is in the VC of 1199001after sensor

1199001replies to 119902 with its LVC information Suppose 119896 = 3

After the initialization 119902 is located in 1199001and has the LVC

information of 1199001 Having such information 119902 can derive the

NN but 3NN cannot be decided yet So 119902 will broadcast thequery message to all of its one-hop neighboring sensors say1199001 1199002 1199003 1199008 and 119900

9in Figure 8(a) to request information

The neighboring sensors will reply to 119902 the information abouttheir LVCs Object 119902 then can derive the resulting 3NN forthe time being say 119900

1 1199008 and 119900

9in the example With

these replied information 119902 can build the approximate order-3 Voronoi cell as shown in Figure 8(b) Then 119902 uses theapproximate order-3 Voronoi cell to derive the safe time inorder to maintain the continuous query result Now if 119896 =

10 the information received from the one-hop neighboringsensors is not enough to derive the result Then the querymessage will be broadcast to 119902rsquos two-hop neighboring sensorsas Figure 8(c) shows If the information is not enough toderive the resulting 119896NN the querymessagewill be broadcast

International Journal of Distributed Sensor Networks 9

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q n1n2

n3

n4(k + 1)

(a)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5qn1

n2

n3

(b)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o3o4

o5q

o9

o2

(c)

o1

o6

o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q

n11(k + 1)

n1

n4n5

n6

n10

n7

n8

n2n9

n3

(d)

o1

o6

o7

o8

o11o10

o12

o13o14o15

o16o9

o2 o3o4

o5q n1n2

n4n5

n6

n7

n3

n9n10

n8

(e)

Figure 8 An example of DC119896NN for 119896 gt 1 where the initialization phase is the same as previous DCNN example and (a) 1199001 1199008 and 119900

9are

the 3NN to the query object 119902 (b) the approximate order-3 Voronoi cell can be built with enough information received (c) the information isnot enough for 10NN query and two-hop neighboring sensors are requested (d) the resulting 10NN can be derived and (e) the approximateorder-10 Voronoi cell can be calculated with information received

to one more hop neighboring sensor Such process will berepeated with an increment on the hop count After havingenough information 119902 can calculate the resulting 10NN andthe approximate order-10 Voronoi cell as shown in Figures8(d) and 8(e) respectively Using the approximate order-10Voronoi cell the safe time can be derived In the followingwe will discuss how to derive the safe time for maintainingthe result of the continuous 119896NN query

43 Phase 3 Information Updates In the distributed andmobile environments it is challenging for a mobile nodeto maintain the location information of the other mobilenodes effectively If a mobile node sends the update messagesfrequently it will consume much network resource andpower Furthermore the result of themoving query should beeffectively maintained For different roles nodes and querywe propose effective ways respectively in our DC119896NN queryprocess to update the location information and maintain thequery result

431 The Safe Time of Each Object In the proposed appro-ach DC119896NN each object cooperates with each other andexchanges information to update the location information ofeach object In order to monitor and obtain the continuousanswer of a continuous 119896 nearest neighbors query we usea safe distance between each object and query Then wecan derive the safe time of each object for location updatesby estimating the maximum speed of that object Supposethat the sensing area is partitioned into a grid for location

management There are three possible methods for derivingthe safe distance The first one is the grid-based safe distanceEach object directly uses the minimum distance betweenitself and the boundary of the grid cell where the objectlocates Simply using the grid-based safe distance may causesome problems about the imprecise updates The secondmethod VD-based safe distance uses VD to obtain the safedistance In order to predict the safe distance more preciselywe can consider the previous two distances simultaneouslyand then select the smaller one So the last method propersafe distance will return a better safe distance by comparisonsHaving the safe distance the safe time then can be derived byestimating the maximum speed of the considered object

In Figure 9 the sensing area is divided into a grid andthe Voronoi diagram formed by the sensors is also shownFor sensor 119900

1in Figure 9(a) the grid-based safe distance and

VD-based safe distance are presented respectively and theproper safe distance will be the VD-based safe distance afterthe comparison On the contrary for sensor 119900

3in Figure 9(b)

the proper safe distance will be the grid-based safe distance

432The Safe Time of EachQuery For themoving query it isimportant to know when the result will change To derive thesafe time during which the result will not change we referto the characteristics of Voronoi diagram In the traditionalenvironment with static objects the system only uses theminimum distance from the query to the boundary of theVoronoi cell where the query locates as the safe distance Thethe safe time can be obtained by the estimated maximum

10 International Journal of Distributed Sensor Networks

o1

o7

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

o6o8

(a)

o1

o7

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

o6o8

(b)

Figure 9 An illustration for different safe distances (a) sensor 1199001uses the VD-based safe distance as the proper safe distance and (b) sensor

1199003uses the grid-based safe distance as the proper safe distance

L L

A

B

Safe distance

Query

B

A

120579

New safe distance

QueryA998400

L998400

B998400

Figure 10 An example showing the impact on the safe distancecaused by object movement

speed of that query During the safe time no update isnecessary thus saving the update cost

Unfortunately in the moving object environment theabove method cannot obtain the right safe time As shownin Figure 10 the left part shows the static case where 119871 is theVoronoi cell boundary between objects 119860 and 119861 and the safedistance of the query can be calculated as the figure showsHowever for the moving objects the original safe distancebetween the 119871 and query cannot be directly used to calculatethe safe time because the object movement will cause thedistance form query to 119871 to be nonlinearly increasing ordecreasing As the right part of Figure 10 shows after themovement of object 119860 and object 119861 119871 becomes 119871

1015840 and thesafe distance changes Thus if we want to use the boundariesof Voronoi cell to estimate more accurate safe time we needto consider the relative movements between the objects andquery

In order to derive the precise safe distance we considerthe movements of objects and query simultaneously and useFigure 11 to illustrate Initially 119876119860 and 119876119861 are the distancesfrom the query to objects 119860 and 119861 respectively The linebetween 119860 and 119861 is the boundary of the Voronoi cellsassociated with 119860 and 119861 and the query is located in thecell of 119860 as Figure 11(a) shows When objects and the querymove as in Figure 11(b) the query may touch the boundaryThis indicates that the query will enter another cell and theresult of the query should be updated The time from thebeginning to the moment of touching the boundary is theprecise safe time for the query According to the properties

of Voronoi diagram when the query is on the boundary119876119860 = 119876119861 We hence can use the condition of 119876119860 = 119876119861

to decide whether the query is on the boundary With thisproperty even though the objects and querymove frequentlythe query only needs the speeds directions and locationsof the neighboring objects to predict the safe time easilyWithin the safe time the query will not touch the boundaryIn Figure 11(c) the query meets the boundary at 119905

1and the

safe time is 1199051

In the following we present the way to calculate the safetime when 119876119860 = 119876119861 Assume that the initial location of themoving query is (119909

119902 119910119902) and the speed is (119881

119909119902 119881119910119902

) Supposethe initial location of object 119860(119861) is (119909

119860 119910119860)((119909119861 119910119861)) with

the speed being (119881119909119860

119881119910119860

)((119881119909119861

119881119910119861

)) The equation to findwhen the querymeets the boundary can be derived accordingto the property of perpendicular bisector Since119876119860 = 119876119861 wecan have

([(119909119902+ 119881119909119902

lowast 119905) minus (119909119860

+ 119881119909119860

lowast 119905)]2

+[(119910119902+ 119881119910119902

lowast 119905) minus (119910119860

+ 119881119910119860

lowast 119905)]2

)

12

= ([(119909119902+ 119881119909119902

lowast 119905) minus (119909119861

+ 119881119909119861

lowast 119905)]2

+[(119910119902+ 119881119910119902

lowast 119905) minus (119910119861

+ 119881119910119861

lowast 119905)]2

)

12

(1)

Then

0 = [1198812

119909119860

+ 1198812

119910119860

minus 1198812

119909119861

minus 1198812

119910119861

minus 2 lowast 119881119909119902

119881119909119860

minus2 lowast 119881119910119902

119881119910119860

+ 2 lowast 119881119909119902

119881119909119861

+ 2 lowast 119881119910119902

119881119910119861

] lowast 1199052

+ 2 [(119909119902minus 119909119860) (119881119909119902

minus 119881119909119860

) + (119910119902minus 119910119860) (119881119910119902

minus 119881119910119860

)

minus (119909119902minus119909119861) (119881119909119902

minus119881119909119861

) minus (119910119902minus119910119861) (119881119910119902

minus119881119910119861

)] lowast 119905

+ [(119909119902minus 119909119860)2

+ (119910119902minus 119910119860)2

minus (119909119902minus 119909119861)2

minus (119910119902minus119910119861)2

]

(2)

International Journal of Distributed Sensor Networks 11

A

B

Query

(x3 y3)

(x2 y2) (x1 y1)QA

QB

(Vx2 Vy2)

(Vx3 Vy3)

(Vx1 Vy1)

(a)

A

B

Query

(x3 y3)

(x2 y2)(x1 y1)

QA

QB

(Vx2 Vy2)

(Vx3 Vy3)

(Vx1 Vy1)

(b)

A

B

d

t1 t2 t3 t

(c)

Figure 11 The precise safe-time for moving objects 119860 and 119861 and the moving query where (a) shows the beginning state (b) presents themoment when the moving query meets the boundary and (c) gives the diagram for the change on the safe distance with time 119905

o1

o2

o3o4

o5

CDq1

CD2

(a)

o1

o2

o3o4

o5

CDq1

CD2

q9984001

(b)

Figure 12 The phenomenon when using the original safe-time methods to (a) stationary query and (b) moving query

Equation (2) is a quadratic equation Since a generalquadratic equation can be written in the following form1198861199092

+ 119887119909 + 119888 = 0 recall that the discriminant of a quadraticequation is Δ = 119887

2

minus 4119886119888 If Δ gt 0 there are two distinct realroots if Δ = 0 there is exactly one real root if Δ lt 0 thereare two distinct (non-real) complex roots In (2)

119886 = 1198812

119909119860

+ 1198812

119910119860

minus 1198812

119909119861

minus 1198812

119910119861

minus 2 lowast 119881119909119902

119881119909119860

minus 2 lowast 119881119910119902

119881119910119860

+ 2 lowast 119881119909119902

119881119909119861

+ 2 lowast 119881119910119902

119881119910119861

119887 = 2 [(119909119902minus 119909119860) (119881119909119902

minus 119881119909119860

) + (119910119902minus 119910119860) (119881119910119902

minus 119881119910119860

)

minus (119909119902minus 119909119861) (119881119909119902

minus 119881119909119861

) minus (119910119902minus 119910119861) (119881119910119902

minus 119881119910119861

)]

119888 = (119909119902minus 119909119860)2

+ (119910119902minus 119910119860)2

minus (119909119902minus 119909119861)2

minus (119910119902minus 119910119861)2

(3)

and then we can derive the safe time 119905 according to thediscriminant

119905 =

[minus119887 + (1198872

minus 4119886119888)12

]

2119886or

[minus119887 minus (1198872

minus 4119886119888)12

]

2119886

(4)

Finally we select the minimum value of 119905 gt 0 as the safetime

Additionally assuming that 119889 is the distance between theobject and the query and 119905 is the time 119876119860 = 119876119861 can be

converted into a function of 119905 and 119889 as shown in Figure 11(c)Then we can obtain the safe time 119905

1which is the time when

119876119860 = 119876119861 Furthermore the object 119861 will be closest to thequery at the time 119905

3

5 Comparisons with Previous Approaches

In this section we compare the proposed DC119896NN approachthe Safe-time with stationary query approach [5] and thenaıve way used pull-based approach in terms of safe timespace and accuracy

51 Safe Time The original safe-time with stationary query[5] (safe-time(S)) does not support moving queries Anexample of C3NN is shown in Figure 12 where 119902

1is the query

point triangles are the 3NN objects the pentagons representthe other individual objects and 119900

4is 4th NN Figure 12(a)

shows the original result for safe-time(S) After obtaining the119896th and (119896 + 1)th objects (119900

2and 1199004in the figure) the cross-

distance (CD) of 119896th and (119896 + 1)th objects can be calculatedRecall that the cross distance of two data objects 119860 and 119861 isthe difference on the distances of119860 and119861 to the center (or thequery point) For the next update (after a safe-time period)all the objects in this region should be checked

We adapt the safe-time(S) method for moving queryThe adapted approach will result in a higher update cost

12 International Journal of Distributed Sensor Networks

Figure 12(b) presents a case that the query moves towardobject 119900

3(119896th NN) and away from object 119900

4((119896 + 1)th NN)

When the query 1199021moves to the point 1199021015840

1 the most outside

concentric circle increases and becomes as large as the mostoutside dotted concentric circle On the contrary the mostinside concentric circle decreases and becomes as small as themost inside dotted concentric circle Thus the cross-distanceincreases and more number of objects will be examined

In addition according to the Figure 12(b) we can knowthat the original Safe-time method safe-time(S) is notappropriate for moving queries since the calculation of Safe-time(S) method does not consider the speed of query safe-time(S) directly uses twofold of the maximum speed of the119896th and (119896+1)thNNobjects to divide theCD to derive the safetime The cost for updates increases when the CD becomeslarger since the average checked area becomes bigger Besidesthe obtained 119896NNanswer cannot be guaranteed to be correctOn the contrary the cross-distance when the query movestowards object 119900

4((119896 + 1)th NN) and away from object 119900

3

(119896th NN) in this case the order of the 119896th and (119896 + 1)th NNobjectmay be changed but the update does not perform thusresulting in incorrect results

We modify the Safe-time to fully support the movingquery In order to support and maintain the accuracy ofmoving query the maximum speed (Maxspeed) used in thesafe time calculation is required to be modified and replacedby the maximum relative speed between the query and theobjects Because of using the relative speed the adaptedsafe-time method safe-time(M) needs twofold maximumrelative speed (2 lowast 119872119886119909119904119901119890119890119889) to calculate the safe time forguaranteeing the accurate resultsThe safe time derived is lessthan the one derived in safe-time(S) due to the relative speedHence the update frequency of safe-time(M) is higher thanthe update frequency of safe-time(S)

52 Space In DC119896NN each object and query only need tomaintain the information of LVC The information to bestored includes the location of neighboring objects and theobject information of order-119896rsquos local Voronoi diagram Thetotal amount of stored information is not significant on eachobjectThus the use of storage space does not need to be verysubstantial

53 Accuracy The safe-time (S) [5] considers the stationaryquery When applying it to the moving query some adaptionshould bemade According to our experimental results whenthe value of 119896 increases with a moving query the accuracy ofthe result will be reduced In our simulation we modify theoriginal Safe-time(S) as Safe time(M) for moving query andconsider the relative distance in detail caused by the movingquery and objects Although the correctness of the answer canbe increased the update frequency increases thus increasingthe number of delivered messages

DC119896NNuses Voronoi and grid cell boundary to calculatethe safe time and updates the information of related objectsbefore the end of the safe time In fact the boundary ofthe Voronoi cell represents the boundary of moving 119896NNquery After the safe time period the query will collect the

information of related neighboring objects Having such real-time information the query can have the resultmore accuratein time Similar to safe-time(M) DC119896NN uses the 119896th and(119896 + 1)th nearest moving objects to derive the safe time So itis able to maintain the correctness of the answer

6 Simulation Experiments

In the simulation we compare the following methods NaıveDC119896NN safe-time (S) and safe-time (M)TheNaıvemethodis centralized and used as a benchmark for the comparisonAll the mobile sensors will send the location informationto the central server to update the information The othermethods DC119896NN Safe-time(S) and Safe-time(M) are dis-tributed and used in the considered mobile wireless sensornetwork where each object knows its position has the abilityto perform some calculation and stores the information oflocalized Voronoi cell (LVC)We assume that each object cantransmit amessage to its one-hopneighbor so that each objectcan communicate with at least one object For Safe-time(S)and the safe-time(M) a maximum speed (MaxSpeed) is setin order to estimate relative speed and distance for safe-timecalculation

In the simulation all the compared approaches areperformed under the same environmental conditions forfairness The initial location and speed of moving objectsare uniformly randomly distributed Since we focus on theperformance of the query process of the proposed DC119896NNapproach we further assume that the transmission quality isideal and no congestion and communication delays occurThe metrics measured include the update frequency for aquery the total number of messages response time andaccuracy The update frequency for a query is the averagenumber of update messages sent by the data objects relatedto the query per minute The total number of messages isall the amount of messages sent from all objects during thequery process The accuracy of each method is measuredby comparing the results to the real answers Since thequery is continuous and the update occurs subsequently themeasured response time is mainly the time required fromsending a query to obtaining the first result

All the experiments are simulated so the results aboutthe response time may not show the practical cases exactlybut can reflect the trends on the performance among all thecompared approaches relatively In order to have the responsetime in our simulation we thus use the total number of hopsfor deriving the result tomultiply the average time for one hopin the simulation system to present the response time Thusthe response time is proportional to the total number of hopsin our simulation program In addition because the maindifference between Safe-time(S) and the Safe-time(M) is theway for deriving the safe time the measured response timeof these two methods is the same The simulation programis implemented with Java The setting of our simulation isshown in Table 1 with a default value for each parameter Inall the simulation experiments the final results are reportedwith the average of 100 queries The duration of each query is60 seconds

International Journal of Distributed Sensor Networks 13

200 400 600 800 10000

10

20

30

40

50

60

Edge length of sensing area (m)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

200 400 600 800 10000

100

200

300

400

500

600

700

Edge length of sensing area (m)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

200 400 600 800 100075

80

85

90

95

100

105

Edge length of sensing area (m)

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

200 400 600 800 1000Edge length of sensing area (m)

Aver

age r

espo

nse t

ime (

s)

DCkNNSafe-time(S)Safe-time(M)

095

1

105

11

(d) Response time

Figure 13 The effects of different sensing areas on (a) update frequency (b) number of messages (c) accuracy and (d) response time

Table 1 Simulation parameters

Parameter Range Default valueEdge length of sensingarea (m) 200 400 600 800 1000 600

Edge length of grid (m) 50 100 150 50Number of objects 20 30 40 50 60 30Transmission range (m) 125 125119896 1 3 5 10 20 3Moving objects () 20 40 60 80 100 20Speed (ms) 2 4 6 8 10 4

61 Effects of Sensing Area Sensing area affects the numberof update and query messages since if the area becomes

greater with the fixed number of objects relatively thedensity of the objects becomes sparse For example when thesensing areas are 200lowast200 400lowast400 600lowast600 800lowast800 and1000lowast1000 the densities are 188 047 021 012 and 008respectively Figure 13(a) shows that DC119896NN has the lowestnumber of updates with all the different areas and the numberof updates for Safe-time(S) is the highest (worst) becauseDC119896NN considers the moving direction and speed of thequeries and objects and selects the proper safe-distance toderive the safe-time Safe-time(S) the Safe-time(M) estimatethe safe time according to the maximum speed of the objectsso more number of updates can be expected AdditionallySafe-time(M) is updated more frequently than Safe-time(S)Recall that Safe-time(M) considers the query movement

14 International Journal of Distributed Sensor Networks

50 75 100 150 2000

5

10

15

20

25

Edge length of grid (m)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

50 75 100 150 2000

50

100

150

200

250

300

350

Edge length of grid (m)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

50 75 100 150 2000

20

40

60

80

100

120

Edge length of grid (m)

Accu

racy

()

DCkNN(G)DCkNN(V)

(c) Accuracy

50 75 100 150 2001

101

102

103

104

105

106

Edge length of grid (m)

Aver

age r

espo

nse t

ime (

s)

DCkNN(G)DCkNN(V)

(d) Response time

Figure 14 The comparisons of using grid-based and VD-base safe distances to derive the safe-time (a) update frequency (b) number ofmessages (c) accuracy and (d) response time

The average safe-distance becomes shorter thus leading tomore updates Besides when the sensing area increasesfrom 200lowast200 to 600lowast600 the update frequency dropsdramaticallyThe curve becomes flatter when the area is from600lowast600 to 1000lowast1000 since the difference on the densitiesof the areas from 600lowast600 to 1000lowast1000 is not much Thenumber of updates is less as the safe-time becomes largerThetotal number of transmitted messages of naıve approach isfixed at about 1800 packets All the other distributedmethodsuse fewer number of messages than naıve

To monitor the results DC119896NN only needs to check therelated objects in the local Voronoi cell at the proper safe-time thus reducing a lot of redundant update messages Safe-time(S) and Safe-time(M) use the maximum speed of theobjects to calculate the safe time so the total number of

transmitted messages of both approaches is more than that ofDC119896NN Figure 13(b) shows that more than 30 of the totalnumber of transmitted messages can be saved by DC119896NN incomparison with Safe-time(M)

For the accuracy since Safe-time(S) does not considerthe query movement the safe-time may be inaccurate Fur-thermore due to the mobility when the density is high theestimated results become more inaccurate So Safe-time(S)performs worst as shown in Figure 13(c) Safe-time(M) isrevised from Safe-time(S) by considering the query move-ment and the safe-distance is less in average for guaranteeingbetter results Hence Safe-time(M) has a better accuracy andalmost the same as DC119896NN The accuracy of Safe-time(M)and DC119896NN is almost about 100 correct and the gap maybe caused by arithmetical errors in the experiments

International Journal of Distributed Sensor Networks 15

10 20 30 40 50 60 700

5

10

15

20

25

30

35

40

45

Number of objects

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

10 20 30 40 50 60 70100

150

200

250

300

350

400

450

Number of objects

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

10 20 30 40 50 60 7080

85

90

95

100

105

Number of objects

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

10 20 30 40 50 60 70Number of objects

Aver

age r

espo

nse t

ime (

s)

096

098

1

102

104

106

108

11

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 15 The effects of the number of objects on (a) update frequency (b) number of messages (c) accuracy and (d) response time

When the area becomes larger the density becomeslower So the number of objects in each objectrsquos transmissionrange is fewer Under such a circumstance DC119896NN usesless computation and the response time is shorter as shownin Figure 13(d) In contrast the Safe-time(S) and the Safe-time(M) need to collect information before performing eachnew query and cause longer response time Since Safe-time(M) and Safe-time(S) use the same method and proce-dure to handle the first query the response time of these twomethods will be almost the same

62 Effects of Grid Size In this simulation experiment setwe want to observe the update efficiency of each object inthe third phase of DC119896NN Recall that we consider the grid-based and VD-base safe distances to derive a proper safe-time In this experiment DC119896NN(G) uses grid-based safe

distance to determine the safe time for the next update andDC119896NN(V) uses VD-base safe distance to derive the safetime The sensing area is fixed to 600lowast600m2 and there are30 data objects We compare DC119896NN(V) with DC119896NN(G)by observing the impacts of different grid sizes All theother settings have the similar trends in our experimentalresults In Figure 14(a) the update frequency of the objectsin DC119896NN(G) is high when the grid size is 50lowast50m2 andbecomes less when the grid size decreases Since the sensingarea is 600lowast600m2 and 30 objects are given the averagedistance between an object and the boundary of a Voronoicell is about 25 to 50 meters With the setting of grid size50lowast50m2 the average distance obtained in DC119896NN(G) isabout 25 meters Thus the safe time of DC119896NN(V) is longerIn general as Figures 14(a) and 14(b) show the update

16 International Journal of Distributed Sensor Networks

1 3 5 10 200

10

20

30

40

50

60

k

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

1 3 5 10 200

100

200

300

400

500

600

700

800

k

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

1 3 5 10 2080

85

90

95

100

105

k

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

1 3 5 10 20k

Aver

age r

espo

nse t

ime (

s)

08

09

1

11

12

13

14

15

16

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 16 The impacts of different values of 119896 on (a) update frequency (b) number of messages (c) accuracy and (d) response time

frequency of the objects and the number of messages sentby the objects decrease as the grid size increases

When the grid size is large the safe time becomes longand less number of updates are issued Hence the resultsbecome more inaccurate As shown in Figure 14(c) whenthe grid sizes are 50lowast50m2 75lowast75m2 100lowast100m2 and150lowast150m2 the corresponding accuracies are 95 9285 and 78 respectively While the grid size increases to200lowast200m2 the accuracy is significantly reduced to 69and the right answer thus can not be guaranteed On theother hand Figure 14(d) shows that the response times ofDC119896NN(G) and DC119896NN(V) are not much different becausethe size of grid is not the major factor to influence thecomplexity of obtaining information for the first query

63 Number of Objects In this subsection we discuss theresults as the number of data objects varies The area in thepresented experiment set is 600lowast600 (m2) with grid size of50lowast50 (m2) As shown in Figure 15(a) when the number ofobjects increases the number of updates in DC119896NN is stillrelatively less than the ones in Safe-time(S) and Safe-time(M)If the number of objects increases the number of repliedmessages per second to the central server in naıve will growdramatically With 20 to 60 objects the number of repliedmessages to the server is from 1200 to 3600 (packetsmin)By observing the results in Figures 15(b) and 15(c) as moreobjects are in the area the number of messages increasesfor the other three methods and the accuracy reduces inSafe-time(S) These match the trends for different areas we

International Journal of Distributed Sensor Networks 17

20 40 60 80 1000

5

10

15

20

25

30

35

40

45

Moving objects ()

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

20 40 60 80 1000

100

200

300

400

500

600

Moving objects ()

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

20 40 60 80 100

80

70

75

85

90

95

100

105

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

Moving objects ()

(c) Accuracy

20 40 60 80 100

Aver

age r

espo

nse t

ime (

s)

09

095

1

11

105

115

12

125

13

DCkNNSafe-time(S)Safe-time(M)

Moving objects ()

(d) Response time

Figure 17 The effects of the moving objects on (a) update frequency (b) number of messages (c) accuracy and (d) response time

discussed earlier due to the density Similarly the responsetime can be expected as shown in Figure 15(d) where theresponse time of DC119896NN is still the shortest

64 Different Values of 119896 It is obvious that the value of119896 affects the performance of query processing significantlyWhen the value of 119896 becomes larger the number of relatedobjects required to be checked also increases In other wordswe need to spend more cost to find out which 119896 objectsare currently in the result for the C119896NN query Thereforethe changes in the value of 119896 mainly affect the amountof data required for the first query and the update costfor maintaining the 119896th and the (119896 + 1)th objects So inFigure 16(a) when the value of 119896 is large more updates arenecessary for all the three methods As Figure 16(b) shows

the influence on the number of transmitted messages inSafe-time(M) is more serious than the one in Safe-time(S)Due to the mobility the number of influenced objects inSafe-time(M) will increase as the value of 119896 increases Inparticular the update frequency in Safe-time(M) becomesnearly twofold the update frequency in Safe-time(S)

Figure 16(c) presents the impact on the accuracy fordifferent values of 119896 With a larger value of 119896 an object inSafe-time(S) will have a higher chance to derive the incorrectsafe time thus causing lower accuracy When the value of 119896increases the response time of all threemethods will increasesignificantly as shown in Figure 16(d) The reason is thatall DC119896NN Safe-time(S) and Safe-time(M) need to searchmore objects and collect more information for answering thequery when the value of 119896 increases to a certain number For

18 International Journal of Distributed Sensor Networks

2 4 6 8 100

10

20

30

40

50

60

Speed (ms)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

2 4 6 8 100

100

200

300

400

500

600

700

800

Speed (ms)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

2 4 6 8 1070

75

80

85

90

95

100

105

Speed (ms)

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

2 4 6 8 1009

095

1

105

11

115

12

125

13

Speed (ms)

Aver

age r

espo

nse t

ime (

s)

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 18 The impacts of speed on (a) update frequency (b) number of messages (c) accuracy and (d) response time

DC119896NN DC119896NN only needs to store local Voronoi diagramwhere the information required is less than required in Safe-time(S) and Safe-time(M) so the response time of DC119896NN isthe shortest

65 The Effect of Moving Objects In this experiment set weconsider different percentages of moving objects in all thedata objects The default value is 20 which means that ifthere is a total of 30 objects then there are sixmoving objectsIn Figures 17(a) and 17(b) as the percentage ofmoving objectsincreases the overall number of updates required between theobjects increases relatively and the change rate of answer totheDC119896NNaccelerates thus increasing the update frequencyof the query and the number of messages However DC119896NNstill keeps the best performance Figure 17(c) shows the accu-racy of the result for different percentage of moving objectsDC119896NN and Safe-time(M) both have higher accuracy and

Safe-time(S) is still the worst The safe time of each object inSafe-time(S) is calculated using the maximum speed of theobjects Hence whether the object is moving or not does notdirectly result in the incorrectness of the answer collectionIn fact in Safe-time(S) one of the main reasons to affectthe accuracy is the directions of moving objects Last asFigure 17(d) shows the percentage of moving objects doesnot impact the response time too much

66 Effects of Speed If each object moves faster the relativevelocities between objects may also become faster This willmake the safe time shorter and the update frequency ofeach object and query increases The safe time used inSafe-time(S) and Safe-time(M) is directly affected by themaximum speed of objects and does not consider the direc-tion of each objectrsquos movement and the speed of individualmovement No matter the objects move or not and move

International Journal of Distributed Sensor Networks 19

fast or slow both of the above methods directly use themaximum speed of objects to calculate the safe time forupdating On the other hand DC119896NN considers the movingdirection of objects and the proper safe-time for updatesIn this experiment the number of moving objects is 20of all the objects As Figure 18(a) shows as the movingobjects speed up the update cost increases and DC119896NN stillperforms best As the speed increases the safe-time in Safe-time(S) and the Safe-time(M) becomes much shorter due toa larger maximum speed among all the objects The trendbecomes even worse as the speed increases

Figure 18(b) shows the trend about the number of trans-mitted messages when the speed is up DC119896NN still hasthe best performance on the number of messages There are42781 messages sent in average when the speed of object is10ms However the Safe-time(M) needs 67913 messagesThe accuracy will not be effected as the speed changesfor DC119896NN and Safe-time(M) because both of them aredesigned or adapted for themoving objects and queries Safe-time(S) will have more inaccurate results as the speed is highas shown in Figure 18(c) However the response time doesnot have a significant impact on the response time for all thethree methods Figure 18(d) presents this trend

7 Conclusions

In this paper we propose a new approach DC119896NN whichuses the local Voronoi diagram and proper safe-time toeffectively process the C119896NNquery in distributed andmobileenvironments such as wireless sensor networks The propersafe-time can be quickly derived by a simple formulaBy comparing our proposed DC119896NN with other existingapproaches Safe-time(S) DC119896NN can effectively improvesearch efficiency reduce response time and the numberof messages and keep the accuracy of the result highAdditionally DC119896NN reduces more 30 of transmissionmessages than Safe-time(M) because the characteristics of theVoronoi diagram are used and each objectrsquos moving directionis considered instead of directly using the maximum speedof the objects as Safe-time method The derived safe-timeis more precise As a result DC119896NN needs less updatefrequency reduces a great number of messages transmittedand yields more accurate results In this work simulationexperiments are also performed The experimental resultsvalidate the proposed DC119896NN approach for the continuous119896 nearest neighbor query in distributed and mobile environ-ments where all the data objects and query can move

Acknowledgment

This work is partially supported by NSC under the Grant98-2220-E-027-007 100-2221-E-027-087-MY2 and 102-2221-E-027-088-

References

[1] O Bohl S Manouchehri and U Winand ldquoMobile informationsystems for the private everyday liferdquo Mobile InformationSystems vol 3 no 3-4 pp 135ndash152 2007

[2] Y Tao andD Papadias ldquoTime-parameterized queries in spatio-temporal databasesrdquo in Proceedings of the ACM SIGMODInternational Conference on Managment of Data pp 334ndash345June 2002

[3] Y Tao D Papadias and Q Shen ldquoContinuous nearest neighborsearchrdquo in Proceedings of the 28th International Conference onVery Large Data Bases (VLDB rsquo02) pp 287ndash298 2002

[4] F Aurenhammer ldquoVoronoi diagramsmdasha survey of a fundamen-tal geometric data structurerdquo ACM Computing Surveys vol 23no 3 pp 345ndash405 1991

[5] K Kim Y Cai andW Tavanapong ldquoSafe-time distributed real-time monitoring of cKNN in mobile peer-to-peer networksrdquo inProceedings of the 9th IEEE International Conference on MobileData Management (MDM rsquo08) pp 124ndash131 April 2008

[6] M Kolahdouzan and C Shahabi ldquoVoronoi-based k nearest nei-ghbor search for spatial network databasesrdquo in Proceedings ofthe 30th International Conference on Very Large Data Bases vol30 pp 840ndash851 2004

[7] M R Kolahdouzan and C Shahabi ldquoAlternative solutions forcontinuous K nearest neighbor queries in spatial networkdatabasesrdquo GeoInformatica vol 9 no 4 pp 321ndash341 2005

[8] D Papadias Y Tao K Mouratidis and C K Hui ldquoAggregatenearest neighbor queries in spatial databasesrdquo ACM Transac-tions on Database Systems vol 30 no 2 pp 529ndash576 2005

[9] T Imielinski S Viswanathan and B R Badrinath ldquoData on airorganization and accessrdquo IEEE Transactions on Knowledge andData Engineering vol 9 no 3 pp 353ndash372 1997

[10] S Hambrusch C-M Liu and S Prabhakar ldquoBroadcasting andquerying multi-dimensional index trees in a multi-channelenvironmentrdquo Information Systems vol 31 no 8 pp 870ndash8862006

[11] C-M Liu and K-F Lin ldquoDisseminating dependent data inwireless broadcast environmentsrdquo Distributed and ParallelDatabases vol 22 no 1 pp 1ndash25 2007

[12] T-C Su and C-M Liu ldquoOn-demand data broadcasting for dataitems with time constraints on multiple broadcast channelsrdquo inDatabase Systems for Advanced Applications vol 6193 of LectureNotes in Computer Science pp 458ndash469 2010

[13] B Zheng J Xu W-C Lee and D L Lee ldquoGrid-partition ind-ex a hybrid method for nearest-neighbor queries in wirelesslocation-based servicesrdquo The VLDB Journal vol 15 no 1 pp21ndash39 2006

[14] B Gedik A Singh and L Liu ldquoEnergy efficient exact kNN sear-ch in wireless broadcast environmentsrdquo in Proceedings of the12th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo04) pp 137ndash146 November 2004

[15] KMouratidis S Bakiras and D Papadias ldquoContinuousmonit-oring of spatial queries in wireless broadcast environmentsrdquoIEEE Transactions onMobile Computing vol 8 no 10 pp 1297ndash1311 2009

[16] G Chatzimilioudis D Zeinalipour-Yazti W-C Lee and M DDikaiakos ldquoContinuous all k-nearest-neighbor querying insmartphone networksrdquo in Proceedings of the 13th IEEE Interna-tional Conference on Mobile Data Management (MDM rsquo12) pp79ndash88 2012

[17] T-Y Fu W-C Peng and W-C Lee ldquoParallelizing itinerary-basedKNNquery processing inwireless sensor networksrdquo IEEETransactions on Knowledge and Data Engineering vol 22 no 5pp 711ndash729 2010

[18] T P Nghiem A B Waluyo and D Taniar ldquoA pure peer-to-peerapproach for kNNquery processing inmobile ad hoc networksrdquo

20 International Journal of Distributed Sensor Networks

Personal and Ubiquitous Computing vol 17 no 5 pp 973ndash9852013

[19] HD Chon D Agrawal andA El Abbadi ldquoRange and kNNqu-ery processing for moving objects in Grid modelrdquo MobileNetworks and Applications vol 8 no 4 pp 401ndash412 2003

[20] X Xiong M F Mokbel and W G Aref ldquoSEA-CNN scalableprocessing of continuous K-nearest neighbor queries in spatio-temporal databasesrdquo in Proceedings of the 21st InternationalConference on Data Engineering (ICDE rsquo05) pp 643ndash654 April2005

[21] G Zhao K XuanW Rahayu et al ldquoVoronoi-based continuous120581 nearest neighbor search in mobile navigationrdquo IEEE Transac-tions on Industrial Electronics vol 58 no 6 pp 2247ndash2257 2011

[22] KMouratidis D Papadias S Bakiras and Y Tao ldquoA threshold-based algorithm for continuous monitoring of k nearest neigh-borsrdquo IEEE Transactions on Knowledge and Data Engineeringvol 17 no 11 pp 1451ndash1464 2005

[23] S-H Wu K-T Chuang C-M Chen and M-S Chen ldquoDIK-NN an itinerary-based KNN query processing algorithm formobile sensor networksrdquo inProceedings of the 23rd InternationalConference on Data Engineering (ICDE rsquo07) pp 456ndash465 April2007

[24] D T Lee ldquoOn k-nearest neighbor voronoi diagrams in the pla-nerdquo IEEE Transactions on Computers vol 31 no 6 pp 478ndash4871982

[25] K Patroumpas TMinogiannis andT Sellis ldquoApproximate ord-er-k Voronoi cells over positional streamsrdquo in Proceedings of the15th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo07) pp 276ndash283 November 2007

International Journal of

AerospaceEngineeringHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

RoboticsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Active and Passive Electronic Components

Control Scienceand Engineering

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

RotatingMachinery

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

Journal ofEngineeringVolume 2014

Submit your manuscripts athttpwwwhindawicom

VLSI Design

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Shock and Vibration

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawi Publishing Corporation httpwwwhindawicom

Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

SensorsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Navigation and Observation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

DistributedSensor Networks

International Journal of

Page 5: Research Article Distributed Continuous k Nearest Neighbors ...downloads.hindawi.com/journals/ijdsn/2013/125145.pdfmobile environments like WSNs, which consist of a number of mobile

International Journal of Distributed Sensor Networks 5

n1

n2n3

q120579

(a)

n1b1

b9984001 b9984009984001

n2n3

q

m1

(b)

n1

b1

n2n3

q

m1

(c)

n1

n2n3

q

m1

m3

b1

b3

(d)

n1b1

b4 b3

n2n3

q

m1m4

m3

(e)

n1b1

b5 b4 b3

n2n3

q

m4

m5

m3

m1

(f)

n1

b1

b3b4b5

b6

n2n3

q

m1

m6

m5

m4

m3

(g)

n1b1

b6

b7

b5 b4 b3

n2n3

q

m3

m1m4

m5

m6 m7

(h)

n1

b1

b6

b7

b8

b5 b4 b3

n2n3

q

m3

m1m4

m5

m6

m8

m7

(i)

Figure 4 The construction of an approximate order-3 Voronoi cell where 119902 is the query point

Q-node

D-node

Itinerary

(a)

s

q

np

w

(b)

Figure 5 The 119896NN search on WSNs (a) Q-node is the first object receiving the query and D-node is the sink node which is responsible forcollecting data and (b) presents the multihops routing path for the 119896NN process

6 International Journal of Distributed Sensor Networks

A 3-nearest neighbor at t0Not a 3-nearest neighbor at t0

CDk = 3

q1

q1 o1

o1 o2

o2

o3

o3

o4

o4

o5

o5

CD2Broadcast range

New CD

t = t0 + ST

(a)

(b)

t = t0

(c)

o1

o2

o3o4

o5

CDq1

CD2

Figure 6 Update process using safe-time for 3NN search on WSNs (a) shows the CD between the third and fourth closest data points (b)presents the maximum influenced distance for update using broadcast (c) indicates the area for broadcasting to update

circles incremental with an distance 119908 The query message isforwarded in hop by hop manner as shown in Figure 5(b)Finally the system can obtain the initial 119896NN from the lastobject which finished the query processing and derive thedistance cross-distance (CD) between the 119896th and (119896 + 1)thnearest neighbors As Figure 6(a) shows the system then cancompute a safe time = CD(2 lowast MaxSpeed) by the cross-distance between the 119896th and (119896 + 1)th nearest neighborsThis indicates that the system ensures that the order of 119896thand (119896 + 1)th nearest neighbors will not exchange in the safe-time periodThus the resulting 119896NNdoes not need to updateIn addition the maximum moving distance of each objectis limited in the safe-time so we can predict the maximuminfluenced region after the movement of 119896th and (119896 + 1)thnearest neighbors as shown in Figures 6(b) and 6(c) to obtainthe safe region (the dark rings in the figure) The system willignore the objects which locate outside the safe region thusreducing the cost of updating each objectrsquos information

34 Performance Metrics In order to evaluate the proposedDC119896NN approach we consider the following performancemetrics including update cost number of messages accuracyand response time

341 Update Cost The update cost is to measure the numberof updates during the query process We sometimes use thefrequency to denote it Since the sensors (objects) and eventhe query will move the status of the sensors should bemaintained in order to have the accurate results However thecost for one update is high in the distributed environmentHence one of the objectives of the designed algorithmDC119896NN is to minimize the update cost for the C119896NN query

342 Number ofMessages Except for the number of updatesthere are some other kinds of messages for the queryprocess in the distributed andmobile environment includingthe messages for query and information passing The totalnumber of messages used during the query process can be

used to indicate the throughput over the networks and theenergy consumption So the proposed DC119896NN is towardsminimizing the total number of messages for the query

343 Accuracy By using the pull-based approach the timeinterval for routing updatemessages to the server depends onthe distance between the data object and the server It thus cannot ensure that the location information of each object savedin the server is the latest Hence the results may be timelyincorrect when deriving the answers for a query due to themobilityThis situation becomes worse in the distributed andmobile environments In our design the proposed approachcan avoid redundant updates and keep the accuracy of theresults

344 Response Time The complicated query process thedelay time for message communication and the numberof users will affect the response time of the system toprocess the query Long response time is unbearable andmayreturn obsoletely invalid query results Even worse the longresponse time may cause important information missing orfinancial loss Thus the system response time is also one ofthe important issues that must be considered when designingthe method for continuous queries

4 Distributed Continuous 119896 NearestNeighbors Search

In the mobile and distributed environments like WSNs orMANETS the pull-based approach may not be a goodmatchfor C119896NN search due to the problems discussed in Section 2We thus propose a distributed algorithm DC119896NN for C119896NNsearch in the mobile and distributed environments Thedistributed approach using a better safe-time can reduce theupdate cost relieve the load for server shorten the responsetime and make the result more accurate There are threephases in DC119896NN initialization phase query processingphase and information update phase In the initialization

International Journal of Distributed Sensor Networks 7

query DC119896NN search()(1) broadcast a query 119902(119896 ℎ119900119901119888) ℎ119900119901119888 is initial to 1(2) get the Voronoi cells or objectrsquos information(3) if (119896 = 1) then(4) show LVC(5) find 119904119886119891119890119905119894119898119890 of DC1NN (with LVC)(6) elseif (119896 gt 1) then(7) while the received information is insufficient do(8) broadcast the query 119902(119896 ℎ119900119901119888 + 1) to ask more hops of neighbor nodes(9) run normal 119896NNSearch to find 119896NN set(10) show LVC according to 119896NNset and 119868119899119891119900(11) find 119904119886119891119890119905119894119898119890 of DC119896NN (with LVC)(12)while (119904119886119891119890119905119894119898119890 = 0)(13) wait

Algorithm 1 The DC119896NN algorithm on the query (sink) node

phase each moving object exchanges the location informa-tion and builds a local Voronoi cell (LVC) as well as calculatesthe safe time for the LVC The query processing phasecollects sufficient location and environmental informationof neighboring neighbors for exploring the result of thegiven C119896NN query The last information update phase is tomaintain the latest information for the moving objects andthe result of the continuous 119896 nearest neighbor query Thefollowing will explain each phase in details

41 Phase 1 Initialization (119896=1) During system initializationeach mobile sensor (moving object) exchanges locationinformation with its neighbors derives the local Voronoi cell(LVC) calculates the safe time of LVC and then stores theLVC and safe time in the memory

When a user issues an NN query 119876 and broadcasts thequery message 119902(119896 ℎ119900119901119888) (case 119896 = 1) where 119896 is the numberof the nearest neighbors the query wants to find and ℎ119900119901119888

is the hop counter and sets to one initially When the querypoint 119876rsquos neighboring objects receive the query message119902(119896 ℎ119900119901119888) they will determine whether 119876 is located in theirVoronoi Cells (VCs) If a neighboring object replies true itmeans that this neighboring object is the nearest neighbor ofthe query point 119876 and this neighboring object will transmitthe Voronoi cell (VC) information of itself to the query point119876 including the neighboring object boundaries locationdirection and speed of movement and some environmentalinformation On the other hand if a neighboring objectreturns false this neighboring object will check whetherquery point119876moves towards it or not If the query point119876 ismoving towards a neighboring object then this neighboringobject also will send its VC information to the 119876 otherwisethe query message will be ignored After the initializationphase eachmoving object will maintain the LVC informationand safe time The update process will be executed for thelatest LVC information only when the safe time decreases tozero Assume that each object has 119889 neighbors in averageSince the bisector between two objects costs 119874(1) time theLVC construction (Initialization phase) can be finished in119874(119889) time

42 Phase 2 C119896NN Query Processing The pseudocodeQuery DC119896NN Search() in Algorithm 1 shows the wholequery process on the query point The operations fromLine 6 to the end of Query DC119896NN Search() do the queryprocessing of C119896NN (119896 gt 1) When a query point119876 wants tofind the 119896 nearest neighbors where 119896 gt 1 119876 first broadcastsmessages 119902(119896 ℎ119900119901119888) (case 119896 gt 1) and gets the local Voronoicell (LVC) information from the nearest neighboring (NN)object The nearest neighboring object of 119876 is responsiblefor routing messages to its neighboring objects collectingthe local Voronoi cell (LVC) information of the neighboringobjects and sending information back to query point 119876Basically if the received information is insufficient to derivethe 119896NN answer the query point 119876 will repeatedly sends thequery message 119902 with one more hop (ie ℎ119900119901119888 = ℎ119900119901119888 + 1) tothe specific neighboring objects to obtain more neighboringVC information until the received information is enough toget 119896NN answer

When the received information is enough to derive theresults of 119896NN the query point 119876 will use the approximatemethod we modified from [25] to calculate the approximateorder-119896 LVC in which the query point 119876 locates By usingthe modified method the query point 119876 has to partitionthe plane into 120582 equal sectors and selects an additionalnearest neighboring object in each sector excluded from119896NN objects Thus the query point 119876 needs to collect atleast 119896 + 120582 neighboring objectsrsquo information to build theapproximate order-119896 LVC Note that the information of theadditional 120582 objects can be learned from the informationof the received neighboring objects In comparison with thecentralized approach for constructing the approximate order-119896 Voronoi cell the modified approximate method only needsto consider the 119896nearest neighboring objects and120582 additionalnearest neighboring objects instead of considering all objectsin the wireless environment The computation time is thusmuch better than the traditional centralized approach andcan be derived as119874(120582) + 119874(120582) times 119874(119896) = 119874(120582(119896 + 1)) where119874(120582) is the time for selecting the 120582 additional neighboringobjects In the end 119874(120582119896) is the time for determining theboundary of the approximate order-119896 LVC For more detailsabout the analysis of the computation time please refer to

8 International Journal of Distributed Sensor Networks

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

(a)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q

(b)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q

(c)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q

(d)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

q

(e)

Figure 7 An example of DCNN where (a) each sensor exchanges information in the initial step (b) each sensor builds its LVC (c) a queryat object 119902 is issued and sensor 119900

1returns the information of its LVC to 119902 since 119902 is located in the Voronoi cell associated with 119900

1 (d) object

119902 knows which sensor will be reached next and can derive the safe time by the LVC information of 1199001 and (e) the query result to 119902 can be

updated seamlessly when it moves to 1199006

[25] After the query point 119876 calculates the approximateorder-119896 LVC a safe time of the query 119902 can be derived Thesafe time of the query 119902 is regarded as the time limit forstarting the next location information updating process andupdating the C119896NN answer

Figure 7 gives an example for the case of 119896 = 1 Asshown in Figure 7(a) there are 16moving sensors 119900

1 119900

16

in the system and each sensor has the location informationabout itself In the initial phase each sensor broadcasts themessage with its location information and receives the loca-tion information from its neighbors The local Voronoi cell(LVC) of each sensor then can be calculated and stored Theoverall calculatedVoronoi diagram is depicted in Figure 7(b)Afterwards if the locations of the sensors change as movingeach sensor will broadcast new location information to itsneighbors and each sensor can derive a new LVC by thereceived updating messages In Figure 7(c) a continuous NNquery is issued by some query object 119902 with its locationIn order to know the Voronoi cell where 119902 locates 119902 firstbroadcasts the query message to the neighboring sensors(in dashed circle) After receiving the query message theneighboring sensor will check whether the query 119902 is locatedin its associated cell If 119902 is not in the cell the sensor willignore the querymessage In Figure 7(c) sensor 119900

1will return

the result to the query 119902 saying that object 1199001is the nearest

neighbor of 119902 for the time being If 119902 moves in the directionas indicated by the solid arrow in Figure 7(d) to object 119900

6

119902 can know that it moves towards the boundary of 1199001and

1199006by the LVC stored in 119900

6and then derive the safe time

When approaching the boundary (ie the safe time is almostpassed) a query message to 119900

6will be issued by 119902 in advance

Sensor 1199006will reply to 119902with the cell information to maintain

the accuracy of the query result Figure 7(e) shows the resultafter 119902moves into the associated cell of sensor 119900

6

Figure 8 demonstrates an example of DC119896NN for 119896 gt

1 The initial phase is the same as the previous DCNNexample Each sensor derives the corresponding LVC withthe information from the neighboring sensors The queryis issued by a moving object 119902 with its location Object 119902

locates itself and knows that it is in the VC of 1199001after sensor

1199001replies to 119902 with its LVC information Suppose 119896 = 3

After the initialization 119902 is located in 1199001and has the LVC

information of 1199001 Having such information 119902 can derive the

NN but 3NN cannot be decided yet So 119902 will broadcast thequery message to all of its one-hop neighboring sensors say1199001 1199002 1199003 1199008 and 119900

9in Figure 8(a) to request information

The neighboring sensors will reply to 119902 the information abouttheir LVCs Object 119902 then can derive the resulting 3NN forthe time being say 119900

1 1199008 and 119900

9in the example With

these replied information 119902 can build the approximate order-3 Voronoi cell as shown in Figure 8(b) Then 119902 uses theapproximate order-3 Voronoi cell to derive the safe time inorder to maintain the continuous query result Now if 119896 =

10 the information received from the one-hop neighboringsensors is not enough to derive the result Then the querymessage will be broadcast to 119902rsquos two-hop neighboring sensorsas Figure 8(c) shows If the information is not enough toderive the resulting 119896NN the querymessagewill be broadcast

International Journal of Distributed Sensor Networks 9

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q n1n2

n3

n4(k + 1)

(a)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5qn1

n2

n3

(b)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o3o4

o5q

o9

o2

(c)

o1

o6

o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q

n11(k + 1)

n1

n4n5

n6

n10

n7

n8

n2n9

n3

(d)

o1

o6

o7

o8

o11o10

o12

o13o14o15

o16o9

o2 o3o4

o5q n1n2

n4n5

n6

n7

n3

n9n10

n8

(e)

Figure 8 An example of DC119896NN for 119896 gt 1 where the initialization phase is the same as previous DCNN example and (a) 1199001 1199008 and 119900

9are

the 3NN to the query object 119902 (b) the approximate order-3 Voronoi cell can be built with enough information received (c) the information isnot enough for 10NN query and two-hop neighboring sensors are requested (d) the resulting 10NN can be derived and (e) the approximateorder-10 Voronoi cell can be calculated with information received

to one more hop neighboring sensor Such process will berepeated with an increment on the hop count After havingenough information 119902 can calculate the resulting 10NN andthe approximate order-10 Voronoi cell as shown in Figures8(d) and 8(e) respectively Using the approximate order-10Voronoi cell the safe time can be derived In the followingwe will discuss how to derive the safe time for maintainingthe result of the continuous 119896NN query

43 Phase 3 Information Updates In the distributed andmobile environments it is challenging for a mobile nodeto maintain the location information of the other mobilenodes effectively If a mobile node sends the update messagesfrequently it will consume much network resource andpower Furthermore the result of themoving query should beeffectively maintained For different roles nodes and querywe propose effective ways respectively in our DC119896NN queryprocess to update the location information and maintain thequery result

431 The Safe Time of Each Object In the proposed appro-ach DC119896NN each object cooperates with each other andexchanges information to update the location information ofeach object In order to monitor and obtain the continuousanswer of a continuous 119896 nearest neighbors query we usea safe distance between each object and query Then wecan derive the safe time of each object for location updatesby estimating the maximum speed of that object Supposethat the sensing area is partitioned into a grid for location

management There are three possible methods for derivingthe safe distance The first one is the grid-based safe distanceEach object directly uses the minimum distance betweenitself and the boundary of the grid cell where the objectlocates Simply using the grid-based safe distance may causesome problems about the imprecise updates The secondmethod VD-based safe distance uses VD to obtain the safedistance In order to predict the safe distance more preciselywe can consider the previous two distances simultaneouslyand then select the smaller one So the last method propersafe distance will return a better safe distance by comparisonsHaving the safe distance the safe time then can be derived byestimating the maximum speed of the considered object

In Figure 9 the sensing area is divided into a grid andthe Voronoi diagram formed by the sensors is also shownFor sensor 119900

1in Figure 9(a) the grid-based safe distance and

VD-based safe distance are presented respectively and theproper safe distance will be the VD-based safe distance afterthe comparison On the contrary for sensor 119900

3in Figure 9(b)

the proper safe distance will be the grid-based safe distance

432The Safe Time of EachQuery For themoving query it isimportant to know when the result will change To derive thesafe time during which the result will not change we referto the characteristics of Voronoi diagram In the traditionalenvironment with static objects the system only uses theminimum distance from the query to the boundary of theVoronoi cell where the query locates as the safe distance Thethe safe time can be obtained by the estimated maximum

10 International Journal of Distributed Sensor Networks

o1

o7

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

o6o8

(a)

o1

o7

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

o6o8

(b)

Figure 9 An illustration for different safe distances (a) sensor 1199001uses the VD-based safe distance as the proper safe distance and (b) sensor

1199003uses the grid-based safe distance as the proper safe distance

L L

A

B

Safe distance

Query

B

A

120579

New safe distance

QueryA998400

L998400

B998400

Figure 10 An example showing the impact on the safe distancecaused by object movement

speed of that query During the safe time no update isnecessary thus saving the update cost

Unfortunately in the moving object environment theabove method cannot obtain the right safe time As shownin Figure 10 the left part shows the static case where 119871 is theVoronoi cell boundary between objects 119860 and 119861 and the safedistance of the query can be calculated as the figure showsHowever for the moving objects the original safe distancebetween the 119871 and query cannot be directly used to calculatethe safe time because the object movement will cause thedistance form query to 119871 to be nonlinearly increasing ordecreasing As the right part of Figure 10 shows after themovement of object 119860 and object 119861 119871 becomes 119871

1015840 and thesafe distance changes Thus if we want to use the boundariesof Voronoi cell to estimate more accurate safe time we needto consider the relative movements between the objects andquery

In order to derive the precise safe distance we considerthe movements of objects and query simultaneously and useFigure 11 to illustrate Initially 119876119860 and 119876119861 are the distancesfrom the query to objects 119860 and 119861 respectively The linebetween 119860 and 119861 is the boundary of the Voronoi cellsassociated with 119860 and 119861 and the query is located in thecell of 119860 as Figure 11(a) shows When objects and the querymove as in Figure 11(b) the query may touch the boundaryThis indicates that the query will enter another cell and theresult of the query should be updated The time from thebeginning to the moment of touching the boundary is theprecise safe time for the query According to the properties

of Voronoi diagram when the query is on the boundary119876119860 = 119876119861 We hence can use the condition of 119876119860 = 119876119861

to decide whether the query is on the boundary With thisproperty even though the objects and querymove frequentlythe query only needs the speeds directions and locationsof the neighboring objects to predict the safe time easilyWithin the safe time the query will not touch the boundaryIn Figure 11(c) the query meets the boundary at 119905

1and the

safe time is 1199051

In the following we present the way to calculate the safetime when 119876119860 = 119876119861 Assume that the initial location of themoving query is (119909

119902 119910119902) and the speed is (119881

119909119902 119881119910119902

) Supposethe initial location of object 119860(119861) is (119909

119860 119910119860)((119909119861 119910119861)) with

the speed being (119881119909119860

119881119910119860

)((119881119909119861

119881119910119861

)) The equation to findwhen the querymeets the boundary can be derived accordingto the property of perpendicular bisector Since119876119860 = 119876119861 wecan have

([(119909119902+ 119881119909119902

lowast 119905) minus (119909119860

+ 119881119909119860

lowast 119905)]2

+[(119910119902+ 119881119910119902

lowast 119905) minus (119910119860

+ 119881119910119860

lowast 119905)]2

)

12

= ([(119909119902+ 119881119909119902

lowast 119905) minus (119909119861

+ 119881119909119861

lowast 119905)]2

+[(119910119902+ 119881119910119902

lowast 119905) minus (119910119861

+ 119881119910119861

lowast 119905)]2

)

12

(1)

Then

0 = [1198812

119909119860

+ 1198812

119910119860

minus 1198812

119909119861

minus 1198812

119910119861

minus 2 lowast 119881119909119902

119881119909119860

minus2 lowast 119881119910119902

119881119910119860

+ 2 lowast 119881119909119902

119881119909119861

+ 2 lowast 119881119910119902

119881119910119861

] lowast 1199052

+ 2 [(119909119902minus 119909119860) (119881119909119902

minus 119881119909119860

) + (119910119902minus 119910119860) (119881119910119902

minus 119881119910119860

)

minus (119909119902minus119909119861) (119881119909119902

minus119881119909119861

) minus (119910119902minus119910119861) (119881119910119902

minus119881119910119861

)] lowast 119905

+ [(119909119902minus 119909119860)2

+ (119910119902minus 119910119860)2

minus (119909119902minus 119909119861)2

minus (119910119902minus119910119861)2

]

(2)

International Journal of Distributed Sensor Networks 11

A

B

Query

(x3 y3)

(x2 y2) (x1 y1)QA

QB

(Vx2 Vy2)

(Vx3 Vy3)

(Vx1 Vy1)

(a)

A

B

Query

(x3 y3)

(x2 y2)(x1 y1)

QA

QB

(Vx2 Vy2)

(Vx3 Vy3)

(Vx1 Vy1)

(b)

A

B

d

t1 t2 t3 t

(c)

Figure 11 The precise safe-time for moving objects 119860 and 119861 and the moving query where (a) shows the beginning state (b) presents themoment when the moving query meets the boundary and (c) gives the diagram for the change on the safe distance with time 119905

o1

o2

o3o4

o5

CDq1

CD2

(a)

o1

o2

o3o4

o5

CDq1

CD2

q9984001

(b)

Figure 12 The phenomenon when using the original safe-time methods to (a) stationary query and (b) moving query

Equation (2) is a quadratic equation Since a generalquadratic equation can be written in the following form1198861199092

+ 119887119909 + 119888 = 0 recall that the discriminant of a quadraticequation is Δ = 119887

2

minus 4119886119888 If Δ gt 0 there are two distinct realroots if Δ = 0 there is exactly one real root if Δ lt 0 thereare two distinct (non-real) complex roots In (2)

119886 = 1198812

119909119860

+ 1198812

119910119860

minus 1198812

119909119861

minus 1198812

119910119861

minus 2 lowast 119881119909119902

119881119909119860

minus 2 lowast 119881119910119902

119881119910119860

+ 2 lowast 119881119909119902

119881119909119861

+ 2 lowast 119881119910119902

119881119910119861

119887 = 2 [(119909119902minus 119909119860) (119881119909119902

minus 119881119909119860

) + (119910119902minus 119910119860) (119881119910119902

minus 119881119910119860

)

minus (119909119902minus 119909119861) (119881119909119902

minus 119881119909119861

) minus (119910119902minus 119910119861) (119881119910119902

minus 119881119910119861

)]

119888 = (119909119902minus 119909119860)2

+ (119910119902minus 119910119860)2

minus (119909119902minus 119909119861)2

minus (119910119902minus 119910119861)2

(3)

and then we can derive the safe time 119905 according to thediscriminant

119905 =

[minus119887 + (1198872

minus 4119886119888)12

]

2119886or

[minus119887 minus (1198872

minus 4119886119888)12

]

2119886

(4)

Finally we select the minimum value of 119905 gt 0 as the safetime

Additionally assuming that 119889 is the distance between theobject and the query and 119905 is the time 119876119860 = 119876119861 can be

converted into a function of 119905 and 119889 as shown in Figure 11(c)Then we can obtain the safe time 119905

1which is the time when

119876119860 = 119876119861 Furthermore the object 119861 will be closest to thequery at the time 119905

3

5 Comparisons with Previous Approaches

In this section we compare the proposed DC119896NN approachthe Safe-time with stationary query approach [5] and thenaıve way used pull-based approach in terms of safe timespace and accuracy

51 Safe Time The original safe-time with stationary query[5] (safe-time(S)) does not support moving queries Anexample of C3NN is shown in Figure 12 where 119902

1is the query

point triangles are the 3NN objects the pentagons representthe other individual objects and 119900

4is 4th NN Figure 12(a)

shows the original result for safe-time(S) After obtaining the119896th and (119896 + 1)th objects (119900

2and 1199004in the figure) the cross-

distance (CD) of 119896th and (119896 + 1)th objects can be calculatedRecall that the cross distance of two data objects 119860 and 119861 isthe difference on the distances of119860 and119861 to the center (or thequery point) For the next update (after a safe-time period)all the objects in this region should be checked

We adapt the safe-time(S) method for moving queryThe adapted approach will result in a higher update cost

12 International Journal of Distributed Sensor Networks

Figure 12(b) presents a case that the query moves towardobject 119900

3(119896th NN) and away from object 119900

4((119896 + 1)th NN)

When the query 1199021moves to the point 1199021015840

1 the most outside

concentric circle increases and becomes as large as the mostoutside dotted concentric circle On the contrary the mostinside concentric circle decreases and becomes as small as themost inside dotted concentric circle Thus the cross-distanceincreases and more number of objects will be examined

In addition according to the Figure 12(b) we can knowthat the original Safe-time method safe-time(S) is notappropriate for moving queries since the calculation of Safe-time(S) method does not consider the speed of query safe-time(S) directly uses twofold of the maximum speed of the119896th and (119896+1)thNNobjects to divide theCD to derive the safetime The cost for updates increases when the CD becomeslarger since the average checked area becomes bigger Besidesthe obtained 119896NNanswer cannot be guaranteed to be correctOn the contrary the cross-distance when the query movestowards object 119900

4((119896 + 1)th NN) and away from object 119900

3

(119896th NN) in this case the order of the 119896th and (119896 + 1)th NNobjectmay be changed but the update does not perform thusresulting in incorrect results

We modify the Safe-time to fully support the movingquery In order to support and maintain the accuracy ofmoving query the maximum speed (Maxspeed) used in thesafe time calculation is required to be modified and replacedby the maximum relative speed between the query and theobjects Because of using the relative speed the adaptedsafe-time method safe-time(M) needs twofold maximumrelative speed (2 lowast 119872119886119909119904119901119890119890119889) to calculate the safe time forguaranteeing the accurate resultsThe safe time derived is lessthan the one derived in safe-time(S) due to the relative speedHence the update frequency of safe-time(M) is higher thanthe update frequency of safe-time(S)

52 Space In DC119896NN each object and query only need tomaintain the information of LVC The information to bestored includes the location of neighboring objects and theobject information of order-119896rsquos local Voronoi diagram Thetotal amount of stored information is not significant on eachobjectThus the use of storage space does not need to be verysubstantial

53 Accuracy The safe-time (S) [5] considers the stationaryquery When applying it to the moving query some adaptionshould bemade According to our experimental results whenthe value of 119896 increases with a moving query the accuracy ofthe result will be reduced In our simulation we modify theoriginal Safe-time(S) as Safe time(M) for moving query andconsider the relative distance in detail caused by the movingquery and objects Although the correctness of the answer canbe increased the update frequency increases thus increasingthe number of delivered messages

DC119896NNuses Voronoi and grid cell boundary to calculatethe safe time and updates the information of related objectsbefore the end of the safe time In fact the boundary ofthe Voronoi cell represents the boundary of moving 119896NNquery After the safe time period the query will collect the

information of related neighboring objects Having such real-time information the query can have the resultmore accuratein time Similar to safe-time(M) DC119896NN uses the 119896th and(119896 + 1)th nearest moving objects to derive the safe time So itis able to maintain the correctness of the answer

6 Simulation Experiments

In the simulation we compare the following methods NaıveDC119896NN safe-time (S) and safe-time (M)TheNaıvemethodis centralized and used as a benchmark for the comparisonAll the mobile sensors will send the location informationto the central server to update the information The othermethods DC119896NN Safe-time(S) and Safe-time(M) are dis-tributed and used in the considered mobile wireless sensornetwork where each object knows its position has the abilityto perform some calculation and stores the information oflocalized Voronoi cell (LVC)We assume that each object cantransmit amessage to its one-hopneighbor so that each objectcan communicate with at least one object For Safe-time(S)and the safe-time(M) a maximum speed (MaxSpeed) is setin order to estimate relative speed and distance for safe-timecalculation

In the simulation all the compared approaches areperformed under the same environmental conditions forfairness The initial location and speed of moving objectsare uniformly randomly distributed Since we focus on theperformance of the query process of the proposed DC119896NNapproach we further assume that the transmission quality isideal and no congestion and communication delays occurThe metrics measured include the update frequency for aquery the total number of messages response time andaccuracy The update frequency for a query is the averagenumber of update messages sent by the data objects relatedto the query per minute The total number of messages isall the amount of messages sent from all objects during thequery process The accuracy of each method is measuredby comparing the results to the real answers Since thequery is continuous and the update occurs subsequently themeasured response time is mainly the time required fromsending a query to obtaining the first result

All the experiments are simulated so the results aboutthe response time may not show the practical cases exactlybut can reflect the trends on the performance among all thecompared approaches relatively In order to have the responsetime in our simulation we thus use the total number of hopsfor deriving the result tomultiply the average time for one hopin the simulation system to present the response time Thusthe response time is proportional to the total number of hopsin our simulation program In addition because the maindifference between Safe-time(S) and the Safe-time(M) is theway for deriving the safe time the measured response timeof these two methods is the same The simulation programis implemented with Java The setting of our simulation isshown in Table 1 with a default value for each parameter Inall the simulation experiments the final results are reportedwith the average of 100 queries The duration of each query is60 seconds

International Journal of Distributed Sensor Networks 13

200 400 600 800 10000

10

20

30

40

50

60

Edge length of sensing area (m)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

200 400 600 800 10000

100

200

300

400

500

600

700

Edge length of sensing area (m)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

200 400 600 800 100075

80

85

90

95

100

105

Edge length of sensing area (m)

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

200 400 600 800 1000Edge length of sensing area (m)

Aver

age r

espo

nse t

ime (

s)

DCkNNSafe-time(S)Safe-time(M)

095

1

105

11

(d) Response time

Figure 13 The effects of different sensing areas on (a) update frequency (b) number of messages (c) accuracy and (d) response time

Table 1 Simulation parameters

Parameter Range Default valueEdge length of sensingarea (m) 200 400 600 800 1000 600

Edge length of grid (m) 50 100 150 50Number of objects 20 30 40 50 60 30Transmission range (m) 125 125119896 1 3 5 10 20 3Moving objects () 20 40 60 80 100 20Speed (ms) 2 4 6 8 10 4

61 Effects of Sensing Area Sensing area affects the numberof update and query messages since if the area becomes

greater with the fixed number of objects relatively thedensity of the objects becomes sparse For example when thesensing areas are 200lowast200 400lowast400 600lowast600 800lowast800 and1000lowast1000 the densities are 188 047 021 012 and 008respectively Figure 13(a) shows that DC119896NN has the lowestnumber of updates with all the different areas and the numberof updates for Safe-time(S) is the highest (worst) becauseDC119896NN considers the moving direction and speed of thequeries and objects and selects the proper safe-distance toderive the safe-time Safe-time(S) the Safe-time(M) estimatethe safe time according to the maximum speed of the objectsso more number of updates can be expected AdditionallySafe-time(M) is updated more frequently than Safe-time(S)Recall that Safe-time(M) considers the query movement

14 International Journal of Distributed Sensor Networks

50 75 100 150 2000

5

10

15

20

25

Edge length of grid (m)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

50 75 100 150 2000

50

100

150

200

250

300

350

Edge length of grid (m)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

50 75 100 150 2000

20

40

60

80

100

120

Edge length of grid (m)

Accu

racy

()

DCkNN(G)DCkNN(V)

(c) Accuracy

50 75 100 150 2001

101

102

103

104

105

106

Edge length of grid (m)

Aver

age r

espo

nse t

ime (

s)

DCkNN(G)DCkNN(V)

(d) Response time

Figure 14 The comparisons of using grid-based and VD-base safe distances to derive the safe-time (a) update frequency (b) number ofmessages (c) accuracy and (d) response time

The average safe-distance becomes shorter thus leading tomore updates Besides when the sensing area increasesfrom 200lowast200 to 600lowast600 the update frequency dropsdramaticallyThe curve becomes flatter when the area is from600lowast600 to 1000lowast1000 since the difference on the densitiesof the areas from 600lowast600 to 1000lowast1000 is not much Thenumber of updates is less as the safe-time becomes largerThetotal number of transmitted messages of naıve approach isfixed at about 1800 packets All the other distributedmethodsuse fewer number of messages than naıve

To monitor the results DC119896NN only needs to check therelated objects in the local Voronoi cell at the proper safe-time thus reducing a lot of redundant update messages Safe-time(S) and Safe-time(M) use the maximum speed of theobjects to calculate the safe time so the total number of

transmitted messages of both approaches is more than that ofDC119896NN Figure 13(b) shows that more than 30 of the totalnumber of transmitted messages can be saved by DC119896NN incomparison with Safe-time(M)

For the accuracy since Safe-time(S) does not considerthe query movement the safe-time may be inaccurate Fur-thermore due to the mobility when the density is high theestimated results become more inaccurate So Safe-time(S)performs worst as shown in Figure 13(c) Safe-time(M) isrevised from Safe-time(S) by considering the query move-ment and the safe-distance is less in average for guaranteeingbetter results Hence Safe-time(M) has a better accuracy andalmost the same as DC119896NN The accuracy of Safe-time(M)and DC119896NN is almost about 100 correct and the gap maybe caused by arithmetical errors in the experiments

International Journal of Distributed Sensor Networks 15

10 20 30 40 50 60 700

5

10

15

20

25

30

35

40

45

Number of objects

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

10 20 30 40 50 60 70100

150

200

250

300

350

400

450

Number of objects

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

10 20 30 40 50 60 7080

85

90

95

100

105

Number of objects

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

10 20 30 40 50 60 70Number of objects

Aver

age r

espo

nse t

ime (

s)

096

098

1

102

104

106

108

11

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 15 The effects of the number of objects on (a) update frequency (b) number of messages (c) accuracy and (d) response time

When the area becomes larger the density becomeslower So the number of objects in each objectrsquos transmissionrange is fewer Under such a circumstance DC119896NN usesless computation and the response time is shorter as shownin Figure 13(d) In contrast the Safe-time(S) and the Safe-time(M) need to collect information before performing eachnew query and cause longer response time Since Safe-time(M) and Safe-time(S) use the same method and proce-dure to handle the first query the response time of these twomethods will be almost the same

62 Effects of Grid Size In this simulation experiment setwe want to observe the update efficiency of each object inthe third phase of DC119896NN Recall that we consider the grid-based and VD-base safe distances to derive a proper safe-time In this experiment DC119896NN(G) uses grid-based safe

distance to determine the safe time for the next update andDC119896NN(V) uses VD-base safe distance to derive the safetime The sensing area is fixed to 600lowast600m2 and there are30 data objects We compare DC119896NN(V) with DC119896NN(G)by observing the impacts of different grid sizes All theother settings have the similar trends in our experimentalresults In Figure 14(a) the update frequency of the objectsin DC119896NN(G) is high when the grid size is 50lowast50m2 andbecomes less when the grid size decreases Since the sensingarea is 600lowast600m2 and 30 objects are given the averagedistance between an object and the boundary of a Voronoicell is about 25 to 50 meters With the setting of grid size50lowast50m2 the average distance obtained in DC119896NN(G) isabout 25 meters Thus the safe time of DC119896NN(V) is longerIn general as Figures 14(a) and 14(b) show the update

16 International Journal of Distributed Sensor Networks

1 3 5 10 200

10

20

30

40

50

60

k

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

1 3 5 10 200

100

200

300

400

500

600

700

800

k

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

1 3 5 10 2080

85

90

95

100

105

k

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

1 3 5 10 20k

Aver

age r

espo

nse t

ime (

s)

08

09

1

11

12

13

14

15

16

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 16 The impacts of different values of 119896 on (a) update frequency (b) number of messages (c) accuracy and (d) response time

frequency of the objects and the number of messages sentby the objects decrease as the grid size increases

When the grid size is large the safe time becomes longand less number of updates are issued Hence the resultsbecome more inaccurate As shown in Figure 14(c) whenthe grid sizes are 50lowast50m2 75lowast75m2 100lowast100m2 and150lowast150m2 the corresponding accuracies are 95 9285 and 78 respectively While the grid size increases to200lowast200m2 the accuracy is significantly reduced to 69and the right answer thus can not be guaranteed On theother hand Figure 14(d) shows that the response times ofDC119896NN(G) and DC119896NN(V) are not much different becausethe size of grid is not the major factor to influence thecomplexity of obtaining information for the first query

63 Number of Objects In this subsection we discuss theresults as the number of data objects varies The area in thepresented experiment set is 600lowast600 (m2) with grid size of50lowast50 (m2) As shown in Figure 15(a) when the number ofobjects increases the number of updates in DC119896NN is stillrelatively less than the ones in Safe-time(S) and Safe-time(M)If the number of objects increases the number of repliedmessages per second to the central server in naıve will growdramatically With 20 to 60 objects the number of repliedmessages to the server is from 1200 to 3600 (packetsmin)By observing the results in Figures 15(b) and 15(c) as moreobjects are in the area the number of messages increasesfor the other three methods and the accuracy reduces inSafe-time(S) These match the trends for different areas we

International Journal of Distributed Sensor Networks 17

20 40 60 80 1000

5

10

15

20

25

30

35

40

45

Moving objects ()

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

20 40 60 80 1000

100

200

300

400

500

600

Moving objects ()

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

20 40 60 80 100

80

70

75

85

90

95

100

105

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

Moving objects ()

(c) Accuracy

20 40 60 80 100

Aver

age r

espo

nse t

ime (

s)

09

095

1

11

105

115

12

125

13

DCkNNSafe-time(S)Safe-time(M)

Moving objects ()

(d) Response time

Figure 17 The effects of the moving objects on (a) update frequency (b) number of messages (c) accuracy and (d) response time

discussed earlier due to the density Similarly the responsetime can be expected as shown in Figure 15(d) where theresponse time of DC119896NN is still the shortest

64 Different Values of 119896 It is obvious that the value of119896 affects the performance of query processing significantlyWhen the value of 119896 becomes larger the number of relatedobjects required to be checked also increases In other wordswe need to spend more cost to find out which 119896 objectsare currently in the result for the C119896NN query Thereforethe changes in the value of 119896 mainly affect the amountof data required for the first query and the update costfor maintaining the 119896th and the (119896 + 1)th objects So inFigure 16(a) when the value of 119896 is large more updates arenecessary for all the three methods As Figure 16(b) shows

the influence on the number of transmitted messages inSafe-time(M) is more serious than the one in Safe-time(S)Due to the mobility the number of influenced objects inSafe-time(M) will increase as the value of 119896 increases Inparticular the update frequency in Safe-time(M) becomesnearly twofold the update frequency in Safe-time(S)

Figure 16(c) presents the impact on the accuracy fordifferent values of 119896 With a larger value of 119896 an object inSafe-time(S) will have a higher chance to derive the incorrectsafe time thus causing lower accuracy When the value of 119896increases the response time of all threemethods will increasesignificantly as shown in Figure 16(d) The reason is thatall DC119896NN Safe-time(S) and Safe-time(M) need to searchmore objects and collect more information for answering thequery when the value of 119896 increases to a certain number For

18 International Journal of Distributed Sensor Networks

2 4 6 8 100

10

20

30

40

50

60

Speed (ms)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

2 4 6 8 100

100

200

300

400

500

600

700

800

Speed (ms)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

2 4 6 8 1070

75

80

85

90

95

100

105

Speed (ms)

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

2 4 6 8 1009

095

1

105

11

115

12

125

13

Speed (ms)

Aver

age r

espo

nse t

ime (

s)

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 18 The impacts of speed on (a) update frequency (b) number of messages (c) accuracy and (d) response time

DC119896NN DC119896NN only needs to store local Voronoi diagramwhere the information required is less than required in Safe-time(S) and Safe-time(M) so the response time of DC119896NN isthe shortest

65 The Effect of Moving Objects In this experiment set weconsider different percentages of moving objects in all thedata objects The default value is 20 which means that ifthere is a total of 30 objects then there are sixmoving objectsIn Figures 17(a) and 17(b) as the percentage ofmoving objectsincreases the overall number of updates required between theobjects increases relatively and the change rate of answer totheDC119896NNaccelerates thus increasing the update frequencyof the query and the number of messages However DC119896NNstill keeps the best performance Figure 17(c) shows the accu-racy of the result for different percentage of moving objectsDC119896NN and Safe-time(M) both have higher accuracy and

Safe-time(S) is still the worst The safe time of each object inSafe-time(S) is calculated using the maximum speed of theobjects Hence whether the object is moving or not does notdirectly result in the incorrectness of the answer collectionIn fact in Safe-time(S) one of the main reasons to affectthe accuracy is the directions of moving objects Last asFigure 17(d) shows the percentage of moving objects doesnot impact the response time too much

66 Effects of Speed If each object moves faster the relativevelocities between objects may also become faster This willmake the safe time shorter and the update frequency ofeach object and query increases The safe time used inSafe-time(S) and Safe-time(M) is directly affected by themaximum speed of objects and does not consider the direc-tion of each objectrsquos movement and the speed of individualmovement No matter the objects move or not and move

International Journal of Distributed Sensor Networks 19

fast or slow both of the above methods directly use themaximum speed of objects to calculate the safe time forupdating On the other hand DC119896NN considers the movingdirection of objects and the proper safe-time for updatesIn this experiment the number of moving objects is 20of all the objects As Figure 18(a) shows as the movingobjects speed up the update cost increases and DC119896NN stillperforms best As the speed increases the safe-time in Safe-time(S) and the Safe-time(M) becomes much shorter due toa larger maximum speed among all the objects The trendbecomes even worse as the speed increases

Figure 18(b) shows the trend about the number of trans-mitted messages when the speed is up DC119896NN still hasthe best performance on the number of messages There are42781 messages sent in average when the speed of object is10ms However the Safe-time(M) needs 67913 messagesThe accuracy will not be effected as the speed changesfor DC119896NN and Safe-time(M) because both of them aredesigned or adapted for themoving objects and queries Safe-time(S) will have more inaccurate results as the speed is highas shown in Figure 18(c) However the response time doesnot have a significant impact on the response time for all thethree methods Figure 18(d) presents this trend

7 Conclusions

In this paper we propose a new approach DC119896NN whichuses the local Voronoi diagram and proper safe-time toeffectively process the C119896NNquery in distributed andmobileenvironments such as wireless sensor networks The propersafe-time can be quickly derived by a simple formulaBy comparing our proposed DC119896NN with other existingapproaches Safe-time(S) DC119896NN can effectively improvesearch efficiency reduce response time and the numberof messages and keep the accuracy of the result highAdditionally DC119896NN reduces more 30 of transmissionmessages than Safe-time(M) because the characteristics of theVoronoi diagram are used and each objectrsquos moving directionis considered instead of directly using the maximum speedof the objects as Safe-time method The derived safe-timeis more precise As a result DC119896NN needs less updatefrequency reduces a great number of messages transmittedand yields more accurate results In this work simulationexperiments are also performed The experimental resultsvalidate the proposed DC119896NN approach for the continuous119896 nearest neighbor query in distributed and mobile environ-ments where all the data objects and query can move

Acknowledgment

This work is partially supported by NSC under the Grant98-2220-E-027-007 100-2221-E-027-087-MY2 and 102-2221-E-027-088-

References

[1] O Bohl S Manouchehri and U Winand ldquoMobile informationsystems for the private everyday liferdquo Mobile InformationSystems vol 3 no 3-4 pp 135ndash152 2007

[2] Y Tao andD Papadias ldquoTime-parameterized queries in spatio-temporal databasesrdquo in Proceedings of the ACM SIGMODInternational Conference on Managment of Data pp 334ndash345June 2002

[3] Y Tao D Papadias and Q Shen ldquoContinuous nearest neighborsearchrdquo in Proceedings of the 28th International Conference onVery Large Data Bases (VLDB rsquo02) pp 287ndash298 2002

[4] F Aurenhammer ldquoVoronoi diagramsmdasha survey of a fundamen-tal geometric data structurerdquo ACM Computing Surveys vol 23no 3 pp 345ndash405 1991

[5] K Kim Y Cai andW Tavanapong ldquoSafe-time distributed real-time monitoring of cKNN in mobile peer-to-peer networksrdquo inProceedings of the 9th IEEE International Conference on MobileData Management (MDM rsquo08) pp 124ndash131 April 2008

[6] M Kolahdouzan and C Shahabi ldquoVoronoi-based k nearest nei-ghbor search for spatial network databasesrdquo in Proceedings ofthe 30th International Conference on Very Large Data Bases vol30 pp 840ndash851 2004

[7] M R Kolahdouzan and C Shahabi ldquoAlternative solutions forcontinuous K nearest neighbor queries in spatial networkdatabasesrdquo GeoInformatica vol 9 no 4 pp 321ndash341 2005

[8] D Papadias Y Tao K Mouratidis and C K Hui ldquoAggregatenearest neighbor queries in spatial databasesrdquo ACM Transac-tions on Database Systems vol 30 no 2 pp 529ndash576 2005

[9] T Imielinski S Viswanathan and B R Badrinath ldquoData on airorganization and accessrdquo IEEE Transactions on Knowledge andData Engineering vol 9 no 3 pp 353ndash372 1997

[10] S Hambrusch C-M Liu and S Prabhakar ldquoBroadcasting andquerying multi-dimensional index trees in a multi-channelenvironmentrdquo Information Systems vol 31 no 8 pp 870ndash8862006

[11] C-M Liu and K-F Lin ldquoDisseminating dependent data inwireless broadcast environmentsrdquo Distributed and ParallelDatabases vol 22 no 1 pp 1ndash25 2007

[12] T-C Su and C-M Liu ldquoOn-demand data broadcasting for dataitems with time constraints on multiple broadcast channelsrdquo inDatabase Systems for Advanced Applications vol 6193 of LectureNotes in Computer Science pp 458ndash469 2010

[13] B Zheng J Xu W-C Lee and D L Lee ldquoGrid-partition ind-ex a hybrid method for nearest-neighbor queries in wirelesslocation-based servicesrdquo The VLDB Journal vol 15 no 1 pp21ndash39 2006

[14] B Gedik A Singh and L Liu ldquoEnergy efficient exact kNN sear-ch in wireless broadcast environmentsrdquo in Proceedings of the12th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo04) pp 137ndash146 November 2004

[15] KMouratidis S Bakiras and D Papadias ldquoContinuousmonit-oring of spatial queries in wireless broadcast environmentsrdquoIEEE Transactions onMobile Computing vol 8 no 10 pp 1297ndash1311 2009

[16] G Chatzimilioudis D Zeinalipour-Yazti W-C Lee and M DDikaiakos ldquoContinuous all k-nearest-neighbor querying insmartphone networksrdquo in Proceedings of the 13th IEEE Interna-tional Conference on Mobile Data Management (MDM rsquo12) pp79ndash88 2012

[17] T-Y Fu W-C Peng and W-C Lee ldquoParallelizing itinerary-basedKNNquery processing inwireless sensor networksrdquo IEEETransactions on Knowledge and Data Engineering vol 22 no 5pp 711ndash729 2010

[18] T P Nghiem A B Waluyo and D Taniar ldquoA pure peer-to-peerapproach for kNNquery processing inmobile ad hoc networksrdquo

20 International Journal of Distributed Sensor Networks

Personal and Ubiquitous Computing vol 17 no 5 pp 973ndash9852013

[19] HD Chon D Agrawal andA El Abbadi ldquoRange and kNNqu-ery processing for moving objects in Grid modelrdquo MobileNetworks and Applications vol 8 no 4 pp 401ndash412 2003

[20] X Xiong M F Mokbel and W G Aref ldquoSEA-CNN scalableprocessing of continuous K-nearest neighbor queries in spatio-temporal databasesrdquo in Proceedings of the 21st InternationalConference on Data Engineering (ICDE rsquo05) pp 643ndash654 April2005

[21] G Zhao K XuanW Rahayu et al ldquoVoronoi-based continuous120581 nearest neighbor search in mobile navigationrdquo IEEE Transac-tions on Industrial Electronics vol 58 no 6 pp 2247ndash2257 2011

[22] KMouratidis D Papadias S Bakiras and Y Tao ldquoA threshold-based algorithm for continuous monitoring of k nearest neigh-borsrdquo IEEE Transactions on Knowledge and Data Engineeringvol 17 no 11 pp 1451ndash1464 2005

[23] S-H Wu K-T Chuang C-M Chen and M-S Chen ldquoDIK-NN an itinerary-based KNN query processing algorithm formobile sensor networksrdquo inProceedings of the 23rd InternationalConference on Data Engineering (ICDE rsquo07) pp 456ndash465 April2007

[24] D T Lee ldquoOn k-nearest neighbor voronoi diagrams in the pla-nerdquo IEEE Transactions on Computers vol 31 no 6 pp 478ndash4871982

[25] K Patroumpas TMinogiannis andT Sellis ldquoApproximate ord-er-k Voronoi cells over positional streamsrdquo in Proceedings of the15th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo07) pp 276ndash283 November 2007

International Journal of

AerospaceEngineeringHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

RoboticsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Active and Passive Electronic Components

Control Scienceand Engineering

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

RotatingMachinery

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

Journal ofEngineeringVolume 2014

Submit your manuscripts athttpwwwhindawicom

VLSI Design

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Shock and Vibration

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawi Publishing Corporation httpwwwhindawicom

Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

SensorsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Navigation and Observation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

DistributedSensor Networks

International Journal of

Page 6: Research Article Distributed Continuous k Nearest Neighbors ...downloads.hindawi.com/journals/ijdsn/2013/125145.pdfmobile environments like WSNs, which consist of a number of mobile

6 International Journal of Distributed Sensor Networks

A 3-nearest neighbor at t0Not a 3-nearest neighbor at t0

CDk = 3

q1

q1 o1

o1 o2

o2

o3

o3

o4

o4

o5

o5

CD2Broadcast range

New CD

t = t0 + ST

(a)

(b)

t = t0

(c)

o1

o2

o3o4

o5

CDq1

CD2

Figure 6 Update process using safe-time for 3NN search on WSNs (a) shows the CD between the third and fourth closest data points (b)presents the maximum influenced distance for update using broadcast (c) indicates the area for broadcasting to update

circles incremental with an distance 119908 The query message isforwarded in hop by hop manner as shown in Figure 5(b)Finally the system can obtain the initial 119896NN from the lastobject which finished the query processing and derive thedistance cross-distance (CD) between the 119896th and (119896 + 1)thnearest neighbors As Figure 6(a) shows the system then cancompute a safe time = CD(2 lowast MaxSpeed) by the cross-distance between the 119896th and (119896 + 1)th nearest neighborsThis indicates that the system ensures that the order of 119896thand (119896 + 1)th nearest neighbors will not exchange in the safe-time periodThus the resulting 119896NNdoes not need to updateIn addition the maximum moving distance of each objectis limited in the safe-time so we can predict the maximuminfluenced region after the movement of 119896th and (119896 + 1)thnearest neighbors as shown in Figures 6(b) and 6(c) to obtainthe safe region (the dark rings in the figure) The system willignore the objects which locate outside the safe region thusreducing the cost of updating each objectrsquos information

34 Performance Metrics In order to evaluate the proposedDC119896NN approach we consider the following performancemetrics including update cost number of messages accuracyand response time

341 Update Cost The update cost is to measure the numberof updates during the query process We sometimes use thefrequency to denote it Since the sensors (objects) and eventhe query will move the status of the sensors should bemaintained in order to have the accurate results However thecost for one update is high in the distributed environmentHence one of the objectives of the designed algorithmDC119896NN is to minimize the update cost for the C119896NN query

342 Number ofMessages Except for the number of updatesthere are some other kinds of messages for the queryprocess in the distributed andmobile environment includingthe messages for query and information passing The totalnumber of messages used during the query process can be

used to indicate the throughput over the networks and theenergy consumption So the proposed DC119896NN is towardsminimizing the total number of messages for the query

343 Accuracy By using the pull-based approach the timeinterval for routing updatemessages to the server depends onthe distance between the data object and the server It thus cannot ensure that the location information of each object savedin the server is the latest Hence the results may be timelyincorrect when deriving the answers for a query due to themobilityThis situation becomes worse in the distributed andmobile environments In our design the proposed approachcan avoid redundant updates and keep the accuracy of theresults

344 Response Time The complicated query process thedelay time for message communication and the numberof users will affect the response time of the system toprocess the query Long response time is unbearable andmayreturn obsoletely invalid query results Even worse the longresponse time may cause important information missing orfinancial loss Thus the system response time is also one ofthe important issues that must be considered when designingthe method for continuous queries

4 Distributed Continuous 119896 NearestNeighbors Search

In the mobile and distributed environments like WSNs orMANETS the pull-based approach may not be a goodmatchfor C119896NN search due to the problems discussed in Section 2We thus propose a distributed algorithm DC119896NN for C119896NNsearch in the mobile and distributed environments Thedistributed approach using a better safe-time can reduce theupdate cost relieve the load for server shorten the responsetime and make the result more accurate There are threephases in DC119896NN initialization phase query processingphase and information update phase In the initialization

International Journal of Distributed Sensor Networks 7

query DC119896NN search()(1) broadcast a query 119902(119896 ℎ119900119901119888) ℎ119900119901119888 is initial to 1(2) get the Voronoi cells or objectrsquos information(3) if (119896 = 1) then(4) show LVC(5) find 119904119886119891119890119905119894119898119890 of DC1NN (with LVC)(6) elseif (119896 gt 1) then(7) while the received information is insufficient do(8) broadcast the query 119902(119896 ℎ119900119901119888 + 1) to ask more hops of neighbor nodes(9) run normal 119896NNSearch to find 119896NN set(10) show LVC according to 119896NNset and 119868119899119891119900(11) find 119904119886119891119890119905119894119898119890 of DC119896NN (with LVC)(12)while (119904119886119891119890119905119894119898119890 = 0)(13) wait

Algorithm 1 The DC119896NN algorithm on the query (sink) node

phase each moving object exchanges the location informa-tion and builds a local Voronoi cell (LVC) as well as calculatesthe safe time for the LVC The query processing phasecollects sufficient location and environmental informationof neighboring neighbors for exploring the result of thegiven C119896NN query The last information update phase is tomaintain the latest information for the moving objects andthe result of the continuous 119896 nearest neighbor query Thefollowing will explain each phase in details

41 Phase 1 Initialization (119896=1) During system initializationeach mobile sensor (moving object) exchanges locationinformation with its neighbors derives the local Voronoi cell(LVC) calculates the safe time of LVC and then stores theLVC and safe time in the memory

When a user issues an NN query 119876 and broadcasts thequery message 119902(119896 ℎ119900119901119888) (case 119896 = 1) where 119896 is the numberof the nearest neighbors the query wants to find and ℎ119900119901119888

is the hop counter and sets to one initially When the querypoint 119876rsquos neighboring objects receive the query message119902(119896 ℎ119900119901119888) they will determine whether 119876 is located in theirVoronoi Cells (VCs) If a neighboring object replies true itmeans that this neighboring object is the nearest neighbor ofthe query point 119876 and this neighboring object will transmitthe Voronoi cell (VC) information of itself to the query point119876 including the neighboring object boundaries locationdirection and speed of movement and some environmentalinformation On the other hand if a neighboring objectreturns false this neighboring object will check whetherquery point119876moves towards it or not If the query point119876 ismoving towards a neighboring object then this neighboringobject also will send its VC information to the 119876 otherwisethe query message will be ignored After the initializationphase eachmoving object will maintain the LVC informationand safe time The update process will be executed for thelatest LVC information only when the safe time decreases tozero Assume that each object has 119889 neighbors in averageSince the bisector between two objects costs 119874(1) time theLVC construction (Initialization phase) can be finished in119874(119889) time

42 Phase 2 C119896NN Query Processing The pseudocodeQuery DC119896NN Search() in Algorithm 1 shows the wholequery process on the query point The operations fromLine 6 to the end of Query DC119896NN Search() do the queryprocessing of C119896NN (119896 gt 1) When a query point119876 wants tofind the 119896 nearest neighbors where 119896 gt 1 119876 first broadcastsmessages 119902(119896 ℎ119900119901119888) (case 119896 gt 1) and gets the local Voronoicell (LVC) information from the nearest neighboring (NN)object The nearest neighboring object of 119876 is responsiblefor routing messages to its neighboring objects collectingthe local Voronoi cell (LVC) information of the neighboringobjects and sending information back to query point 119876Basically if the received information is insufficient to derivethe 119896NN answer the query point 119876 will repeatedly sends thequery message 119902 with one more hop (ie ℎ119900119901119888 = ℎ119900119901119888 + 1) tothe specific neighboring objects to obtain more neighboringVC information until the received information is enough toget 119896NN answer

When the received information is enough to derive theresults of 119896NN the query point 119876 will use the approximatemethod we modified from [25] to calculate the approximateorder-119896 LVC in which the query point 119876 locates By usingthe modified method the query point 119876 has to partitionthe plane into 120582 equal sectors and selects an additionalnearest neighboring object in each sector excluded from119896NN objects Thus the query point 119876 needs to collect atleast 119896 + 120582 neighboring objectsrsquo information to build theapproximate order-119896 LVC Note that the information of theadditional 120582 objects can be learned from the informationof the received neighboring objects In comparison with thecentralized approach for constructing the approximate order-119896 Voronoi cell the modified approximate method only needsto consider the 119896nearest neighboring objects and120582 additionalnearest neighboring objects instead of considering all objectsin the wireless environment The computation time is thusmuch better than the traditional centralized approach andcan be derived as119874(120582) + 119874(120582) times 119874(119896) = 119874(120582(119896 + 1)) where119874(120582) is the time for selecting the 120582 additional neighboringobjects In the end 119874(120582119896) is the time for determining theboundary of the approximate order-119896 LVC For more detailsabout the analysis of the computation time please refer to

8 International Journal of Distributed Sensor Networks

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

(a)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q

(b)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q

(c)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q

(d)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

q

(e)

Figure 7 An example of DCNN where (a) each sensor exchanges information in the initial step (b) each sensor builds its LVC (c) a queryat object 119902 is issued and sensor 119900

1returns the information of its LVC to 119902 since 119902 is located in the Voronoi cell associated with 119900

1 (d) object

119902 knows which sensor will be reached next and can derive the safe time by the LVC information of 1199001 and (e) the query result to 119902 can be

updated seamlessly when it moves to 1199006

[25] After the query point 119876 calculates the approximateorder-119896 LVC a safe time of the query 119902 can be derived Thesafe time of the query 119902 is regarded as the time limit forstarting the next location information updating process andupdating the C119896NN answer

Figure 7 gives an example for the case of 119896 = 1 Asshown in Figure 7(a) there are 16moving sensors 119900

1 119900

16

in the system and each sensor has the location informationabout itself In the initial phase each sensor broadcasts themessage with its location information and receives the loca-tion information from its neighbors The local Voronoi cell(LVC) of each sensor then can be calculated and stored Theoverall calculatedVoronoi diagram is depicted in Figure 7(b)Afterwards if the locations of the sensors change as movingeach sensor will broadcast new location information to itsneighbors and each sensor can derive a new LVC by thereceived updating messages In Figure 7(c) a continuous NNquery is issued by some query object 119902 with its locationIn order to know the Voronoi cell where 119902 locates 119902 firstbroadcasts the query message to the neighboring sensors(in dashed circle) After receiving the query message theneighboring sensor will check whether the query 119902 is locatedin its associated cell If 119902 is not in the cell the sensor willignore the querymessage In Figure 7(c) sensor 119900

1will return

the result to the query 119902 saying that object 1199001is the nearest

neighbor of 119902 for the time being If 119902 moves in the directionas indicated by the solid arrow in Figure 7(d) to object 119900

6

119902 can know that it moves towards the boundary of 1199001and

1199006by the LVC stored in 119900

6and then derive the safe time

When approaching the boundary (ie the safe time is almostpassed) a query message to 119900

6will be issued by 119902 in advance

Sensor 1199006will reply to 119902with the cell information to maintain

the accuracy of the query result Figure 7(e) shows the resultafter 119902moves into the associated cell of sensor 119900

6

Figure 8 demonstrates an example of DC119896NN for 119896 gt

1 The initial phase is the same as the previous DCNNexample Each sensor derives the corresponding LVC withthe information from the neighboring sensors The queryis issued by a moving object 119902 with its location Object 119902

locates itself and knows that it is in the VC of 1199001after sensor

1199001replies to 119902 with its LVC information Suppose 119896 = 3

After the initialization 119902 is located in 1199001and has the LVC

information of 1199001 Having such information 119902 can derive the

NN but 3NN cannot be decided yet So 119902 will broadcast thequery message to all of its one-hop neighboring sensors say1199001 1199002 1199003 1199008 and 119900

9in Figure 8(a) to request information

The neighboring sensors will reply to 119902 the information abouttheir LVCs Object 119902 then can derive the resulting 3NN forthe time being say 119900

1 1199008 and 119900

9in the example With

these replied information 119902 can build the approximate order-3 Voronoi cell as shown in Figure 8(b) Then 119902 uses theapproximate order-3 Voronoi cell to derive the safe time inorder to maintain the continuous query result Now if 119896 =

10 the information received from the one-hop neighboringsensors is not enough to derive the result Then the querymessage will be broadcast to 119902rsquos two-hop neighboring sensorsas Figure 8(c) shows If the information is not enough toderive the resulting 119896NN the querymessagewill be broadcast

International Journal of Distributed Sensor Networks 9

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q n1n2

n3

n4(k + 1)

(a)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5qn1

n2

n3

(b)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o3o4

o5q

o9

o2

(c)

o1

o6

o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q

n11(k + 1)

n1

n4n5

n6

n10

n7

n8

n2n9

n3

(d)

o1

o6

o7

o8

o11o10

o12

o13o14o15

o16o9

o2 o3o4

o5q n1n2

n4n5

n6

n7

n3

n9n10

n8

(e)

Figure 8 An example of DC119896NN for 119896 gt 1 where the initialization phase is the same as previous DCNN example and (a) 1199001 1199008 and 119900

9are

the 3NN to the query object 119902 (b) the approximate order-3 Voronoi cell can be built with enough information received (c) the information isnot enough for 10NN query and two-hop neighboring sensors are requested (d) the resulting 10NN can be derived and (e) the approximateorder-10 Voronoi cell can be calculated with information received

to one more hop neighboring sensor Such process will berepeated with an increment on the hop count After havingenough information 119902 can calculate the resulting 10NN andthe approximate order-10 Voronoi cell as shown in Figures8(d) and 8(e) respectively Using the approximate order-10Voronoi cell the safe time can be derived In the followingwe will discuss how to derive the safe time for maintainingthe result of the continuous 119896NN query

43 Phase 3 Information Updates In the distributed andmobile environments it is challenging for a mobile nodeto maintain the location information of the other mobilenodes effectively If a mobile node sends the update messagesfrequently it will consume much network resource andpower Furthermore the result of themoving query should beeffectively maintained For different roles nodes and querywe propose effective ways respectively in our DC119896NN queryprocess to update the location information and maintain thequery result

431 The Safe Time of Each Object In the proposed appro-ach DC119896NN each object cooperates with each other andexchanges information to update the location information ofeach object In order to monitor and obtain the continuousanswer of a continuous 119896 nearest neighbors query we usea safe distance between each object and query Then wecan derive the safe time of each object for location updatesby estimating the maximum speed of that object Supposethat the sensing area is partitioned into a grid for location

management There are three possible methods for derivingthe safe distance The first one is the grid-based safe distanceEach object directly uses the minimum distance betweenitself and the boundary of the grid cell where the objectlocates Simply using the grid-based safe distance may causesome problems about the imprecise updates The secondmethod VD-based safe distance uses VD to obtain the safedistance In order to predict the safe distance more preciselywe can consider the previous two distances simultaneouslyand then select the smaller one So the last method propersafe distance will return a better safe distance by comparisonsHaving the safe distance the safe time then can be derived byestimating the maximum speed of the considered object

In Figure 9 the sensing area is divided into a grid andthe Voronoi diagram formed by the sensors is also shownFor sensor 119900

1in Figure 9(a) the grid-based safe distance and

VD-based safe distance are presented respectively and theproper safe distance will be the VD-based safe distance afterthe comparison On the contrary for sensor 119900

3in Figure 9(b)

the proper safe distance will be the grid-based safe distance

432The Safe Time of EachQuery For themoving query it isimportant to know when the result will change To derive thesafe time during which the result will not change we referto the characteristics of Voronoi diagram In the traditionalenvironment with static objects the system only uses theminimum distance from the query to the boundary of theVoronoi cell where the query locates as the safe distance Thethe safe time can be obtained by the estimated maximum

10 International Journal of Distributed Sensor Networks

o1

o7

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

o6o8

(a)

o1

o7

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

o6o8

(b)

Figure 9 An illustration for different safe distances (a) sensor 1199001uses the VD-based safe distance as the proper safe distance and (b) sensor

1199003uses the grid-based safe distance as the proper safe distance

L L

A

B

Safe distance

Query

B

A

120579

New safe distance

QueryA998400

L998400

B998400

Figure 10 An example showing the impact on the safe distancecaused by object movement

speed of that query During the safe time no update isnecessary thus saving the update cost

Unfortunately in the moving object environment theabove method cannot obtain the right safe time As shownin Figure 10 the left part shows the static case where 119871 is theVoronoi cell boundary between objects 119860 and 119861 and the safedistance of the query can be calculated as the figure showsHowever for the moving objects the original safe distancebetween the 119871 and query cannot be directly used to calculatethe safe time because the object movement will cause thedistance form query to 119871 to be nonlinearly increasing ordecreasing As the right part of Figure 10 shows after themovement of object 119860 and object 119861 119871 becomes 119871

1015840 and thesafe distance changes Thus if we want to use the boundariesof Voronoi cell to estimate more accurate safe time we needto consider the relative movements between the objects andquery

In order to derive the precise safe distance we considerthe movements of objects and query simultaneously and useFigure 11 to illustrate Initially 119876119860 and 119876119861 are the distancesfrom the query to objects 119860 and 119861 respectively The linebetween 119860 and 119861 is the boundary of the Voronoi cellsassociated with 119860 and 119861 and the query is located in thecell of 119860 as Figure 11(a) shows When objects and the querymove as in Figure 11(b) the query may touch the boundaryThis indicates that the query will enter another cell and theresult of the query should be updated The time from thebeginning to the moment of touching the boundary is theprecise safe time for the query According to the properties

of Voronoi diagram when the query is on the boundary119876119860 = 119876119861 We hence can use the condition of 119876119860 = 119876119861

to decide whether the query is on the boundary With thisproperty even though the objects and querymove frequentlythe query only needs the speeds directions and locationsof the neighboring objects to predict the safe time easilyWithin the safe time the query will not touch the boundaryIn Figure 11(c) the query meets the boundary at 119905

1and the

safe time is 1199051

In the following we present the way to calculate the safetime when 119876119860 = 119876119861 Assume that the initial location of themoving query is (119909

119902 119910119902) and the speed is (119881

119909119902 119881119910119902

) Supposethe initial location of object 119860(119861) is (119909

119860 119910119860)((119909119861 119910119861)) with

the speed being (119881119909119860

119881119910119860

)((119881119909119861

119881119910119861

)) The equation to findwhen the querymeets the boundary can be derived accordingto the property of perpendicular bisector Since119876119860 = 119876119861 wecan have

([(119909119902+ 119881119909119902

lowast 119905) minus (119909119860

+ 119881119909119860

lowast 119905)]2

+[(119910119902+ 119881119910119902

lowast 119905) minus (119910119860

+ 119881119910119860

lowast 119905)]2

)

12

= ([(119909119902+ 119881119909119902

lowast 119905) minus (119909119861

+ 119881119909119861

lowast 119905)]2

+[(119910119902+ 119881119910119902

lowast 119905) minus (119910119861

+ 119881119910119861

lowast 119905)]2

)

12

(1)

Then

0 = [1198812

119909119860

+ 1198812

119910119860

minus 1198812

119909119861

minus 1198812

119910119861

minus 2 lowast 119881119909119902

119881119909119860

minus2 lowast 119881119910119902

119881119910119860

+ 2 lowast 119881119909119902

119881119909119861

+ 2 lowast 119881119910119902

119881119910119861

] lowast 1199052

+ 2 [(119909119902minus 119909119860) (119881119909119902

minus 119881119909119860

) + (119910119902minus 119910119860) (119881119910119902

minus 119881119910119860

)

minus (119909119902minus119909119861) (119881119909119902

minus119881119909119861

) minus (119910119902minus119910119861) (119881119910119902

minus119881119910119861

)] lowast 119905

+ [(119909119902minus 119909119860)2

+ (119910119902minus 119910119860)2

minus (119909119902minus 119909119861)2

minus (119910119902minus119910119861)2

]

(2)

International Journal of Distributed Sensor Networks 11

A

B

Query

(x3 y3)

(x2 y2) (x1 y1)QA

QB

(Vx2 Vy2)

(Vx3 Vy3)

(Vx1 Vy1)

(a)

A

B

Query

(x3 y3)

(x2 y2)(x1 y1)

QA

QB

(Vx2 Vy2)

(Vx3 Vy3)

(Vx1 Vy1)

(b)

A

B

d

t1 t2 t3 t

(c)

Figure 11 The precise safe-time for moving objects 119860 and 119861 and the moving query where (a) shows the beginning state (b) presents themoment when the moving query meets the boundary and (c) gives the diagram for the change on the safe distance with time 119905

o1

o2

o3o4

o5

CDq1

CD2

(a)

o1

o2

o3o4

o5

CDq1

CD2

q9984001

(b)

Figure 12 The phenomenon when using the original safe-time methods to (a) stationary query and (b) moving query

Equation (2) is a quadratic equation Since a generalquadratic equation can be written in the following form1198861199092

+ 119887119909 + 119888 = 0 recall that the discriminant of a quadraticequation is Δ = 119887

2

minus 4119886119888 If Δ gt 0 there are two distinct realroots if Δ = 0 there is exactly one real root if Δ lt 0 thereare two distinct (non-real) complex roots In (2)

119886 = 1198812

119909119860

+ 1198812

119910119860

minus 1198812

119909119861

minus 1198812

119910119861

minus 2 lowast 119881119909119902

119881119909119860

minus 2 lowast 119881119910119902

119881119910119860

+ 2 lowast 119881119909119902

119881119909119861

+ 2 lowast 119881119910119902

119881119910119861

119887 = 2 [(119909119902minus 119909119860) (119881119909119902

minus 119881119909119860

) + (119910119902minus 119910119860) (119881119910119902

minus 119881119910119860

)

minus (119909119902minus 119909119861) (119881119909119902

minus 119881119909119861

) minus (119910119902minus 119910119861) (119881119910119902

minus 119881119910119861

)]

119888 = (119909119902minus 119909119860)2

+ (119910119902minus 119910119860)2

minus (119909119902minus 119909119861)2

minus (119910119902minus 119910119861)2

(3)

and then we can derive the safe time 119905 according to thediscriminant

119905 =

[minus119887 + (1198872

minus 4119886119888)12

]

2119886or

[minus119887 minus (1198872

minus 4119886119888)12

]

2119886

(4)

Finally we select the minimum value of 119905 gt 0 as the safetime

Additionally assuming that 119889 is the distance between theobject and the query and 119905 is the time 119876119860 = 119876119861 can be

converted into a function of 119905 and 119889 as shown in Figure 11(c)Then we can obtain the safe time 119905

1which is the time when

119876119860 = 119876119861 Furthermore the object 119861 will be closest to thequery at the time 119905

3

5 Comparisons with Previous Approaches

In this section we compare the proposed DC119896NN approachthe Safe-time with stationary query approach [5] and thenaıve way used pull-based approach in terms of safe timespace and accuracy

51 Safe Time The original safe-time with stationary query[5] (safe-time(S)) does not support moving queries Anexample of C3NN is shown in Figure 12 where 119902

1is the query

point triangles are the 3NN objects the pentagons representthe other individual objects and 119900

4is 4th NN Figure 12(a)

shows the original result for safe-time(S) After obtaining the119896th and (119896 + 1)th objects (119900

2and 1199004in the figure) the cross-

distance (CD) of 119896th and (119896 + 1)th objects can be calculatedRecall that the cross distance of two data objects 119860 and 119861 isthe difference on the distances of119860 and119861 to the center (or thequery point) For the next update (after a safe-time period)all the objects in this region should be checked

We adapt the safe-time(S) method for moving queryThe adapted approach will result in a higher update cost

12 International Journal of Distributed Sensor Networks

Figure 12(b) presents a case that the query moves towardobject 119900

3(119896th NN) and away from object 119900

4((119896 + 1)th NN)

When the query 1199021moves to the point 1199021015840

1 the most outside

concentric circle increases and becomes as large as the mostoutside dotted concentric circle On the contrary the mostinside concentric circle decreases and becomes as small as themost inside dotted concentric circle Thus the cross-distanceincreases and more number of objects will be examined

In addition according to the Figure 12(b) we can knowthat the original Safe-time method safe-time(S) is notappropriate for moving queries since the calculation of Safe-time(S) method does not consider the speed of query safe-time(S) directly uses twofold of the maximum speed of the119896th and (119896+1)thNNobjects to divide theCD to derive the safetime The cost for updates increases when the CD becomeslarger since the average checked area becomes bigger Besidesthe obtained 119896NNanswer cannot be guaranteed to be correctOn the contrary the cross-distance when the query movestowards object 119900

4((119896 + 1)th NN) and away from object 119900

3

(119896th NN) in this case the order of the 119896th and (119896 + 1)th NNobjectmay be changed but the update does not perform thusresulting in incorrect results

We modify the Safe-time to fully support the movingquery In order to support and maintain the accuracy ofmoving query the maximum speed (Maxspeed) used in thesafe time calculation is required to be modified and replacedby the maximum relative speed between the query and theobjects Because of using the relative speed the adaptedsafe-time method safe-time(M) needs twofold maximumrelative speed (2 lowast 119872119886119909119904119901119890119890119889) to calculate the safe time forguaranteeing the accurate resultsThe safe time derived is lessthan the one derived in safe-time(S) due to the relative speedHence the update frequency of safe-time(M) is higher thanthe update frequency of safe-time(S)

52 Space In DC119896NN each object and query only need tomaintain the information of LVC The information to bestored includes the location of neighboring objects and theobject information of order-119896rsquos local Voronoi diagram Thetotal amount of stored information is not significant on eachobjectThus the use of storage space does not need to be verysubstantial

53 Accuracy The safe-time (S) [5] considers the stationaryquery When applying it to the moving query some adaptionshould bemade According to our experimental results whenthe value of 119896 increases with a moving query the accuracy ofthe result will be reduced In our simulation we modify theoriginal Safe-time(S) as Safe time(M) for moving query andconsider the relative distance in detail caused by the movingquery and objects Although the correctness of the answer canbe increased the update frequency increases thus increasingthe number of delivered messages

DC119896NNuses Voronoi and grid cell boundary to calculatethe safe time and updates the information of related objectsbefore the end of the safe time In fact the boundary ofthe Voronoi cell represents the boundary of moving 119896NNquery After the safe time period the query will collect the

information of related neighboring objects Having such real-time information the query can have the resultmore accuratein time Similar to safe-time(M) DC119896NN uses the 119896th and(119896 + 1)th nearest moving objects to derive the safe time So itis able to maintain the correctness of the answer

6 Simulation Experiments

In the simulation we compare the following methods NaıveDC119896NN safe-time (S) and safe-time (M)TheNaıvemethodis centralized and used as a benchmark for the comparisonAll the mobile sensors will send the location informationto the central server to update the information The othermethods DC119896NN Safe-time(S) and Safe-time(M) are dis-tributed and used in the considered mobile wireless sensornetwork where each object knows its position has the abilityto perform some calculation and stores the information oflocalized Voronoi cell (LVC)We assume that each object cantransmit amessage to its one-hopneighbor so that each objectcan communicate with at least one object For Safe-time(S)and the safe-time(M) a maximum speed (MaxSpeed) is setin order to estimate relative speed and distance for safe-timecalculation

In the simulation all the compared approaches areperformed under the same environmental conditions forfairness The initial location and speed of moving objectsare uniformly randomly distributed Since we focus on theperformance of the query process of the proposed DC119896NNapproach we further assume that the transmission quality isideal and no congestion and communication delays occurThe metrics measured include the update frequency for aquery the total number of messages response time andaccuracy The update frequency for a query is the averagenumber of update messages sent by the data objects relatedto the query per minute The total number of messages isall the amount of messages sent from all objects during thequery process The accuracy of each method is measuredby comparing the results to the real answers Since thequery is continuous and the update occurs subsequently themeasured response time is mainly the time required fromsending a query to obtaining the first result

All the experiments are simulated so the results aboutthe response time may not show the practical cases exactlybut can reflect the trends on the performance among all thecompared approaches relatively In order to have the responsetime in our simulation we thus use the total number of hopsfor deriving the result tomultiply the average time for one hopin the simulation system to present the response time Thusthe response time is proportional to the total number of hopsin our simulation program In addition because the maindifference between Safe-time(S) and the Safe-time(M) is theway for deriving the safe time the measured response timeof these two methods is the same The simulation programis implemented with Java The setting of our simulation isshown in Table 1 with a default value for each parameter Inall the simulation experiments the final results are reportedwith the average of 100 queries The duration of each query is60 seconds

International Journal of Distributed Sensor Networks 13

200 400 600 800 10000

10

20

30

40

50

60

Edge length of sensing area (m)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

200 400 600 800 10000

100

200

300

400

500

600

700

Edge length of sensing area (m)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

200 400 600 800 100075

80

85

90

95

100

105

Edge length of sensing area (m)

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

200 400 600 800 1000Edge length of sensing area (m)

Aver

age r

espo

nse t

ime (

s)

DCkNNSafe-time(S)Safe-time(M)

095

1

105

11

(d) Response time

Figure 13 The effects of different sensing areas on (a) update frequency (b) number of messages (c) accuracy and (d) response time

Table 1 Simulation parameters

Parameter Range Default valueEdge length of sensingarea (m) 200 400 600 800 1000 600

Edge length of grid (m) 50 100 150 50Number of objects 20 30 40 50 60 30Transmission range (m) 125 125119896 1 3 5 10 20 3Moving objects () 20 40 60 80 100 20Speed (ms) 2 4 6 8 10 4

61 Effects of Sensing Area Sensing area affects the numberof update and query messages since if the area becomes

greater with the fixed number of objects relatively thedensity of the objects becomes sparse For example when thesensing areas are 200lowast200 400lowast400 600lowast600 800lowast800 and1000lowast1000 the densities are 188 047 021 012 and 008respectively Figure 13(a) shows that DC119896NN has the lowestnumber of updates with all the different areas and the numberof updates for Safe-time(S) is the highest (worst) becauseDC119896NN considers the moving direction and speed of thequeries and objects and selects the proper safe-distance toderive the safe-time Safe-time(S) the Safe-time(M) estimatethe safe time according to the maximum speed of the objectsso more number of updates can be expected AdditionallySafe-time(M) is updated more frequently than Safe-time(S)Recall that Safe-time(M) considers the query movement

14 International Journal of Distributed Sensor Networks

50 75 100 150 2000

5

10

15

20

25

Edge length of grid (m)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

50 75 100 150 2000

50

100

150

200

250

300

350

Edge length of grid (m)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

50 75 100 150 2000

20

40

60

80

100

120

Edge length of grid (m)

Accu

racy

()

DCkNN(G)DCkNN(V)

(c) Accuracy

50 75 100 150 2001

101

102

103

104

105

106

Edge length of grid (m)

Aver

age r

espo

nse t

ime (

s)

DCkNN(G)DCkNN(V)

(d) Response time

Figure 14 The comparisons of using grid-based and VD-base safe distances to derive the safe-time (a) update frequency (b) number ofmessages (c) accuracy and (d) response time

The average safe-distance becomes shorter thus leading tomore updates Besides when the sensing area increasesfrom 200lowast200 to 600lowast600 the update frequency dropsdramaticallyThe curve becomes flatter when the area is from600lowast600 to 1000lowast1000 since the difference on the densitiesof the areas from 600lowast600 to 1000lowast1000 is not much Thenumber of updates is less as the safe-time becomes largerThetotal number of transmitted messages of naıve approach isfixed at about 1800 packets All the other distributedmethodsuse fewer number of messages than naıve

To monitor the results DC119896NN only needs to check therelated objects in the local Voronoi cell at the proper safe-time thus reducing a lot of redundant update messages Safe-time(S) and Safe-time(M) use the maximum speed of theobjects to calculate the safe time so the total number of

transmitted messages of both approaches is more than that ofDC119896NN Figure 13(b) shows that more than 30 of the totalnumber of transmitted messages can be saved by DC119896NN incomparison with Safe-time(M)

For the accuracy since Safe-time(S) does not considerthe query movement the safe-time may be inaccurate Fur-thermore due to the mobility when the density is high theestimated results become more inaccurate So Safe-time(S)performs worst as shown in Figure 13(c) Safe-time(M) isrevised from Safe-time(S) by considering the query move-ment and the safe-distance is less in average for guaranteeingbetter results Hence Safe-time(M) has a better accuracy andalmost the same as DC119896NN The accuracy of Safe-time(M)and DC119896NN is almost about 100 correct and the gap maybe caused by arithmetical errors in the experiments

International Journal of Distributed Sensor Networks 15

10 20 30 40 50 60 700

5

10

15

20

25

30

35

40

45

Number of objects

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

10 20 30 40 50 60 70100

150

200

250

300

350

400

450

Number of objects

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

10 20 30 40 50 60 7080

85

90

95

100

105

Number of objects

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

10 20 30 40 50 60 70Number of objects

Aver

age r

espo

nse t

ime (

s)

096

098

1

102

104

106

108

11

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 15 The effects of the number of objects on (a) update frequency (b) number of messages (c) accuracy and (d) response time

When the area becomes larger the density becomeslower So the number of objects in each objectrsquos transmissionrange is fewer Under such a circumstance DC119896NN usesless computation and the response time is shorter as shownin Figure 13(d) In contrast the Safe-time(S) and the Safe-time(M) need to collect information before performing eachnew query and cause longer response time Since Safe-time(M) and Safe-time(S) use the same method and proce-dure to handle the first query the response time of these twomethods will be almost the same

62 Effects of Grid Size In this simulation experiment setwe want to observe the update efficiency of each object inthe third phase of DC119896NN Recall that we consider the grid-based and VD-base safe distances to derive a proper safe-time In this experiment DC119896NN(G) uses grid-based safe

distance to determine the safe time for the next update andDC119896NN(V) uses VD-base safe distance to derive the safetime The sensing area is fixed to 600lowast600m2 and there are30 data objects We compare DC119896NN(V) with DC119896NN(G)by observing the impacts of different grid sizes All theother settings have the similar trends in our experimentalresults In Figure 14(a) the update frequency of the objectsin DC119896NN(G) is high when the grid size is 50lowast50m2 andbecomes less when the grid size decreases Since the sensingarea is 600lowast600m2 and 30 objects are given the averagedistance between an object and the boundary of a Voronoicell is about 25 to 50 meters With the setting of grid size50lowast50m2 the average distance obtained in DC119896NN(G) isabout 25 meters Thus the safe time of DC119896NN(V) is longerIn general as Figures 14(a) and 14(b) show the update

16 International Journal of Distributed Sensor Networks

1 3 5 10 200

10

20

30

40

50

60

k

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

1 3 5 10 200

100

200

300

400

500

600

700

800

k

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

1 3 5 10 2080

85

90

95

100

105

k

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

1 3 5 10 20k

Aver

age r

espo

nse t

ime (

s)

08

09

1

11

12

13

14

15

16

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 16 The impacts of different values of 119896 on (a) update frequency (b) number of messages (c) accuracy and (d) response time

frequency of the objects and the number of messages sentby the objects decrease as the grid size increases

When the grid size is large the safe time becomes longand less number of updates are issued Hence the resultsbecome more inaccurate As shown in Figure 14(c) whenthe grid sizes are 50lowast50m2 75lowast75m2 100lowast100m2 and150lowast150m2 the corresponding accuracies are 95 9285 and 78 respectively While the grid size increases to200lowast200m2 the accuracy is significantly reduced to 69and the right answer thus can not be guaranteed On theother hand Figure 14(d) shows that the response times ofDC119896NN(G) and DC119896NN(V) are not much different becausethe size of grid is not the major factor to influence thecomplexity of obtaining information for the first query

63 Number of Objects In this subsection we discuss theresults as the number of data objects varies The area in thepresented experiment set is 600lowast600 (m2) with grid size of50lowast50 (m2) As shown in Figure 15(a) when the number ofobjects increases the number of updates in DC119896NN is stillrelatively less than the ones in Safe-time(S) and Safe-time(M)If the number of objects increases the number of repliedmessages per second to the central server in naıve will growdramatically With 20 to 60 objects the number of repliedmessages to the server is from 1200 to 3600 (packetsmin)By observing the results in Figures 15(b) and 15(c) as moreobjects are in the area the number of messages increasesfor the other three methods and the accuracy reduces inSafe-time(S) These match the trends for different areas we

International Journal of Distributed Sensor Networks 17

20 40 60 80 1000

5

10

15

20

25

30

35

40

45

Moving objects ()

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

20 40 60 80 1000

100

200

300

400

500

600

Moving objects ()

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

20 40 60 80 100

80

70

75

85

90

95

100

105

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

Moving objects ()

(c) Accuracy

20 40 60 80 100

Aver

age r

espo

nse t

ime (

s)

09

095

1

11

105

115

12

125

13

DCkNNSafe-time(S)Safe-time(M)

Moving objects ()

(d) Response time

Figure 17 The effects of the moving objects on (a) update frequency (b) number of messages (c) accuracy and (d) response time

discussed earlier due to the density Similarly the responsetime can be expected as shown in Figure 15(d) where theresponse time of DC119896NN is still the shortest

64 Different Values of 119896 It is obvious that the value of119896 affects the performance of query processing significantlyWhen the value of 119896 becomes larger the number of relatedobjects required to be checked also increases In other wordswe need to spend more cost to find out which 119896 objectsare currently in the result for the C119896NN query Thereforethe changes in the value of 119896 mainly affect the amountof data required for the first query and the update costfor maintaining the 119896th and the (119896 + 1)th objects So inFigure 16(a) when the value of 119896 is large more updates arenecessary for all the three methods As Figure 16(b) shows

the influence on the number of transmitted messages inSafe-time(M) is more serious than the one in Safe-time(S)Due to the mobility the number of influenced objects inSafe-time(M) will increase as the value of 119896 increases Inparticular the update frequency in Safe-time(M) becomesnearly twofold the update frequency in Safe-time(S)

Figure 16(c) presents the impact on the accuracy fordifferent values of 119896 With a larger value of 119896 an object inSafe-time(S) will have a higher chance to derive the incorrectsafe time thus causing lower accuracy When the value of 119896increases the response time of all threemethods will increasesignificantly as shown in Figure 16(d) The reason is thatall DC119896NN Safe-time(S) and Safe-time(M) need to searchmore objects and collect more information for answering thequery when the value of 119896 increases to a certain number For

18 International Journal of Distributed Sensor Networks

2 4 6 8 100

10

20

30

40

50

60

Speed (ms)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

2 4 6 8 100

100

200

300

400

500

600

700

800

Speed (ms)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

2 4 6 8 1070

75

80

85

90

95

100

105

Speed (ms)

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

2 4 6 8 1009

095

1

105

11

115

12

125

13

Speed (ms)

Aver

age r

espo

nse t

ime (

s)

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 18 The impacts of speed on (a) update frequency (b) number of messages (c) accuracy and (d) response time

DC119896NN DC119896NN only needs to store local Voronoi diagramwhere the information required is less than required in Safe-time(S) and Safe-time(M) so the response time of DC119896NN isthe shortest

65 The Effect of Moving Objects In this experiment set weconsider different percentages of moving objects in all thedata objects The default value is 20 which means that ifthere is a total of 30 objects then there are sixmoving objectsIn Figures 17(a) and 17(b) as the percentage ofmoving objectsincreases the overall number of updates required between theobjects increases relatively and the change rate of answer totheDC119896NNaccelerates thus increasing the update frequencyof the query and the number of messages However DC119896NNstill keeps the best performance Figure 17(c) shows the accu-racy of the result for different percentage of moving objectsDC119896NN and Safe-time(M) both have higher accuracy and

Safe-time(S) is still the worst The safe time of each object inSafe-time(S) is calculated using the maximum speed of theobjects Hence whether the object is moving or not does notdirectly result in the incorrectness of the answer collectionIn fact in Safe-time(S) one of the main reasons to affectthe accuracy is the directions of moving objects Last asFigure 17(d) shows the percentage of moving objects doesnot impact the response time too much

66 Effects of Speed If each object moves faster the relativevelocities between objects may also become faster This willmake the safe time shorter and the update frequency ofeach object and query increases The safe time used inSafe-time(S) and Safe-time(M) is directly affected by themaximum speed of objects and does not consider the direc-tion of each objectrsquos movement and the speed of individualmovement No matter the objects move or not and move

International Journal of Distributed Sensor Networks 19

fast or slow both of the above methods directly use themaximum speed of objects to calculate the safe time forupdating On the other hand DC119896NN considers the movingdirection of objects and the proper safe-time for updatesIn this experiment the number of moving objects is 20of all the objects As Figure 18(a) shows as the movingobjects speed up the update cost increases and DC119896NN stillperforms best As the speed increases the safe-time in Safe-time(S) and the Safe-time(M) becomes much shorter due toa larger maximum speed among all the objects The trendbecomes even worse as the speed increases

Figure 18(b) shows the trend about the number of trans-mitted messages when the speed is up DC119896NN still hasthe best performance on the number of messages There are42781 messages sent in average when the speed of object is10ms However the Safe-time(M) needs 67913 messagesThe accuracy will not be effected as the speed changesfor DC119896NN and Safe-time(M) because both of them aredesigned or adapted for themoving objects and queries Safe-time(S) will have more inaccurate results as the speed is highas shown in Figure 18(c) However the response time doesnot have a significant impact on the response time for all thethree methods Figure 18(d) presents this trend

7 Conclusions

In this paper we propose a new approach DC119896NN whichuses the local Voronoi diagram and proper safe-time toeffectively process the C119896NNquery in distributed andmobileenvironments such as wireless sensor networks The propersafe-time can be quickly derived by a simple formulaBy comparing our proposed DC119896NN with other existingapproaches Safe-time(S) DC119896NN can effectively improvesearch efficiency reduce response time and the numberof messages and keep the accuracy of the result highAdditionally DC119896NN reduces more 30 of transmissionmessages than Safe-time(M) because the characteristics of theVoronoi diagram are used and each objectrsquos moving directionis considered instead of directly using the maximum speedof the objects as Safe-time method The derived safe-timeis more precise As a result DC119896NN needs less updatefrequency reduces a great number of messages transmittedand yields more accurate results In this work simulationexperiments are also performed The experimental resultsvalidate the proposed DC119896NN approach for the continuous119896 nearest neighbor query in distributed and mobile environ-ments where all the data objects and query can move

Acknowledgment

This work is partially supported by NSC under the Grant98-2220-E-027-007 100-2221-E-027-087-MY2 and 102-2221-E-027-088-

References

[1] O Bohl S Manouchehri and U Winand ldquoMobile informationsystems for the private everyday liferdquo Mobile InformationSystems vol 3 no 3-4 pp 135ndash152 2007

[2] Y Tao andD Papadias ldquoTime-parameterized queries in spatio-temporal databasesrdquo in Proceedings of the ACM SIGMODInternational Conference on Managment of Data pp 334ndash345June 2002

[3] Y Tao D Papadias and Q Shen ldquoContinuous nearest neighborsearchrdquo in Proceedings of the 28th International Conference onVery Large Data Bases (VLDB rsquo02) pp 287ndash298 2002

[4] F Aurenhammer ldquoVoronoi diagramsmdasha survey of a fundamen-tal geometric data structurerdquo ACM Computing Surveys vol 23no 3 pp 345ndash405 1991

[5] K Kim Y Cai andW Tavanapong ldquoSafe-time distributed real-time monitoring of cKNN in mobile peer-to-peer networksrdquo inProceedings of the 9th IEEE International Conference on MobileData Management (MDM rsquo08) pp 124ndash131 April 2008

[6] M Kolahdouzan and C Shahabi ldquoVoronoi-based k nearest nei-ghbor search for spatial network databasesrdquo in Proceedings ofthe 30th International Conference on Very Large Data Bases vol30 pp 840ndash851 2004

[7] M R Kolahdouzan and C Shahabi ldquoAlternative solutions forcontinuous K nearest neighbor queries in spatial networkdatabasesrdquo GeoInformatica vol 9 no 4 pp 321ndash341 2005

[8] D Papadias Y Tao K Mouratidis and C K Hui ldquoAggregatenearest neighbor queries in spatial databasesrdquo ACM Transac-tions on Database Systems vol 30 no 2 pp 529ndash576 2005

[9] T Imielinski S Viswanathan and B R Badrinath ldquoData on airorganization and accessrdquo IEEE Transactions on Knowledge andData Engineering vol 9 no 3 pp 353ndash372 1997

[10] S Hambrusch C-M Liu and S Prabhakar ldquoBroadcasting andquerying multi-dimensional index trees in a multi-channelenvironmentrdquo Information Systems vol 31 no 8 pp 870ndash8862006

[11] C-M Liu and K-F Lin ldquoDisseminating dependent data inwireless broadcast environmentsrdquo Distributed and ParallelDatabases vol 22 no 1 pp 1ndash25 2007

[12] T-C Su and C-M Liu ldquoOn-demand data broadcasting for dataitems with time constraints on multiple broadcast channelsrdquo inDatabase Systems for Advanced Applications vol 6193 of LectureNotes in Computer Science pp 458ndash469 2010

[13] B Zheng J Xu W-C Lee and D L Lee ldquoGrid-partition ind-ex a hybrid method for nearest-neighbor queries in wirelesslocation-based servicesrdquo The VLDB Journal vol 15 no 1 pp21ndash39 2006

[14] B Gedik A Singh and L Liu ldquoEnergy efficient exact kNN sear-ch in wireless broadcast environmentsrdquo in Proceedings of the12th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo04) pp 137ndash146 November 2004

[15] KMouratidis S Bakiras and D Papadias ldquoContinuousmonit-oring of spatial queries in wireless broadcast environmentsrdquoIEEE Transactions onMobile Computing vol 8 no 10 pp 1297ndash1311 2009

[16] G Chatzimilioudis D Zeinalipour-Yazti W-C Lee and M DDikaiakos ldquoContinuous all k-nearest-neighbor querying insmartphone networksrdquo in Proceedings of the 13th IEEE Interna-tional Conference on Mobile Data Management (MDM rsquo12) pp79ndash88 2012

[17] T-Y Fu W-C Peng and W-C Lee ldquoParallelizing itinerary-basedKNNquery processing inwireless sensor networksrdquo IEEETransactions on Knowledge and Data Engineering vol 22 no 5pp 711ndash729 2010

[18] T P Nghiem A B Waluyo and D Taniar ldquoA pure peer-to-peerapproach for kNNquery processing inmobile ad hoc networksrdquo

20 International Journal of Distributed Sensor Networks

Personal and Ubiquitous Computing vol 17 no 5 pp 973ndash9852013

[19] HD Chon D Agrawal andA El Abbadi ldquoRange and kNNqu-ery processing for moving objects in Grid modelrdquo MobileNetworks and Applications vol 8 no 4 pp 401ndash412 2003

[20] X Xiong M F Mokbel and W G Aref ldquoSEA-CNN scalableprocessing of continuous K-nearest neighbor queries in spatio-temporal databasesrdquo in Proceedings of the 21st InternationalConference on Data Engineering (ICDE rsquo05) pp 643ndash654 April2005

[21] G Zhao K XuanW Rahayu et al ldquoVoronoi-based continuous120581 nearest neighbor search in mobile navigationrdquo IEEE Transac-tions on Industrial Electronics vol 58 no 6 pp 2247ndash2257 2011

[22] KMouratidis D Papadias S Bakiras and Y Tao ldquoA threshold-based algorithm for continuous monitoring of k nearest neigh-borsrdquo IEEE Transactions on Knowledge and Data Engineeringvol 17 no 11 pp 1451ndash1464 2005

[23] S-H Wu K-T Chuang C-M Chen and M-S Chen ldquoDIK-NN an itinerary-based KNN query processing algorithm formobile sensor networksrdquo inProceedings of the 23rd InternationalConference on Data Engineering (ICDE rsquo07) pp 456ndash465 April2007

[24] D T Lee ldquoOn k-nearest neighbor voronoi diagrams in the pla-nerdquo IEEE Transactions on Computers vol 31 no 6 pp 478ndash4871982

[25] K Patroumpas TMinogiannis andT Sellis ldquoApproximate ord-er-k Voronoi cells over positional streamsrdquo in Proceedings of the15th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo07) pp 276ndash283 November 2007

International Journal of

AerospaceEngineeringHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

RoboticsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Active and Passive Electronic Components

Control Scienceand Engineering

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

RotatingMachinery

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

Journal ofEngineeringVolume 2014

Submit your manuscripts athttpwwwhindawicom

VLSI Design

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Shock and Vibration

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawi Publishing Corporation httpwwwhindawicom

Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

SensorsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Navigation and Observation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

DistributedSensor Networks

International Journal of

Page 7: Research Article Distributed Continuous k Nearest Neighbors ...downloads.hindawi.com/journals/ijdsn/2013/125145.pdfmobile environments like WSNs, which consist of a number of mobile

International Journal of Distributed Sensor Networks 7

query DC119896NN search()(1) broadcast a query 119902(119896 ℎ119900119901119888) ℎ119900119901119888 is initial to 1(2) get the Voronoi cells or objectrsquos information(3) if (119896 = 1) then(4) show LVC(5) find 119904119886119891119890119905119894119898119890 of DC1NN (with LVC)(6) elseif (119896 gt 1) then(7) while the received information is insufficient do(8) broadcast the query 119902(119896 ℎ119900119901119888 + 1) to ask more hops of neighbor nodes(9) run normal 119896NNSearch to find 119896NN set(10) show LVC according to 119896NNset and 119868119899119891119900(11) find 119904119886119891119890119905119894119898119890 of DC119896NN (with LVC)(12)while (119904119886119891119890119905119894119898119890 = 0)(13) wait

Algorithm 1 The DC119896NN algorithm on the query (sink) node

phase each moving object exchanges the location informa-tion and builds a local Voronoi cell (LVC) as well as calculatesthe safe time for the LVC The query processing phasecollects sufficient location and environmental informationof neighboring neighbors for exploring the result of thegiven C119896NN query The last information update phase is tomaintain the latest information for the moving objects andthe result of the continuous 119896 nearest neighbor query Thefollowing will explain each phase in details

41 Phase 1 Initialization (119896=1) During system initializationeach mobile sensor (moving object) exchanges locationinformation with its neighbors derives the local Voronoi cell(LVC) calculates the safe time of LVC and then stores theLVC and safe time in the memory

When a user issues an NN query 119876 and broadcasts thequery message 119902(119896 ℎ119900119901119888) (case 119896 = 1) where 119896 is the numberof the nearest neighbors the query wants to find and ℎ119900119901119888

is the hop counter and sets to one initially When the querypoint 119876rsquos neighboring objects receive the query message119902(119896 ℎ119900119901119888) they will determine whether 119876 is located in theirVoronoi Cells (VCs) If a neighboring object replies true itmeans that this neighboring object is the nearest neighbor ofthe query point 119876 and this neighboring object will transmitthe Voronoi cell (VC) information of itself to the query point119876 including the neighboring object boundaries locationdirection and speed of movement and some environmentalinformation On the other hand if a neighboring objectreturns false this neighboring object will check whetherquery point119876moves towards it or not If the query point119876 ismoving towards a neighboring object then this neighboringobject also will send its VC information to the 119876 otherwisethe query message will be ignored After the initializationphase eachmoving object will maintain the LVC informationand safe time The update process will be executed for thelatest LVC information only when the safe time decreases tozero Assume that each object has 119889 neighbors in averageSince the bisector between two objects costs 119874(1) time theLVC construction (Initialization phase) can be finished in119874(119889) time

42 Phase 2 C119896NN Query Processing The pseudocodeQuery DC119896NN Search() in Algorithm 1 shows the wholequery process on the query point The operations fromLine 6 to the end of Query DC119896NN Search() do the queryprocessing of C119896NN (119896 gt 1) When a query point119876 wants tofind the 119896 nearest neighbors where 119896 gt 1 119876 first broadcastsmessages 119902(119896 ℎ119900119901119888) (case 119896 gt 1) and gets the local Voronoicell (LVC) information from the nearest neighboring (NN)object The nearest neighboring object of 119876 is responsiblefor routing messages to its neighboring objects collectingthe local Voronoi cell (LVC) information of the neighboringobjects and sending information back to query point 119876Basically if the received information is insufficient to derivethe 119896NN answer the query point 119876 will repeatedly sends thequery message 119902 with one more hop (ie ℎ119900119901119888 = ℎ119900119901119888 + 1) tothe specific neighboring objects to obtain more neighboringVC information until the received information is enough toget 119896NN answer

When the received information is enough to derive theresults of 119896NN the query point 119876 will use the approximatemethod we modified from [25] to calculate the approximateorder-119896 LVC in which the query point 119876 locates By usingthe modified method the query point 119876 has to partitionthe plane into 120582 equal sectors and selects an additionalnearest neighboring object in each sector excluded from119896NN objects Thus the query point 119876 needs to collect atleast 119896 + 120582 neighboring objectsrsquo information to build theapproximate order-119896 LVC Note that the information of theadditional 120582 objects can be learned from the informationof the received neighboring objects In comparison with thecentralized approach for constructing the approximate order-119896 Voronoi cell the modified approximate method only needsto consider the 119896nearest neighboring objects and120582 additionalnearest neighboring objects instead of considering all objectsin the wireless environment The computation time is thusmuch better than the traditional centralized approach andcan be derived as119874(120582) + 119874(120582) times 119874(119896) = 119874(120582(119896 + 1)) where119874(120582) is the time for selecting the 120582 additional neighboringobjects In the end 119874(120582119896) is the time for determining theboundary of the approximate order-119896 LVC For more detailsabout the analysis of the computation time please refer to

8 International Journal of Distributed Sensor Networks

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

(a)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q

(b)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q

(c)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q

(d)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

q

(e)

Figure 7 An example of DCNN where (a) each sensor exchanges information in the initial step (b) each sensor builds its LVC (c) a queryat object 119902 is issued and sensor 119900

1returns the information of its LVC to 119902 since 119902 is located in the Voronoi cell associated with 119900

1 (d) object

119902 knows which sensor will be reached next and can derive the safe time by the LVC information of 1199001 and (e) the query result to 119902 can be

updated seamlessly when it moves to 1199006

[25] After the query point 119876 calculates the approximateorder-119896 LVC a safe time of the query 119902 can be derived Thesafe time of the query 119902 is regarded as the time limit forstarting the next location information updating process andupdating the C119896NN answer

Figure 7 gives an example for the case of 119896 = 1 Asshown in Figure 7(a) there are 16moving sensors 119900

1 119900

16

in the system and each sensor has the location informationabout itself In the initial phase each sensor broadcasts themessage with its location information and receives the loca-tion information from its neighbors The local Voronoi cell(LVC) of each sensor then can be calculated and stored Theoverall calculatedVoronoi diagram is depicted in Figure 7(b)Afterwards if the locations of the sensors change as movingeach sensor will broadcast new location information to itsneighbors and each sensor can derive a new LVC by thereceived updating messages In Figure 7(c) a continuous NNquery is issued by some query object 119902 with its locationIn order to know the Voronoi cell where 119902 locates 119902 firstbroadcasts the query message to the neighboring sensors(in dashed circle) After receiving the query message theneighboring sensor will check whether the query 119902 is locatedin its associated cell If 119902 is not in the cell the sensor willignore the querymessage In Figure 7(c) sensor 119900

1will return

the result to the query 119902 saying that object 1199001is the nearest

neighbor of 119902 for the time being If 119902 moves in the directionas indicated by the solid arrow in Figure 7(d) to object 119900

6

119902 can know that it moves towards the boundary of 1199001and

1199006by the LVC stored in 119900

6and then derive the safe time

When approaching the boundary (ie the safe time is almostpassed) a query message to 119900

6will be issued by 119902 in advance

Sensor 1199006will reply to 119902with the cell information to maintain

the accuracy of the query result Figure 7(e) shows the resultafter 119902moves into the associated cell of sensor 119900

6

Figure 8 demonstrates an example of DC119896NN for 119896 gt

1 The initial phase is the same as the previous DCNNexample Each sensor derives the corresponding LVC withthe information from the neighboring sensors The queryis issued by a moving object 119902 with its location Object 119902

locates itself and knows that it is in the VC of 1199001after sensor

1199001replies to 119902 with its LVC information Suppose 119896 = 3

After the initialization 119902 is located in 1199001and has the LVC

information of 1199001 Having such information 119902 can derive the

NN but 3NN cannot be decided yet So 119902 will broadcast thequery message to all of its one-hop neighboring sensors say1199001 1199002 1199003 1199008 and 119900

9in Figure 8(a) to request information

The neighboring sensors will reply to 119902 the information abouttheir LVCs Object 119902 then can derive the resulting 3NN forthe time being say 119900

1 1199008 and 119900

9in the example With

these replied information 119902 can build the approximate order-3 Voronoi cell as shown in Figure 8(b) Then 119902 uses theapproximate order-3 Voronoi cell to derive the safe time inorder to maintain the continuous query result Now if 119896 =

10 the information received from the one-hop neighboringsensors is not enough to derive the result Then the querymessage will be broadcast to 119902rsquos two-hop neighboring sensorsas Figure 8(c) shows If the information is not enough toderive the resulting 119896NN the querymessagewill be broadcast

International Journal of Distributed Sensor Networks 9

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q n1n2

n3

n4(k + 1)

(a)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5qn1

n2

n3

(b)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o3o4

o5q

o9

o2

(c)

o1

o6

o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q

n11(k + 1)

n1

n4n5

n6

n10

n7

n8

n2n9

n3

(d)

o1

o6

o7

o8

o11o10

o12

o13o14o15

o16o9

o2 o3o4

o5q n1n2

n4n5

n6

n7

n3

n9n10

n8

(e)

Figure 8 An example of DC119896NN for 119896 gt 1 where the initialization phase is the same as previous DCNN example and (a) 1199001 1199008 and 119900

9are

the 3NN to the query object 119902 (b) the approximate order-3 Voronoi cell can be built with enough information received (c) the information isnot enough for 10NN query and two-hop neighboring sensors are requested (d) the resulting 10NN can be derived and (e) the approximateorder-10 Voronoi cell can be calculated with information received

to one more hop neighboring sensor Such process will berepeated with an increment on the hop count After havingenough information 119902 can calculate the resulting 10NN andthe approximate order-10 Voronoi cell as shown in Figures8(d) and 8(e) respectively Using the approximate order-10Voronoi cell the safe time can be derived In the followingwe will discuss how to derive the safe time for maintainingthe result of the continuous 119896NN query

43 Phase 3 Information Updates In the distributed andmobile environments it is challenging for a mobile nodeto maintain the location information of the other mobilenodes effectively If a mobile node sends the update messagesfrequently it will consume much network resource andpower Furthermore the result of themoving query should beeffectively maintained For different roles nodes and querywe propose effective ways respectively in our DC119896NN queryprocess to update the location information and maintain thequery result

431 The Safe Time of Each Object In the proposed appro-ach DC119896NN each object cooperates with each other andexchanges information to update the location information ofeach object In order to monitor and obtain the continuousanswer of a continuous 119896 nearest neighbors query we usea safe distance between each object and query Then wecan derive the safe time of each object for location updatesby estimating the maximum speed of that object Supposethat the sensing area is partitioned into a grid for location

management There are three possible methods for derivingthe safe distance The first one is the grid-based safe distanceEach object directly uses the minimum distance betweenitself and the boundary of the grid cell where the objectlocates Simply using the grid-based safe distance may causesome problems about the imprecise updates The secondmethod VD-based safe distance uses VD to obtain the safedistance In order to predict the safe distance more preciselywe can consider the previous two distances simultaneouslyand then select the smaller one So the last method propersafe distance will return a better safe distance by comparisonsHaving the safe distance the safe time then can be derived byestimating the maximum speed of the considered object

In Figure 9 the sensing area is divided into a grid andthe Voronoi diagram formed by the sensors is also shownFor sensor 119900

1in Figure 9(a) the grid-based safe distance and

VD-based safe distance are presented respectively and theproper safe distance will be the VD-based safe distance afterthe comparison On the contrary for sensor 119900

3in Figure 9(b)

the proper safe distance will be the grid-based safe distance

432The Safe Time of EachQuery For themoving query it isimportant to know when the result will change To derive thesafe time during which the result will not change we referto the characteristics of Voronoi diagram In the traditionalenvironment with static objects the system only uses theminimum distance from the query to the boundary of theVoronoi cell where the query locates as the safe distance Thethe safe time can be obtained by the estimated maximum

10 International Journal of Distributed Sensor Networks

o1

o7

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

o6o8

(a)

o1

o7

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

o6o8

(b)

Figure 9 An illustration for different safe distances (a) sensor 1199001uses the VD-based safe distance as the proper safe distance and (b) sensor

1199003uses the grid-based safe distance as the proper safe distance

L L

A

B

Safe distance

Query

B

A

120579

New safe distance

QueryA998400

L998400

B998400

Figure 10 An example showing the impact on the safe distancecaused by object movement

speed of that query During the safe time no update isnecessary thus saving the update cost

Unfortunately in the moving object environment theabove method cannot obtain the right safe time As shownin Figure 10 the left part shows the static case where 119871 is theVoronoi cell boundary between objects 119860 and 119861 and the safedistance of the query can be calculated as the figure showsHowever for the moving objects the original safe distancebetween the 119871 and query cannot be directly used to calculatethe safe time because the object movement will cause thedistance form query to 119871 to be nonlinearly increasing ordecreasing As the right part of Figure 10 shows after themovement of object 119860 and object 119861 119871 becomes 119871

1015840 and thesafe distance changes Thus if we want to use the boundariesof Voronoi cell to estimate more accurate safe time we needto consider the relative movements between the objects andquery

In order to derive the precise safe distance we considerthe movements of objects and query simultaneously and useFigure 11 to illustrate Initially 119876119860 and 119876119861 are the distancesfrom the query to objects 119860 and 119861 respectively The linebetween 119860 and 119861 is the boundary of the Voronoi cellsassociated with 119860 and 119861 and the query is located in thecell of 119860 as Figure 11(a) shows When objects and the querymove as in Figure 11(b) the query may touch the boundaryThis indicates that the query will enter another cell and theresult of the query should be updated The time from thebeginning to the moment of touching the boundary is theprecise safe time for the query According to the properties

of Voronoi diagram when the query is on the boundary119876119860 = 119876119861 We hence can use the condition of 119876119860 = 119876119861

to decide whether the query is on the boundary With thisproperty even though the objects and querymove frequentlythe query only needs the speeds directions and locationsof the neighboring objects to predict the safe time easilyWithin the safe time the query will not touch the boundaryIn Figure 11(c) the query meets the boundary at 119905

1and the

safe time is 1199051

In the following we present the way to calculate the safetime when 119876119860 = 119876119861 Assume that the initial location of themoving query is (119909

119902 119910119902) and the speed is (119881

119909119902 119881119910119902

) Supposethe initial location of object 119860(119861) is (119909

119860 119910119860)((119909119861 119910119861)) with

the speed being (119881119909119860

119881119910119860

)((119881119909119861

119881119910119861

)) The equation to findwhen the querymeets the boundary can be derived accordingto the property of perpendicular bisector Since119876119860 = 119876119861 wecan have

([(119909119902+ 119881119909119902

lowast 119905) minus (119909119860

+ 119881119909119860

lowast 119905)]2

+[(119910119902+ 119881119910119902

lowast 119905) minus (119910119860

+ 119881119910119860

lowast 119905)]2

)

12

= ([(119909119902+ 119881119909119902

lowast 119905) minus (119909119861

+ 119881119909119861

lowast 119905)]2

+[(119910119902+ 119881119910119902

lowast 119905) minus (119910119861

+ 119881119910119861

lowast 119905)]2

)

12

(1)

Then

0 = [1198812

119909119860

+ 1198812

119910119860

minus 1198812

119909119861

minus 1198812

119910119861

minus 2 lowast 119881119909119902

119881119909119860

minus2 lowast 119881119910119902

119881119910119860

+ 2 lowast 119881119909119902

119881119909119861

+ 2 lowast 119881119910119902

119881119910119861

] lowast 1199052

+ 2 [(119909119902minus 119909119860) (119881119909119902

minus 119881119909119860

) + (119910119902minus 119910119860) (119881119910119902

minus 119881119910119860

)

minus (119909119902minus119909119861) (119881119909119902

minus119881119909119861

) minus (119910119902minus119910119861) (119881119910119902

minus119881119910119861

)] lowast 119905

+ [(119909119902minus 119909119860)2

+ (119910119902minus 119910119860)2

minus (119909119902minus 119909119861)2

minus (119910119902minus119910119861)2

]

(2)

International Journal of Distributed Sensor Networks 11

A

B

Query

(x3 y3)

(x2 y2) (x1 y1)QA

QB

(Vx2 Vy2)

(Vx3 Vy3)

(Vx1 Vy1)

(a)

A

B

Query

(x3 y3)

(x2 y2)(x1 y1)

QA

QB

(Vx2 Vy2)

(Vx3 Vy3)

(Vx1 Vy1)

(b)

A

B

d

t1 t2 t3 t

(c)

Figure 11 The precise safe-time for moving objects 119860 and 119861 and the moving query where (a) shows the beginning state (b) presents themoment when the moving query meets the boundary and (c) gives the diagram for the change on the safe distance with time 119905

o1

o2

o3o4

o5

CDq1

CD2

(a)

o1

o2

o3o4

o5

CDq1

CD2

q9984001

(b)

Figure 12 The phenomenon when using the original safe-time methods to (a) stationary query and (b) moving query

Equation (2) is a quadratic equation Since a generalquadratic equation can be written in the following form1198861199092

+ 119887119909 + 119888 = 0 recall that the discriminant of a quadraticequation is Δ = 119887

2

minus 4119886119888 If Δ gt 0 there are two distinct realroots if Δ = 0 there is exactly one real root if Δ lt 0 thereare two distinct (non-real) complex roots In (2)

119886 = 1198812

119909119860

+ 1198812

119910119860

minus 1198812

119909119861

minus 1198812

119910119861

minus 2 lowast 119881119909119902

119881119909119860

minus 2 lowast 119881119910119902

119881119910119860

+ 2 lowast 119881119909119902

119881119909119861

+ 2 lowast 119881119910119902

119881119910119861

119887 = 2 [(119909119902minus 119909119860) (119881119909119902

minus 119881119909119860

) + (119910119902minus 119910119860) (119881119910119902

minus 119881119910119860

)

minus (119909119902minus 119909119861) (119881119909119902

minus 119881119909119861

) minus (119910119902minus 119910119861) (119881119910119902

minus 119881119910119861

)]

119888 = (119909119902minus 119909119860)2

+ (119910119902minus 119910119860)2

minus (119909119902minus 119909119861)2

minus (119910119902minus 119910119861)2

(3)

and then we can derive the safe time 119905 according to thediscriminant

119905 =

[minus119887 + (1198872

minus 4119886119888)12

]

2119886or

[minus119887 minus (1198872

minus 4119886119888)12

]

2119886

(4)

Finally we select the minimum value of 119905 gt 0 as the safetime

Additionally assuming that 119889 is the distance between theobject and the query and 119905 is the time 119876119860 = 119876119861 can be

converted into a function of 119905 and 119889 as shown in Figure 11(c)Then we can obtain the safe time 119905

1which is the time when

119876119860 = 119876119861 Furthermore the object 119861 will be closest to thequery at the time 119905

3

5 Comparisons with Previous Approaches

In this section we compare the proposed DC119896NN approachthe Safe-time with stationary query approach [5] and thenaıve way used pull-based approach in terms of safe timespace and accuracy

51 Safe Time The original safe-time with stationary query[5] (safe-time(S)) does not support moving queries Anexample of C3NN is shown in Figure 12 where 119902

1is the query

point triangles are the 3NN objects the pentagons representthe other individual objects and 119900

4is 4th NN Figure 12(a)

shows the original result for safe-time(S) After obtaining the119896th and (119896 + 1)th objects (119900

2and 1199004in the figure) the cross-

distance (CD) of 119896th and (119896 + 1)th objects can be calculatedRecall that the cross distance of two data objects 119860 and 119861 isthe difference on the distances of119860 and119861 to the center (or thequery point) For the next update (after a safe-time period)all the objects in this region should be checked

We adapt the safe-time(S) method for moving queryThe adapted approach will result in a higher update cost

12 International Journal of Distributed Sensor Networks

Figure 12(b) presents a case that the query moves towardobject 119900

3(119896th NN) and away from object 119900

4((119896 + 1)th NN)

When the query 1199021moves to the point 1199021015840

1 the most outside

concentric circle increases and becomes as large as the mostoutside dotted concentric circle On the contrary the mostinside concentric circle decreases and becomes as small as themost inside dotted concentric circle Thus the cross-distanceincreases and more number of objects will be examined

In addition according to the Figure 12(b) we can knowthat the original Safe-time method safe-time(S) is notappropriate for moving queries since the calculation of Safe-time(S) method does not consider the speed of query safe-time(S) directly uses twofold of the maximum speed of the119896th and (119896+1)thNNobjects to divide theCD to derive the safetime The cost for updates increases when the CD becomeslarger since the average checked area becomes bigger Besidesthe obtained 119896NNanswer cannot be guaranteed to be correctOn the contrary the cross-distance when the query movestowards object 119900

4((119896 + 1)th NN) and away from object 119900

3

(119896th NN) in this case the order of the 119896th and (119896 + 1)th NNobjectmay be changed but the update does not perform thusresulting in incorrect results

We modify the Safe-time to fully support the movingquery In order to support and maintain the accuracy ofmoving query the maximum speed (Maxspeed) used in thesafe time calculation is required to be modified and replacedby the maximum relative speed between the query and theobjects Because of using the relative speed the adaptedsafe-time method safe-time(M) needs twofold maximumrelative speed (2 lowast 119872119886119909119904119901119890119890119889) to calculate the safe time forguaranteeing the accurate resultsThe safe time derived is lessthan the one derived in safe-time(S) due to the relative speedHence the update frequency of safe-time(M) is higher thanthe update frequency of safe-time(S)

52 Space In DC119896NN each object and query only need tomaintain the information of LVC The information to bestored includes the location of neighboring objects and theobject information of order-119896rsquos local Voronoi diagram Thetotal amount of stored information is not significant on eachobjectThus the use of storage space does not need to be verysubstantial

53 Accuracy The safe-time (S) [5] considers the stationaryquery When applying it to the moving query some adaptionshould bemade According to our experimental results whenthe value of 119896 increases with a moving query the accuracy ofthe result will be reduced In our simulation we modify theoriginal Safe-time(S) as Safe time(M) for moving query andconsider the relative distance in detail caused by the movingquery and objects Although the correctness of the answer canbe increased the update frequency increases thus increasingthe number of delivered messages

DC119896NNuses Voronoi and grid cell boundary to calculatethe safe time and updates the information of related objectsbefore the end of the safe time In fact the boundary ofthe Voronoi cell represents the boundary of moving 119896NNquery After the safe time period the query will collect the

information of related neighboring objects Having such real-time information the query can have the resultmore accuratein time Similar to safe-time(M) DC119896NN uses the 119896th and(119896 + 1)th nearest moving objects to derive the safe time So itis able to maintain the correctness of the answer

6 Simulation Experiments

In the simulation we compare the following methods NaıveDC119896NN safe-time (S) and safe-time (M)TheNaıvemethodis centralized and used as a benchmark for the comparisonAll the mobile sensors will send the location informationto the central server to update the information The othermethods DC119896NN Safe-time(S) and Safe-time(M) are dis-tributed and used in the considered mobile wireless sensornetwork where each object knows its position has the abilityto perform some calculation and stores the information oflocalized Voronoi cell (LVC)We assume that each object cantransmit amessage to its one-hopneighbor so that each objectcan communicate with at least one object For Safe-time(S)and the safe-time(M) a maximum speed (MaxSpeed) is setin order to estimate relative speed and distance for safe-timecalculation

In the simulation all the compared approaches areperformed under the same environmental conditions forfairness The initial location and speed of moving objectsare uniformly randomly distributed Since we focus on theperformance of the query process of the proposed DC119896NNapproach we further assume that the transmission quality isideal and no congestion and communication delays occurThe metrics measured include the update frequency for aquery the total number of messages response time andaccuracy The update frequency for a query is the averagenumber of update messages sent by the data objects relatedto the query per minute The total number of messages isall the amount of messages sent from all objects during thequery process The accuracy of each method is measuredby comparing the results to the real answers Since thequery is continuous and the update occurs subsequently themeasured response time is mainly the time required fromsending a query to obtaining the first result

All the experiments are simulated so the results aboutthe response time may not show the practical cases exactlybut can reflect the trends on the performance among all thecompared approaches relatively In order to have the responsetime in our simulation we thus use the total number of hopsfor deriving the result tomultiply the average time for one hopin the simulation system to present the response time Thusthe response time is proportional to the total number of hopsin our simulation program In addition because the maindifference between Safe-time(S) and the Safe-time(M) is theway for deriving the safe time the measured response timeof these two methods is the same The simulation programis implemented with Java The setting of our simulation isshown in Table 1 with a default value for each parameter Inall the simulation experiments the final results are reportedwith the average of 100 queries The duration of each query is60 seconds

International Journal of Distributed Sensor Networks 13

200 400 600 800 10000

10

20

30

40

50

60

Edge length of sensing area (m)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

200 400 600 800 10000

100

200

300

400

500

600

700

Edge length of sensing area (m)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

200 400 600 800 100075

80

85

90

95

100

105

Edge length of sensing area (m)

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

200 400 600 800 1000Edge length of sensing area (m)

Aver

age r

espo

nse t

ime (

s)

DCkNNSafe-time(S)Safe-time(M)

095

1

105

11

(d) Response time

Figure 13 The effects of different sensing areas on (a) update frequency (b) number of messages (c) accuracy and (d) response time

Table 1 Simulation parameters

Parameter Range Default valueEdge length of sensingarea (m) 200 400 600 800 1000 600

Edge length of grid (m) 50 100 150 50Number of objects 20 30 40 50 60 30Transmission range (m) 125 125119896 1 3 5 10 20 3Moving objects () 20 40 60 80 100 20Speed (ms) 2 4 6 8 10 4

61 Effects of Sensing Area Sensing area affects the numberof update and query messages since if the area becomes

greater with the fixed number of objects relatively thedensity of the objects becomes sparse For example when thesensing areas are 200lowast200 400lowast400 600lowast600 800lowast800 and1000lowast1000 the densities are 188 047 021 012 and 008respectively Figure 13(a) shows that DC119896NN has the lowestnumber of updates with all the different areas and the numberof updates for Safe-time(S) is the highest (worst) becauseDC119896NN considers the moving direction and speed of thequeries and objects and selects the proper safe-distance toderive the safe-time Safe-time(S) the Safe-time(M) estimatethe safe time according to the maximum speed of the objectsso more number of updates can be expected AdditionallySafe-time(M) is updated more frequently than Safe-time(S)Recall that Safe-time(M) considers the query movement

14 International Journal of Distributed Sensor Networks

50 75 100 150 2000

5

10

15

20

25

Edge length of grid (m)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

50 75 100 150 2000

50

100

150

200

250

300

350

Edge length of grid (m)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

50 75 100 150 2000

20

40

60

80

100

120

Edge length of grid (m)

Accu

racy

()

DCkNN(G)DCkNN(V)

(c) Accuracy

50 75 100 150 2001

101

102

103

104

105

106

Edge length of grid (m)

Aver

age r

espo

nse t

ime (

s)

DCkNN(G)DCkNN(V)

(d) Response time

Figure 14 The comparisons of using grid-based and VD-base safe distances to derive the safe-time (a) update frequency (b) number ofmessages (c) accuracy and (d) response time

The average safe-distance becomes shorter thus leading tomore updates Besides when the sensing area increasesfrom 200lowast200 to 600lowast600 the update frequency dropsdramaticallyThe curve becomes flatter when the area is from600lowast600 to 1000lowast1000 since the difference on the densitiesof the areas from 600lowast600 to 1000lowast1000 is not much Thenumber of updates is less as the safe-time becomes largerThetotal number of transmitted messages of naıve approach isfixed at about 1800 packets All the other distributedmethodsuse fewer number of messages than naıve

To monitor the results DC119896NN only needs to check therelated objects in the local Voronoi cell at the proper safe-time thus reducing a lot of redundant update messages Safe-time(S) and Safe-time(M) use the maximum speed of theobjects to calculate the safe time so the total number of

transmitted messages of both approaches is more than that ofDC119896NN Figure 13(b) shows that more than 30 of the totalnumber of transmitted messages can be saved by DC119896NN incomparison with Safe-time(M)

For the accuracy since Safe-time(S) does not considerthe query movement the safe-time may be inaccurate Fur-thermore due to the mobility when the density is high theestimated results become more inaccurate So Safe-time(S)performs worst as shown in Figure 13(c) Safe-time(M) isrevised from Safe-time(S) by considering the query move-ment and the safe-distance is less in average for guaranteeingbetter results Hence Safe-time(M) has a better accuracy andalmost the same as DC119896NN The accuracy of Safe-time(M)and DC119896NN is almost about 100 correct and the gap maybe caused by arithmetical errors in the experiments

International Journal of Distributed Sensor Networks 15

10 20 30 40 50 60 700

5

10

15

20

25

30

35

40

45

Number of objects

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

10 20 30 40 50 60 70100

150

200

250

300

350

400

450

Number of objects

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

10 20 30 40 50 60 7080

85

90

95

100

105

Number of objects

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

10 20 30 40 50 60 70Number of objects

Aver

age r

espo

nse t

ime (

s)

096

098

1

102

104

106

108

11

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 15 The effects of the number of objects on (a) update frequency (b) number of messages (c) accuracy and (d) response time

When the area becomes larger the density becomeslower So the number of objects in each objectrsquos transmissionrange is fewer Under such a circumstance DC119896NN usesless computation and the response time is shorter as shownin Figure 13(d) In contrast the Safe-time(S) and the Safe-time(M) need to collect information before performing eachnew query and cause longer response time Since Safe-time(M) and Safe-time(S) use the same method and proce-dure to handle the first query the response time of these twomethods will be almost the same

62 Effects of Grid Size In this simulation experiment setwe want to observe the update efficiency of each object inthe third phase of DC119896NN Recall that we consider the grid-based and VD-base safe distances to derive a proper safe-time In this experiment DC119896NN(G) uses grid-based safe

distance to determine the safe time for the next update andDC119896NN(V) uses VD-base safe distance to derive the safetime The sensing area is fixed to 600lowast600m2 and there are30 data objects We compare DC119896NN(V) with DC119896NN(G)by observing the impacts of different grid sizes All theother settings have the similar trends in our experimentalresults In Figure 14(a) the update frequency of the objectsin DC119896NN(G) is high when the grid size is 50lowast50m2 andbecomes less when the grid size decreases Since the sensingarea is 600lowast600m2 and 30 objects are given the averagedistance between an object and the boundary of a Voronoicell is about 25 to 50 meters With the setting of grid size50lowast50m2 the average distance obtained in DC119896NN(G) isabout 25 meters Thus the safe time of DC119896NN(V) is longerIn general as Figures 14(a) and 14(b) show the update

16 International Journal of Distributed Sensor Networks

1 3 5 10 200

10

20

30

40

50

60

k

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

1 3 5 10 200

100

200

300

400

500

600

700

800

k

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

1 3 5 10 2080

85

90

95

100

105

k

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

1 3 5 10 20k

Aver

age r

espo

nse t

ime (

s)

08

09

1

11

12

13

14

15

16

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 16 The impacts of different values of 119896 on (a) update frequency (b) number of messages (c) accuracy and (d) response time

frequency of the objects and the number of messages sentby the objects decrease as the grid size increases

When the grid size is large the safe time becomes longand less number of updates are issued Hence the resultsbecome more inaccurate As shown in Figure 14(c) whenthe grid sizes are 50lowast50m2 75lowast75m2 100lowast100m2 and150lowast150m2 the corresponding accuracies are 95 9285 and 78 respectively While the grid size increases to200lowast200m2 the accuracy is significantly reduced to 69and the right answer thus can not be guaranteed On theother hand Figure 14(d) shows that the response times ofDC119896NN(G) and DC119896NN(V) are not much different becausethe size of grid is not the major factor to influence thecomplexity of obtaining information for the first query

63 Number of Objects In this subsection we discuss theresults as the number of data objects varies The area in thepresented experiment set is 600lowast600 (m2) with grid size of50lowast50 (m2) As shown in Figure 15(a) when the number ofobjects increases the number of updates in DC119896NN is stillrelatively less than the ones in Safe-time(S) and Safe-time(M)If the number of objects increases the number of repliedmessages per second to the central server in naıve will growdramatically With 20 to 60 objects the number of repliedmessages to the server is from 1200 to 3600 (packetsmin)By observing the results in Figures 15(b) and 15(c) as moreobjects are in the area the number of messages increasesfor the other three methods and the accuracy reduces inSafe-time(S) These match the trends for different areas we

International Journal of Distributed Sensor Networks 17

20 40 60 80 1000

5

10

15

20

25

30

35

40

45

Moving objects ()

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

20 40 60 80 1000

100

200

300

400

500

600

Moving objects ()

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

20 40 60 80 100

80

70

75

85

90

95

100

105

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

Moving objects ()

(c) Accuracy

20 40 60 80 100

Aver

age r

espo

nse t

ime (

s)

09

095

1

11

105

115

12

125

13

DCkNNSafe-time(S)Safe-time(M)

Moving objects ()

(d) Response time

Figure 17 The effects of the moving objects on (a) update frequency (b) number of messages (c) accuracy and (d) response time

discussed earlier due to the density Similarly the responsetime can be expected as shown in Figure 15(d) where theresponse time of DC119896NN is still the shortest

64 Different Values of 119896 It is obvious that the value of119896 affects the performance of query processing significantlyWhen the value of 119896 becomes larger the number of relatedobjects required to be checked also increases In other wordswe need to spend more cost to find out which 119896 objectsare currently in the result for the C119896NN query Thereforethe changes in the value of 119896 mainly affect the amountof data required for the first query and the update costfor maintaining the 119896th and the (119896 + 1)th objects So inFigure 16(a) when the value of 119896 is large more updates arenecessary for all the three methods As Figure 16(b) shows

the influence on the number of transmitted messages inSafe-time(M) is more serious than the one in Safe-time(S)Due to the mobility the number of influenced objects inSafe-time(M) will increase as the value of 119896 increases Inparticular the update frequency in Safe-time(M) becomesnearly twofold the update frequency in Safe-time(S)

Figure 16(c) presents the impact on the accuracy fordifferent values of 119896 With a larger value of 119896 an object inSafe-time(S) will have a higher chance to derive the incorrectsafe time thus causing lower accuracy When the value of 119896increases the response time of all threemethods will increasesignificantly as shown in Figure 16(d) The reason is thatall DC119896NN Safe-time(S) and Safe-time(M) need to searchmore objects and collect more information for answering thequery when the value of 119896 increases to a certain number For

18 International Journal of Distributed Sensor Networks

2 4 6 8 100

10

20

30

40

50

60

Speed (ms)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

2 4 6 8 100

100

200

300

400

500

600

700

800

Speed (ms)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

2 4 6 8 1070

75

80

85

90

95

100

105

Speed (ms)

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

2 4 6 8 1009

095

1

105

11

115

12

125

13

Speed (ms)

Aver

age r

espo

nse t

ime (

s)

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 18 The impacts of speed on (a) update frequency (b) number of messages (c) accuracy and (d) response time

DC119896NN DC119896NN only needs to store local Voronoi diagramwhere the information required is less than required in Safe-time(S) and Safe-time(M) so the response time of DC119896NN isthe shortest

65 The Effect of Moving Objects In this experiment set weconsider different percentages of moving objects in all thedata objects The default value is 20 which means that ifthere is a total of 30 objects then there are sixmoving objectsIn Figures 17(a) and 17(b) as the percentage ofmoving objectsincreases the overall number of updates required between theobjects increases relatively and the change rate of answer totheDC119896NNaccelerates thus increasing the update frequencyof the query and the number of messages However DC119896NNstill keeps the best performance Figure 17(c) shows the accu-racy of the result for different percentage of moving objectsDC119896NN and Safe-time(M) both have higher accuracy and

Safe-time(S) is still the worst The safe time of each object inSafe-time(S) is calculated using the maximum speed of theobjects Hence whether the object is moving or not does notdirectly result in the incorrectness of the answer collectionIn fact in Safe-time(S) one of the main reasons to affectthe accuracy is the directions of moving objects Last asFigure 17(d) shows the percentage of moving objects doesnot impact the response time too much

66 Effects of Speed If each object moves faster the relativevelocities between objects may also become faster This willmake the safe time shorter and the update frequency ofeach object and query increases The safe time used inSafe-time(S) and Safe-time(M) is directly affected by themaximum speed of objects and does not consider the direc-tion of each objectrsquos movement and the speed of individualmovement No matter the objects move or not and move

International Journal of Distributed Sensor Networks 19

fast or slow both of the above methods directly use themaximum speed of objects to calculate the safe time forupdating On the other hand DC119896NN considers the movingdirection of objects and the proper safe-time for updatesIn this experiment the number of moving objects is 20of all the objects As Figure 18(a) shows as the movingobjects speed up the update cost increases and DC119896NN stillperforms best As the speed increases the safe-time in Safe-time(S) and the Safe-time(M) becomes much shorter due toa larger maximum speed among all the objects The trendbecomes even worse as the speed increases

Figure 18(b) shows the trend about the number of trans-mitted messages when the speed is up DC119896NN still hasthe best performance on the number of messages There are42781 messages sent in average when the speed of object is10ms However the Safe-time(M) needs 67913 messagesThe accuracy will not be effected as the speed changesfor DC119896NN and Safe-time(M) because both of them aredesigned or adapted for themoving objects and queries Safe-time(S) will have more inaccurate results as the speed is highas shown in Figure 18(c) However the response time doesnot have a significant impact on the response time for all thethree methods Figure 18(d) presents this trend

7 Conclusions

In this paper we propose a new approach DC119896NN whichuses the local Voronoi diagram and proper safe-time toeffectively process the C119896NNquery in distributed andmobileenvironments such as wireless sensor networks The propersafe-time can be quickly derived by a simple formulaBy comparing our proposed DC119896NN with other existingapproaches Safe-time(S) DC119896NN can effectively improvesearch efficiency reduce response time and the numberof messages and keep the accuracy of the result highAdditionally DC119896NN reduces more 30 of transmissionmessages than Safe-time(M) because the characteristics of theVoronoi diagram are used and each objectrsquos moving directionis considered instead of directly using the maximum speedof the objects as Safe-time method The derived safe-timeis more precise As a result DC119896NN needs less updatefrequency reduces a great number of messages transmittedand yields more accurate results In this work simulationexperiments are also performed The experimental resultsvalidate the proposed DC119896NN approach for the continuous119896 nearest neighbor query in distributed and mobile environ-ments where all the data objects and query can move

Acknowledgment

This work is partially supported by NSC under the Grant98-2220-E-027-007 100-2221-E-027-087-MY2 and 102-2221-E-027-088-

References

[1] O Bohl S Manouchehri and U Winand ldquoMobile informationsystems for the private everyday liferdquo Mobile InformationSystems vol 3 no 3-4 pp 135ndash152 2007

[2] Y Tao andD Papadias ldquoTime-parameterized queries in spatio-temporal databasesrdquo in Proceedings of the ACM SIGMODInternational Conference on Managment of Data pp 334ndash345June 2002

[3] Y Tao D Papadias and Q Shen ldquoContinuous nearest neighborsearchrdquo in Proceedings of the 28th International Conference onVery Large Data Bases (VLDB rsquo02) pp 287ndash298 2002

[4] F Aurenhammer ldquoVoronoi diagramsmdasha survey of a fundamen-tal geometric data structurerdquo ACM Computing Surveys vol 23no 3 pp 345ndash405 1991

[5] K Kim Y Cai andW Tavanapong ldquoSafe-time distributed real-time monitoring of cKNN in mobile peer-to-peer networksrdquo inProceedings of the 9th IEEE International Conference on MobileData Management (MDM rsquo08) pp 124ndash131 April 2008

[6] M Kolahdouzan and C Shahabi ldquoVoronoi-based k nearest nei-ghbor search for spatial network databasesrdquo in Proceedings ofthe 30th International Conference on Very Large Data Bases vol30 pp 840ndash851 2004

[7] M R Kolahdouzan and C Shahabi ldquoAlternative solutions forcontinuous K nearest neighbor queries in spatial networkdatabasesrdquo GeoInformatica vol 9 no 4 pp 321ndash341 2005

[8] D Papadias Y Tao K Mouratidis and C K Hui ldquoAggregatenearest neighbor queries in spatial databasesrdquo ACM Transac-tions on Database Systems vol 30 no 2 pp 529ndash576 2005

[9] T Imielinski S Viswanathan and B R Badrinath ldquoData on airorganization and accessrdquo IEEE Transactions on Knowledge andData Engineering vol 9 no 3 pp 353ndash372 1997

[10] S Hambrusch C-M Liu and S Prabhakar ldquoBroadcasting andquerying multi-dimensional index trees in a multi-channelenvironmentrdquo Information Systems vol 31 no 8 pp 870ndash8862006

[11] C-M Liu and K-F Lin ldquoDisseminating dependent data inwireless broadcast environmentsrdquo Distributed and ParallelDatabases vol 22 no 1 pp 1ndash25 2007

[12] T-C Su and C-M Liu ldquoOn-demand data broadcasting for dataitems with time constraints on multiple broadcast channelsrdquo inDatabase Systems for Advanced Applications vol 6193 of LectureNotes in Computer Science pp 458ndash469 2010

[13] B Zheng J Xu W-C Lee and D L Lee ldquoGrid-partition ind-ex a hybrid method for nearest-neighbor queries in wirelesslocation-based servicesrdquo The VLDB Journal vol 15 no 1 pp21ndash39 2006

[14] B Gedik A Singh and L Liu ldquoEnergy efficient exact kNN sear-ch in wireless broadcast environmentsrdquo in Proceedings of the12th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo04) pp 137ndash146 November 2004

[15] KMouratidis S Bakiras and D Papadias ldquoContinuousmonit-oring of spatial queries in wireless broadcast environmentsrdquoIEEE Transactions onMobile Computing vol 8 no 10 pp 1297ndash1311 2009

[16] G Chatzimilioudis D Zeinalipour-Yazti W-C Lee and M DDikaiakos ldquoContinuous all k-nearest-neighbor querying insmartphone networksrdquo in Proceedings of the 13th IEEE Interna-tional Conference on Mobile Data Management (MDM rsquo12) pp79ndash88 2012

[17] T-Y Fu W-C Peng and W-C Lee ldquoParallelizing itinerary-basedKNNquery processing inwireless sensor networksrdquo IEEETransactions on Knowledge and Data Engineering vol 22 no 5pp 711ndash729 2010

[18] T P Nghiem A B Waluyo and D Taniar ldquoA pure peer-to-peerapproach for kNNquery processing inmobile ad hoc networksrdquo

20 International Journal of Distributed Sensor Networks

Personal and Ubiquitous Computing vol 17 no 5 pp 973ndash9852013

[19] HD Chon D Agrawal andA El Abbadi ldquoRange and kNNqu-ery processing for moving objects in Grid modelrdquo MobileNetworks and Applications vol 8 no 4 pp 401ndash412 2003

[20] X Xiong M F Mokbel and W G Aref ldquoSEA-CNN scalableprocessing of continuous K-nearest neighbor queries in spatio-temporal databasesrdquo in Proceedings of the 21st InternationalConference on Data Engineering (ICDE rsquo05) pp 643ndash654 April2005

[21] G Zhao K XuanW Rahayu et al ldquoVoronoi-based continuous120581 nearest neighbor search in mobile navigationrdquo IEEE Transac-tions on Industrial Electronics vol 58 no 6 pp 2247ndash2257 2011

[22] KMouratidis D Papadias S Bakiras and Y Tao ldquoA threshold-based algorithm for continuous monitoring of k nearest neigh-borsrdquo IEEE Transactions on Knowledge and Data Engineeringvol 17 no 11 pp 1451ndash1464 2005

[23] S-H Wu K-T Chuang C-M Chen and M-S Chen ldquoDIK-NN an itinerary-based KNN query processing algorithm formobile sensor networksrdquo inProceedings of the 23rd InternationalConference on Data Engineering (ICDE rsquo07) pp 456ndash465 April2007

[24] D T Lee ldquoOn k-nearest neighbor voronoi diagrams in the pla-nerdquo IEEE Transactions on Computers vol 31 no 6 pp 478ndash4871982

[25] K Patroumpas TMinogiannis andT Sellis ldquoApproximate ord-er-k Voronoi cells over positional streamsrdquo in Proceedings of the15th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo07) pp 276ndash283 November 2007

International Journal of

AerospaceEngineeringHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

RoboticsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Active and Passive Electronic Components

Control Scienceand Engineering

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

RotatingMachinery

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

Journal ofEngineeringVolume 2014

Submit your manuscripts athttpwwwhindawicom

VLSI Design

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Shock and Vibration

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawi Publishing Corporation httpwwwhindawicom

Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

SensorsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Navigation and Observation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

DistributedSensor Networks

International Journal of

Page 8: Research Article Distributed Continuous k Nearest Neighbors ...downloads.hindawi.com/journals/ijdsn/2013/125145.pdfmobile environments like WSNs, which consist of a number of mobile

8 International Journal of Distributed Sensor Networks

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

(a)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q

(b)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q

(c)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q

(d)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

q

(e)

Figure 7 An example of DCNN where (a) each sensor exchanges information in the initial step (b) each sensor builds its LVC (c) a queryat object 119902 is issued and sensor 119900

1returns the information of its LVC to 119902 since 119902 is located in the Voronoi cell associated with 119900

1 (d) object

119902 knows which sensor will be reached next and can derive the safe time by the LVC information of 1199001 and (e) the query result to 119902 can be

updated seamlessly when it moves to 1199006

[25] After the query point 119876 calculates the approximateorder-119896 LVC a safe time of the query 119902 can be derived Thesafe time of the query 119902 is regarded as the time limit forstarting the next location information updating process andupdating the C119896NN answer

Figure 7 gives an example for the case of 119896 = 1 Asshown in Figure 7(a) there are 16moving sensors 119900

1 119900

16

in the system and each sensor has the location informationabout itself In the initial phase each sensor broadcasts themessage with its location information and receives the loca-tion information from its neighbors The local Voronoi cell(LVC) of each sensor then can be calculated and stored Theoverall calculatedVoronoi diagram is depicted in Figure 7(b)Afterwards if the locations of the sensors change as movingeach sensor will broadcast new location information to itsneighbors and each sensor can derive a new LVC by thereceived updating messages In Figure 7(c) a continuous NNquery is issued by some query object 119902 with its locationIn order to know the Voronoi cell where 119902 locates 119902 firstbroadcasts the query message to the neighboring sensors(in dashed circle) After receiving the query message theneighboring sensor will check whether the query 119902 is locatedin its associated cell If 119902 is not in the cell the sensor willignore the querymessage In Figure 7(c) sensor 119900

1will return

the result to the query 119902 saying that object 1199001is the nearest

neighbor of 119902 for the time being If 119902 moves in the directionas indicated by the solid arrow in Figure 7(d) to object 119900

6

119902 can know that it moves towards the boundary of 1199001and

1199006by the LVC stored in 119900

6and then derive the safe time

When approaching the boundary (ie the safe time is almostpassed) a query message to 119900

6will be issued by 119902 in advance

Sensor 1199006will reply to 119902with the cell information to maintain

the accuracy of the query result Figure 7(e) shows the resultafter 119902moves into the associated cell of sensor 119900

6

Figure 8 demonstrates an example of DC119896NN for 119896 gt

1 The initial phase is the same as the previous DCNNexample Each sensor derives the corresponding LVC withthe information from the neighboring sensors The queryis issued by a moving object 119902 with its location Object 119902

locates itself and knows that it is in the VC of 1199001after sensor

1199001replies to 119902 with its LVC information Suppose 119896 = 3

After the initialization 119902 is located in 1199001and has the LVC

information of 1199001 Having such information 119902 can derive the

NN but 3NN cannot be decided yet So 119902 will broadcast thequery message to all of its one-hop neighboring sensors say1199001 1199002 1199003 1199008 and 119900

9in Figure 8(a) to request information

The neighboring sensors will reply to 119902 the information abouttheir LVCs Object 119902 then can derive the resulting 3NN forthe time being say 119900

1 1199008 and 119900

9in the example With

these replied information 119902 can build the approximate order-3 Voronoi cell as shown in Figure 8(b) Then 119902 uses theapproximate order-3 Voronoi cell to derive the safe time inorder to maintain the continuous query result Now if 119896 =

10 the information received from the one-hop neighboringsensors is not enough to derive the result Then the querymessage will be broadcast to 119902rsquos two-hop neighboring sensorsas Figure 8(c) shows If the information is not enough toderive the resulting 119896NN the querymessagewill be broadcast

International Journal of Distributed Sensor Networks 9

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q n1n2

n3

n4(k + 1)

(a)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5qn1

n2

n3

(b)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o3o4

o5q

o9

o2

(c)

o1

o6

o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q

n11(k + 1)

n1

n4n5

n6

n10

n7

n8

n2n9

n3

(d)

o1

o6

o7

o8

o11o10

o12

o13o14o15

o16o9

o2 o3o4

o5q n1n2

n4n5

n6

n7

n3

n9n10

n8

(e)

Figure 8 An example of DC119896NN for 119896 gt 1 where the initialization phase is the same as previous DCNN example and (a) 1199001 1199008 and 119900

9are

the 3NN to the query object 119902 (b) the approximate order-3 Voronoi cell can be built with enough information received (c) the information isnot enough for 10NN query and two-hop neighboring sensors are requested (d) the resulting 10NN can be derived and (e) the approximateorder-10 Voronoi cell can be calculated with information received

to one more hop neighboring sensor Such process will berepeated with an increment on the hop count After havingenough information 119902 can calculate the resulting 10NN andthe approximate order-10 Voronoi cell as shown in Figures8(d) and 8(e) respectively Using the approximate order-10Voronoi cell the safe time can be derived In the followingwe will discuss how to derive the safe time for maintainingthe result of the continuous 119896NN query

43 Phase 3 Information Updates In the distributed andmobile environments it is challenging for a mobile nodeto maintain the location information of the other mobilenodes effectively If a mobile node sends the update messagesfrequently it will consume much network resource andpower Furthermore the result of themoving query should beeffectively maintained For different roles nodes and querywe propose effective ways respectively in our DC119896NN queryprocess to update the location information and maintain thequery result

431 The Safe Time of Each Object In the proposed appro-ach DC119896NN each object cooperates with each other andexchanges information to update the location information ofeach object In order to monitor and obtain the continuousanswer of a continuous 119896 nearest neighbors query we usea safe distance between each object and query Then wecan derive the safe time of each object for location updatesby estimating the maximum speed of that object Supposethat the sensing area is partitioned into a grid for location

management There are three possible methods for derivingthe safe distance The first one is the grid-based safe distanceEach object directly uses the minimum distance betweenitself and the boundary of the grid cell where the objectlocates Simply using the grid-based safe distance may causesome problems about the imprecise updates The secondmethod VD-based safe distance uses VD to obtain the safedistance In order to predict the safe distance more preciselywe can consider the previous two distances simultaneouslyand then select the smaller one So the last method propersafe distance will return a better safe distance by comparisonsHaving the safe distance the safe time then can be derived byestimating the maximum speed of the considered object

In Figure 9 the sensing area is divided into a grid andthe Voronoi diagram formed by the sensors is also shownFor sensor 119900

1in Figure 9(a) the grid-based safe distance and

VD-based safe distance are presented respectively and theproper safe distance will be the VD-based safe distance afterthe comparison On the contrary for sensor 119900

3in Figure 9(b)

the proper safe distance will be the grid-based safe distance

432The Safe Time of EachQuery For themoving query it isimportant to know when the result will change To derive thesafe time during which the result will not change we referto the characteristics of Voronoi diagram In the traditionalenvironment with static objects the system only uses theminimum distance from the query to the boundary of theVoronoi cell where the query locates as the safe distance Thethe safe time can be obtained by the estimated maximum

10 International Journal of Distributed Sensor Networks

o1

o7

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

o6o8

(a)

o1

o7

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

o6o8

(b)

Figure 9 An illustration for different safe distances (a) sensor 1199001uses the VD-based safe distance as the proper safe distance and (b) sensor

1199003uses the grid-based safe distance as the proper safe distance

L L

A

B

Safe distance

Query

B

A

120579

New safe distance

QueryA998400

L998400

B998400

Figure 10 An example showing the impact on the safe distancecaused by object movement

speed of that query During the safe time no update isnecessary thus saving the update cost

Unfortunately in the moving object environment theabove method cannot obtain the right safe time As shownin Figure 10 the left part shows the static case where 119871 is theVoronoi cell boundary between objects 119860 and 119861 and the safedistance of the query can be calculated as the figure showsHowever for the moving objects the original safe distancebetween the 119871 and query cannot be directly used to calculatethe safe time because the object movement will cause thedistance form query to 119871 to be nonlinearly increasing ordecreasing As the right part of Figure 10 shows after themovement of object 119860 and object 119861 119871 becomes 119871

1015840 and thesafe distance changes Thus if we want to use the boundariesof Voronoi cell to estimate more accurate safe time we needto consider the relative movements between the objects andquery

In order to derive the precise safe distance we considerthe movements of objects and query simultaneously and useFigure 11 to illustrate Initially 119876119860 and 119876119861 are the distancesfrom the query to objects 119860 and 119861 respectively The linebetween 119860 and 119861 is the boundary of the Voronoi cellsassociated with 119860 and 119861 and the query is located in thecell of 119860 as Figure 11(a) shows When objects and the querymove as in Figure 11(b) the query may touch the boundaryThis indicates that the query will enter another cell and theresult of the query should be updated The time from thebeginning to the moment of touching the boundary is theprecise safe time for the query According to the properties

of Voronoi diagram when the query is on the boundary119876119860 = 119876119861 We hence can use the condition of 119876119860 = 119876119861

to decide whether the query is on the boundary With thisproperty even though the objects and querymove frequentlythe query only needs the speeds directions and locationsof the neighboring objects to predict the safe time easilyWithin the safe time the query will not touch the boundaryIn Figure 11(c) the query meets the boundary at 119905

1and the

safe time is 1199051

In the following we present the way to calculate the safetime when 119876119860 = 119876119861 Assume that the initial location of themoving query is (119909

119902 119910119902) and the speed is (119881

119909119902 119881119910119902

) Supposethe initial location of object 119860(119861) is (119909

119860 119910119860)((119909119861 119910119861)) with

the speed being (119881119909119860

119881119910119860

)((119881119909119861

119881119910119861

)) The equation to findwhen the querymeets the boundary can be derived accordingto the property of perpendicular bisector Since119876119860 = 119876119861 wecan have

([(119909119902+ 119881119909119902

lowast 119905) minus (119909119860

+ 119881119909119860

lowast 119905)]2

+[(119910119902+ 119881119910119902

lowast 119905) minus (119910119860

+ 119881119910119860

lowast 119905)]2

)

12

= ([(119909119902+ 119881119909119902

lowast 119905) minus (119909119861

+ 119881119909119861

lowast 119905)]2

+[(119910119902+ 119881119910119902

lowast 119905) minus (119910119861

+ 119881119910119861

lowast 119905)]2

)

12

(1)

Then

0 = [1198812

119909119860

+ 1198812

119910119860

minus 1198812

119909119861

minus 1198812

119910119861

minus 2 lowast 119881119909119902

119881119909119860

minus2 lowast 119881119910119902

119881119910119860

+ 2 lowast 119881119909119902

119881119909119861

+ 2 lowast 119881119910119902

119881119910119861

] lowast 1199052

+ 2 [(119909119902minus 119909119860) (119881119909119902

minus 119881119909119860

) + (119910119902minus 119910119860) (119881119910119902

minus 119881119910119860

)

minus (119909119902minus119909119861) (119881119909119902

minus119881119909119861

) minus (119910119902minus119910119861) (119881119910119902

minus119881119910119861

)] lowast 119905

+ [(119909119902minus 119909119860)2

+ (119910119902minus 119910119860)2

minus (119909119902minus 119909119861)2

minus (119910119902minus119910119861)2

]

(2)

International Journal of Distributed Sensor Networks 11

A

B

Query

(x3 y3)

(x2 y2) (x1 y1)QA

QB

(Vx2 Vy2)

(Vx3 Vy3)

(Vx1 Vy1)

(a)

A

B

Query

(x3 y3)

(x2 y2)(x1 y1)

QA

QB

(Vx2 Vy2)

(Vx3 Vy3)

(Vx1 Vy1)

(b)

A

B

d

t1 t2 t3 t

(c)

Figure 11 The precise safe-time for moving objects 119860 and 119861 and the moving query where (a) shows the beginning state (b) presents themoment when the moving query meets the boundary and (c) gives the diagram for the change on the safe distance with time 119905

o1

o2

o3o4

o5

CDq1

CD2

(a)

o1

o2

o3o4

o5

CDq1

CD2

q9984001

(b)

Figure 12 The phenomenon when using the original safe-time methods to (a) stationary query and (b) moving query

Equation (2) is a quadratic equation Since a generalquadratic equation can be written in the following form1198861199092

+ 119887119909 + 119888 = 0 recall that the discriminant of a quadraticequation is Δ = 119887

2

minus 4119886119888 If Δ gt 0 there are two distinct realroots if Δ = 0 there is exactly one real root if Δ lt 0 thereare two distinct (non-real) complex roots In (2)

119886 = 1198812

119909119860

+ 1198812

119910119860

minus 1198812

119909119861

minus 1198812

119910119861

minus 2 lowast 119881119909119902

119881119909119860

minus 2 lowast 119881119910119902

119881119910119860

+ 2 lowast 119881119909119902

119881119909119861

+ 2 lowast 119881119910119902

119881119910119861

119887 = 2 [(119909119902minus 119909119860) (119881119909119902

minus 119881119909119860

) + (119910119902minus 119910119860) (119881119910119902

minus 119881119910119860

)

minus (119909119902minus 119909119861) (119881119909119902

minus 119881119909119861

) minus (119910119902minus 119910119861) (119881119910119902

minus 119881119910119861

)]

119888 = (119909119902minus 119909119860)2

+ (119910119902minus 119910119860)2

minus (119909119902minus 119909119861)2

minus (119910119902minus 119910119861)2

(3)

and then we can derive the safe time 119905 according to thediscriminant

119905 =

[minus119887 + (1198872

minus 4119886119888)12

]

2119886or

[minus119887 minus (1198872

minus 4119886119888)12

]

2119886

(4)

Finally we select the minimum value of 119905 gt 0 as the safetime

Additionally assuming that 119889 is the distance between theobject and the query and 119905 is the time 119876119860 = 119876119861 can be

converted into a function of 119905 and 119889 as shown in Figure 11(c)Then we can obtain the safe time 119905

1which is the time when

119876119860 = 119876119861 Furthermore the object 119861 will be closest to thequery at the time 119905

3

5 Comparisons with Previous Approaches

In this section we compare the proposed DC119896NN approachthe Safe-time with stationary query approach [5] and thenaıve way used pull-based approach in terms of safe timespace and accuracy

51 Safe Time The original safe-time with stationary query[5] (safe-time(S)) does not support moving queries Anexample of C3NN is shown in Figure 12 where 119902

1is the query

point triangles are the 3NN objects the pentagons representthe other individual objects and 119900

4is 4th NN Figure 12(a)

shows the original result for safe-time(S) After obtaining the119896th and (119896 + 1)th objects (119900

2and 1199004in the figure) the cross-

distance (CD) of 119896th and (119896 + 1)th objects can be calculatedRecall that the cross distance of two data objects 119860 and 119861 isthe difference on the distances of119860 and119861 to the center (or thequery point) For the next update (after a safe-time period)all the objects in this region should be checked

We adapt the safe-time(S) method for moving queryThe adapted approach will result in a higher update cost

12 International Journal of Distributed Sensor Networks

Figure 12(b) presents a case that the query moves towardobject 119900

3(119896th NN) and away from object 119900

4((119896 + 1)th NN)

When the query 1199021moves to the point 1199021015840

1 the most outside

concentric circle increases and becomes as large as the mostoutside dotted concentric circle On the contrary the mostinside concentric circle decreases and becomes as small as themost inside dotted concentric circle Thus the cross-distanceincreases and more number of objects will be examined

In addition according to the Figure 12(b) we can knowthat the original Safe-time method safe-time(S) is notappropriate for moving queries since the calculation of Safe-time(S) method does not consider the speed of query safe-time(S) directly uses twofold of the maximum speed of the119896th and (119896+1)thNNobjects to divide theCD to derive the safetime The cost for updates increases when the CD becomeslarger since the average checked area becomes bigger Besidesthe obtained 119896NNanswer cannot be guaranteed to be correctOn the contrary the cross-distance when the query movestowards object 119900

4((119896 + 1)th NN) and away from object 119900

3

(119896th NN) in this case the order of the 119896th and (119896 + 1)th NNobjectmay be changed but the update does not perform thusresulting in incorrect results

We modify the Safe-time to fully support the movingquery In order to support and maintain the accuracy ofmoving query the maximum speed (Maxspeed) used in thesafe time calculation is required to be modified and replacedby the maximum relative speed between the query and theobjects Because of using the relative speed the adaptedsafe-time method safe-time(M) needs twofold maximumrelative speed (2 lowast 119872119886119909119904119901119890119890119889) to calculate the safe time forguaranteeing the accurate resultsThe safe time derived is lessthan the one derived in safe-time(S) due to the relative speedHence the update frequency of safe-time(M) is higher thanthe update frequency of safe-time(S)

52 Space In DC119896NN each object and query only need tomaintain the information of LVC The information to bestored includes the location of neighboring objects and theobject information of order-119896rsquos local Voronoi diagram Thetotal amount of stored information is not significant on eachobjectThus the use of storage space does not need to be verysubstantial

53 Accuracy The safe-time (S) [5] considers the stationaryquery When applying it to the moving query some adaptionshould bemade According to our experimental results whenthe value of 119896 increases with a moving query the accuracy ofthe result will be reduced In our simulation we modify theoriginal Safe-time(S) as Safe time(M) for moving query andconsider the relative distance in detail caused by the movingquery and objects Although the correctness of the answer canbe increased the update frequency increases thus increasingthe number of delivered messages

DC119896NNuses Voronoi and grid cell boundary to calculatethe safe time and updates the information of related objectsbefore the end of the safe time In fact the boundary ofthe Voronoi cell represents the boundary of moving 119896NNquery After the safe time period the query will collect the

information of related neighboring objects Having such real-time information the query can have the resultmore accuratein time Similar to safe-time(M) DC119896NN uses the 119896th and(119896 + 1)th nearest moving objects to derive the safe time So itis able to maintain the correctness of the answer

6 Simulation Experiments

In the simulation we compare the following methods NaıveDC119896NN safe-time (S) and safe-time (M)TheNaıvemethodis centralized and used as a benchmark for the comparisonAll the mobile sensors will send the location informationto the central server to update the information The othermethods DC119896NN Safe-time(S) and Safe-time(M) are dis-tributed and used in the considered mobile wireless sensornetwork where each object knows its position has the abilityto perform some calculation and stores the information oflocalized Voronoi cell (LVC)We assume that each object cantransmit amessage to its one-hopneighbor so that each objectcan communicate with at least one object For Safe-time(S)and the safe-time(M) a maximum speed (MaxSpeed) is setin order to estimate relative speed and distance for safe-timecalculation

In the simulation all the compared approaches areperformed under the same environmental conditions forfairness The initial location and speed of moving objectsare uniformly randomly distributed Since we focus on theperformance of the query process of the proposed DC119896NNapproach we further assume that the transmission quality isideal and no congestion and communication delays occurThe metrics measured include the update frequency for aquery the total number of messages response time andaccuracy The update frequency for a query is the averagenumber of update messages sent by the data objects relatedto the query per minute The total number of messages isall the amount of messages sent from all objects during thequery process The accuracy of each method is measuredby comparing the results to the real answers Since thequery is continuous and the update occurs subsequently themeasured response time is mainly the time required fromsending a query to obtaining the first result

All the experiments are simulated so the results aboutthe response time may not show the practical cases exactlybut can reflect the trends on the performance among all thecompared approaches relatively In order to have the responsetime in our simulation we thus use the total number of hopsfor deriving the result tomultiply the average time for one hopin the simulation system to present the response time Thusthe response time is proportional to the total number of hopsin our simulation program In addition because the maindifference between Safe-time(S) and the Safe-time(M) is theway for deriving the safe time the measured response timeof these two methods is the same The simulation programis implemented with Java The setting of our simulation isshown in Table 1 with a default value for each parameter Inall the simulation experiments the final results are reportedwith the average of 100 queries The duration of each query is60 seconds

International Journal of Distributed Sensor Networks 13

200 400 600 800 10000

10

20

30

40

50

60

Edge length of sensing area (m)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

200 400 600 800 10000

100

200

300

400

500

600

700

Edge length of sensing area (m)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

200 400 600 800 100075

80

85

90

95

100

105

Edge length of sensing area (m)

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

200 400 600 800 1000Edge length of sensing area (m)

Aver

age r

espo

nse t

ime (

s)

DCkNNSafe-time(S)Safe-time(M)

095

1

105

11

(d) Response time

Figure 13 The effects of different sensing areas on (a) update frequency (b) number of messages (c) accuracy and (d) response time

Table 1 Simulation parameters

Parameter Range Default valueEdge length of sensingarea (m) 200 400 600 800 1000 600

Edge length of grid (m) 50 100 150 50Number of objects 20 30 40 50 60 30Transmission range (m) 125 125119896 1 3 5 10 20 3Moving objects () 20 40 60 80 100 20Speed (ms) 2 4 6 8 10 4

61 Effects of Sensing Area Sensing area affects the numberof update and query messages since if the area becomes

greater with the fixed number of objects relatively thedensity of the objects becomes sparse For example when thesensing areas are 200lowast200 400lowast400 600lowast600 800lowast800 and1000lowast1000 the densities are 188 047 021 012 and 008respectively Figure 13(a) shows that DC119896NN has the lowestnumber of updates with all the different areas and the numberof updates for Safe-time(S) is the highest (worst) becauseDC119896NN considers the moving direction and speed of thequeries and objects and selects the proper safe-distance toderive the safe-time Safe-time(S) the Safe-time(M) estimatethe safe time according to the maximum speed of the objectsso more number of updates can be expected AdditionallySafe-time(M) is updated more frequently than Safe-time(S)Recall that Safe-time(M) considers the query movement

14 International Journal of Distributed Sensor Networks

50 75 100 150 2000

5

10

15

20

25

Edge length of grid (m)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

50 75 100 150 2000

50

100

150

200

250

300

350

Edge length of grid (m)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

50 75 100 150 2000

20

40

60

80

100

120

Edge length of grid (m)

Accu

racy

()

DCkNN(G)DCkNN(V)

(c) Accuracy

50 75 100 150 2001

101

102

103

104

105

106

Edge length of grid (m)

Aver

age r

espo

nse t

ime (

s)

DCkNN(G)DCkNN(V)

(d) Response time

Figure 14 The comparisons of using grid-based and VD-base safe distances to derive the safe-time (a) update frequency (b) number ofmessages (c) accuracy and (d) response time

The average safe-distance becomes shorter thus leading tomore updates Besides when the sensing area increasesfrom 200lowast200 to 600lowast600 the update frequency dropsdramaticallyThe curve becomes flatter when the area is from600lowast600 to 1000lowast1000 since the difference on the densitiesof the areas from 600lowast600 to 1000lowast1000 is not much Thenumber of updates is less as the safe-time becomes largerThetotal number of transmitted messages of naıve approach isfixed at about 1800 packets All the other distributedmethodsuse fewer number of messages than naıve

To monitor the results DC119896NN only needs to check therelated objects in the local Voronoi cell at the proper safe-time thus reducing a lot of redundant update messages Safe-time(S) and Safe-time(M) use the maximum speed of theobjects to calculate the safe time so the total number of

transmitted messages of both approaches is more than that ofDC119896NN Figure 13(b) shows that more than 30 of the totalnumber of transmitted messages can be saved by DC119896NN incomparison with Safe-time(M)

For the accuracy since Safe-time(S) does not considerthe query movement the safe-time may be inaccurate Fur-thermore due to the mobility when the density is high theestimated results become more inaccurate So Safe-time(S)performs worst as shown in Figure 13(c) Safe-time(M) isrevised from Safe-time(S) by considering the query move-ment and the safe-distance is less in average for guaranteeingbetter results Hence Safe-time(M) has a better accuracy andalmost the same as DC119896NN The accuracy of Safe-time(M)and DC119896NN is almost about 100 correct and the gap maybe caused by arithmetical errors in the experiments

International Journal of Distributed Sensor Networks 15

10 20 30 40 50 60 700

5

10

15

20

25

30

35

40

45

Number of objects

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

10 20 30 40 50 60 70100

150

200

250

300

350

400

450

Number of objects

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

10 20 30 40 50 60 7080

85

90

95

100

105

Number of objects

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

10 20 30 40 50 60 70Number of objects

Aver

age r

espo

nse t

ime (

s)

096

098

1

102

104

106

108

11

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 15 The effects of the number of objects on (a) update frequency (b) number of messages (c) accuracy and (d) response time

When the area becomes larger the density becomeslower So the number of objects in each objectrsquos transmissionrange is fewer Under such a circumstance DC119896NN usesless computation and the response time is shorter as shownin Figure 13(d) In contrast the Safe-time(S) and the Safe-time(M) need to collect information before performing eachnew query and cause longer response time Since Safe-time(M) and Safe-time(S) use the same method and proce-dure to handle the first query the response time of these twomethods will be almost the same

62 Effects of Grid Size In this simulation experiment setwe want to observe the update efficiency of each object inthe third phase of DC119896NN Recall that we consider the grid-based and VD-base safe distances to derive a proper safe-time In this experiment DC119896NN(G) uses grid-based safe

distance to determine the safe time for the next update andDC119896NN(V) uses VD-base safe distance to derive the safetime The sensing area is fixed to 600lowast600m2 and there are30 data objects We compare DC119896NN(V) with DC119896NN(G)by observing the impacts of different grid sizes All theother settings have the similar trends in our experimentalresults In Figure 14(a) the update frequency of the objectsin DC119896NN(G) is high when the grid size is 50lowast50m2 andbecomes less when the grid size decreases Since the sensingarea is 600lowast600m2 and 30 objects are given the averagedistance between an object and the boundary of a Voronoicell is about 25 to 50 meters With the setting of grid size50lowast50m2 the average distance obtained in DC119896NN(G) isabout 25 meters Thus the safe time of DC119896NN(V) is longerIn general as Figures 14(a) and 14(b) show the update

16 International Journal of Distributed Sensor Networks

1 3 5 10 200

10

20

30

40

50

60

k

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

1 3 5 10 200

100

200

300

400

500

600

700

800

k

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

1 3 5 10 2080

85

90

95

100

105

k

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

1 3 5 10 20k

Aver

age r

espo

nse t

ime (

s)

08

09

1

11

12

13

14

15

16

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 16 The impacts of different values of 119896 on (a) update frequency (b) number of messages (c) accuracy and (d) response time

frequency of the objects and the number of messages sentby the objects decrease as the grid size increases

When the grid size is large the safe time becomes longand less number of updates are issued Hence the resultsbecome more inaccurate As shown in Figure 14(c) whenthe grid sizes are 50lowast50m2 75lowast75m2 100lowast100m2 and150lowast150m2 the corresponding accuracies are 95 9285 and 78 respectively While the grid size increases to200lowast200m2 the accuracy is significantly reduced to 69and the right answer thus can not be guaranteed On theother hand Figure 14(d) shows that the response times ofDC119896NN(G) and DC119896NN(V) are not much different becausethe size of grid is not the major factor to influence thecomplexity of obtaining information for the first query

63 Number of Objects In this subsection we discuss theresults as the number of data objects varies The area in thepresented experiment set is 600lowast600 (m2) with grid size of50lowast50 (m2) As shown in Figure 15(a) when the number ofobjects increases the number of updates in DC119896NN is stillrelatively less than the ones in Safe-time(S) and Safe-time(M)If the number of objects increases the number of repliedmessages per second to the central server in naıve will growdramatically With 20 to 60 objects the number of repliedmessages to the server is from 1200 to 3600 (packetsmin)By observing the results in Figures 15(b) and 15(c) as moreobjects are in the area the number of messages increasesfor the other three methods and the accuracy reduces inSafe-time(S) These match the trends for different areas we

International Journal of Distributed Sensor Networks 17

20 40 60 80 1000

5

10

15

20

25

30

35

40

45

Moving objects ()

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

20 40 60 80 1000

100

200

300

400

500

600

Moving objects ()

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

20 40 60 80 100

80

70

75

85

90

95

100

105

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

Moving objects ()

(c) Accuracy

20 40 60 80 100

Aver

age r

espo

nse t

ime (

s)

09

095

1

11

105

115

12

125

13

DCkNNSafe-time(S)Safe-time(M)

Moving objects ()

(d) Response time

Figure 17 The effects of the moving objects on (a) update frequency (b) number of messages (c) accuracy and (d) response time

discussed earlier due to the density Similarly the responsetime can be expected as shown in Figure 15(d) where theresponse time of DC119896NN is still the shortest

64 Different Values of 119896 It is obvious that the value of119896 affects the performance of query processing significantlyWhen the value of 119896 becomes larger the number of relatedobjects required to be checked also increases In other wordswe need to spend more cost to find out which 119896 objectsare currently in the result for the C119896NN query Thereforethe changes in the value of 119896 mainly affect the amountof data required for the first query and the update costfor maintaining the 119896th and the (119896 + 1)th objects So inFigure 16(a) when the value of 119896 is large more updates arenecessary for all the three methods As Figure 16(b) shows

the influence on the number of transmitted messages inSafe-time(M) is more serious than the one in Safe-time(S)Due to the mobility the number of influenced objects inSafe-time(M) will increase as the value of 119896 increases Inparticular the update frequency in Safe-time(M) becomesnearly twofold the update frequency in Safe-time(S)

Figure 16(c) presents the impact on the accuracy fordifferent values of 119896 With a larger value of 119896 an object inSafe-time(S) will have a higher chance to derive the incorrectsafe time thus causing lower accuracy When the value of 119896increases the response time of all threemethods will increasesignificantly as shown in Figure 16(d) The reason is thatall DC119896NN Safe-time(S) and Safe-time(M) need to searchmore objects and collect more information for answering thequery when the value of 119896 increases to a certain number For

18 International Journal of Distributed Sensor Networks

2 4 6 8 100

10

20

30

40

50

60

Speed (ms)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

2 4 6 8 100

100

200

300

400

500

600

700

800

Speed (ms)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

2 4 6 8 1070

75

80

85

90

95

100

105

Speed (ms)

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

2 4 6 8 1009

095

1

105

11

115

12

125

13

Speed (ms)

Aver

age r

espo

nse t

ime (

s)

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 18 The impacts of speed on (a) update frequency (b) number of messages (c) accuracy and (d) response time

DC119896NN DC119896NN only needs to store local Voronoi diagramwhere the information required is less than required in Safe-time(S) and Safe-time(M) so the response time of DC119896NN isthe shortest

65 The Effect of Moving Objects In this experiment set weconsider different percentages of moving objects in all thedata objects The default value is 20 which means that ifthere is a total of 30 objects then there are sixmoving objectsIn Figures 17(a) and 17(b) as the percentage ofmoving objectsincreases the overall number of updates required between theobjects increases relatively and the change rate of answer totheDC119896NNaccelerates thus increasing the update frequencyof the query and the number of messages However DC119896NNstill keeps the best performance Figure 17(c) shows the accu-racy of the result for different percentage of moving objectsDC119896NN and Safe-time(M) both have higher accuracy and

Safe-time(S) is still the worst The safe time of each object inSafe-time(S) is calculated using the maximum speed of theobjects Hence whether the object is moving or not does notdirectly result in the incorrectness of the answer collectionIn fact in Safe-time(S) one of the main reasons to affectthe accuracy is the directions of moving objects Last asFigure 17(d) shows the percentage of moving objects doesnot impact the response time too much

66 Effects of Speed If each object moves faster the relativevelocities between objects may also become faster This willmake the safe time shorter and the update frequency ofeach object and query increases The safe time used inSafe-time(S) and Safe-time(M) is directly affected by themaximum speed of objects and does not consider the direc-tion of each objectrsquos movement and the speed of individualmovement No matter the objects move or not and move

International Journal of Distributed Sensor Networks 19

fast or slow both of the above methods directly use themaximum speed of objects to calculate the safe time forupdating On the other hand DC119896NN considers the movingdirection of objects and the proper safe-time for updatesIn this experiment the number of moving objects is 20of all the objects As Figure 18(a) shows as the movingobjects speed up the update cost increases and DC119896NN stillperforms best As the speed increases the safe-time in Safe-time(S) and the Safe-time(M) becomes much shorter due toa larger maximum speed among all the objects The trendbecomes even worse as the speed increases

Figure 18(b) shows the trend about the number of trans-mitted messages when the speed is up DC119896NN still hasthe best performance on the number of messages There are42781 messages sent in average when the speed of object is10ms However the Safe-time(M) needs 67913 messagesThe accuracy will not be effected as the speed changesfor DC119896NN and Safe-time(M) because both of them aredesigned or adapted for themoving objects and queries Safe-time(S) will have more inaccurate results as the speed is highas shown in Figure 18(c) However the response time doesnot have a significant impact on the response time for all thethree methods Figure 18(d) presents this trend

7 Conclusions

In this paper we propose a new approach DC119896NN whichuses the local Voronoi diagram and proper safe-time toeffectively process the C119896NNquery in distributed andmobileenvironments such as wireless sensor networks The propersafe-time can be quickly derived by a simple formulaBy comparing our proposed DC119896NN with other existingapproaches Safe-time(S) DC119896NN can effectively improvesearch efficiency reduce response time and the numberof messages and keep the accuracy of the result highAdditionally DC119896NN reduces more 30 of transmissionmessages than Safe-time(M) because the characteristics of theVoronoi diagram are used and each objectrsquos moving directionis considered instead of directly using the maximum speedof the objects as Safe-time method The derived safe-timeis more precise As a result DC119896NN needs less updatefrequency reduces a great number of messages transmittedand yields more accurate results In this work simulationexperiments are also performed The experimental resultsvalidate the proposed DC119896NN approach for the continuous119896 nearest neighbor query in distributed and mobile environ-ments where all the data objects and query can move

Acknowledgment

This work is partially supported by NSC under the Grant98-2220-E-027-007 100-2221-E-027-087-MY2 and 102-2221-E-027-088-

References

[1] O Bohl S Manouchehri and U Winand ldquoMobile informationsystems for the private everyday liferdquo Mobile InformationSystems vol 3 no 3-4 pp 135ndash152 2007

[2] Y Tao andD Papadias ldquoTime-parameterized queries in spatio-temporal databasesrdquo in Proceedings of the ACM SIGMODInternational Conference on Managment of Data pp 334ndash345June 2002

[3] Y Tao D Papadias and Q Shen ldquoContinuous nearest neighborsearchrdquo in Proceedings of the 28th International Conference onVery Large Data Bases (VLDB rsquo02) pp 287ndash298 2002

[4] F Aurenhammer ldquoVoronoi diagramsmdasha survey of a fundamen-tal geometric data structurerdquo ACM Computing Surveys vol 23no 3 pp 345ndash405 1991

[5] K Kim Y Cai andW Tavanapong ldquoSafe-time distributed real-time monitoring of cKNN in mobile peer-to-peer networksrdquo inProceedings of the 9th IEEE International Conference on MobileData Management (MDM rsquo08) pp 124ndash131 April 2008

[6] M Kolahdouzan and C Shahabi ldquoVoronoi-based k nearest nei-ghbor search for spatial network databasesrdquo in Proceedings ofthe 30th International Conference on Very Large Data Bases vol30 pp 840ndash851 2004

[7] M R Kolahdouzan and C Shahabi ldquoAlternative solutions forcontinuous K nearest neighbor queries in spatial networkdatabasesrdquo GeoInformatica vol 9 no 4 pp 321ndash341 2005

[8] D Papadias Y Tao K Mouratidis and C K Hui ldquoAggregatenearest neighbor queries in spatial databasesrdquo ACM Transac-tions on Database Systems vol 30 no 2 pp 529ndash576 2005

[9] T Imielinski S Viswanathan and B R Badrinath ldquoData on airorganization and accessrdquo IEEE Transactions on Knowledge andData Engineering vol 9 no 3 pp 353ndash372 1997

[10] S Hambrusch C-M Liu and S Prabhakar ldquoBroadcasting andquerying multi-dimensional index trees in a multi-channelenvironmentrdquo Information Systems vol 31 no 8 pp 870ndash8862006

[11] C-M Liu and K-F Lin ldquoDisseminating dependent data inwireless broadcast environmentsrdquo Distributed and ParallelDatabases vol 22 no 1 pp 1ndash25 2007

[12] T-C Su and C-M Liu ldquoOn-demand data broadcasting for dataitems with time constraints on multiple broadcast channelsrdquo inDatabase Systems for Advanced Applications vol 6193 of LectureNotes in Computer Science pp 458ndash469 2010

[13] B Zheng J Xu W-C Lee and D L Lee ldquoGrid-partition ind-ex a hybrid method for nearest-neighbor queries in wirelesslocation-based servicesrdquo The VLDB Journal vol 15 no 1 pp21ndash39 2006

[14] B Gedik A Singh and L Liu ldquoEnergy efficient exact kNN sear-ch in wireless broadcast environmentsrdquo in Proceedings of the12th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo04) pp 137ndash146 November 2004

[15] KMouratidis S Bakiras and D Papadias ldquoContinuousmonit-oring of spatial queries in wireless broadcast environmentsrdquoIEEE Transactions onMobile Computing vol 8 no 10 pp 1297ndash1311 2009

[16] G Chatzimilioudis D Zeinalipour-Yazti W-C Lee and M DDikaiakos ldquoContinuous all k-nearest-neighbor querying insmartphone networksrdquo in Proceedings of the 13th IEEE Interna-tional Conference on Mobile Data Management (MDM rsquo12) pp79ndash88 2012

[17] T-Y Fu W-C Peng and W-C Lee ldquoParallelizing itinerary-basedKNNquery processing inwireless sensor networksrdquo IEEETransactions on Knowledge and Data Engineering vol 22 no 5pp 711ndash729 2010

[18] T P Nghiem A B Waluyo and D Taniar ldquoA pure peer-to-peerapproach for kNNquery processing inmobile ad hoc networksrdquo

20 International Journal of Distributed Sensor Networks

Personal and Ubiquitous Computing vol 17 no 5 pp 973ndash9852013

[19] HD Chon D Agrawal andA El Abbadi ldquoRange and kNNqu-ery processing for moving objects in Grid modelrdquo MobileNetworks and Applications vol 8 no 4 pp 401ndash412 2003

[20] X Xiong M F Mokbel and W G Aref ldquoSEA-CNN scalableprocessing of continuous K-nearest neighbor queries in spatio-temporal databasesrdquo in Proceedings of the 21st InternationalConference on Data Engineering (ICDE rsquo05) pp 643ndash654 April2005

[21] G Zhao K XuanW Rahayu et al ldquoVoronoi-based continuous120581 nearest neighbor search in mobile navigationrdquo IEEE Transac-tions on Industrial Electronics vol 58 no 6 pp 2247ndash2257 2011

[22] KMouratidis D Papadias S Bakiras and Y Tao ldquoA threshold-based algorithm for continuous monitoring of k nearest neigh-borsrdquo IEEE Transactions on Knowledge and Data Engineeringvol 17 no 11 pp 1451ndash1464 2005

[23] S-H Wu K-T Chuang C-M Chen and M-S Chen ldquoDIK-NN an itinerary-based KNN query processing algorithm formobile sensor networksrdquo inProceedings of the 23rd InternationalConference on Data Engineering (ICDE rsquo07) pp 456ndash465 April2007

[24] D T Lee ldquoOn k-nearest neighbor voronoi diagrams in the pla-nerdquo IEEE Transactions on Computers vol 31 no 6 pp 478ndash4871982

[25] K Patroumpas TMinogiannis andT Sellis ldquoApproximate ord-er-k Voronoi cells over positional streamsrdquo in Proceedings of the15th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo07) pp 276ndash283 November 2007

International Journal of

AerospaceEngineeringHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

RoboticsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Active and Passive Electronic Components

Control Scienceand Engineering

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

RotatingMachinery

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

Journal ofEngineeringVolume 2014

Submit your manuscripts athttpwwwhindawicom

VLSI Design

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Shock and Vibration

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawi Publishing Corporation httpwwwhindawicom

Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

SensorsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Navigation and Observation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

DistributedSensor Networks

International Journal of

Page 9: Research Article Distributed Continuous k Nearest Neighbors ...downloads.hindawi.com/journals/ijdsn/2013/125145.pdfmobile environments like WSNs, which consist of a number of mobile

International Journal of Distributed Sensor Networks 9

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q n1n2

n3

n4(k + 1)

(a)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5qn1

n2

n3

(b)

o1

o6o7

o8

o11o10

o12o13

o14o15

o16

o3o4

o5q

o9

o2

(c)

o1

o6

o7

o8

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5q

n11(k + 1)

n1

n4n5

n6

n10

n7

n8

n2n9

n3

(d)

o1

o6

o7

o8

o11o10

o12

o13o14o15

o16o9

o2 o3o4

o5q n1n2

n4n5

n6

n7

n3

n9n10

n8

(e)

Figure 8 An example of DC119896NN for 119896 gt 1 where the initialization phase is the same as previous DCNN example and (a) 1199001 1199008 and 119900

9are

the 3NN to the query object 119902 (b) the approximate order-3 Voronoi cell can be built with enough information received (c) the information isnot enough for 10NN query and two-hop neighboring sensors are requested (d) the resulting 10NN can be derived and (e) the approximateorder-10 Voronoi cell can be calculated with information received

to one more hop neighboring sensor Such process will berepeated with an increment on the hop count After havingenough information 119902 can calculate the resulting 10NN andthe approximate order-10 Voronoi cell as shown in Figures8(d) and 8(e) respectively Using the approximate order-10Voronoi cell the safe time can be derived In the followingwe will discuss how to derive the safe time for maintainingthe result of the continuous 119896NN query

43 Phase 3 Information Updates In the distributed andmobile environments it is challenging for a mobile nodeto maintain the location information of the other mobilenodes effectively If a mobile node sends the update messagesfrequently it will consume much network resource andpower Furthermore the result of themoving query should beeffectively maintained For different roles nodes and querywe propose effective ways respectively in our DC119896NN queryprocess to update the location information and maintain thequery result

431 The Safe Time of Each Object In the proposed appro-ach DC119896NN each object cooperates with each other andexchanges information to update the location information ofeach object In order to monitor and obtain the continuousanswer of a continuous 119896 nearest neighbors query we usea safe distance between each object and query Then wecan derive the safe time of each object for location updatesby estimating the maximum speed of that object Supposethat the sensing area is partitioned into a grid for location

management There are three possible methods for derivingthe safe distance The first one is the grid-based safe distanceEach object directly uses the minimum distance betweenitself and the boundary of the grid cell where the objectlocates Simply using the grid-based safe distance may causesome problems about the imprecise updates The secondmethod VD-based safe distance uses VD to obtain the safedistance In order to predict the safe distance more preciselywe can consider the previous two distances simultaneouslyand then select the smaller one So the last method propersafe distance will return a better safe distance by comparisonsHaving the safe distance the safe time then can be derived byestimating the maximum speed of the considered object

In Figure 9 the sensing area is divided into a grid andthe Voronoi diagram formed by the sensors is also shownFor sensor 119900

1in Figure 9(a) the grid-based safe distance and

VD-based safe distance are presented respectively and theproper safe distance will be the VD-based safe distance afterthe comparison On the contrary for sensor 119900

3in Figure 9(b)

the proper safe distance will be the grid-based safe distance

432The Safe Time of EachQuery For themoving query it isimportant to know when the result will change To derive thesafe time during which the result will not change we referto the characteristics of Voronoi diagram In the traditionalenvironment with static objects the system only uses theminimum distance from the query to the boundary of theVoronoi cell where the query locates as the safe distance Thethe safe time can be obtained by the estimated maximum

10 International Journal of Distributed Sensor Networks

o1

o7

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

o6o8

(a)

o1

o7

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

o6o8

(b)

Figure 9 An illustration for different safe distances (a) sensor 1199001uses the VD-based safe distance as the proper safe distance and (b) sensor

1199003uses the grid-based safe distance as the proper safe distance

L L

A

B

Safe distance

Query

B

A

120579

New safe distance

QueryA998400

L998400

B998400

Figure 10 An example showing the impact on the safe distancecaused by object movement

speed of that query During the safe time no update isnecessary thus saving the update cost

Unfortunately in the moving object environment theabove method cannot obtain the right safe time As shownin Figure 10 the left part shows the static case where 119871 is theVoronoi cell boundary between objects 119860 and 119861 and the safedistance of the query can be calculated as the figure showsHowever for the moving objects the original safe distancebetween the 119871 and query cannot be directly used to calculatethe safe time because the object movement will cause thedistance form query to 119871 to be nonlinearly increasing ordecreasing As the right part of Figure 10 shows after themovement of object 119860 and object 119861 119871 becomes 119871

1015840 and thesafe distance changes Thus if we want to use the boundariesof Voronoi cell to estimate more accurate safe time we needto consider the relative movements between the objects andquery

In order to derive the precise safe distance we considerthe movements of objects and query simultaneously and useFigure 11 to illustrate Initially 119876119860 and 119876119861 are the distancesfrom the query to objects 119860 and 119861 respectively The linebetween 119860 and 119861 is the boundary of the Voronoi cellsassociated with 119860 and 119861 and the query is located in thecell of 119860 as Figure 11(a) shows When objects and the querymove as in Figure 11(b) the query may touch the boundaryThis indicates that the query will enter another cell and theresult of the query should be updated The time from thebeginning to the moment of touching the boundary is theprecise safe time for the query According to the properties

of Voronoi diagram when the query is on the boundary119876119860 = 119876119861 We hence can use the condition of 119876119860 = 119876119861

to decide whether the query is on the boundary With thisproperty even though the objects and querymove frequentlythe query only needs the speeds directions and locationsof the neighboring objects to predict the safe time easilyWithin the safe time the query will not touch the boundaryIn Figure 11(c) the query meets the boundary at 119905

1and the

safe time is 1199051

In the following we present the way to calculate the safetime when 119876119860 = 119876119861 Assume that the initial location of themoving query is (119909

119902 119910119902) and the speed is (119881

119909119902 119881119910119902

) Supposethe initial location of object 119860(119861) is (119909

119860 119910119860)((119909119861 119910119861)) with

the speed being (119881119909119860

119881119910119860

)((119881119909119861

119881119910119861

)) The equation to findwhen the querymeets the boundary can be derived accordingto the property of perpendicular bisector Since119876119860 = 119876119861 wecan have

([(119909119902+ 119881119909119902

lowast 119905) minus (119909119860

+ 119881119909119860

lowast 119905)]2

+[(119910119902+ 119881119910119902

lowast 119905) minus (119910119860

+ 119881119910119860

lowast 119905)]2

)

12

= ([(119909119902+ 119881119909119902

lowast 119905) minus (119909119861

+ 119881119909119861

lowast 119905)]2

+[(119910119902+ 119881119910119902

lowast 119905) minus (119910119861

+ 119881119910119861

lowast 119905)]2

)

12

(1)

Then

0 = [1198812

119909119860

+ 1198812

119910119860

minus 1198812

119909119861

minus 1198812

119910119861

minus 2 lowast 119881119909119902

119881119909119860

minus2 lowast 119881119910119902

119881119910119860

+ 2 lowast 119881119909119902

119881119909119861

+ 2 lowast 119881119910119902

119881119910119861

] lowast 1199052

+ 2 [(119909119902minus 119909119860) (119881119909119902

minus 119881119909119860

) + (119910119902minus 119910119860) (119881119910119902

minus 119881119910119860

)

minus (119909119902minus119909119861) (119881119909119902

minus119881119909119861

) minus (119910119902minus119910119861) (119881119910119902

minus119881119910119861

)] lowast 119905

+ [(119909119902minus 119909119860)2

+ (119910119902minus 119910119860)2

minus (119909119902minus 119909119861)2

minus (119910119902minus119910119861)2

]

(2)

International Journal of Distributed Sensor Networks 11

A

B

Query

(x3 y3)

(x2 y2) (x1 y1)QA

QB

(Vx2 Vy2)

(Vx3 Vy3)

(Vx1 Vy1)

(a)

A

B

Query

(x3 y3)

(x2 y2)(x1 y1)

QA

QB

(Vx2 Vy2)

(Vx3 Vy3)

(Vx1 Vy1)

(b)

A

B

d

t1 t2 t3 t

(c)

Figure 11 The precise safe-time for moving objects 119860 and 119861 and the moving query where (a) shows the beginning state (b) presents themoment when the moving query meets the boundary and (c) gives the diagram for the change on the safe distance with time 119905

o1

o2

o3o4

o5

CDq1

CD2

(a)

o1

o2

o3o4

o5

CDq1

CD2

q9984001

(b)

Figure 12 The phenomenon when using the original safe-time methods to (a) stationary query and (b) moving query

Equation (2) is a quadratic equation Since a generalquadratic equation can be written in the following form1198861199092

+ 119887119909 + 119888 = 0 recall that the discriminant of a quadraticequation is Δ = 119887

2

minus 4119886119888 If Δ gt 0 there are two distinct realroots if Δ = 0 there is exactly one real root if Δ lt 0 thereare two distinct (non-real) complex roots In (2)

119886 = 1198812

119909119860

+ 1198812

119910119860

minus 1198812

119909119861

minus 1198812

119910119861

minus 2 lowast 119881119909119902

119881119909119860

minus 2 lowast 119881119910119902

119881119910119860

+ 2 lowast 119881119909119902

119881119909119861

+ 2 lowast 119881119910119902

119881119910119861

119887 = 2 [(119909119902minus 119909119860) (119881119909119902

minus 119881119909119860

) + (119910119902minus 119910119860) (119881119910119902

minus 119881119910119860

)

minus (119909119902minus 119909119861) (119881119909119902

minus 119881119909119861

) minus (119910119902minus 119910119861) (119881119910119902

minus 119881119910119861

)]

119888 = (119909119902minus 119909119860)2

+ (119910119902minus 119910119860)2

minus (119909119902minus 119909119861)2

minus (119910119902minus 119910119861)2

(3)

and then we can derive the safe time 119905 according to thediscriminant

119905 =

[minus119887 + (1198872

minus 4119886119888)12

]

2119886or

[minus119887 minus (1198872

minus 4119886119888)12

]

2119886

(4)

Finally we select the minimum value of 119905 gt 0 as the safetime

Additionally assuming that 119889 is the distance between theobject and the query and 119905 is the time 119876119860 = 119876119861 can be

converted into a function of 119905 and 119889 as shown in Figure 11(c)Then we can obtain the safe time 119905

1which is the time when

119876119860 = 119876119861 Furthermore the object 119861 will be closest to thequery at the time 119905

3

5 Comparisons with Previous Approaches

In this section we compare the proposed DC119896NN approachthe Safe-time with stationary query approach [5] and thenaıve way used pull-based approach in terms of safe timespace and accuracy

51 Safe Time The original safe-time with stationary query[5] (safe-time(S)) does not support moving queries Anexample of C3NN is shown in Figure 12 where 119902

1is the query

point triangles are the 3NN objects the pentagons representthe other individual objects and 119900

4is 4th NN Figure 12(a)

shows the original result for safe-time(S) After obtaining the119896th and (119896 + 1)th objects (119900

2and 1199004in the figure) the cross-

distance (CD) of 119896th and (119896 + 1)th objects can be calculatedRecall that the cross distance of two data objects 119860 and 119861 isthe difference on the distances of119860 and119861 to the center (or thequery point) For the next update (after a safe-time period)all the objects in this region should be checked

We adapt the safe-time(S) method for moving queryThe adapted approach will result in a higher update cost

12 International Journal of Distributed Sensor Networks

Figure 12(b) presents a case that the query moves towardobject 119900

3(119896th NN) and away from object 119900

4((119896 + 1)th NN)

When the query 1199021moves to the point 1199021015840

1 the most outside

concentric circle increases and becomes as large as the mostoutside dotted concentric circle On the contrary the mostinside concentric circle decreases and becomes as small as themost inside dotted concentric circle Thus the cross-distanceincreases and more number of objects will be examined

In addition according to the Figure 12(b) we can knowthat the original Safe-time method safe-time(S) is notappropriate for moving queries since the calculation of Safe-time(S) method does not consider the speed of query safe-time(S) directly uses twofold of the maximum speed of the119896th and (119896+1)thNNobjects to divide theCD to derive the safetime The cost for updates increases when the CD becomeslarger since the average checked area becomes bigger Besidesthe obtained 119896NNanswer cannot be guaranteed to be correctOn the contrary the cross-distance when the query movestowards object 119900

4((119896 + 1)th NN) and away from object 119900

3

(119896th NN) in this case the order of the 119896th and (119896 + 1)th NNobjectmay be changed but the update does not perform thusresulting in incorrect results

We modify the Safe-time to fully support the movingquery In order to support and maintain the accuracy ofmoving query the maximum speed (Maxspeed) used in thesafe time calculation is required to be modified and replacedby the maximum relative speed between the query and theobjects Because of using the relative speed the adaptedsafe-time method safe-time(M) needs twofold maximumrelative speed (2 lowast 119872119886119909119904119901119890119890119889) to calculate the safe time forguaranteeing the accurate resultsThe safe time derived is lessthan the one derived in safe-time(S) due to the relative speedHence the update frequency of safe-time(M) is higher thanthe update frequency of safe-time(S)

52 Space In DC119896NN each object and query only need tomaintain the information of LVC The information to bestored includes the location of neighboring objects and theobject information of order-119896rsquos local Voronoi diagram Thetotal amount of stored information is not significant on eachobjectThus the use of storage space does not need to be verysubstantial

53 Accuracy The safe-time (S) [5] considers the stationaryquery When applying it to the moving query some adaptionshould bemade According to our experimental results whenthe value of 119896 increases with a moving query the accuracy ofthe result will be reduced In our simulation we modify theoriginal Safe-time(S) as Safe time(M) for moving query andconsider the relative distance in detail caused by the movingquery and objects Although the correctness of the answer canbe increased the update frequency increases thus increasingthe number of delivered messages

DC119896NNuses Voronoi and grid cell boundary to calculatethe safe time and updates the information of related objectsbefore the end of the safe time In fact the boundary ofthe Voronoi cell represents the boundary of moving 119896NNquery After the safe time period the query will collect the

information of related neighboring objects Having such real-time information the query can have the resultmore accuratein time Similar to safe-time(M) DC119896NN uses the 119896th and(119896 + 1)th nearest moving objects to derive the safe time So itis able to maintain the correctness of the answer

6 Simulation Experiments

In the simulation we compare the following methods NaıveDC119896NN safe-time (S) and safe-time (M)TheNaıvemethodis centralized and used as a benchmark for the comparisonAll the mobile sensors will send the location informationto the central server to update the information The othermethods DC119896NN Safe-time(S) and Safe-time(M) are dis-tributed and used in the considered mobile wireless sensornetwork where each object knows its position has the abilityto perform some calculation and stores the information oflocalized Voronoi cell (LVC)We assume that each object cantransmit amessage to its one-hopneighbor so that each objectcan communicate with at least one object For Safe-time(S)and the safe-time(M) a maximum speed (MaxSpeed) is setin order to estimate relative speed and distance for safe-timecalculation

In the simulation all the compared approaches areperformed under the same environmental conditions forfairness The initial location and speed of moving objectsare uniformly randomly distributed Since we focus on theperformance of the query process of the proposed DC119896NNapproach we further assume that the transmission quality isideal and no congestion and communication delays occurThe metrics measured include the update frequency for aquery the total number of messages response time andaccuracy The update frequency for a query is the averagenumber of update messages sent by the data objects relatedto the query per minute The total number of messages isall the amount of messages sent from all objects during thequery process The accuracy of each method is measuredby comparing the results to the real answers Since thequery is continuous and the update occurs subsequently themeasured response time is mainly the time required fromsending a query to obtaining the first result

All the experiments are simulated so the results aboutthe response time may not show the practical cases exactlybut can reflect the trends on the performance among all thecompared approaches relatively In order to have the responsetime in our simulation we thus use the total number of hopsfor deriving the result tomultiply the average time for one hopin the simulation system to present the response time Thusthe response time is proportional to the total number of hopsin our simulation program In addition because the maindifference between Safe-time(S) and the Safe-time(M) is theway for deriving the safe time the measured response timeof these two methods is the same The simulation programis implemented with Java The setting of our simulation isshown in Table 1 with a default value for each parameter Inall the simulation experiments the final results are reportedwith the average of 100 queries The duration of each query is60 seconds

International Journal of Distributed Sensor Networks 13

200 400 600 800 10000

10

20

30

40

50

60

Edge length of sensing area (m)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

200 400 600 800 10000

100

200

300

400

500

600

700

Edge length of sensing area (m)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

200 400 600 800 100075

80

85

90

95

100

105

Edge length of sensing area (m)

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

200 400 600 800 1000Edge length of sensing area (m)

Aver

age r

espo

nse t

ime (

s)

DCkNNSafe-time(S)Safe-time(M)

095

1

105

11

(d) Response time

Figure 13 The effects of different sensing areas on (a) update frequency (b) number of messages (c) accuracy and (d) response time

Table 1 Simulation parameters

Parameter Range Default valueEdge length of sensingarea (m) 200 400 600 800 1000 600

Edge length of grid (m) 50 100 150 50Number of objects 20 30 40 50 60 30Transmission range (m) 125 125119896 1 3 5 10 20 3Moving objects () 20 40 60 80 100 20Speed (ms) 2 4 6 8 10 4

61 Effects of Sensing Area Sensing area affects the numberof update and query messages since if the area becomes

greater with the fixed number of objects relatively thedensity of the objects becomes sparse For example when thesensing areas are 200lowast200 400lowast400 600lowast600 800lowast800 and1000lowast1000 the densities are 188 047 021 012 and 008respectively Figure 13(a) shows that DC119896NN has the lowestnumber of updates with all the different areas and the numberof updates for Safe-time(S) is the highest (worst) becauseDC119896NN considers the moving direction and speed of thequeries and objects and selects the proper safe-distance toderive the safe-time Safe-time(S) the Safe-time(M) estimatethe safe time according to the maximum speed of the objectsso more number of updates can be expected AdditionallySafe-time(M) is updated more frequently than Safe-time(S)Recall that Safe-time(M) considers the query movement

14 International Journal of Distributed Sensor Networks

50 75 100 150 2000

5

10

15

20

25

Edge length of grid (m)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

50 75 100 150 2000

50

100

150

200

250

300

350

Edge length of grid (m)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

50 75 100 150 2000

20

40

60

80

100

120

Edge length of grid (m)

Accu

racy

()

DCkNN(G)DCkNN(V)

(c) Accuracy

50 75 100 150 2001

101

102

103

104

105

106

Edge length of grid (m)

Aver

age r

espo

nse t

ime (

s)

DCkNN(G)DCkNN(V)

(d) Response time

Figure 14 The comparisons of using grid-based and VD-base safe distances to derive the safe-time (a) update frequency (b) number ofmessages (c) accuracy and (d) response time

The average safe-distance becomes shorter thus leading tomore updates Besides when the sensing area increasesfrom 200lowast200 to 600lowast600 the update frequency dropsdramaticallyThe curve becomes flatter when the area is from600lowast600 to 1000lowast1000 since the difference on the densitiesof the areas from 600lowast600 to 1000lowast1000 is not much Thenumber of updates is less as the safe-time becomes largerThetotal number of transmitted messages of naıve approach isfixed at about 1800 packets All the other distributedmethodsuse fewer number of messages than naıve

To monitor the results DC119896NN only needs to check therelated objects in the local Voronoi cell at the proper safe-time thus reducing a lot of redundant update messages Safe-time(S) and Safe-time(M) use the maximum speed of theobjects to calculate the safe time so the total number of

transmitted messages of both approaches is more than that ofDC119896NN Figure 13(b) shows that more than 30 of the totalnumber of transmitted messages can be saved by DC119896NN incomparison with Safe-time(M)

For the accuracy since Safe-time(S) does not considerthe query movement the safe-time may be inaccurate Fur-thermore due to the mobility when the density is high theestimated results become more inaccurate So Safe-time(S)performs worst as shown in Figure 13(c) Safe-time(M) isrevised from Safe-time(S) by considering the query move-ment and the safe-distance is less in average for guaranteeingbetter results Hence Safe-time(M) has a better accuracy andalmost the same as DC119896NN The accuracy of Safe-time(M)and DC119896NN is almost about 100 correct and the gap maybe caused by arithmetical errors in the experiments

International Journal of Distributed Sensor Networks 15

10 20 30 40 50 60 700

5

10

15

20

25

30

35

40

45

Number of objects

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

10 20 30 40 50 60 70100

150

200

250

300

350

400

450

Number of objects

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

10 20 30 40 50 60 7080

85

90

95

100

105

Number of objects

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

10 20 30 40 50 60 70Number of objects

Aver

age r

espo

nse t

ime (

s)

096

098

1

102

104

106

108

11

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 15 The effects of the number of objects on (a) update frequency (b) number of messages (c) accuracy and (d) response time

When the area becomes larger the density becomeslower So the number of objects in each objectrsquos transmissionrange is fewer Under such a circumstance DC119896NN usesless computation and the response time is shorter as shownin Figure 13(d) In contrast the Safe-time(S) and the Safe-time(M) need to collect information before performing eachnew query and cause longer response time Since Safe-time(M) and Safe-time(S) use the same method and proce-dure to handle the first query the response time of these twomethods will be almost the same

62 Effects of Grid Size In this simulation experiment setwe want to observe the update efficiency of each object inthe third phase of DC119896NN Recall that we consider the grid-based and VD-base safe distances to derive a proper safe-time In this experiment DC119896NN(G) uses grid-based safe

distance to determine the safe time for the next update andDC119896NN(V) uses VD-base safe distance to derive the safetime The sensing area is fixed to 600lowast600m2 and there are30 data objects We compare DC119896NN(V) with DC119896NN(G)by observing the impacts of different grid sizes All theother settings have the similar trends in our experimentalresults In Figure 14(a) the update frequency of the objectsin DC119896NN(G) is high when the grid size is 50lowast50m2 andbecomes less when the grid size decreases Since the sensingarea is 600lowast600m2 and 30 objects are given the averagedistance between an object and the boundary of a Voronoicell is about 25 to 50 meters With the setting of grid size50lowast50m2 the average distance obtained in DC119896NN(G) isabout 25 meters Thus the safe time of DC119896NN(V) is longerIn general as Figures 14(a) and 14(b) show the update

16 International Journal of Distributed Sensor Networks

1 3 5 10 200

10

20

30

40

50

60

k

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

1 3 5 10 200

100

200

300

400

500

600

700

800

k

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

1 3 5 10 2080

85

90

95

100

105

k

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

1 3 5 10 20k

Aver

age r

espo

nse t

ime (

s)

08

09

1

11

12

13

14

15

16

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 16 The impacts of different values of 119896 on (a) update frequency (b) number of messages (c) accuracy and (d) response time

frequency of the objects and the number of messages sentby the objects decrease as the grid size increases

When the grid size is large the safe time becomes longand less number of updates are issued Hence the resultsbecome more inaccurate As shown in Figure 14(c) whenthe grid sizes are 50lowast50m2 75lowast75m2 100lowast100m2 and150lowast150m2 the corresponding accuracies are 95 9285 and 78 respectively While the grid size increases to200lowast200m2 the accuracy is significantly reduced to 69and the right answer thus can not be guaranteed On theother hand Figure 14(d) shows that the response times ofDC119896NN(G) and DC119896NN(V) are not much different becausethe size of grid is not the major factor to influence thecomplexity of obtaining information for the first query

63 Number of Objects In this subsection we discuss theresults as the number of data objects varies The area in thepresented experiment set is 600lowast600 (m2) with grid size of50lowast50 (m2) As shown in Figure 15(a) when the number ofobjects increases the number of updates in DC119896NN is stillrelatively less than the ones in Safe-time(S) and Safe-time(M)If the number of objects increases the number of repliedmessages per second to the central server in naıve will growdramatically With 20 to 60 objects the number of repliedmessages to the server is from 1200 to 3600 (packetsmin)By observing the results in Figures 15(b) and 15(c) as moreobjects are in the area the number of messages increasesfor the other three methods and the accuracy reduces inSafe-time(S) These match the trends for different areas we

International Journal of Distributed Sensor Networks 17

20 40 60 80 1000

5

10

15

20

25

30

35

40

45

Moving objects ()

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

20 40 60 80 1000

100

200

300

400

500

600

Moving objects ()

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

20 40 60 80 100

80

70

75

85

90

95

100

105

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

Moving objects ()

(c) Accuracy

20 40 60 80 100

Aver

age r

espo

nse t

ime (

s)

09

095

1

11

105

115

12

125

13

DCkNNSafe-time(S)Safe-time(M)

Moving objects ()

(d) Response time

Figure 17 The effects of the moving objects on (a) update frequency (b) number of messages (c) accuracy and (d) response time

discussed earlier due to the density Similarly the responsetime can be expected as shown in Figure 15(d) where theresponse time of DC119896NN is still the shortest

64 Different Values of 119896 It is obvious that the value of119896 affects the performance of query processing significantlyWhen the value of 119896 becomes larger the number of relatedobjects required to be checked also increases In other wordswe need to spend more cost to find out which 119896 objectsare currently in the result for the C119896NN query Thereforethe changes in the value of 119896 mainly affect the amountof data required for the first query and the update costfor maintaining the 119896th and the (119896 + 1)th objects So inFigure 16(a) when the value of 119896 is large more updates arenecessary for all the three methods As Figure 16(b) shows

the influence on the number of transmitted messages inSafe-time(M) is more serious than the one in Safe-time(S)Due to the mobility the number of influenced objects inSafe-time(M) will increase as the value of 119896 increases Inparticular the update frequency in Safe-time(M) becomesnearly twofold the update frequency in Safe-time(S)

Figure 16(c) presents the impact on the accuracy fordifferent values of 119896 With a larger value of 119896 an object inSafe-time(S) will have a higher chance to derive the incorrectsafe time thus causing lower accuracy When the value of 119896increases the response time of all threemethods will increasesignificantly as shown in Figure 16(d) The reason is thatall DC119896NN Safe-time(S) and Safe-time(M) need to searchmore objects and collect more information for answering thequery when the value of 119896 increases to a certain number For

18 International Journal of Distributed Sensor Networks

2 4 6 8 100

10

20

30

40

50

60

Speed (ms)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

2 4 6 8 100

100

200

300

400

500

600

700

800

Speed (ms)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

2 4 6 8 1070

75

80

85

90

95

100

105

Speed (ms)

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

2 4 6 8 1009

095

1

105

11

115

12

125

13

Speed (ms)

Aver

age r

espo

nse t

ime (

s)

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 18 The impacts of speed on (a) update frequency (b) number of messages (c) accuracy and (d) response time

DC119896NN DC119896NN only needs to store local Voronoi diagramwhere the information required is less than required in Safe-time(S) and Safe-time(M) so the response time of DC119896NN isthe shortest

65 The Effect of Moving Objects In this experiment set weconsider different percentages of moving objects in all thedata objects The default value is 20 which means that ifthere is a total of 30 objects then there are sixmoving objectsIn Figures 17(a) and 17(b) as the percentage ofmoving objectsincreases the overall number of updates required between theobjects increases relatively and the change rate of answer totheDC119896NNaccelerates thus increasing the update frequencyof the query and the number of messages However DC119896NNstill keeps the best performance Figure 17(c) shows the accu-racy of the result for different percentage of moving objectsDC119896NN and Safe-time(M) both have higher accuracy and

Safe-time(S) is still the worst The safe time of each object inSafe-time(S) is calculated using the maximum speed of theobjects Hence whether the object is moving or not does notdirectly result in the incorrectness of the answer collectionIn fact in Safe-time(S) one of the main reasons to affectthe accuracy is the directions of moving objects Last asFigure 17(d) shows the percentage of moving objects doesnot impact the response time too much

66 Effects of Speed If each object moves faster the relativevelocities between objects may also become faster This willmake the safe time shorter and the update frequency ofeach object and query increases The safe time used inSafe-time(S) and Safe-time(M) is directly affected by themaximum speed of objects and does not consider the direc-tion of each objectrsquos movement and the speed of individualmovement No matter the objects move or not and move

International Journal of Distributed Sensor Networks 19

fast or slow both of the above methods directly use themaximum speed of objects to calculate the safe time forupdating On the other hand DC119896NN considers the movingdirection of objects and the proper safe-time for updatesIn this experiment the number of moving objects is 20of all the objects As Figure 18(a) shows as the movingobjects speed up the update cost increases and DC119896NN stillperforms best As the speed increases the safe-time in Safe-time(S) and the Safe-time(M) becomes much shorter due toa larger maximum speed among all the objects The trendbecomes even worse as the speed increases

Figure 18(b) shows the trend about the number of trans-mitted messages when the speed is up DC119896NN still hasthe best performance on the number of messages There are42781 messages sent in average when the speed of object is10ms However the Safe-time(M) needs 67913 messagesThe accuracy will not be effected as the speed changesfor DC119896NN and Safe-time(M) because both of them aredesigned or adapted for themoving objects and queries Safe-time(S) will have more inaccurate results as the speed is highas shown in Figure 18(c) However the response time doesnot have a significant impact on the response time for all thethree methods Figure 18(d) presents this trend

7 Conclusions

In this paper we propose a new approach DC119896NN whichuses the local Voronoi diagram and proper safe-time toeffectively process the C119896NNquery in distributed andmobileenvironments such as wireless sensor networks The propersafe-time can be quickly derived by a simple formulaBy comparing our proposed DC119896NN with other existingapproaches Safe-time(S) DC119896NN can effectively improvesearch efficiency reduce response time and the numberof messages and keep the accuracy of the result highAdditionally DC119896NN reduces more 30 of transmissionmessages than Safe-time(M) because the characteristics of theVoronoi diagram are used and each objectrsquos moving directionis considered instead of directly using the maximum speedof the objects as Safe-time method The derived safe-timeis more precise As a result DC119896NN needs less updatefrequency reduces a great number of messages transmittedand yields more accurate results In this work simulationexperiments are also performed The experimental resultsvalidate the proposed DC119896NN approach for the continuous119896 nearest neighbor query in distributed and mobile environ-ments where all the data objects and query can move

Acknowledgment

This work is partially supported by NSC under the Grant98-2220-E-027-007 100-2221-E-027-087-MY2 and 102-2221-E-027-088-

References

[1] O Bohl S Manouchehri and U Winand ldquoMobile informationsystems for the private everyday liferdquo Mobile InformationSystems vol 3 no 3-4 pp 135ndash152 2007

[2] Y Tao andD Papadias ldquoTime-parameterized queries in spatio-temporal databasesrdquo in Proceedings of the ACM SIGMODInternational Conference on Managment of Data pp 334ndash345June 2002

[3] Y Tao D Papadias and Q Shen ldquoContinuous nearest neighborsearchrdquo in Proceedings of the 28th International Conference onVery Large Data Bases (VLDB rsquo02) pp 287ndash298 2002

[4] F Aurenhammer ldquoVoronoi diagramsmdasha survey of a fundamen-tal geometric data structurerdquo ACM Computing Surveys vol 23no 3 pp 345ndash405 1991

[5] K Kim Y Cai andW Tavanapong ldquoSafe-time distributed real-time monitoring of cKNN in mobile peer-to-peer networksrdquo inProceedings of the 9th IEEE International Conference on MobileData Management (MDM rsquo08) pp 124ndash131 April 2008

[6] M Kolahdouzan and C Shahabi ldquoVoronoi-based k nearest nei-ghbor search for spatial network databasesrdquo in Proceedings ofthe 30th International Conference on Very Large Data Bases vol30 pp 840ndash851 2004

[7] M R Kolahdouzan and C Shahabi ldquoAlternative solutions forcontinuous K nearest neighbor queries in spatial networkdatabasesrdquo GeoInformatica vol 9 no 4 pp 321ndash341 2005

[8] D Papadias Y Tao K Mouratidis and C K Hui ldquoAggregatenearest neighbor queries in spatial databasesrdquo ACM Transac-tions on Database Systems vol 30 no 2 pp 529ndash576 2005

[9] T Imielinski S Viswanathan and B R Badrinath ldquoData on airorganization and accessrdquo IEEE Transactions on Knowledge andData Engineering vol 9 no 3 pp 353ndash372 1997

[10] S Hambrusch C-M Liu and S Prabhakar ldquoBroadcasting andquerying multi-dimensional index trees in a multi-channelenvironmentrdquo Information Systems vol 31 no 8 pp 870ndash8862006

[11] C-M Liu and K-F Lin ldquoDisseminating dependent data inwireless broadcast environmentsrdquo Distributed and ParallelDatabases vol 22 no 1 pp 1ndash25 2007

[12] T-C Su and C-M Liu ldquoOn-demand data broadcasting for dataitems with time constraints on multiple broadcast channelsrdquo inDatabase Systems for Advanced Applications vol 6193 of LectureNotes in Computer Science pp 458ndash469 2010

[13] B Zheng J Xu W-C Lee and D L Lee ldquoGrid-partition ind-ex a hybrid method for nearest-neighbor queries in wirelesslocation-based servicesrdquo The VLDB Journal vol 15 no 1 pp21ndash39 2006

[14] B Gedik A Singh and L Liu ldquoEnergy efficient exact kNN sear-ch in wireless broadcast environmentsrdquo in Proceedings of the12th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo04) pp 137ndash146 November 2004

[15] KMouratidis S Bakiras and D Papadias ldquoContinuousmonit-oring of spatial queries in wireless broadcast environmentsrdquoIEEE Transactions onMobile Computing vol 8 no 10 pp 1297ndash1311 2009

[16] G Chatzimilioudis D Zeinalipour-Yazti W-C Lee and M DDikaiakos ldquoContinuous all k-nearest-neighbor querying insmartphone networksrdquo in Proceedings of the 13th IEEE Interna-tional Conference on Mobile Data Management (MDM rsquo12) pp79ndash88 2012

[17] T-Y Fu W-C Peng and W-C Lee ldquoParallelizing itinerary-basedKNNquery processing inwireless sensor networksrdquo IEEETransactions on Knowledge and Data Engineering vol 22 no 5pp 711ndash729 2010

[18] T P Nghiem A B Waluyo and D Taniar ldquoA pure peer-to-peerapproach for kNNquery processing inmobile ad hoc networksrdquo

20 International Journal of Distributed Sensor Networks

Personal and Ubiquitous Computing vol 17 no 5 pp 973ndash9852013

[19] HD Chon D Agrawal andA El Abbadi ldquoRange and kNNqu-ery processing for moving objects in Grid modelrdquo MobileNetworks and Applications vol 8 no 4 pp 401ndash412 2003

[20] X Xiong M F Mokbel and W G Aref ldquoSEA-CNN scalableprocessing of continuous K-nearest neighbor queries in spatio-temporal databasesrdquo in Proceedings of the 21st InternationalConference on Data Engineering (ICDE rsquo05) pp 643ndash654 April2005

[21] G Zhao K XuanW Rahayu et al ldquoVoronoi-based continuous120581 nearest neighbor search in mobile navigationrdquo IEEE Transac-tions on Industrial Electronics vol 58 no 6 pp 2247ndash2257 2011

[22] KMouratidis D Papadias S Bakiras and Y Tao ldquoA threshold-based algorithm for continuous monitoring of k nearest neigh-borsrdquo IEEE Transactions on Knowledge and Data Engineeringvol 17 no 11 pp 1451ndash1464 2005

[23] S-H Wu K-T Chuang C-M Chen and M-S Chen ldquoDIK-NN an itinerary-based KNN query processing algorithm formobile sensor networksrdquo inProceedings of the 23rd InternationalConference on Data Engineering (ICDE rsquo07) pp 456ndash465 April2007

[24] D T Lee ldquoOn k-nearest neighbor voronoi diagrams in the pla-nerdquo IEEE Transactions on Computers vol 31 no 6 pp 478ndash4871982

[25] K Patroumpas TMinogiannis andT Sellis ldquoApproximate ord-er-k Voronoi cells over positional streamsrdquo in Proceedings of the15th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo07) pp 276ndash283 November 2007

International Journal of

AerospaceEngineeringHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

RoboticsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Active and Passive Electronic Components

Control Scienceand Engineering

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

RotatingMachinery

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

Journal ofEngineeringVolume 2014

Submit your manuscripts athttpwwwhindawicom

VLSI Design

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Shock and Vibration

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawi Publishing Corporation httpwwwhindawicom

Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

SensorsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Navigation and Observation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

DistributedSensor Networks

International Journal of

Page 10: Research Article Distributed Continuous k Nearest Neighbors ...downloads.hindawi.com/journals/ijdsn/2013/125145.pdfmobile environments like WSNs, which consist of a number of mobile

10 International Journal of Distributed Sensor Networks

o1

o7

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

o6o8

(a)

o1

o7

o11o10

o12o13

o14o15

o16

o9

o2 o3o4

o5

o6o8

(b)

Figure 9 An illustration for different safe distances (a) sensor 1199001uses the VD-based safe distance as the proper safe distance and (b) sensor

1199003uses the grid-based safe distance as the proper safe distance

L L

A

B

Safe distance

Query

B

A

120579

New safe distance

QueryA998400

L998400

B998400

Figure 10 An example showing the impact on the safe distancecaused by object movement

speed of that query During the safe time no update isnecessary thus saving the update cost

Unfortunately in the moving object environment theabove method cannot obtain the right safe time As shownin Figure 10 the left part shows the static case where 119871 is theVoronoi cell boundary between objects 119860 and 119861 and the safedistance of the query can be calculated as the figure showsHowever for the moving objects the original safe distancebetween the 119871 and query cannot be directly used to calculatethe safe time because the object movement will cause thedistance form query to 119871 to be nonlinearly increasing ordecreasing As the right part of Figure 10 shows after themovement of object 119860 and object 119861 119871 becomes 119871

1015840 and thesafe distance changes Thus if we want to use the boundariesof Voronoi cell to estimate more accurate safe time we needto consider the relative movements between the objects andquery

In order to derive the precise safe distance we considerthe movements of objects and query simultaneously and useFigure 11 to illustrate Initially 119876119860 and 119876119861 are the distancesfrom the query to objects 119860 and 119861 respectively The linebetween 119860 and 119861 is the boundary of the Voronoi cellsassociated with 119860 and 119861 and the query is located in thecell of 119860 as Figure 11(a) shows When objects and the querymove as in Figure 11(b) the query may touch the boundaryThis indicates that the query will enter another cell and theresult of the query should be updated The time from thebeginning to the moment of touching the boundary is theprecise safe time for the query According to the properties

of Voronoi diagram when the query is on the boundary119876119860 = 119876119861 We hence can use the condition of 119876119860 = 119876119861

to decide whether the query is on the boundary With thisproperty even though the objects and querymove frequentlythe query only needs the speeds directions and locationsof the neighboring objects to predict the safe time easilyWithin the safe time the query will not touch the boundaryIn Figure 11(c) the query meets the boundary at 119905

1and the

safe time is 1199051

In the following we present the way to calculate the safetime when 119876119860 = 119876119861 Assume that the initial location of themoving query is (119909

119902 119910119902) and the speed is (119881

119909119902 119881119910119902

) Supposethe initial location of object 119860(119861) is (119909

119860 119910119860)((119909119861 119910119861)) with

the speed being (119881119909119860

119881119910119860

)((119881119909119861

119881119910119861

)) The equation to findwhen the querymeets the boundary can be derived accordingto the property of perpendicular bisector Since119876119860 = 119876119861 wecan have

([(119909119902+ 119881119909119902

lowast 119905) minus (119909119860

+ 119881119909119860

lowast 119905)]2

+[(119910119902+ 119881119910119902

lowast 119905) minus (119910119860

+ 119881119910119860

lowast 119905)]2

)

12

= ([(119909119902+ 119881119909119902

lowast 119905) minus (119909119861

+ 119881119909119861

lowast 119905)]2

+[(119910119902+ 119881119910119902

lowast 119905) minus (119910119861

+ 119881119910119861

lowast 119905)]2

)

12

(1)

Then

0 = [1198812

119909119860

+ 1198812

119910119860

minus 1198812

119909119861

minus 1198812

119910119861

minus 2 lowast 119881119909119902

119881119909119860

minus2 lowast 119881119910119902

119881119910119860

+ 2 lowast 119881119909119902

119881119909119861

+ 2 lowast 119881119910119902

119881119910119861

] lowast 1199052

+ 2 [(119909119902minus 119909119860) (119881119909119902

minus 119881119909119860

) + (119910119902minus 119910119860) (119881119910119902

minus 119881119910119860

)

minus (119909119902minus119909119861) (119881119909119902

minus119881119909119861

) minus (119910119902minus119910119861) (119881119910119902

minus119881119910119861

)] lowast 119905

+ [(119909119902minus 119909119860)2

+ (119910119902minus 119910119860)2

minus (119909119902minus 119909119861)2

minus (119910119902minus119910119861)2

]

(2)

International Journal of Distributed Sensor Networks 11

A

B

Query

(x3 y3)

(x2 y2) (x1 y1)QA

QB

(Vx2 Vy2)

(Vx3 Vy3)

(Vx1 Vy1)

(a)

A

B

Query

(x3 y3)

(x2 y2)(x1 y1)

QA

QB

(Vx2 Vy2)

(Vx3 Vy3)

(Vx1 Vy1)

(b)

A

B

d

t1 t2 t3 t

(c)

Figure 11 The precise safe-time for moving objects 119860 and 119861 and the moving query where (a) shows the beginning state (b) presents themoment when the moving query meets the boundary and (c) gives the diagram for the change on the safe distance with time 119905

o1

o2

o3o4

o5

CDq1

CD2

(a)

o1

o2

o3o4

o5

CDq1

CD2

q9984001

(b)

Figure 12 The phenomenon when using the original safe-time methods to (a) stationary query and (b) moving query

Equation (2) is a quadratic equation Since a generalquadratic equation can be written in the following form1198861199092

+ 119887119909 + 119888 = 0 recall that the discriminant of a quadraticequation is Δ = 119887

2

minus 4119886119888 If Δ gt 0 there are two distinct realroots if Δ = 0 there is exactly one real root if Δ lt 0 thereare two distinct (non-real) complex roots In (2)

119886 = 1198812

119909119860

+ 1198812

119910119860

minus 1198812

119909119861

minus 1198812

119910119861

minus 2 lowast 119881119909119902

119881119909119860

minus 2 lowast 119881119910119902

119881119910119860

+ 2 lowast 119881119909119902

119881119909119861

+ 2 lowast 119881119910119902

119881119910119861

119887 = 2 [(119909119902minus 119909119860) (119881119909119902

minus 119881119909119860

) + (119910119902minus 119910119860) (119881119910119902

minus 119881119910119860

)

minus (119909119902minus 119909119861) (119881119909119902

minus 119881119909119861

) minus (119910119902minus 119910119861) (119881119910119902

minus 119881119910119861

)]

119888 = (119909119902minus 119909119860)2

+ (119910119902minus 119910119860)2

minus (119909119902minus 119909119861)2

minus (119910119902minus 119910119861)2

(3)

and then we can derive the safe time 119905 according to thediscriminant

119905 =

[minus119887 + (1198872

minus 4119886119888)12

]

2119886or

[minus119887 minus (1198872

minus 4119886119888)12

]

2119886

(4)

Finally we select the minimum value of 119905 gt 0 as the safetime

Additionally assuming that 119889 is the distance between theobject and the query and 119905 is the time 119876119860 = 119876119861 can be

converted into a function of 119905 and 119889 as shown in Figure 11(c)Then we can obtain the safe time 119905

1which is the time when

119876119860 = 119876119861 Furthermore the object 119861 will be closest to thequery at the time 119905

3

5 Comparisons with Previous Approaches

In this section we compare the proposed DC119896NN approachthe Safe-time with stationary query approach [5] and thenaıve way used pull-based approach in terms of safe timespace and accuracy

51 Safe Time The original safe-time with stationary query[5] (safe-time(S)) does not support moving queries Anexample of C3NN is shown in Figure 12 where 119902

1is the query

point triangles are the 3NN objects the pentagons representthe other individual objects and 119900

4is 4th NN Figure 12(a)

shows the original result for safe-time(S) After obtaining the119896th and (119896 + 1)th objects (119900

2and 1199004in the figure) the cross-

distance (CD) of 119896th and (119896 + 1)th objects can be calculatedRecall that the cross distance of two data objects 119860 and 119861 isthe difference on the distances of119860 and119861 to the center (or thequery point) For the next update (after a safe-time period)all the objects in this region should be checked

We adapt the safe-time(S) method for moving queryThe adapted approach will result in a higher update cost

12 International Journal of Distributed Sensor Networks

Figure 12(b) presents a case that the query moves towardobject 119900

3(119896th NN) and away from object 119900

4((119896 + 1)th NN)

When the query 1199021moves to the point 1199021015840

1 the most outside

concentric circle increases and becomes as large as the mostoutside dotted concentric circle On the contrary the mostinside concentric circle decreases and becomes as small as themost inside dotted concentric circle Thus the cross-distanceincreases and more number of objects will be examined

In addition according to the Figure 12(b) we can knowthat the original Safe-time method safe-time(S) is notappropriate for moving queries since the calculation of Safe-time(S) method does not consider the speed of query safe-time(S) directly uses twofold of the maximum speed of the119896th and (119896+1)thNNobjects to divide theCD to derive the safetime The cost for updates increases when the CD becomeslarger since the average checked area becomes bigger Besidesthe obtained 119896NNanswer cannot be guaranteed to be correctOn the contrary the cross-distance when the query movestowards object 119900

4((119896 + 1)th NN) and away from object 119900

3

(119896th NN) in this case the order of the 119896th and (119896 + 1)th NNobjectmay be changed but the update does not perform thusresulting in incorrect results

We modify the Safe-time to fully support the movingquery In order to support and maintain the accuracy ofmoving query the maximum speed (Maxspeed) used in thesafe time calculation is required to be modified and replacedby the maximum relative speed between the query and theobjects Because of using the relative speed the adaptedsafe-time method safe-time(M) needs twofold maximumrelative speed (2 lowast 119872119886119909119904119901119890119890119889) to calculate the safe time forguaranteeing the accurate resultsThe safe time derived is lessthan the one derived in safe-time(S) due to the relative speedHence the update frequency of safe-time(M) is higher thanthe update frequency of safe-time(S)

52 Space In DC119896NN each object and query only need tomaintain the information of LVC The information to bestored includes the location of neighboring objects and theobject information of order-119896rsquos local Voronoi diagram Thetotal amount of stored information is not significant on eachobjectThus the use of storage space does not need to be verysubstantial

53 Accuracy The safe-time (S) [5] considers the stationaryquery When applying it to the moving query some adaptionshould bemade According to our experimental results whenthe value of 119896 increases with a moving query the accuracy ofthe result will be reduced In our simulation we modify theoriginal Safe-time(S) as Safe time(M) for moving query andconsider the relative distance in detail caused by the movingquery and objects Although the correctness of the answer canbe increased the update frequency increases thus increasingthe number of delivered messages

DC119896NNuses Voronoi and grid cell boundary to calculatethe safe time and updates the information of related objectsbefore the end of the safe time In fact the boundary ofthe Voronoi cell represents the boundary of moving 119896NNquery After the safe time period the query will collect the

information of related neighboring objects Having such real-time information the query can have the resultmore accuratein time Similar to safe-time(M) DC119896NN uses the 119896th and(119896 + 1)th nearest moving objects to derive the safe time So itis able to maintain the correctness of the answer

6 Simulation Experiments

In the simulation we compare the following methods NaıveDC119896NN safe-time (S) and safe-time (M)TheNaıvemethodis centralized and used as a benchmark for the comparisonAll the mobile sensors will send the location informationto the central server to update the information The othermethods DC119896NN Safe-time(S) and Safe-time(M) are dis-tributed and used in the considered mobile wireless sensornetwork where each object knows its position has the abilityto perform some calculation and stores the information oflocalized Voronoi cell (LVC)We assume that each object cantransmit amessage to its one-hopneighbor so that each objectcan communicate with at least one object For Safe-time(S)and the safe-time(M) a maximum speed (MaxSpeed) is setin order to estimate relative speed and distance for safe-timecalculation

In the simulation all the compared approaches areperformed under the same environmental conditions forfairness The initial location and speed of moving objectsare uniformly randomly distributed Since we focus on theperformance of the query process of the proposed DC119896NNapproach we further assume that the transmission quality isideal and no congestion and communication delays occurThe metrics measured include the update frequency for aquery the total number of messages response time andaccuracy The update frequency for a query is the averagenumber of update messages sent by the data objects relatedto the query per minute The total number of messages isall the amount of messages sent from all objects during thequery process The accuracy of each method is measuredby comparing the results to the real answers Since thequery is continuous and the update occurs subsequently themeasured response time is mainly the time required fromsending a query to obtaining the first result

All the experiments are simulated so the results aboutthe response time may not show the practical cases exactlybut can reflect the trends on the performance among all thecompared approaches relatively In order to have the responsetime in our simulation we thus use the total number of hopsfor deriving the result tomultiply the average time for one hopin the simulation system to present the response time Thusthe response time is proportional to the total number of hopsin our simulation program In addition because the maindifference between Safe-time(S) and the Safe-time(M) is theway for deriving the safe time the measured response timeof these two methods is the same The simulation programis implemented with Java The setting of our simulation isshown in Table 1 with a default value for each parameter Inall the simulation experiments the final results are reportedwith the average of 100 queries The duration of each query is60 seconds

International Journal of Distributed Sensor Networks 13

200 400 600 800 10000

10

20

30

40

50

60

Edge length of sensing area (m)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

200 400 600 800 10000

100

200

300

400

500

600

700

Edge length of sensing area (m)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

200 400 600 800 100075

80

85

90

95

100

105

Edge length of sensing area (m)

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

200 400 600 800 1000Edge length of sensing area (m)

Aver

age r

espo

nse t

ime (

s)

DCkNNSafe-time(S)Safe-time(M)

095

1

105

11

(d) Response time

Figure 13 The effects of different sensing areas on (a) update frequency (b) number of messages (c) accuracy and (d) response time

Table 1 Simulation parameters

Parameter Range Default valueEdge length of sensingarea (m) 200 400 600 800 1000 600

Edge length of grid (m) 50 100 150 50Number of objects 20 30 40 50 60 30Transmission range (m) 125 125119896 1 3 5 10 20 3Moving objects () 20 40 60 80 100 20Speed (ms) 2 4 6 8 10 4

61 Effects of Sensing Area Sensing area affects the numberof update and query messages since if the area becomes

greater with the fixed number of objects relatively thedensity of the objects becomes sparse For example when thesensing areas are 200lowast200 400lowast400 600lowast600 800lowast800 and1000lowast1000 the densities are 188 047 021 012 and 008respectively Figure 13(a) shows that DC119896NN has the lowestnumber of updates with all the different areas and the numberof updates for Safe-time(S) is the highest (worst) becauseDC119896NN considers the moving direction and speed of thequeries and objects and selects the proper safe-distance toderive the safe-time Safe-time(S) the Safe-time(M) estimatethe safe time according to the maximum speed of the objectsso more number of updates can be expected AdditionallySafe-time(M) is updated more frequently than Safe-time(S)Recall that Safe-time(M) considers the query movement

14 International Journal of Distributed Sensor Networks

50 75 100 150 2000

5

10

15

20

25

Edge length of grid (m)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

50 75 100 150 2000

50

100

150

200

250

300

350

Edge length of grid (m)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

50 75 100 150 2000

20

40

60

80

100

120

Edge length of grid (m)

Accu

racy

()

DCkNN(G)DCkNN(V)

(c) Accuracy

50 75 100 150 2001

101

102

103

104

105

106

Edge length of grid (m)

Aver

age r

espo

nse t

ime (

s)

DCkNN(G)DCkNN(V)

(d) Response time

Figure 14 The comparisons of using grid-based and VD-base safe distances to derive the safe-time (a) update frequency (b) number ofmessages (c) accuracy and (d) response time

The average safe-distance becomes shorter thus leading tomore updates Besides when the sensing area increasesfrom 200lowast200 to 600lowast600 the update frequency dropsdramaticallyThe curve becomes flatter when the area is from600lowast600 to 1000lowast1000 since the difference on the densitiesof the areas from 600lowast600 to 1000lowast1000 is not much Thenumber of updates is less as the safe-time becomes largerThetotal number of transmitted messages of naıve approach isfixed at about 1800 packets All the other distributedmethodsuse fewer number of messages than naıve

To monitor the results DC119896NN only needs to check therelated objects in the local Voronoi cell at the proper safe-time thus reducing a lot of redundant update messages Safe-time(S) and Safe-time(M) use the maximum speed of theobjects to calculate the safe time so the total number of

transmitted messages of both approaches is more than that ofDC119896NN Figure 13(b) shows that more than 30 of the totalnumber of transmitted messages can be saved by DC119896NN incomparison with Safe-time(M)

For the accuracy since Safe-time(S) does not considerthe query movement the safe-time may be inaccurate Fur-thermore due to the mobility when the density is high theestimated results become more inaccurate So Safe-time(S)performs worst as shown in Figure 13(c) Safe-time(M) isrevised from Safe-time(S) by considering the query move-ment and the safe-distance is less in average for guaranteeingbetter results Hence Safe-time(M) has a better accuracy andalmost the same as DC119896NN The accuracy of Safe-time(M)and DC119896NN is almost about 100 correct and the gap maybe caused by arithmetical errors in the experiments

International Journal of Distributed Sensor Networks 15

10 20 30 40 50 60 700

5

10

15

20

25

30

35

40

45

Number of objects

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

10 20 30 40 50 60 70100

150

200

250

300

350

400

450

Number of objects

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

10 20 30 40 50 60 7080

85

90

95

100

105

Number of objects

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

10 20 30 40 50 60 70Number of objects

Aver

age r

espo

nse t

ime (

s)

096

098

1

102

104

106

108

11

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 15 The effects of the number of objects on (a) update frequency (b) number of messages (c) accuracy and (d) response time

When the area becomes larger the density becomeslower So the number of objects in each objectrsquos transmissionrange is fewer Under such a circumstance DC119896NN usesless computation and the response time is shorter as shownin Figure 13(d) In contrast the Safe-time(S) and the Safe-time(M) need to collect information before performing eachnew query and cause longer response time Since Safe-time(M) and Safe-time(S) use the same method and proce-dure to handle the first query the response time of these twomethods will be almost the same

62 Effects of Grid Size In this simulation experiment setwe want to observe the update efficiency of each object inthe third phase of DC119896NN Recall that we consider the grid-based and VD-base safe distances to derive a proper safe-time In this experiment DC119896NN(G) uses grid-based safe

distance to determine the safe time for the next update andDC119896NN(V) uses VD-base safe distance to derive the safetime The sensing area is fixed to 600lowast600m2 and there are30 data objects We compare DC119896NN(V) with DC119896NN(G)by observing the impacts of different grid sizes All theother settings have the similar trends in our experimentalresults In Figure 14(a) the update frequency of the objectsin DC119896NN(G) is high when the grid size is 50lowast50m2 andbecomes less when the grid size decreases Since the sensingarea is 600lowast600m2 and 30 objects are given the averagedistance between an object and the boundary of a Voronoicell is about 25 to 50 meters With the setting of grid size50lowast50m2 the average distance obtained in DC119896NN(G) isabout 25 meters Thus the safe time of DC119896NN(V) is longerIn general as Figures 14(a) and 14(b) show the update

16 International Journal of Distributed Sensor Networks

1 3 5 10 200

10

20

30

40

50

60

k

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

1 3 5 10 200

100

200

300

400

500

600

700

800

k

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

1 3 5 10 2080

85

90

95

100

105

k

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

1 3 5 10 20k

Aver

age r

espo

nse t

ime (

s)

08

09

1

11

12

13

14

15

16

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 16 The impacts of different values of 119896 on (a) update frequency (b) number of messages (c) accuracy and (d) response time

frequency of the objects and the number of messages sentby the objects decrease as the grid size increases

When the grid size is large the safe time becomes longand less number of updates are issued Hence the resultsbecome more inaccurate As shown in Figure 14(c) whenthe grid sizes are 50lowast50m2 75lowast75m2 100lowast100m2 and150lowast150m2 the corresponding accuracies are 95 9285 and 78 respectively While the grid size increases to200lowast200m2 the accuracy is significantly reduced to 69and the right answer thus can not be guaranteed On theother hand Figure 14(d) shows that the response times ofDC119896NN(G) and DC119896NN(V) are not much different becausethe size of grid is not the major factor to influence thecomplexity of obtaining information for the first query

63 Number of Objects In this subsection we discuss theresults as the number of data objects varies The area in thepresented experiment set is 600lowast600 (m2) with grid size of50lowast50 (m2) As shown in Figure 15(a) when the number ofobjects increases the number of updates in DC119896NN is stillrelatively less than the ones in Safe-time(S) and Safe-time(M)If the number of objects increases the number of repliedmessages per second to the central server in naıve will growdramatically With 20 to 60 objects the number of repliedmessages to the server is from 1200 to 3600 (packetsmin)By observing the results in Figures 15(b) and 15(c) as moreobjects are in the area the number of messages increasesfor the other three methods and the accuracy reduces inSafe-time(S) These match the trends for different areas we

International Journal of Distributed Sensor Networks 17

20 40 60 80 1000

5

10

15

20

25

30

35

40

45

Moving objects ()

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

20 40 60 80 1000

100

200

300

400

500

600

Moving objects ()

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

20 40 60 80 100

80

70

75

85

90

95

100

105

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

Moving objects ()

(c) Accuracy

20 40 60 80 100

Aver

age r

espo

nse t

ime (

s)

09

095

1

11

105

115

12

125

13

DCkNNSafe-time(S)Safe-time(M)

Moving objects ()

(d) Response time

Figure 17 The effects of the moving objects on (a) update frequency (b) number of messages (c) accuracy and (d) response time

discussed earlier due to the density Similarly the responsetime can be expected as shown in Figure 15(d) where theresponse time of DC119896NN is still the shortest

64 Different Values of 119896 It is obvious that the value of119896 affects the performance of query processing significantlyWhen the value of 119896 becomes larger the number of relatedobjects required to be checked also increases In other wordswe need to spend more cost to find out which 119896 objectsare currently in the result for the C119896NN query Thereforethe changes in the value of 119896 mainly affect the amountof data required for the first query and the update costfor maintaining the 119896th and the (119896 + 1)th objects So inFigure 16(a) when the value of 119896 is large more updates arenecessary for all the three methods As Figure 16(b) shows

the influence on the number of transmitted messages inSafe-time(M) is more serious than the one in Safe-time(S)Due to the mobility the number of influenced objects inSafe-time(M) will increase as the value of 119896 increases Inparticular the update frequency in Safe-time(M) becomesnearly twofold the update frequency in Safe-time(S)

Figure 16(c) presents the impact on the accuracy fordifferent values of 119896 With a larger value of 119896 an object inSafe-time(S) will have a higher chance to derive the incorrectsafe time thus causing lower accuracy When the value of 119896increases the response time of all threemethods will increasesignificantly as shown in Figure 16(d) The reason is thatall DC119896NN Safe-time(S) and Safe-time(M) need to searchmore objects and collect more information for answering thequery when the value of 119896 increases to a certain number For

18 International Journal of Distributed Sensor Networks

2 4 6 8 100

10

20

30

40

50

60

Speed (ms)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

2 4 6 8 100

100

200

300

400

500

600

700

800

Speed (ms)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

2 4 6 8 1070

75

80

85

90

95

100

105

Speed (ms)

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

2 4 6 8 1009

095

1

105

11

115

12

125

13

Speed (ms)

Aver

age r

espo

nse t

ime (

s)

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 18 The impacts of speed on (a) update frequency (b) number of messages (c) accuracy and (d) response time

DC119896NN DC119896NN only needs to store local Voronoi diagramwhere the information required is less than required in Safe-time(S) and Safe-time(M) so the response time of DC119896NN isthe shortest

65 The Effect of Moving Objects In this experiment set weconsider different percentages of moving objects in all thedata objects The default value is 20 which means that ifthere is a total of 30 objects then there are sixmoving objectsIn Figures 17(a) and 17(b) as the percentage ofmoving objectsincreases the overall number of updates required between theobjects increases relatively and the change rate of answer totheDC119896NNaccelerates thus increasing the update frequencyof the query and the number of messages However DC119896NNstill keeps the best performance Figure 17(c) shows the accu-racy of the result for different percentage of moving objectsDC119896NN and Safe-time(M) both have higher accuracy and

Safe-time(S) is still the worst The safe time of each object inSafe-time(S) is calculated using the maximum speed of theobjects Hence whether the object is moving or not does notdirectly result in the incorrectness of the answer collectionIn fact in Safe-time(S) one of the main reasons to affectthe accuracy is the directions of moving objects Last asFigure 17(d) shows the percentage of moving objects doesnot impact the response time too much

66 Effects of Speed If each object moves faster the relativevelocities between objects may also become faster This willmake the safe time shorter and the update frequency ofeach object and query increases The safe time used inSafe-time(S) and Safe-time(M) is directly affected by themaximum speed of objects and does not consider the direc-tion of each objectrsquos movement and the speed of individualmovement No matter the objects move or not and move

International Journal of Distributed Sensor Networks 19

fast or slow both of the above methods directly use themaximum speed of objects to calculate the safe time forupdating On the other hand DC119896NN considers the movingdirection of objects and the proper safe-time for updatesIn this experiment the number of moving objects is 20of all the objects As Figure 18(a) shows as the movingobjects speed up the update cost increases and DC119896NN stillperforms best As the speed increases the safe-time in Safe-time(S) and the Safe-time(M) becomes much shorter due toa larger maximum speed among all the objects The trendbecomes even worse as the speed increases

Figure 18(b) shows the trend about the number of trans-mitted messages when the speed is up DC119896NN still hasthe best performance on the number of messages There are42781 messages sent in average when the speed of object is10ms However the Safe-time(M) needs 67913 messagesThe accuracy will not be effected as the speed changesfor DC119896NN and Safe-time(M) because both of them aredesigned or adapted for themoving objects and queries Safe-time(S) will have more inaccurate results as the speed is highas shown in Figure 18(c) However the response time doesnot have a significant impact on the response time for all thethree methods Figure 18(d) presents this trend

7 Conclusions

In this paper we propose a new approach DC119896NN whichuses the local Voronoi diagram and proper safe-time toeffectively process the C119896NNquery in distributed andmobileenvironments such as wireless sensor networks The propersafe-time can be quickly derived by a simple formulaBy comparing our proposed DC119896NN with other existingapproaches Safe-time(S) DC119896NN can effectively improvesearch efficiency reduce response time and the numberof messages and keep the accuracy of the result highAdditionally DC119896NN reduces more 30 of transmissionmessages than Safe-time(M) because the characteristics of theVoronoi diagram are used and each objectrsquos moving directionis considered instead of directly using the maximum speedof the objects as Safe-time method The derived safe-timeis more precise As a result DC119896NN needs less updatefrequency reduces a great number of messages transmittedand yields more accurate results In this work simulationexperiments are also performed The experimental resultsvalidate the proposed DC119896NN approach for the continuous119896 nearest neighbor query in distributed and mobile environ-ments where all the data objects and query can move

Acknowledgment

This work is partially supported by NSC under the Grant98-2220-E-027-007 100-2221-E-027-087-MY2 and 102-2221-E-027-088-

References

[1] O Bohl S Manouchehri and U Winand ldquoMobile informationsystems for the private everyday liferdquo Mobile InformationSystems vol 3 no 3-4 pp 135ndash152 2007

[2] Y Tao andD Papadias ldquoTime-parameterized queries in spatio-temporal databasesrdquo in Proceedings of the ACM SIGMODInternational Conference on Managment of Data pp 334ndash345June 2002

[3] Y Tao D Papadias and Q Shen ldquoContinuous nearest neighborsearchrdquo in Proceedings of the 28th International Conference onVery Large Data Bases (VLDB rsquo02) pp 287ndash298 2002

[4] F Aurenhammer ldquoVoronoi diagramsmdasha survey of a fundamen-tal geometric data structurerdquo ACM Computing Surveys vol 23no 3 pp 345ndash405 1991

[5] K Kim Y Cai andW Tavanapong ldquoSafe-time distributed real-time monitoring of cKNN in mobile peer-to-peer networksrdquo inProceedings of the 9th IEEE International Conference on MobileData Management (MDM rsquo08) pp 124ndash131 April 2008

[6] M Kolahdouzan and C Shahabi ldquoVoronoi-based k nearest nei-ghbor search for spatial network databasesrdquo in Proceedings ofthe 30th International Conference on Very Large Data Bases vol30 pp 840ndash851 2004

[7] M R Kolahdouzan and C Shahabi ldquoAlternative solutions forcontinuous K nearest neighbor queries in spatial networkdatabasesrdquo GeoInformatica vol 9 no 4 pp 321ndash341 2005

[8] D Papadias Y Tao K Mouratidis and C K Hui ldquoAggregatenearest neighbor queries in spatial databasesrdquo ACM Transac-tions on Database Systems vol 30 no 2 pp 529ndash576 2005

[9] T Imielinski S Viswanathan and B R Badrinath ldquoData on airorganization and accessrdquo IEEE Transactions on Knowledge andData Engineering vol 9 no 3 pp 353ndash372 1997

[10] S Hambrusch C-M Liu and S Prabhakar ldquoBroadcasting andquerying multi-dimensional index trees in a multi-channelenvironmentrdquo Information Systems vol 31 no 8 pp 870ndash8862006

[11] C-M Liu and K-F Lin ldquoDisseminating dependent data inwireless broadcast environmentsrdquo Distributed and ParallelDatabases vol 22 no 1 pp 1ndash25 2007

[12] T-C Su and C-M Liu ldquoOn-demand data broadcasting for dataitems with time constraints on multiple broadcast channelsrdquo inDatabase Systems for Advanced Applications vol 6193 of LectureNotes in Computer Science pp 458ndash469 2010

[13] B Zheng J Xu W-C Lee and D L Lee ldquoGrid-partition ind-ex a hybrid method for nearest-neighbor queries in wirelesslocation-based servicesrdquo The VLDB Journal vol 15 no 1 pp21ndash39 2006

[14] B Gedik A Singh and L Liu ldquoEnergy efficient exact kNN sear-ch in wireless broadcast environmentsrdquo in Proceedings of the12th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo04) pp 137ndash146 November 2004

[15] KMouratidis S Bakiras and D Papadias ldquoContinuousmonit-oring of spatial queries in wireless broadcast environmentsrdquoIEEE Transactions onMobile Computing vol 8 no 10 pp 1297ndash1311 2009

[16] G Chatzimilioudis D Zeinalipour-Yazti W-C Lee and M DDikaiakos ldquoContinuous all k-nearest-neighbor querying insmartphone networksrdquo in Proceedings of the 13th IEEE Interna-tional Conference on Mobile Data Management (MDM rsquo12) pp79ndash88 2012

[17] T-Y Fu W-C Peng and W-C Lee ldquoParallelizing itinerary-basedKNNquery processing inwireless sensor networksrdquo IEEETransactions on Knowledge and Data Engineering vol 22 no 5pp 711ndash729 2010

[18] T P Nghiem A B Waluyo and D Taniar ldquoA pure peer-to-peerapproach for kNNquery processing inmobile ad hoc networksrdquo

20 International Journal of Distributed Sensor Networks

Personal and Ubiquitous Computing vol 17 no 5 pp 973ndash9852013

[19] HD Chon D Agrawal andA El Abbadi ldquoRange and kNNqu-ery processing for moving objects in Grid modelrdquo MobileNetworks and Applications vol 8 no 4 pp 401ndash412 2003

[20] X Xiong M F Mokbel and W G Aref ldquoSEA-CNN scalableprocessing of continuous K-nearest neighbor queries in spatio-temporal databasesrdquo in Proceedings of the 21st InternationalConference on Data Engineering (ICDE rsquo05) pp 643ndash654 April2005

[21] G Zhao K XuanW Rahayu et al ldquoVoronoi-based continuous120581 nearest neighbor search in mobile navigationrdquo IEEE Transac-tions on Industrial Electronics vol 58 no 6 pp 2247ndash2257 2011

[22] KMouratidis D Papadias S Bakiras and Y Tao ldquoA threshold-based algorithm for continuous monitoring of k nearest neigh-borsrdquo IEEE Transactions on Knowledge and Data Engineeringvol 17 no 11 pp 1451ndash1464 2005

[23] S-H Wu K-T Chuang C-M Chen and M-S Chen ldquoDIK-NN an itinerary-based KNN query processing algorithm formobile sensor networksrdquo inProceedings of the 23rd InternationalConference on Data Engineering (ICDE rsquo07) pp 456ndash465 April2007

[24] D T Lee ldquoOn k-nearest neighbor voronoi diagrams in the pla-nerdquo IEEE Transactions on Computers vol 31 no 6 pp 478ndash4871982

[25] K Patroumpas TMinogiannis andT Sellis ldquoApproximate ord-er-k Voronoi cells over positional streamsrdquo in Proceedings of the15th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo07) pp 276ndash283 November 2007

International Journal of

AerospaceEngineeringHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

RoboticsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Active and Passive Electronic Components

Control Scienceand Engineering

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

RotatingMachinery

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

Journal ofEngineeringVolume 2014

Submit your manuscripts athttpwwwhindawicom

VLSI Design

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Shock and Vibration

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawi Publishing Corporation httpwwwhindawicom

Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

SensorsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Navigation and Observation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

DistributedSensor Networks

International Journal of

Page 11: Research Article Distributed Continuous k Nearest Neighbors ...downloads.hindawi.com/journals/ijdsn/2013/125145.pdfmobile environments like WSNs, which consist of a number of mobile

International Journal of Distributed Sensor Networks 11

A

B

Query

(x3 y3)

(x2 y2) (x1 y1)QA

QB

(Vx2 Vy2)

(Vx3 Vy3)

(Vx1 Vy1)

(a)

A

B

Query

(x3 y3)

(x2 y2)(x1 y1)

QA

QB

(Vx2 Vy2)

(Vx3 Vy3)

(Vx1 Vy1)

(b)

A

B

d

t1 t2 t3 t

(c)

Figure 11 The precise safe-time for moving objects 119860 and 119861 and the moving query where (a) shows the beginning state (b) presents themoment when the moving query meets the boundary and (c) gives the diagram for the change on the safe distance with time 119905

o1

o2

o3o4

o5

CDq1

CD2

(a)

o1

o2

o3o4

o5

CDq1

CD2

q9984001

(b)

Figure 12 The phenomenon when using the original safe-time methods to (a) stationary query and (b) moving query

Equation (2) is a quadratic equation Since a generalquadratic equation can be written in the following form1198861199092

+ 119887119909 + 119888 = 0 recall that the discriminant of a quadraticequation is Δ = 119887

2

minus 4119886119888 If Δ gt 0 there are two distinct realroots if Δ = 0 there is exactly one real root if Δ lt 0 thereare two distinct (non-real) complex roots In (2)

119886 = 1198812

119909119860

+ 1198812

119910119860

minus 1198812

119909119861

minus 1198812

119910119861

minus 2 lowast 119881119909119902

119881119909119860

minus 2 lowast 119881119910119902

119881119910119860

+ 2 lowast 119881119909119902

119881119909119861

+ 2 lowast 119881119910119902

119881119910119861

119887 = 2 [(119909119902minus 119909119860) (119881119909119902

minus 119881119909119860

) + (119910119902minus 119910119860) (119881119910119902

minus 119881119910119860

)

minus (119909119902minus 119909119861) (119881119909119902

minus 119881119909119861

) minus (119910119902minus 119910119861) (119881119910119902

minus 119881119910119861

)]

119888 = (119909119902minus 119909119860)2

+ (119910119902minus 119910119860)2

minus (119909119902minus 119909119861)2

minus (119910119902minus 119910119861)2

(3)

and then we can derive the safe time 119905 according to thediscriminant

119905 =

[minus119887 + (1198872

minus 4119886119888)12

]

2119886or

[minus119887 minus (1198872

minus 4119886119888)12

]

2119886

(4)

Finally we select the minimum value of 119905 gt 0 as the safetime

Additionally assuming that 119889 is the distance between theobject and the query and 119905 is the time 119876119860 = 119876119861 can be

converted into a function of 119905 and 119889 as shown in Figure 11(c)Then we can obtain the safe time 119905

1which is the time when

119876119860 = 119876119861 Furthermore the object 119861 will be closest to thequery at the time 119905

3

5 Comparisons with Previous Approaches

In this section we compare the proposed DC119896NN approachthe Safe-time with stationary query approach [5] and thenaıve way used pull-based approach in terms of safe timespace and accuracy

51 Safe Time The original safe-time with stationary query[5] (safe-time(S)) does not support moving queries Anexample of C3NN is shown in Figure 12 where 119902

1is the query

point triangles are the 3NN objects the pentagons representthe other individual objects and 119900

4is 4th NN Figure 12(a)

shows the original result for safe-time(S) After obtaining the119896th and (119896 + 1)th objects (119900

2and 1199004in the figure) the cross-

distance (CD) of 119896th and (119896 + 1)th objects can be calculatedRecall that the cross distance of two data objects 119860 and 119861 isthe difference on the distances of119860 and119861 to the center (or thequery point) For the next update (after a safe-time period)all the objects in this region should be checked

We adapt the safe-time(S) method for moving queryThe adapted approach will result in a higher update cost

12 International Journal of Distributed Sensor Networks

Figure 12(b) presents a case that the query moves towardobject 119900

3(119896th NN) and away from object 119900

4((119896 + 1)th NN)

When the query 1199021moves to the point 1199021015840

1 the most outside

concentric circle increases and becomes as large as the mostoutside dotted concentric circle On the contrary the mostinside concentric circle decreases and becomes as small as themost inside dotted concentric circle Thus the cross-distanceincreases and more number of objects will be examined

In addition according to the Figure 12(b) we can knowthat the original Safe-time method safe-time(S) is notappropriate for moving queries since the calculation of Safe-time(S) method does not consider the speed of query safe-time(S) directly uses twofold of the maximum speed of the119896th and (119896+1)thNNobjects to divide theCD to derive the safetime The cost for updates increases when the CD becomeslarger since the average checked area becomes bigger Besidesthe obtained 119896NNanswer cannot be guaranteed to be correctOn the contrary the cross-distance when the query movestowards object 119900

4((119896 + 1)th NN) and away from object 119900

3

(119896th NN) in this case the order of the 119896th and (119896 + 1)th NNobjectmay be changed but the update does not perform thusresulting in incorrect results

We modify the Safe-time to fully support the movingquery In order to support and maintain the accuracy ofmoving query the maximum speed (Maxspeed) used in thesafe time calculation is required to be modified and replacedby the maximum relative speed between the query and theobjects Because of using the relative speed the adaptedsafe-time method safe-time(M) needs twofold maximumrelative speed (2 lowast 119872119886119909119904119901119890119890119889) to calculate the safe time forguaranteeing the accurate resultsThe safe time derived is lessthan the one derived in safe-time(S) due to the relative speedHence the update frequency of safe-time(M) is higher thanthe update frequency of safe-time(S)

52 Space In DC119896NN each object and query only need tomaintain the information of LVC The information to bestored includes the location of neighboring objects and theobject information of order-119896rsquos local Voronoi diagram Thetotal amount of stored information is not significant on eachobjectThus the use of storage space does not need to be verysubstantial

53 Accuracy The safe-time (S) [5] considers the stationaryquery When applying it to the moving query some adaptionshould bemade According to our experimental results whenthe value of 119896 increases with a moving query the accuracy ofthe result will be reduced In our simulation we modify theoriginal Safe-time(S) as Safe time(M) for moving query andconsider the relative distance in detail caused by the movingquery and objects Although the correctness of the answer canbe increased the update frequency increases thus increasingthe number of delivered messages

DC119896NNuses Voronoi and grid cell boundary to calculatethe safe time and updates the information of related objectsbefore the end of the safe time In fact the boundary ofthe Voronoi cell represents the boundary of moving 119896NNquery After the safe time period the query will collect the

information of related neighboring objects Having such real-time information the query can have the resultmore accuratein time Similar to safe-time(M) DC119896NN uses the 119896th and(119896 + 1)th nearest moving objects to derive the safe time So itis able to maintain the correctness of the answer

6 Simulation Experiments

In the simulation we compare the following methods NaıveDC119896NN safe-time (S) and safe-time (M)TheNaıvemethodis centralized and used as a benchmark for the comparisonAll the mobile sensors will send the location informationto the central server to update the information The othermethods DC119896NN Safe-time(S) and Safe-time(M) are dis-tributed and used in the considered mobile wireless sensornetwork where each object knows its position has the abilityto perform some calculation and stores the information oflocalized Voronoi cell (LVC)We assume that each object cantransmit amessage to its one-hopneighbor so that each objectcan communicate with at least one object For Safe-time(S)and the safe-time(M) a maximum speed (MaxSpeed) is setin order to estimate relative speed and distance for safe-timecalculation

In the simulation all the compared approaches areperformed under the same environmental conditions forfairness The initial location and speed of moving objectsare uniformly randomly distributed Since we focus on theperformance of the query process of the proposed DC119896NNapproach we further assume that the transmission quality isideal and no congestion and communication delays occurThe metrics measured include the update frequency for aquery the total number of messages response time andaccuracy The update frequency for a query is the averagenumber of update messages sent by the data objects relatedto the query per minute The total number of messages isall the amount of messages sent from all objects during thequery process The accuracy of each method is measuredby comparing the results to the real answers Since thequery is continuous and the update occurs subsequently themeasured response time is mainly the time required fromsending a query to obtaining the first result

All the experiments are simulated so the results aboutthe response time may not show the practical cases exactlybut can reflect the trends on the performance among all thecompared approaches relatively In order to have the responsetime in our simulation we thus use the total number of hopsfor deriving the result tomultiply the average time for one hopin the simulation system to present the response time Thusthe response time is proportional to the total number of hopsin our simulation program In addition because the maindifference between Safe-time(S) and the Safe-time(M) is theway for deriving the safe time the measured response timeof these two methods is the same The simulation programis implemented with Java The setting of our simulation isshown in Table 1 with a default value for each parameter Inall the simulation experiments the final results are reportedwith the average of 100 queries The duration of each query is60 seconds

International Journal of Distributed Sensor Networks 13

200 400 600 800 10000

10

20

30

40

50

60

Edge length of sensing area (m)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

200 400 600 800 10000

100

200

300

400

500

600

700

Edge length of sensing area (m)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

200 400 600 800 100075

80

85

90

95

100

105

Edge length of sensing area (m)

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

200 400 600 800 1000Edge length of sensing area (m)

Aver

age r

espo

nse t

ime (

s)

DCkNNSafe-time(S)Safe-time(M)

095

1

105

11

(d) Response time

Figure 13 The effects of different sensing areas on (a) update frequency (b) number of messages (c) accuracy and (d) response time

Table 1 Simulation parameters

Parameter Range Default valueEdge length of sensingarea (m) 200 400 600 800 1000 600

Edge length of grid (m) 50 100 150 50Number of objects 20 30 40 50 60 30Transmission range (m) 125 125119896 1 3 5 10 20 3Moving objects () 20 40 60 80 100 20Speed (ms) 2 4 6 8 10 4

61 Effects of Sensing Area Sensing area affects the numberof update and query messages since if the area becomes

greater with the fixed number of objects relatively thedensity of the objects becomes sparse For example when thesensing areas are 200lowast200 400lowast400 600lowast600 800lowast800 and1000lowast1000 the densities are 188 047 021 012 and 008respectively Figure 13(a) shows that DC119896NN has the lowestnumber of updates with all the different areas and the numberof updates for Safe-time(S) is the highest (worst) becauseDC119896NN considers the moving direction and speed of thequeries and objects and selects the proper safe-distance toderive the safe-time Safe-time(S) the Safe-time(M) estimatethe safe time according to the maximum speed of the objectsso more number of updates can be expected AdditionallySafe-time(M) is updated more frequently than Safe-time(S)Recall that Safe-time(M) considers the query movement

14 International Journal of Distributed Sensor Networks

50 75 100 150 2000

5

10

15

20

25

Edge length of grid (m)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

50 75 100 150 2000

50

100

150

200

250

300

350

Edge length of grid (m)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

50 75 100 150 2000

20

40

60

80

100

120

Edge length of grid (m)

Accu

racy

()

DCkNN(G)DCkNN(V)

(c) Accuracy

50 75 100 150 2001

101

102

103

104

105

106

Edge length of grid (m)

Aver

age r

espo

nse t

ime (

s)

DCkNN(G)DCkNN(V)

(d) Response time

Figure 14 The comparisons of using grid-based and VD-base safe distances to derive the safe-time (a) update frequency (b) number ofmessages (c) accuracy and (d) response time

The average safe-distance becomes shorter thus leading tomore updates Besides when the sensing area increasesfrom 200lowast200 to 600lowast600 the update frequency dropsdramaticallyThe curve becomes flatter when the area is from600lowast600 to 1000lowast1000 since the difference on the densitiesof the areas from 600lowast600 to 1000lowast1000 is not much Thenumber of updates is less as the safe-time becomes largerThetotal number of transmitted messages of naıve approach isfixed at about 1800 packets All the other distributedmethodsuse fewer number of messages than naıve

To monitor the results DC119896NN only needs to check therelated objects in the local Voronoi cell at the proper safe-time thus reducing a lot of redundant update messages Safe-time(S) and Safe-time(M) use the maximum speed of theobjects to calculate the safe time so the total number of

transmitted messages of both approaches is more than that ofDC119896NN Figure 13(b) shows that more than 30 of the totalnumber of transmitted messages can be saved by DC119896NN incomparison with Safe-time(M)

For the accuracy since Safe-time(S) does not considerthe query movement the safe-time may be inaccurate Fur-thermore due to the mobility when the density is high theestimated results become more inaccurate So Safe-time(S)performs worst as shown in Figure 13(c) Safe-time(M) isrevised from Safe-time(S) by considering the query move-ment and the safe-distance is less in average for guaranteeingbetter results Hence Safe-time(M) has a better accuracy andalmost the same as DC119896NN The accuracy of Safe-time(M)and DC119896NN is almost about 100 correct and the gap maybe caused by arithmetical errors in the experiments

International Journal of Distributed Sensor Networks 15

10 20 30 40 50 60 700

5

10

15

20

25

30

35

40

45

Number of objects

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

10 20 30 40 50 60 70100

150

200

250

300

350

400

450

Number of objects

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

10 20 30 40 50 60 7080

85

90

95

100

105

Number of objects

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

10 20 30 40 50 60 70Number of objects

Aver

age r

espo

nse t

ime (

s)

096

098

1

102

104

106

108

11

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 15 The effects of the number of objects on (a) update frequency (b) number of messages (c) accuracy and (d) response time

When the area becomes larger the density becomeslower So the number of objects in each objectrsquos transmissionrange is fewer Under such a circumstance DC119896NN usesless computation and the response time is shorter as shownin Figure 13(d) In contrast the Safe-time(S) and the Safe-time(M) need to collect information before performing eachnew query and cause longer response time Since Safe-time(M) and Safe-time(S) use the same method and proce-dure to handle the first query the response time of these twomethods will be almost the same

62 Effects of Grid Size In this simulation experiment setwe want to observe the update efficiency of each object inthe third phase of DC119896NN Recall that we consider the grid-based and VD-base safe distances to derive a proper safe-time In this experiment DC119896NN(G) uses grid-based safe

distance to determine the safe time for the next update andDC119896NN(V) uses VD-base safe distance to derive the safetime The sensing area is fixed to 600lowast600m2 and there are30 data objects We compare DC119896NN(V) with DC119896NN(G)by observing the impacts of different grid sizes All theother settings have the similar trends in our experimentalresults In Figure 14(a) the update frequency of the objectsin DC119896NN(G) is high when the grid size is 50lowast50m2 andbecomes less when the grid size decreases Since the sensingarea is 600lowast600m2 and 30 objects are given the averagedistance between an object and the boundary of a Voronoicell is about 25 to 50 meters With the setting of grid size50lowast50m2 the average distance obtained in DC119896NN(G) isabout 25 meters Thus the safe time of DC119896NN(V) is longerIn general as Figures 14(a) and 14(b) show the update

16 International Journal of Distributed Sensor Networks

1 3 5 10 200

10

20

30

40

50

60

k

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

1 3 5 10 200

100

200

300

400

500

600

700

800

k

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

1 3 5 10 2080

85

90

95

100

105

k

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

1 3 5 10 20k

Aver

age r

espo

nse t

ime (

s)

08

09

1

11

12

13

14

15

16

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 16 The impacts of different values of 119896 on (a) update frequency (b) number of messages (c) accuracy and (d) response time

frequency of the objects and the number of messages sentby the objects decrease as the grid size increases

When the grid size is large the safe time becomes longand less number of updates are issued Hence the resultsbecome more inaccurate As shown in Figure 14(c) whenthe grid sizes are 50lowast50m2 75lowast75m2 100lowast100m2 and150lowast150m2 the corresponding accuracies are 95 9285 and 78 respectively While the grid size increases to200lowast200m2 the accuracy is significantly reduced to 69and the right answer thus can not be guaranteed On theother hand Figure 14(d) shows that the response times ofDC119896NN(G) and DC119896NN(V) are not much different becausethe size of grid is not the major factor to influence thecomplexity of obtaining information for the first query

63 Number of Objects In this subsection we discuss theresults as the number of data objects varies The area in thepresented experiment set is 600lowast600 (m2) with grid size of50lowast50 (m2) As shown in Figure 15(a) when the number ofobjects increases the number of updates in DC119896NN is stillrelatively less than the ones in Safe-time(S) and Safe-time(M)If the number of objects increases the number of repliedmessages per second to the central server in naıve will growdramatically With 20 to 60 objects the number of repliedmessages to the server is from 1200 to 3600 (packetsmin)By observing the results in Figures 15(b) and 15(c) as moreobjects are in the area the number of messages increasesfor the other three methods and the accuracy reduces inSafe-time(S) These match the trends for different areas we

International Journal of Distributed Sensor Networks 17

20 40 60 80 1000

5

10

15

20

25

30

35

40

45

Moving objects ()

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

20 40 60 80 1000

100

200

300

400

500

600

Moving objects ()

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

20 40 60 80 100

80

70

75

85

90

95

100

105

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

Moving objects ()

(c) Accuracy

20 40 60 80 100

Aver

age r

espo

nse t

ime (

s)

09

095

1

11

105

115

12

125

13

DCkNNSafe-time(S)Safe-time(M)

Moving objects ()

(d) Response time

Figure 17 The effects of the moving objects on (a) update frequency (b) number of messages (c) accuracy and (d) response time

discussed earlier due to the density Similarly the responsetime can be expected as shown in Figure 15(d) where theresponse time of DC119896NN is still the shortest

64 Different Values of 119896 It is obvious that the value of119896 affects the performance of query processing significantlyWhen the value of 119896 becomes larger the number of relatedobjects required to be checked also increases In other wordswe need to spend more cost to find out which 119896 objectsare currently in the result for the C119896NN query Thereforethe changes in the value of 119896 mainly affect the amountof data required for the first query and the update costfor maintaining the 119896th and the (119896 + 1)th objects So inFigure 16(a) when the value of 119896 is large more updates arenecessary for all the three methods As Figure 16(b) shows

the influence on the number of transmitted messages inSafe-time(M) is more serious than the one in Safe-time(S)Due to the mobility the number of influenced objects inSafe-time(M) will increase as the value of 119896 increases Inparticular the update frequency in Safe-time(M) becomesnearly twofold the update frequency in Safe-time(S)

Figure 16(c) presents the impact on the accuracy fordifferent values of 119896 With a larger value of 119896 an object inSafe-time(S) will have a higher chance to derive the incorrectsafe time thus causing lower accuracy When the value of 119896increases the response time of all threemethods will increasesignificantly as shown in Figure 16(d) The reason is thatall DC119896NN Safe-time(S) and Safe-time(M) need to searchmore objects and collect more information for answering thequery when the value of 119896 increases to a certain number For

18 International Journal of Distributed Sensor Networks

2 4 6 8 100

10

20

30

40

50

60

Speed (ms)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

2 4 6 8 100

100

200

300

400

500

600

700

800

Speed (ms)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

2 4 6 8 1070

75

80

85

90

95

100

105

Speed (ms)

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

2 4 6 8 1009

095

1

105

11

115

12

125

13

Speed (ms)

Aver

age r

espo

nse t

ime (

s)

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 18 The impacts of speed on (a) update frequency (b) number of messages (c) accuracy and (d) response time

DC119896NN DC119896NN only needs to store local Voronoi diagramwhere the information required is less than required in Safe-time(S) and Safe-time(M) so the response time of DC119896NN isthe shortest

65 The Effect of Moving Objects In this experiment set weconsider different percentages of moving objects in all thedata objects The default value is 20 which means that ifthere is a total of 30 objects then there are sixmoving objectsIn Figures 17(a) and 17(b) as the percentage ofmoving objectsincreases the overall number of updates required between theobjects increases relatively and the change rate of answer totheDC119896NNaccelerates thus increasing the update frequencyof the query and the number of messages However DC119896NNstill keeps the best performance Figure 17(c) shows the accu-racy of the result for different percentage of moving objectsDC119896NN and Safe-time(M) both have higher accuracy and

Safe-time(S) is still the worst The safe time of each object inSafe-time(S) is calculated using the maximum speed of theobjects Hence whether the object is moving or not does notdirectly result in the incorrectness of the answer collectionIn fact in Safe-time(S) one of the main reasons to affectthe accuracy is the directions of moving objects Last asFigure 17(d) shows the percentage of moving objects doesnot impact the response time too much

66 Effects of Speed If each object moves faster the relativevelocities between objects may also become faster This willmake the safe time shorter and the update frequency ofeach object and query increases The safe time used inSafe-time(S) and Safe-time(M) is directly affected by themaximum speed of objects and does not consider the direc-tion of each objectrsquos movement and the speed of individualmovement No matter the objects move or not and move

International Journal of Distributed Sensor Networks 19

fast or slow both of the above methods directly use themaximum speed of objects to calculate the safe time forupdating On the other hand DC119896NN considers the movingdirection of objects and the proper safe-time for updatesIn this experiment the number of moving objects is 20of all the objects As Figure 18(a) shows as the movingobjects speed up the update cost increases and DC119896NN stillperforms best As the speed increases the safe-time in Safe-time(S) and the Safe-time(M) becomes much shorter due toa larger maximum speed among all the objects The trendbecomes even worse as the speed increases

Figure 18(b) shows the trend about the number of trans-mitted messages when the speed is up DC119896NN still hasthe best performance on the number of messages There are42781 messages sent in average when the speed of object is10ms However the Safe-time(M) needs 67913 messagesThe accuracy will not be effected as the speed changesfor DC119896NN and Safe-time(M) because both of them aredesigned or adapted for themoving objects and queries Safe-time(S) will have more inaccurate results as the speed is highas shown in Figure 18(c) However the response time doesnot have a significant impact on the response time for all thethree methods Figure 18(d) presents this trend

7 Conclusions

In this paper we propose a new approach DC119896NN whichuses the local Voronoi diagram and proper safe-time toeffectively process the C119896NNquery in distributed andmobileenvironments such as wireless sensor networks The propersafe-time can be quickly derived by a simple formulaBy comparing our proposed DC119896NN with other existingapproaches Safe-time(S) DC119896NN can effectively improvesearch efficiency reduce response time and the numberof messages and keep the accuracy of the result highAdditionally DC119896NN reduces more 30 of transmissionmessages than Safe-time(M) because the characteristics of theVoronoi diagram are used and each objectrsquos moving directionis considered instead of directly using the maximum speedof the objects as Safe-time method The derived safe-timeis more precise As a result DC119896NN needs less updatefrequency reduces a great number of messages transmittedand yields more accurate results In this work simulationexperiments are also performed The experimental resultsvalidate the proposed DC119896NN approach for the continuous119896 nearest neighbor query in distributed and mobile environ-ments where all the data objects and query can move

Acknowledgment

This work is partially supported by NSC under the Grant98-2220-E-027-007 100-2221-E-027-087-MY2 and 102-2221-E-027-088-

References

[1] O Bohl S Manouchehri and U Winand ldquoMobile informationsystems for the private everyday liferdquo Mobile InformationSystems vol 3 no 3-4 pp 135ndash152 2007

[2] Y Tao andD Papadias ldquoTime-parameterized queries in spatio-temporal databasesrdquo in Proceedings of the ACM SIGMODInternational Conference on Managment of Data pp 334ndash345June 2002

[3] Y Tao D Papadias and Q Shen ldquoContinuous nearest neighborsearchrdquo in Proceedings of the 28th International Conference onVery Large Data Bases (VLDB rsquo02) pp 287ndash298 2002

[4] F Aurenhammer ldquoVoronoi diagramsmdasha survey of a fundamen-tal geometric data structurerdquo ACM Computing Surveys vol 23no 3 pp 345ndash405 1991

[5] K Kim Y Cai andW Tavanapong ldquoSafe-time distributed real-time monitoring of cKNN in mobile peer-to-peer networksrdquo inProceedings of the 9th IEEE International Conference on MobileData Management (MDM rsquo08) pp 124ndash131 April 2008

[6] M Kolahdouzan and C Shahabi ldquoVoronoi-based k nearest nei-ghbor search for spatial network databasesrdquo in Proceedings ofthe 30th International Conference on Very Large Data Bases vol30 pp 840ndash851 2004

[7] M R Kolahdouzan and C Shahabi ldquoAlternative solutions forcontinuous K nearest neighbor queries in spatial networkdatabasesrdquo GeoInformatica vol 9 no 4 pp 321ndash341 2005

[8] D Papadias Y Tao K Mouratidis and C K Hui ldquoAggregatenearest neighbor queries in spatial databasesrdquo ACM Transac-tions on Database Systems vol 30 no 2 pp 529ndash576 2005

[9] T Imielinski S Viswanathan and B R Badrinath ldquoData on airorganization and accessrdquo IEEE Transactions on Knowledge andData Engineering vol 9 no 3 pp 353ndash372 1997

[10] S Hambrusch C-M Liu and S Prabhakar ldquoBroadcasting andquerying multi-dimensional index trees in a multi-channelenvironmentrdquo Information Systems vol 31 no 8 pp 870ndash8862006

[11] C-M Liu and K-F Lin ldquoDisseminating dependent data inwireless broadcast environmentsrdquo Distributed and ParallelDatabases vol 22 no 1 pp 1ndash25 2007

[12] T-C Su and C-M Liu ldquoOn-demand data broadcasting for dataitems with time constraints on multiple broadcast channelsrdquo inDatabase Systems for Advanced Applications vol 6193 of LectureNotes in Computer Science pp 458ndash469 2010

[13] B Zheng J Xu W-C Lee and D L Lee ldquoGrid-partition ind-ex a hybrid method for nearest-neighbor queries in wirelesslocation-based servicesrdquo The VLDB Journal vol 15 no 1 pp21ndash39 2006

[14] B Gedik A Singh and L Liu ldquoEnergy efficient exact kNN sear-ch in wireless broadcast environmentsrdquo in Proceedings of the12th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo04) pp 137ndash146 November 2004

[15] KMouratidis S Bakiras and D Papadias ldquoContinuousmonit-oring of spatial queries in wireless broadcast environmentsrdquoIEEE Transactions onMobile Computing vol 8 no 10 pp 1297ndash1311 2009

[16] G Chatzimilioudis D Zeinalipour-Yazti W-C Lee and M DDikaiakos ldquoContinuous all k-nearest-neighbor querying insmartphone networksrdquo in Proceedings of the 13th IEEE Interna-tional Conference on Mobile Data Management (MDM rsquo12) pp79ndash88 2012

[17] T-Y Fu W-C Peng and W-C Lee ldquoParallelizing itinerary-basedKNNquery processing inwireless sensor networksrdquo IEEETransactions on Knowledge and Data Engineering vol 22 no 5pp 711ndash729 2010

[18] T P Nghiem A B Waluyo and D Taniar ldquoA pure peer-to-peerapproach for kNNquery processing inmobile ad hoc networksrdquo

20 International Journal of Distributed Sensor Networks

Personal and Ubiquitous Computing vol 17 no 5 pp 973ndash9852013

[19] HD Chon D Agrawal andA El Abbadi ldquoRange and kNNqu-ery processing for moving objects in Grid modelrdquo MobileNetworks and Applications vol 8 no 4 pp 401ndash412 2003

[20] X Xiong M F Mokbel and W G Aref ldquoSEA-CNN scalableprocessing of continuous K-nearest neighbor queries in spatio-temporal databasesrdquo in Proceedings of the 21st InternationalConference on Data Engineering (ICDE rsquo05) pp 643ndash654 April2005

[21] G Zhao K XuanW Rahayu et al ldquoVoronoi-based continuous120581 nearest neighbor search in mobile navigationrdquo IEEE Transac-tions on Industrial Electronics vol 58 no 6 pp 2247ndash2257 2011

[22] KMouratidis D Papadias S Bakiras and Y Tao ldquoA threshold-based algorithm for continuous monitoring of k nearest neigh-borsrdquo IEEE Transactions on Knowledge and Data Engineeringvol 17 no 11 pp 1451ndash1464 2005

[23] S-H Wu K-T Chuang C-M Chen and M-S Chen ldquoDIK-NN an itinerary-based KNN query processing algorithm formobile sensor networksrdquo inProceedings of the 23rd InternationalConference on Data Engineering (ICDE rsquo07) pp 456ndash465 April2007

[24] D T Lee ldquoOn k-nearest neighbor voronoi diagrams in the pla-nerdquo IEEE Transactions on Computers vol 31 no 6 pp 478ndash4871982

[25] K Patroumpas TMinogiannis andT Sellis ldquoApproximate ord-er-k Voronoi cells over positional streamsrdquo in Proceedings of the15th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo07) pp 276ndash283 November 2007

International Journal of

AerospaceEngineeringHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

RoboticsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Active and Passive Electronic Components

Control Scienceand Engineering

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

RotatingMachinery

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

Journal ofEngineeringVolume 2014

Submit your manuscripts athttpwwwhindawicom

VLSI Design

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Shock and Vibration

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawi Publishing Corporation httpwwwhindawicom

Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

SensorsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Navigation and Observation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

DistributedSensor Networks

International Journal of

Page 12: Research Article Distributed Continuous k Nearest Neighbors ...downloads.hindawi.com/journals/ijdsn/2013/125145.pdfmobile environments like WSNs, which consist of a number of mobile

12 International Journal of Distributed Sensor Networks

Figure 12(b) presents a case that the query moves towardobject 119900

3(119896th NN) and away from object 119900

4((119896 + 1)th NN)

When the query 1199021moves to the point 1199021015840

1 the most outside

concentric circle increases and becomes as large as the mostoutside dotted concentric circle On the contrary the mostinside concentric circle decreases and becomes as small as themost inside dotted concentric circle Thus the cross-distanceincreases and more number of objects will be examined

In addition according to the Figure 12(b) we can knowthat the original Safe-time method safe-time(S) is notappropriate for moving queries since the calculation of Safe-time(S) method does not consider the speed of query safe-time(S) directly uses twofold of the maximum speed of the119896th and (119896+1)thNNobjects to divide theCD to derive the safetime The cost for updates increases when the CD becomeslarger since the average checked area becomes bigger Besidesthe obtained 119896NNanswer cannot be guaranteed to be correctOn the contrary the cross-distance when the query movestowards object 119900

4((119896 + 1)th NN) and away from object 119900

3

(119896th NN) in this case the order of the 119896th and (119896 + 1)th NNobjectmay be changed but the update does not perform thusresulting in incorrect results

We modify the Safe-time to fully support the movingquery In order to support and maintain the accuracy ofmoving query the maximum speed (Maxspeed) used in thesafe time calculation is required to be modified and replacedby the maximum relative speed between the query and theobjects Because of using the relative speed the adaptedsafe-time method safe-time(M) needs twofold maximumrelative speed (2 lowast 119872119886119909119904119901119890119890119889) to calculate the safe time forguaranteeing the accurate resultsThe safe time derived is lessthan the one derived in safe-time(S) due to the relative speedHence the update frequency of safe-time(M) is higher thanthe update frequency of safe-time(S)

52 Space In DC119896NN each object and query only need tomaintain the information of LVC The information to bestored includes the location of neighboring objects and theobject information of order-119896rsquos local Voronoi diagram Thetotal amount of stored information is not significant on eachobjectThus the use of storage space does not need to be verysubstantial

53 Accuracy The safe-time (S) [5] considers the stationaryquery When applying it to the moving query some adaptionshould bemade According to our experimental results whenthe value of 119896 increases with a moving query the accuracy ofthe result will be reduced In our simulation we modify theoriginal Safe-time(S) as Safe time(M) for moving query andconsider the relative distance in detail caused by the movingquery and objects Although the correctness of the answer canbe increased the update frequency increases thus increasingthe number of delivered messages

DC119896NNuses Voronoi and grid cell boundary to calculatethe safe time and updates the information of related objectsbefore the end of the safe time In fact the boundary ofthe Voronoi cell represents the boundary of moving 119896NNquery After the safe time period the query will collect the

information of related neighboring objects Having such real-time information the query can have the resultmore accuratein time Similar to safe-time(M) DC119896NN uses the 119896th and(119896 + 1)th nearest moving objects to derive the safe time So itis able to maintain the correctness of the answer

6 Simulation Experiments

In the simulation we compare the following methods NaıveDC119896NN safe-time (S) and safe-time (M)TheNaıvemethodis centralized and used as a benchmark for the comparisonAll the mobile sensors will send the location informationto the central server to update the information The othermethods DC119896NN Safe-time(S) and Safe-time(M) are dis-tributed and used in the considered mobile wireless sensornetwork where each object knows its position has the abilityto perform some calculation and stores the information oflocalized Voronoi cell (LVC)We assume that each object cantransmit amessage to its one-hopneighbor so that each objectcan communicate with at least one object For Safe-time(S)and the safe-time(M) a maximum speed (MaxSpeed) is setin order to estimate relative speed and distance for safe-timecalculation

In the simulation all the compared approaches areperformed under the same environmental conditions forfairness The initial location and speed of moving objectsare uniformly randomly distributed Since we focus on theperformance of the query process of the proposed DC119896NNapproach we further assume that the transmission quality isideal and no congestion and communication delays occurThe metrics measured include the update frequency for aquery the total number of messages response time andaccuracy The update frequency for a query is the averagenumber of update messages sent by the data objects relatedto the query per minute The total number of messages isall the amount of messages sent from all objects during thequery process The accuracy of each method is measuredby comparing the results to the real answers Since thequery is continuous and the update occurs subsequently themeasured response time is mainly the time required fromsending a query to obtaining the first result

All the experiments are simulated so the results aboutthe response time may not show the practical cases exactlybut can reflect the trends on the performance among all thecompared approaches relatively In order to have the responsetime in our simulation we thus use the total number of hopsfor deriving the result tomultiply the average time for one hopin the simulation system to present the response time Thusthe response time is proportional to the total number of hopsin our simulation program In addition because the maindifference between Safe-time(S) and the Safe-time(M) is theway for deriving the safe time the measured response timeof these two methods is the same The simulation programis implemented with Java The setting of our simulation isshown in Table 1 with a default value for each parameter Inall the simulation experiments the final results are reportedwith the average of 100 queries The duration of each query is60 seconds

International Journal of Distributed Sensor Networks 13

200 400 600 800 10000

10

20

30

40

50

60

Edge length of sensing area (m)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

200 400 600 800 10000

100

200

300

400

500

600

700

Edge length of sensing area (m)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

200 400 600 800 100075

80

85

90

95

100

105

Edge length of sensing area (m)

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

200 400 600 800 1000Edge length of sensing area (m)

Aver

age r

espo

nse t

ime (

s)

DCkNNSafe-time(S)Safe-time(M)

095

1

105

11

(d) Response time

Figure 13 The effects of different sensing areas on (a) update frequency (b) number of messages (c) accuracy and (d) response time

Table 1 Simulation parameters

Parameter Range Default valueEdge length of sensingarea (m) 200 400 600 800 1000 600

Edge length of grid (m) 50 100 150 50Number of objects 20 30 40 50 60 30Transmission range (m) 125 125119896 1 3 5 10 20 3Moving objects () 20 40 60 80 100 20Speed (ms) 2 4 6 8 10 4

61 Effects of Sensing Area Sensing area affects the numberof update and query messages since if the area becomes

greater with the fixed number of objects relatively thedensity of the objects becomes sparse For example when thesensing areas are 200lowast200 400lowast400 600lowast600 800lowast800 and1000lowast1000 the densities are 188 047 021 012 and 008respectively Figure 13(a) shows that DC119896NN has the lowestnumber of updates with all the different areas and the numberof updates for Safe-time(S) is the highest (worst) becauseDC119896NN considers the moving direction and speed of thequeries and objects and selects the proper safe-distance toderive the safe-time Safe-time(S) the Safe-time(M) estimatethe safe time according to the maximum speed of the objectsso more number of updates can be expected AdditionallySafe-time(M) is updated more frequently than Safe-time(S)Recall that Safe-time(M) considers the query movement

14 International Journal of Distributed Sensor Networks

50 75 100 150 2000

5

10

15

20

25

Edge length of grid (m)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

50 75 100 150 2000

50

100

150

200

250

300

350

Edge length of grid (m)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

50 75 100 150 2000

20

40

60

80

100

120

Edge length of grid (m)

Accu

racy

()

DCkNN(G)DCkNN(V)

(c) Accuracy

50 75 100 150 2001

101

102

103

104

105

106

Edge length of grid (m)

Aver

age r

espo

nse t

ime (

s)

DCkNN(G)DCkNN(V)

(d) Response time

Figure 14 The comparisons of using grid-based and VD-base safe distances to derive the safe-time (a) update frequency (b) number ofmessages (c) accuracy and (d) response time

The average safe-distance becomes shorter thus leading tomore updates Besides when the sensing area increasesfrom 200lowast200 to 600lowast600 the update frequency dropsdramaticallyThe curve becomes flatter when the area is from600lowast600 to 1000lowast1000 since the difference on the densitiesof the areas from 600lowast600 to 1000lowast1000 is not much Thenumber of updates is less as the safe-time becomes largerThetotal number of transmitted messages of naıve approach isfixed at about 1800 packets All the other distributedmethodsuse fewer number of messages than naıve

To monitor the results DC119896NN only needs to check therelated objects in the local Voronoi cell at the proper safe-time thus reducing a lot of redundant update messages Safe-time(S) and Safe-time(M) use the maximum speed of theobjects to calculate the safe time so the total number of

transmitted messages of both approaches is more than that ofDC119896NN Figure 13(b) shows that more than 30 of the totalnumber of transmitted messages can be saved by DC119896NN incomparison with Safe-time(M)

For the accuracy since Safe-time(S) does not considerthe query movement the safe-time may be inaccurate Fur-thermore due to the mobility when the density is high theestimated results become more inaccurate So Safe-time(S)performs worst as shown in Figure 13(c) Safe-time(M) isrevised from Safe-time(S) by considering the query move-ment and the safe-distance is less in average for guaranteeingbetter results Hence Safe-time(M) has a better accuracy andalmost the same as DC119896NN The accuracy of Safe-time(M)and DC119896NN is almost about 100 correct and the gap maybe caused by arithmetical errors in the experiments

International Journal of Distributed Sensor Networks 15

10 20 30 40 50 60 700

5

10

15

20

25

30

35

40

45

Number of objects

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

10 20 30 40 50 60 70100

150

200

250

300

350

400

450

Number of objects

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

10 20 30 40 50 60 7080

85

90

95

100

105

Number of objects

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

10 20 30 40 50 60 70Number of objects

Aver

age r

espo

nse t

ime (

s)

096

098

1

102

104

106

108

11

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 15 The effects of the number of objects on (a) update frequency (b) number of messages (c) accuracy and (d) response time

When the area becomes larger the density becomeslower So the number of objects in each objectrsquos transmissionrange is fewer Under such a circumstance DC119896NN usesless computation and the response time is shorter as shownin Figure 13(d) In contrast the Safe-time(S) and the Safe-time(M) need to collect information before performing eachnew query and cause longer response time Since Safe-time(M) and Safe-time(S) use the same method and proce-dure to handle the first query the response time of these twomethods will be almost the same

62 Effects of Grid Size In this simulation experiment setwe want to observe the update efficiency of each object inthe third phase of DC119896NN Recall that we consider the grid-based and VD-base safe distances to derive a proper safe-time In this experiment DC119896NN(G) uses grid-based safe

distance to determine the safe time for the next update andDC119896NN(V) uses VD-base safe distance to derive the safetime The sensing area is fixed to 600lowast600m2 and there are30 data objects We compare DC119896NN(V) with DC119896NN(G)by observing the impacts of different grid sizes All theother settings have the similar trends in our experimentalresults In Figure 14(a) the update frequency of the objectsin DC119896NN(G) is high when the grid size is 50lowast50m2 andbecomes less when the grid size decreases Since the sensingarea is 600lowast600m2 and 30 objects are given the averagedistance between an object and the boundary of a Voronoicell is about 25 to 50 meters With the setting of grid size50lowast50m2 the average distance obtained in DC119896NN(G) isabout 25 meters Thus the safe time of DC119896NN(V) is longerIn general as Figures 14(a) and 14(b) show the update

16 International Journal of Distributed Sensor Networks

1 3 5 10 200

10

20

30

40

50

60

k

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

1 3 5 10 200

100

200

300

400

500

600

700

800

k

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

1 3 5 10 2080

85

90

95

100

105

k

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

1 3 5 10 20k

Aver

age r

espo

nse t

ime (

s)

08

09

1

11

12

13

14

15

16

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 16 The impacts of different values of 119896 on (a) update frequency (b) number of messages (c) accuracy and (d) response time

frequency of the objects and the number of messages sentby the objects decrease as the grid size increases

When the grid size is large the safe time becomes longand less number of updates are issued Hence the resultsbecome more inaccurate As shown in Figure 14(c) whenthe grid sizes are 50lowast50m2 75lowast75m2 100lowast100m2 and150lowast150m2 the corresponding accuracies are 95 9285 and 78 respectively While the grid size increases to200lowast200m2 the accuracy is significantly reduced to 69and the right answer thus can not be guaranteed On theother hand Figure 14(d) shows that the response times ofDC119896NN(G) and DC119896NN(V) are not much different becausethe size of grid is not the major factor to influence thecomplexity of obtaining information for the first query

63 Number of Objects In this subsection we discuss theresults as the number of data objects varies The area in thepresented experiment set is 600lowast600 (m2) with grid size of50lowast50 (m2) As shown in Figure 15(a) when the number ofobjects increases the number of updates in DC119896NN is stillrelatively less than the ones in Safe-time(S) and Safe-time(M)If the number of objects increases the number of repliedmessages per second to the central server in naıve will growdramatically With 20 to 60 objects the number of repliedmessages to the server is from 1200 to 3600 (packetsmin)By observing the results in Figures 15(b) and 15(c) as moreobjects are in the area the number of messages increasesfor the other three methods and the accuracy reduces inSafe-time(S) These match the trends for different areas we

International Journal of Distributed Sensor Networks 17

20 40 60 80 1000

5

10

15

20

25

30

35

40

45

Moving objects ()

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

20 40 60 80 1000

100

200

300

400

500

600

Moving objects ()

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

20 40 60 80 100

80

70

75

85

90

95

100

105

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

Moving objects ()

(c) Accuracy

20 40 60 80 100

Aver

age r

espo

nse t

ime (

s)

09

095

1

11

105

115

12

125

13

DCkNNSafe-time(S)Safe-time(M)

Moving objects ()

(d) Response time

Figure 17 The effects of the moving objects on (a) update frequency (b) number of messages (c) accuracy and (d) response time

discussed earlier due to the density Similarly the responsetime can be expected as shown in Figure 15(d) where theresponse time of DC119896NN is still the shortest

64 Different Values of 119896 It is obvious that the value of119896 affects the performance of query processing significantlyWhen the value of 119896 becomes larger the number of relatedobjects required to be checked also increases In other wordswe need to spend more cost to find out which 119896 objectsare currently in the result for the C119896NN query Thereforethe changes in the value of 119896 mainly affect the amountof data required for the first query and the update costfor maintaining the 119896th and the (119896 + 1)th objects So inFigure 16(a) when the value of 119896 is large more updates arenecessary for all the three methods As Figure 16(b) shows

the influence on the number of transmitted messages inSafe-time(M) is more serious than the one in Safe-time(S)Due to the mobility the number of influenced objects inSafe-time(M) will increase as the value of 119896 increases Inparticular the update frequency in Safe-time(M) becomesnearly twofold the update frequency in Safe-time(S)

Figure 16(c) presents the impact on the accuracy fordifferent values of 119896 With a larger value of 119896 an object inSafe-time(S) will have a higher chance to derive the incorrectsafe time thus causing lower accuracy When the value of 119896increases the response time of all threemethods will increasesignificantly as shown in Figure 16(d) The reason is thatall DC119896NN Safe-time(S) and Safe-time(M) need to searchmore objects and collect more information for answering thequery when the value of 119896 increases to a certain number For

18 International Journal of Distributed Sensor Networks

2 4 6 8 100

10

20

30

40

50

60

Speed (ms)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

2 4 6 8 100

100

200

300

400

500

600

700

800

Speed (ms)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

2 4 6 8 1070

75

80

85

90

95

100

105

Speed (ms)

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

2 4 6 8 1009

095

1

105

11

115

12

125

13

Speed (ms)

Aver

age r

espo

nse t

ime (

s)

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 18 The impacts of speed on (a) update frequency (b) number of messages (c) accuracy and (d) response time

DC119896NN DC119896NN only needs to store local Voronoi diagramwhere the information required is less than required in Safe-time(S) and Safe-time(M) so the response time of DC119896NN isthe shortest

65 The Effect of Moving Objects In this experiment set weconsider different percentages of moving objects in all thedata objects The default value is 20 which means that ifthere is a total of 30 objects then there are sixmoving objectsIn Figures 17(a) and 17(b) as the percentage ofmoving objectsincreases the overall number of updates required between theobjects increases relatively and the change rate of answer totheDC119896NNaccelerates thus increasing the update frequencyof the query and the number of messages However DC119896NNstill keeps the best performance Figure 17(c) shows the accu-racy of the result for different percentage of moving objectsDC119896NN and Safe-time(M) both have higher accuracy and

Safe-time(S) is still the worst The safe time of each object inSafe-time(S) is calculated using the maximum speed of theobjects Hence whether the object is moving or not does notdirectly result in the incorrectness of the answer collectionIn fact in Safe-time(S) one of the main reasons to affectthe accuracy is the directions of moving objects Last asFigure 17(d) shows the percentage of moving objects doesnot impact the response time too much

66 Effects of Speed If each object moves faster the relativevelocities between objects may also become faster This willmake the safe time shorter and the update frequency ofeach object and query increases The safe time used inSafe-time(S) and Safe-time(M) is directly affected by themaximum speed of objects and does not consider the direc-tion of each objectrsquos movement and the speed of individualmovement No matter the objects move or not and move

International Journal of Distributed Sensor Networks 19

fast or slow both of the above methods directly use themaximum speed of objects to calculate the safe time forupdating On the other hand DC119896NN considers the movingdirection of objects and the proper safe-time for updatesIn this experiment the number of moving objects is 20of all the objects As Figure 18(a) shows as the movingobjects speed up the update cost increases and DC119896NN stillperforms best As the speed increases the safe-time in Safe-time(S) and the Safe-time(M) becomes much shorter due toa larger maximum speed among all the objects The trendbecomes even worse as the speed increases

Figure 18(b) shows the trend about the number of trans-mitted messages when the speed is up DC119896NN still hasthe best performance on the number of messages There are42781 messages sent in average when the speed of object is10ms However the Safe-time(M) needs 67913 messagesThe accuracy will not be effected as the speed changesfor DC119896NN and Safe-time(M) because both of them aredesigned or adapted for themoving objects and queries Safe-time(S) will have more inaccurate results as the speed is highas shown in Figure 18(c) However the response time doesnot have a significant impact on the response time for all thethree methods Figure 18(d) presents this trend

7 Conclusions

In this paper we propose a new approach DC119896NN whichuses the local Voronoi diagram and proper safe-time toeffectively process the C119896NNquery in distributed andmobileenvironments such as wireless sensor networks The propersafe-time can be quickly derived by a simple formulaBy comparing our proposed DC119896NN with other existingapproaches Safe-time(S) DC119896NN can effectively improvesearch efficiency reduce response time and the numberof messages and keep the accuracy of the result highAdditionally DC119896NN reduces more 30 of transmissionmessages than Safe-time(M) because the characteristics of theVoronoi diagram are used and each objectrsquos moving directionis considered instead of directly using the maximum speedof the objects as Safe-time method The derived safe-timeis more precise As a result DC119896NN needs less updatefrequency reduces a great number of messages transmittedand yields more accurate results In this work simulationexperiments are also performed The experimental resultsvalidate the proposed DC119896NN approach for the continuous119896 nearest neighbor query in distributed and mobile environ-ments where all the data objects and query can move

Acknowledgment

This work is partially supported by NSC under the Grant98-2220-E-027-007 100-2221-E-027-087-MY2 and 102-2221-E-027-088-

References

[1] O Bohl S Manouchehri and U Winand ldquoMobile informationsystems for the private everyday liferdquo Mobile InformationSystems vol 3 no 3-4 pp 135ndash152 2007

[2] Y Tao andD Papadias ldquoTime-parameterized queries in spatio-temporal databasesrdquo in Proceedings of the ACM SIGMODInternational Conference on Managment of Data pp 334ndash345June 2002

[3] Y Tao D Papadias and Q Shen ldquoContinuous nearest neighborsearchrdquo in Proceedings of the 28th International Conference onVery Large Data Bases (VLDB rsquo02) pp 287ndash298 2002

[4] F Aurenhammer ldquoVoronoi diagramsmdasha survey of a fundamen-tal geometric data structurerdquo ACM Computing Surveys vol 23no 3 pp 345ndash405 1991

[5] K Kim Y Cai andW Tavanapong ldquoSafe-time distributed real-time monitoring of cKNN in mobile peer-to-peer networksrdquo inProceedings of the 9th IEEE International Conference on MobileData Management (MDM rsquo08) pp 124ndash131 April 2008

[6] M Kolahdouzan and C Shahabi ldquoVoronoi-based k nearest nei-ghbor search for spatial network databasesrdquo in Proceedings ofthe 30th International Conference on Very Large Data Bases vol30 pp 840ndash851 2004

[7] M R Kolahdouzan and C Shahabi ldquoAlternative solutions forcontinuous K nearest neighbor queries in spatial networkdatabasesrdquo GeoInformatica vol 9 no 4 pp 321ndash341 2005

[8] D Papadias Y Tao K Mouratidis and C K Hui ldquoAggregatenearest neighbor queries in spatial databasesrdquo ACM Transac-tions on Database Systems vol 30 no 2 pp 529ndash576 2005

[9] T Imielinski S Viswanathan and B R Badrinath ldquoData on airorganization and accessrdquo IEEE Transactions on Knowledge andData Engineering vol 9 no 3 pp 353ndash372 1997

[10] S Hambrusch C-M Liu and S Prabhakar ldquoBroadcasting andquerying multi-dimensional index trees in a multi-channelenvironmentrdquo Information Systems vol 31 no 8 pp 870ndash8862006

[11] C-M Liu and K-F Lin ldquoDisseminating dependent data inwireless broadcast environmentsrdquo Distributed and ParallelDatabases vol 22 no 1 pp 1ndash25 2007

[12] T-C Su and C-M Liu ldquoOn-demand data broadcasting for dataitems with time constraints on multiple broadcast channelsrdquo inDatabase Systems for Advanced Applications vol 6193 of LectureNotes in Computer Science pp 458ndash469 2010

[13] B Zheng J Xu W-C Lee and D L Lee ldquoGrid-partition ind-ex a hybrid method for nearest-neighbor queries in wirelesslocation-based servicesrdquo The VLDB Journal vol 15 no 1 pp21ndash39 2006

[14] B Gedik A Singh and L Liu ldquoEnergy efficient exact kNN sear-ch in wireless broadcast environmentsrdquo in Proceedings of the12th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo04) pp 137ndash146 November 2004

[15] KMouratidis S Bakiras and D Papadias ldquoContinuousmonit-oring of spatial queries in wireless broadcast environmentsrdquoIEEE Transactions onMobile Computing vol 8 no 10 pp 1297ndash1311 2009

[16] G Chatzimilioudis D Zeinalipour-Yazti W-C Lee and M DDikaiakos ldquoContinuous all k-nearest-neighbor querying insmartphone networksrdquo in Proceedings of the 13th IEEE Interna-tional Conference on Mobile Data Management (MDM rsquo12) pp79ndash88 2012

[17] T-Y Fu W-C Peng and W-C Lee ldquoParallelizing itinerary-basedKNNquery processing inwireless sensor networksrdquo IEEETransactions on Knowledge and Data Engineering vol 22 no 5pp 711ndash729 2010

[18] T P Nghiem A B Waluyo and D Taniar ldquoA pure peer-to-peerapproach for kNNquery processing inmobile ad hoc networksrdquo

20 International Journal of Distributed Sensor Networks

Personal and Ubiquitous Computing vol 17 no 5 pp 973ndash9852013

[19] HD Chon D Agrawal andA El Abbadi ldquoRange and kNNqu-ery processing for moving objects in Grid modelrdquo MobileNetworks and Applications vol 8 no 4 pp 401ndash412 2003

[20] X Xiong M F Mokbel and W G Aref ldquoSEA-CNN scalableprocessing of continuous K-nearest neighbor queries in spatio-temporal databasesrdquo in Proceedings of the 21st InternationalConference on Data Engineering (ICDE rsquo05) pp 643ndash654 April2005

[21] G Zhao K XuanW Rahayu et al ldquoVoronoi-based continuous120581 nearest neighbor search in mobile navigationrdquo IEEE Transac-tions on Industrial Electronics vol 58 no 6 pp 2247ndash2257 2011

[22] KMouratidis D Papadias S Bakiras and Y Tao ldquoA threshold-based algorithm for continuous monitoring of k nearest neigh-borsrdquo IEEE Transactions on Knowledge and Data Engineeringvol 17 no 11 pp 1451ndash1464 2005

[23] S-H Wu K-T Chuang C-M Chen and M-S Chen ldquoDIK-NN an itinerary-based KNN query processing algorithm formobile sensor networksrdquo inProceedings of the 23rd InternationalConference on Data Engineering (ICDE rsquo07) pp 456ndash465 April2007

[24] D T Lee ldquoOn k-nearest neighbor voronoi diagrams in the pla-nerdquo IEEE Transactions on Computers vol 31 no 6 pp 478ndash4871982

[25] K Patroumpas TMinogiannis andT Sellis ldquoApproximate ord-er-k Voronoi cells over positional streamsrdquo in Proceedings of the15th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo07) pp 276ndash283 November 2007

International Journal of

AerospaceEngineeringHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

RoboticsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Active and Passive Electronic Components

Control Scienceand Engineering

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

RotatingMachinery

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

Journal ofEngineeringVolume 2014

Submit your manuscripts athttpwwwhindawicom

VLSI Design

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Shock and Vibration

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawi Publishing Corporation httpwwwhindawicom

Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

SensorsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Navigation and Observation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

DistributedSensor Networks

International Journal of

Page 13: Research Article Distributed Continuous k Nearest Neighbors ...downloads.hindawi.com/journals/ijdsn/2013/125145.pdfmobile environments like WSNs, which consist of a number of mobile

International Journal of Distributed Sensor Networks 13

200 400 600 800 10000

10

20

30

40

50

60

Edge length of sensing area (m)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

200 400 600 800 10000

100

200

300

400

500

600

700

Edge length of sensing area (m)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

200 400 600 800 100075

80

85

90

95

100

105

Edge length of sensing area (m)

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

200 400 600 800 1000Edge length of sensing area (m)

Aver

age r

espo

nse t

ime (

s)

DCkNNSafe-time(S)Safe-time(M)

095

1

105

11

(d) Response time

Figure 13 The effects of different sensing areas on (a) update frequency (b) number of messages (c) accuracy and (d) response time

Table 1 Simulation parameters

Parameter Range Default valueEdge length of sensingarea (m) 200 400 600 800 1000 600

Edge length of grid (m) 50 100 150 50Number of objects 20 30 40 50 60 30Transmission range (m) 125 125119896 1 3 5 10 20 3Moving objects () 20 40 60 80 100 20Speed (ms) 2 4 6 8 10 4

61 Effects of Sensing Area Sensing area affects the numberof update and query messages since if the area becomes

greater with the fixed number of objects relatively thedensity of the objects becomes sparse For example when thesensing areas are 200lowast200 400lowast400 600lowast600 800lowast800 and1000lowast1000 the densities are 188 047 021 012 and 008respectively Figure 13(a) shows that DC119896NN has the lowestnumber of updates with all the different areas and the numberof updates for Safe-time(S) is the highest (worst) becauseDC119896NN considers the moving direction and speed of thequeries and objects and selects the proper safe-distance toderive the safe-time Safe-time(S) the Safe-time(M) estimatethe safe time according to the maximum speed of the objectsso more number of updates can be expected AdditionallySafe-time(M) is updated more frequently than Safe-time(S)Recall that Safe-time(M) considers the query movement

14 International Journal of Distributed Sensor Networks

50 75 100 150 2000

5

10

15

20

25

Edge length of grid (m)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

50 75 100 150 2000

50

100

150

200

250

300

350

Edge length of grid (m)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

50 75 100 150 2000

20

40

60

80

100

120

Edge length of grid (m)

Accu

racy

()

DCkNN(G)DCkNN(V)

(c) Accuracy

50 75 100 150 2001

101

102

103

104

105

106

Edge length of grid (m)

Aver

age r

espo

nse t

ime (

s)

DCkNN(G)DCkNN(V)

(d) Response time

Figure 14 The comparisons of using grid-based and VD-base safe distances to derive the safe-time (a) update frequency (b) number ofmessages (c) accuracy and (d) response time

The average safe-distance becomes shorter thus leading tomore updates Besides when the sensing area increasesfrom 200lowast200 to 600lowast600 the update frequency dropsdramaticallyThe curve becomes flatter when the area is from600lowast600 to 1000lowast1000 since the difference on the densitiesof the areas from 600lowast600 to 1000lowast1000 is not much Thenumber of updates is less as the safe-time becomes largerThetotal number of transmitted messages of naıve approach isfixed at about 1800 packets All the other distributedmethodsuse fewer number of messages than naıve

To monitor the results DC119896NN only needs to check therelated objects in the local Voronoi cell at the proper safe-time thus reducing a lot of redundant update messages Safe-time(S) and Safe-time(M) use the maximum speed of theobjects to calculate the safe time so the total number of

transmitted messages of both approaches is more than that ofDC119896NN Figure 13(b) shows that more than 30 of the totalnumber of transmitted messages can be saved by DC119896NN incomparison with Safe-time(M)

For the accuracy since Safe-time(S) does not considerthe query movement the safe-time may be inaccurate Fur-thermore due to the mobility when the density is high theestimated results become more inaccurate So Safe-time(S)performs worst as shown in Figure 13(c) Safe-time(M) isrevised from Safe-time(S) by considering the query move-ment and the safe-distance is less in average for guaranteeingbetter results Hence Safe-time(M) has a better accuracy andalmost the same as DC119896NN The accuracy of Safe-time(M)and DC119896NN is almost about 100 correct and the gap maybe caused by arithmetical errors in the experiments

International Journal of Distributed Sensor Networks 15

10 20 30 40 50 60 700

5

10

15

20

25

30

35

40

45

Number of objects

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

10 20 30 40 50 60 70100

150

200

250

300

350

400

450

Number of objects

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

10 20 30 40 50 60 7080

85

90

95

100

105

Number of objects

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

10 20 30 40 50 60 70Number of objects

Aver

age r

espo

nse t

ime (

s)

096

098

1

102

104

106

108

11

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 15 The effects of the number of objects on (a) update frequency (b) number of messages (c) accuracy and (d) response time

When the area becomes larger the density becomeslower So the number of objects in each objectrsquos transmissionrange is fewer Under such a circumstance DC119896NN usesless computation and the response time is shorter as shownin Figure 13(d) In contrast the Safe-time(S) and the Safe-time(M) need to collect information before performing eachnew query and cause longer response time Since Safe-time(M) and Safe-time(S) use the same method and proce-dure to handle the first query the response time of these twomethods will be almost the same

62 Effects of Grid Size In this simulation experiment setwe want to observe the update efficiency of each object inthe third phase of DC119896NN Recall that we consider the grid-based and VD-base safe distances to derive a proper safe-time In this experiment DC119896NN(G) uses grid-based safe

distance to determine the safe time for the next update andDC119896NN(V) uses VD-base safe distance to derive the safetime The sensing area is fixed to 600lowast600m2 and there are30 data objects We compare DC119896NN(V) with DC119896NN(G)by observing the impacts of different grid sizes All theother settings have the similar trends in our experimentalresults In Figure 14(a) the update frequency of the objectsin DC119896NN(G) is high when the grid size is 50lowast50m2 andbecomes less when the grid size decreases Since the sensingarea is 600lowast600m2 and 30 objects are given the averagedistance between an object and the boundary of a Voronoicell is about 25 to 50 meters With the setting of grid size50lowast50m2 the average distance obtained in DC119896NN(G) isabout 25 meters Thus the safe time of DC119896NN(V) is longerIn general as Figures 14(a) and 14(b) show the update

16 International Journal of Distributed Sensor Networks

1 3 5 10 200

10

20

30

40

50

60

k

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

1 3 5 10 200

100

200

300

400

500

600

700

800

k

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

1 3 5 10 2080

85

90

95

100

105

k

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

1 3 5 10 20k

Aver

age r

espo

nse t

ime (

s)

08

09

1

11

12

13

14

15

16

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 16 The impacts of different values of 119896 on (a) update frequency (b) number of messages (c) accuracy and (d) response time

frequency of the objects and the number of messages sentby the objects decrease as the grid size increases

When the grid size is large the safe time becomes longand less number of updates are issued Hence the resultsbecome more inaccurate As shown in Figure 14(c) whenthe grid sizes are 50lowast50m2 75lowast75m2 100lowast100m2 and150lowast150m2 the corresponding accuracies are 95 9285 and 78 respectively While the grid size increases to200lowast200m2 the accuracy is significantly reduced to 69and the right answer thus can not be guaranteed On theother hand Figure 14(d) shows that the response times ofDC119896NN(G) and DC119896NN(V) are not much different becausethe size of grid is not the major factor to influence thecomplexity of obtaining information for the first query

63 Number of Objects In this subsection we discuss theresults as the number of data objects varies The area in thepresented experiment set is 600lowast600 (m2) with grid size of50lowast50 (m2) As shown in Figure 15(a) when the number ofobjects increases the number of updates in DC119896NN is stillrelatively less than the ones in Safe-time(S) and Safe-time(M)If the number of objects increases the number of repliedmessages per second to the central server in naıve will growdramatically With 20 to 60 objects the number of repliedmessages to the server is from 1200 to 3600 (packetsmin)By observing the results in Figures 15(b) and 15(c) as moreobjects are in the area the number of messages increasesfor the other three methods and the accuracy reduces inSafe-time(S) These match the trends for different areas we

International Journal of Distributed Sensor Networks 17

20 40 60 80 1000

5

10

15

20

25

30

35

40

45

Moving objects ()

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

20 40 60 80 1000

100

200

300

400

500

600

Moving objects ()

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

20 40 60 80 100

80

70

75

85

90

95

100

105

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

Moving objects ()

(c) Accuracy

20 40 60 80 100

Aver

age r

espo

nse t

ime (

s)

09

095

1

11

105

115

12

125

13

DCkNNSafe-time(S)Safe-time(M)

Moving objects ()

(d) Response time

Figure 17 The effects of the moving objects on (a) update frequency (b) number of messages (c) accuracy and (d) response time

discussed earlier due to the density Similarly the responsetime can be expected as shown in Figure 15(d) where theresponse time of DC119896NN is still the shortest

64 Different Values of 119896 It is obvious that the value of119896 affects the performance of query processing significantlyWhen the value of 119896 becomes larger the number of relatedobjects required to be checked also increases In other wordswe need to spend more cost to find out which 119896 objectsare currently in the result for the C119896NN query Thereforethe changes in the value of 119896 mainly affect the amountof data required for the first query and the update costfor maintaining the 119896th and the (119896 + 1)th objects So inFigure 16(a) when the value of 119896 is large more updates arenecessary for all the three methods As Figure 16(b) shows

the influence on the number of transmitted messages inSafe-time(M) is more serious than the one in Safe-time(S)Due to the mobility the number of influenced objects inSafe-time(M) will increase as the value of 119896 increases Inparticular the update frequency in Safe-time(M) becomesnearly twofold the update frequency in Safe-time(S)

Figure 16(c) presents the impact on the accuracy fordifferent values of 119896 With a larger value of 119896 an object inSafe-time(S) will have a higher chance to derive the incorrectsafe time thus causing lower accuracy When the value of 119896increases the response time of all threemethods will increasesignificantly as shown in Figure 16(d) The reason is thatall DC119896NN Safe-time(S) and Safe-time(M) need to searchmore objects and collect more information for answering thequery when the value of 119896 increases to a certain number For

18 International Journal of Distributed Sensor Networks

2 4 6 8 100

10

20

30

40

50

60

Speed (ms)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

2 4 6 8 100

100

200

300

400

500

600

700

800

Speed (ms)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

2 4 6 8 1070

75

80

85

90

95

100

105

Speed (ms)

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

2 4 6 8 1009

095

1

105

11

115

12

125

13

Speed (ms)

Aver

age r

espo

nse t

ime (

s)

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 18 The impacts of speed on (a) update frequency (b) number of messages (c) accuracy and (d) response time

DC119896NN DC119896NN only needs to store local Voronoi diagramwhere the information required is less than required in Safe-time(S) and Safe-time(M) so the response time of DC119896NN isthe shortest

65 The Effect of Moving Objects In this experiment set weconsider different percentages of moving objects in all thedata objects The default value is 20 which means that ifthere is a total of 30 objects then there are sixmoving objectsIn Figures 17(a) and 17(b) as the percentage ofmoving objectsincreases the overall number of updates required between theobjects increases relatively and the change rate of answer totheDC119896NNaccelerates thus increasing the update frequencyof the query and the number of messages However DC119896NNstill keeps the best performance Figure 17(c) shows the accu-racy of the result for different percentage of moving objectsDC119896NN and Safe-time(M) both have higher accuracy and

Safe-time(S) is still the worst The safe time of each object inSafe-time(S) is calculated using the maximum speed of theobjects Hence whether the object is moving or not does notdirectly result in the incorrectness of the answer collectionIn fact in Safe-time(S) one of the main reasons to affectthe accuracy is the directions of moving objects Last asFigure 17(d) shows the percentage of moving objects doesnot impact the response time too much

66 Effects of Speed If each object moves faster the relativevelocities between objects may also become faster This willmake the safe time shorter and the update frequency ofeach object and query increases The safe time used inSafe-time(S) and Safe-time(M) is directly affected by themaximum speed of objects and does not consider the direc-tion of each objectrsquos movement and the speed of individualmovement No matter the objects move or not and move

International Journal of Distributed Sensor Networks 19

fast or slow both of the above methods directly use themaximum speed of objects to calculate the safe time forupdating On the other hand DC119896NN considers the movingdirection of objects and the proper safe-time for updatesIn this experiment the number of moving objects is 20of all the objects As Figure 18(a) shows as the movingobjects speed up the update cost increases and DC119896NN stillperforms best As the speed increases the safe-time in Safe-time(S) and the Safe-time(M) becomes much shorter due toa larger maximum speed among all the objects The trendbecomes even worse as the speed increases

Figure 18(b) shows the trend about the number of trans-mitted messages when the speed is up DC119896NN still hasthe best performance on the number of messages There are42781 messages sent in average when the speed of object is10ms However the Safe-time(M) needs 67913 messagesThe accuracy will not be effected as the speed changesfor DC119896NN and Safe-time(M) because both of them aredesigned or adapted for themoving objects and queries Safe-time(S) will have more inaccurate results as the speed is highas shown in Figure 18(c) However the response time doesnot have a significant impact on the response time for all thethree methods Figure 18(d) presents this trend

7 Conclusions

In this paper we propose a new approach DC119896NN whichuses the local Voronoi diagram and proper safe-time toeffectively process the C119896NNquery in distributed andmobileenvironments such as wireless sensor networks The propersafe-time can be quickly derived by a simple formulaBy comparing our proposed DC119896NN with other existingapproaches Safe-time(S) DC119896NN can effectively improvesearch efficiency reduce response time and the numberof messages and keep the accuracy of the result highAdditionally DC119896NN reduces more 30 of transmissionmessages than Safe-time(M) because the characteristics of theVoronoi diagram are used and each objectrsquos moving directionis considered instead of directly using the maximum speedof the objects as Safe-time method The derived safe-timeis more precise As a result DC119896NN needs less updatefrequency reduces a great number of messages transmittedand yields more accurate results In this work simulationexperiments are also performed The experimental resultsvalidate the proposed DC119896NN approach for the continuous119896 nearest neighbor query in distributed and mobile environ-ments where all the data objects and query can move

Acknowledgment

This work is partially supported by NSC under the Grant98-2220-E-027-007 100-2221-E-027-087-MY2 and 102-2221-E-027-088-

References

[1] O Bohl S Manouchehri and U Winand ldquoMobile informationsystems for the private everyday liferdquo Mobile InformationSystems vol 3 no 3-4 pp 135ndash152 2007

[2] Y Tao andD Papadias ldquoTime-parameterized queries in spatio-temporal databasesrdquo in Proceedings of the ACM SIGMODInternational Conference on Managment of Data pp 334ndash345June 2002

[3] Y Tao D Papadias and Q Shen ldquoContinuous nearest neighborsearchrdquo in Proceedings of the 28th International Conference onVery Large Data Bases (VLDB rsquo02) pp 287ndash298 2002

[4] F Aurenhammer ldquoVoronoi diagramsmdasha survey of a fundamen-tal geometric data structurerdquo ACM Computing Surveys vol 23no 3 pp 345ndash405 1991

[5] K Kim Y Cai andW Tavanapong ldquoSafe-time distributed real-time monitoring of cKNN in mobile peer-to-peer networksrdquo inProceedings of the 9th IEEE International Conference on MobileData Management (MDM rsquo08) pp 124ndash131 April 2008

[6] M Kolahdouzan and C Shahabi ldquoVoronoi-based k nearest nei-ghbor search for spatial network databasesrdquo in Proceedings ofthe 30th International Conference on Very Large Data Bases vol30 pp 840ndash851 2004

[7] M R Kolahdouzan and C Shahabi ldquoAlternative solutions forcontinuous K nearest neighbor queries in spatial networkdatabasesrdquo GeoInformatica vol 9 no 4 pp 321ndash341 2005

[8] D Papadias Y Tao K Mouratidis and C K Hui ldquoAggregatenearest neighbor queries in spatial databasesrdquo ACM Transac-tions on Database Systems vol 30 no 2 pp 529ndash576 2005

[9] T Imielinski S Viswanathan and B R Badrinath ldquoData on airorganization and accessrdquo IEEE Transactions on Knowledge andData Engineering vol 9 no 3 pp 353ndash372 1997

[10] S Hambrusch C-M Liu and S Prabhakar ldquoBroadcasting andquerying multi-dimensional index trees in a multi-channelenvironmentrdquo Information Systems vol 31 no 8 pp 870ndash8862006

[11] C-M Liu and K-F Lin ldquoDisseminating dependent data inwireless broadcast environmentsrdquo Distributed and ParallelDatabases vol 22 no 1 pp 1ndash25 2007

[12] T-C Su and C-M Liu ldquoOn-demand data broadcasting for dataitems with time constraints on multiple broadcast channelsrdquo inDatabase Systems for Advanced Applications vol 6193 of LectureNotes in Computer Science pp 458ndash469 2010

[13] B Zheng J Xu W-C Lee and D L Lee ldquoGrid-partition ind-ex a hybrid method for nearest-neighbor queries in wirelesslocation-based servicesrdquo The VLDB Journal vol 15 no 1 pp21ndash39 2006

[14] B Gedik A Singh and L Liu ldquoEnergy efficient exact kNN sear-ch in wireless broadcast environmentsrdquo in Proceedings of the12th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo04) pp 137ndash146 November 2004

[15] KMouratidis S Bakiras and D Papadias ldquoContinuousmonit-oring of spatial queries in wireless broadcast environmentsrdquoIEEE Transactions onMobile Computing vol 8 no 10 pp 1297ndash1311 2009

[16] G Chatzimilioudis D Zeinalipour-Yazti W-C Lee and M DDikaiakos ldquoContinuous all k-nearest-neighbor querying insmartphone networksrdquo in Proceedings of the 13th IEEE Interna-tional Conference on Mobile Data Management (MDM rsquo12) pp79ndash88 2012

[17] T-Y Fu W-C Peng and W-C Lee ldquoParallelizing itinerary-basedKNNquery processing inwireless sensor networksrdquo IEEETransactions on Knowledge and Data Engineering vol 22 no 5pp 711ndash729 2010

[18] T P Nghiem A B Waluyo and D Taniar ldquoA pure peer-to-peerapproach for kNNquery processing inmobile ad hoc networksrdquo

20 International Journal of Distributed Sensor Networks

Personal and Ubiquitous Computing vol 17 no 5 pp 973ndash9852013

[19] HD Chon D Agrawal andA El Abbadi ldquoRange and kNNqu-ery processing for moving objects in Grid modelrdquo MobileNetworks and Applications vol 8 no 4 pp 401ndash412 2003

[20] X Xiong M F Mokbel and W G Aref ldquoSEA-CNN scalableprocessing of continuous K-nearest neighbor queries in spatio-temporal databasesrdquo in Proceedings of the 21st InternationalConference on Data Engineering (ICDE rsquo05) pp 643ndash654 April2005

[21] G Zhao K XuanW Rahayu et al ldquoVoronoi-based continuous120581 nearest neighbor search in mobile navigationrdquo IEEE Transac-tions on Industrial Electronics vol 58 no 6 pp 2247ndash2257 2011

[22] KMouratidis D Papadias S Bakiras and Y Tao ldquoA threshold-based algorithm for continuous monitoring of k nearest neigh-borsrdquo IEEE Transactions on Knowledge and Data Engineeringvol 17 no 11 pp 1451ndash1464 2005

[23] S-H Wu K-T Chuang C-M Chen and M-S Chen ldquoDIK-NN an itinerary-based KNN query processing algorithm formobile sensor networksrdquo inProceedings of the 23rd InternationalConference on Data Engineering (ICDE rsquo07) pp 456ndash465 April2007

[24] D T Lee ldquoOn k-nearest neighbor voronoi diagrams in the pla-nerdquo IEEE Transactions on Computers vol 31 no 6 pp 478ndash4871982

[25] K Patroumpas TMinogiannis andT Sellis ldquoApproximate ord-er-k Voronoi cells over positional streamsrdquo in Proceedings of the15th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo07) pp 276ndash283 November 2007

International Journal of

AerospaceEngineeringHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

RoboticsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Active and Passive Electronic Components

Control Scienceand Engineering

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

RotatingMachinery

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

Journal ofEngineeringVolume 2014

Submit your manuscripts athttpwwwhindawicom

VLSI Design

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Shock and Vibration

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawi Publishing Corporation httpwwwhindawicom

Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

SensorsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Navigation and Observation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

DistributedSensor Networks

International Journal of

Page 14: Research Article Distributed Continuous k Nearest Neighbors ...downloads.hindawi.com/journals/ijdsn/2013/125145.pdfmobile environments like WSNs, which consist of a number of mobile

14 International Journal of Distributed Sensor Networks

50 75 100 150 2000

5

10

15

20

25

Edge length of grid (m)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

50 75 100 150 2000

50

100

150

200

250

300

350

Edge length of grid (m)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

50 75 100 150 2000

20

40

60

80

100

120

Edge length of grid (m)

Accu

racy

()

DCkNN(G)DCkNN(V)

(c) Accuracy

50 75 100 150 2001

101

102

103

104

105

106

Edge length of grid (m)

Aver

age r

espo

nse t

ime (

s)

DCkNN(G)DCkNN(V)

(d) Response time

Figure 14 The comparisons of using grid-based and VD-base safe distances to derive the safe-time (a) update frequency (b) number ofmessages (c) accuracy and (d) response time

The average safe-distance becomes shorter thus leading tomore updates Besides when the sensing area increasesfrom 200lowast200 to 600lowast600 the update frequency dropsdramaticallyThe curve becomes flatter when the area is from600lowast600 to 1000lowast1000 since the difference on the densitiesof the areas from 600lowast600 to 1000lowast1000 is not much Thenumber of updates is less as the safe-time becomes largerThetotal number of transmitted messages of naıve approach isfixed at about 1800 packets All the other distributedmethodsuse fewer number of messages than naıve

To monitor the results DC119896NN only needs to check therelated objects in the local Voronoi cell at the proper safe-time thus reducing a lot of redundant update messages Safe-time(S) and Safe-time(M) use the maximum speed of theobjects to calculate the safe time so the total number of

transmitted messages of both approaches is more than that ofDC119896NN Figure 13(b) shows that more than 30 of the totalnumber of transmitted messages can be saved by DC119896NN incomparison with Safe-time(M)

For the accuracy since Safe-time(S) does not considerthe query movement the safe-time may be inaccurate Fur-thermore due to the mobility when the density is high theestimated results become more inaccurate So Safe-time(S)performs worst as shown in Figure 13(c) Safe-time(M) isrevised from Safe-time(S) by considering the query move-ment and the safe-distance is less in average for guaranteeingbetter results Hence Safe-time(M) has a better accuracy andalmost the same as DC119896NN The accuracy of Safe-time(M)and DC119896NN is almost about 100 correct and the gap maybe caused by arithmetical errors in the experiments

International Journal of Distributed Sensor Networks 15

10 20 30 40 50 60 700

5

10

15

20

25

30

35

40

45

Number of objects

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

10 20 30 40 50 60 70100

150

200

250

300

350

400

450

Number of objects

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

10 20 30 40 50 60 7080

85

90

95

100

105

Number of objects

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

10 20 30 40 50 60 70Number of objects

Aver

age r

espo

nse t

ime (

s)

096

098

1

102

104

106

108

11

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 15 The effects of the number of objects on (a) update frequency (b) number of messages (c) accuracy and (d) response time

When the area becomes larger the density becomeslower So the number of objects in each objectrsquos transmissionrange is fewer Under such a circumstance DC119896NN usesless computation and the response time is shorter as shownin Figure 13(d) In contrast the Safe-time(S) and the Safe-time(M) need to collect information before performing eachnew query and cause longer response time Since Safe-time(M) and Safe-time(S) use the same method and proce-dure to handle the first query the response time of these twomethods will be almost the same

62 Effects of Grid Size In this simulation experiment setwe want to observe the update efficiency of each object inthe third phase of DC119896NN Recall that we consider the grid-based and VD-base safe distances to derive a proper safe-time In this experiment DC119896NN(G) uses grid-based safe

distance to determine the safe time for the next update andDC119896NN(V) uses VD-base safe distance to derive the safetime The sensing area is fixed to 600lowast600m2 and there are30 data objects We compare DC119896NN(V) with DC119896NN(G)by observing the impacts of different grid sizes All theother settings have the similar trends in our experimentalresults In Figure 14(a) the update frequency of the objectsin DC119896NN(G) is high when the grid size is 50lowast50m2 andbecomes less when the grid size decreases Since the sensingarea is 600lowast600m2 and 30 objects are given the averagedistance between an object and the boundary of a Voronoicell is about 25 to 50 meters With the setting of grid size50lowast50m2 the average distance obtained in DC119896NN(G) isabout 25 meters Thus the safe time of DC119896NN(V) is longerIn general as Figures 14(a) and 14(b) show the update

16 International Journal of Distributed Sensor Networks

1 3 5 10 200

10

20

30

40

50

60

k

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

1 3 5 10 200

100

200

300

400

500

600

700

800

k

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

1 3 5 10 2080

85

90

95

100

105

k

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

1 3 5 10 20k

Aver

age r

espo

nse t

ime (

s)

08

09

1

11

12

13

14

15

16

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 16 The impacts of different values of 119896 on (a) update frequency (b) number of messages (c) accuracy and (d) response time

frequency of the objects and the number of messages sentby the objects decrease as the grid size increases

When the grid size is large the safe time becomes longand less number of updates are issued Hence the resultsbecome more inaccurate As shown in Figure 14(c) whenthe grid sizes are 50lowast50m2 75lowast75m2 100lowast100m2 and150lowast150m2 the corresponding accuracies are 95 9285 and 78 respectively While the grid size increases to200lowast200m2 the accuracy is significantly reduced to 69and the right answer thus can not be guaranteed On theother hand Figure 14(d) shows that the response times ofDC119896NN(G) and DC119896NN(V) are not much different becausethe size of grid is not the major factor to influence thecomplexity of obtaining information for the first query

63 Number of Objects In this subsection we discuss theresults as the number of data objects varies The area in thepresented experiment set is 600lowast600 (m2) with grid size of50lowast50 (m2) As shown in Figure 15(a) when the number ofobjects increases the number of updates in DC119896NN is stillrelatively less than the ones in Safe-time(S) and Safe-time(M)If the number of objects increases the number of repliedmessages per second to the central server in naıve will growdramatically With 20 to 60 objects the number of repliedmessages to the server is from 1200 to 3600 (packetsmin)By observing the results in Figures 15(b) and 15(c) as moreobjects are in the area the number of messages increasesfor the other three methods and the accuracy reduces inSafe-time(S) These match the trends for different areas we

International Journal of Distributed Sensor Networks 17

20 40 60 80 1000

5

10

15

20

25

30

35

40

45

Moving objects ()

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

20 40 60 80 1000

100

200

300

400

500

600

Moving objects ()

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

20 40 60 80 100

80

70

75

85

90

95

100

105

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

Moving objects ()

(c) Accuracy

20 40 60 80 100

Aver

age r

espo

nse t

ime (

s)

09

095

1

11

105

115

12

125

13

DCkNNSafe-time(S)Safe-time(M)

Moving objects ()

(d) Response time

Figure 17 The effects of the moving objects on (a) update frequency (b) number of messages (c) accuracy and (d) response time

discussed earlier due to the density Similarly the responsetime can be expected as shown in Figure 15(d) where theresponse time of DC119896NN is still the shortest

64 Different Values of 119896 It is obvious that the value of119896 affects the performance of query processing significantlyWhen the value of 119896 becomes larger the number of relatedobjects required to be checked also increases In other wordswe need to spend more cost to find out which 119896 objectsare currently in the result for the C119896NN query Thereforethe changes in the value of 119896 mainly affect the amountof data required for the first query and the update costfor maintaining the 119896th and the (119896 + 1)th objects So inFigure 16(a) when the value of 119896 is large more updates arenecessary for all the three methods As Figure 16(b) shows

the influence on the number of transmitted messages inSafe-time(M) is more serious than the one in Safe-time(S)Due to the mobility the number of influenced objects inSafe-time(M) will increase as the value of 119896 increases Inparticular the update frequency in Safe-time(M) becomesnearly twofold the update frequency in Safe-time(S)

Figure 16(c) presents the impact on the accuracy fordifferent values of 119896 With a larger value of 119896 an object inSafe-time(S) will have a higher chance to derive the incorrectsafe time thus causing lower accuracy When the value of 119896increases the response time of all threemethods will increasesignificantly as shown in Figure 16(d) The reason is thatall DC119896NN Safe-time(S) and Safe-time(M) need to searchmore objects and collect more information for answering thequery when the value of 119896 increases to a certain number For

18 International Journal of Distributed Sensor Networks

2 4 6 8 100

10

20

30

40

50

60

Speed (ms)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

2 4 6 8 100

100

200

300

400

500

600

700

800

Speed (ms)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

2 4 6 8 1070

75

80

85

90

95

100

105

Speed (ms)

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

2 4 6 8 1009

095

1

105

11

115

12

125

13

Speed (ms)

Aver

age r

espo

nse t

ime (

s)

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 18 The impacts of speed on (a) update frequency (b) number of messages (c) accuracy and (d) response time

DC119896NN DC119896NN only needs to store local Voronoi diagramwhere the information required is less than required in Safe-time(S) and Safe-time(M) so the response time of DC119896NN isthe shortest

65 The Effect of Moving Objects In this experiment set weconsider different percentages of moving objects in all thedata objects The default value is 20 which means that ifthere is a total of 30 objects then there are sixmoving objectsIn Figures 17(a) and 17(b) as the percentage ofmoving objectsincreases the overall number of updates required between theobjects increases relatively and the change rate of answer totheDC119896NNaccelerates thus increasing the update frequencyof the query and the number of messages However DC119896NNstill keeps the best performance Figure 17(c) shows the accu-racy of the result for different percentage of moving objectsDC119896NN and Safe-time(M) both have higher accuracy and

Safe-time(S) is still the worst The safe time of each object inSafe-time(S) is calculated using the maximum speed of theobjects Hence whether the object is moving or not does notdirectly result in the incorrectness of the answer collectionIn fact in Safe-time(S) one of the main reasons to affectthe accuracy is the directions of moving objects Last asFigure 17(d) shows the percentage of moving objects doesnot impact the response time too much

66 Effects of Speed If each object moves faster the relativevelocities between objects may also become faster This willmake the safe time shorter and the update frequency ofeach object and query increases The safe time used inSafe-time(S) and Safe-time(M) is directly affected by themaximum speed of objects and does not consider the direc-tion of each objectrsquos movement and the speed of individualmovement No matter the objects move or not and move

International Journal of Distributed Sensor Networks 19

fast or slow both of the above methods directly use themaximum speed of objects to calculate the safe time forupdating On the other hand DC119896NN considers the movingdirection of objects and the proper safe-time for updatesIn this experiment the number of moving objects is 20of all the objects As Figure 18(a) shows as the movingobjects speed up the update cost increases and DC119896NN stillperforms best As the speed increases the safe-time in Safe-time(S) and the Safe-time(M) becomes much shorter due toa larger maximum speed among all the objects The trendbecomes even worse as the speed increases

Figure 18(b) shows the trend about the number of trans-mitted messages when the speed is up DC119896NN still hasthe best performance on the number of messages There are42781 messages sent in average when the speed of object is10ms However the Safe-time(M) needs 67913 messagesThe accuracy will not be effected as the speed changesfor DC119896NN and Safe-time(M) because both of them aredesigned or adapted for themoving objects and queries Safe-time(S) will have more inaccurate results as the speed is highas shown in Figure 18(c) However the response time doesnot have a significant impact on the response time for all thethree methods Figure 18(d) presents this trend

7 Conclusions

In this paper we propose a new approach DC119896NN whichuses the local Voronoi diagram and proper safe-time toeffectively process the C119896NNquery in distributed andmobileenvironments such as wireless sensor networks The propersafe-time can be quickly derived by a simple formulaBy comparing our proposed DC119896NN with other existingapproaches Safe-time(S) DC119896NN can effectively improvesearch efficiency reduce response time and the numberof messages and keep the accuracy of the result highAdditionally DC119896NN reduces more 30 of transmissionmessages than Safe-time(M) because the characteristics of theVoronoi diagram are used and each objectrsquos moving directionis considered instead of directly using the maximum speedof the objects as Safe-time method The derived safe-timeis more precise As a result DC119896NN needs less updatefrequency reduces a great number of messages transmittedand yields more accurate results In this work simulationexperiments are also performed The experimental resultsvalidate the proposed DC119896NN approach for the continuous119896 nearest neighbor query in distributed and mobile environ-ments where all the data objects and query can move

Acknowledgment

This work is partially supported by NSC under the Grant98-2220-E-027-007 100-2221-E-027-087-MY2 and 102-2221-E-027-088-

References

[1] O Bohl S Manouchehri and U Winand ldquoMobile informationsystems for the private everyday liferdquo Mobile InformationSystems vol 3 no 3-4 pp 135ndash152 2007

[2] Y Tao andD Papadias ldquoTime-parameterized queries in spatio-temporal databasesrdquo in Proceedings of the ACM SIGMODInternational Conference on Managment of Data pp 334ndash345June 2002

[3] Y Tao D Papadias and Q Shen ldquoContinuous nearest neighborsearchrdquo in Proceedings of the 28th International Conference onVery Large Data Bases (VLDB rsquo02) pp 287ndash298 2002

[4] F Aurenhammer ldquoVoronoi diagramsmdasha survey of a fundamen-tal geometric data structurerdquo ACM Computing Surveys vol 23no 3 pp 345ndash405 1991

[5] K Kim Y Cai andW Tavanapong ldquoSafe-time distributed real-time monitoring of cKNN in mobile peer-to-peer networksrdquo inProceedings of the 9th IEEE International Conference on MobileData Management (MDM rsquo08) pp 124ndash131 April 2008

[6] M Kolahdouzan and C Shahabi ldquoVoronoi-based k nearest nei-ghbor search for spatial network databasesrdquo in Proceedings ofthe 30th International Conference on Very Large Data Bases vol30 pp 840ndash851 2004

[7] M R Kolahdouzan and C Shahabi ldquoAlternative solutions forcontinuous K nearest neighbor queries in spatial networkdatabasesrdquo GeoInformatica vol 9 no 4 pp 321ndash341 2005

[8] D Papadias Y Tao K Mouratidis and C K Hui ldquoAggregatenearest neighbor queries in spatial databasesrdquo ACM Transac-tions on Database Systems vol 30 no 2 pp 529ndash576 2005

[9] T Imielinski S Viswanathan and B R Badrinath ldquoData on airorganization and accessrdquo IEEE Transactions on Knowledge andData Engineering vol 9 no 3 pp 353ndash372 1997

[10] S Hambrusch C-M Liu and S Prabhakar ldquoBroadcasting andquerying multi-dimensional index trees in a multi-channelenvironmentrdquo Information Systems vol 31 no 8 pp 870ndash8862006

[11] C-M Liu and K-F Lin ldquoDisseminating dependent data inwireless broadcast environmentsrdquo Distributed and ParallelDatabases vol 22 no 1 pp 1ndash25 2007

[12] T-C Su and C-M Liu ldquoOn-demand data broadcasting for dataitems with time constraints on multiple broadcast channelsrdquo inDatabase Systems for Advanced Applications vol 6193 of LectureNotes in Computer Science pp 458ndash469 2010

[13] B Zheng J Xu W-C Lee and D L Lee ldquoGrid-partition ind-ex a hybrid method for nearest-neighbor queries in wirelesslocation-based servicesrdquo The VLDB Journal vol 15 no 1 pp21ndash39 2006

[14] B Gedik A Singh and L Liu ldquoEnergy efficient exact kNN sear-ch in wireless broadcast environmentsrdquo in Proceedings of the12th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo04) pp 137ndash146 November 2004

[15] KMouratidis S Bakiras and D Papadias ldquoContinuousmonit-oring of spatial queries in wireless broadcast environmentsrdquoIEEE Transactions onMobile Computing vol 8 no 10 pp 1297ndash1311 2009

[16] G Chatzimilioudis D Zeinalipour-Yazti W-C Lee and M DDikaiakos ldquoContinuous all k-nearest-neighbor querying insmartphone networksrdquo in Proceedings of the 13th IEEE Interna-tional Conference on Mobile Data Management (MDM rsquo12) pp79ndash88 2012

[17] T-Y Fu W-C Peng and W-C Lee ldquoParallelizing itinerary-basedKNNquery processing inwireless sensor networksrdquo IEEETransactions on Knowledge and Data Engineering vol 22 no 5pp 711ndash729 2010

[18] T P Nghiem A B Waluyo and D Taniar ldquoA pure peer-to-peerapproach for kNNquery processing inmobile ad hoc networksrdquo

20 International Journal of Distributed Sensor Networks

Personal and Ubiquitous Computing vol 17 no 5 pp 973ndash9852013

[19] HD Chon D Agrawal andA El Abbadi ldquoRange and kNNqu-ery processing for moving objects in Grid modelrdquo MobileNetworks and Applications vol 8 no 4 pp 401ndash412 2003

[20] X Xiong M F Mokbel and W G Aref ldquoSEA-CNN scalableprocessing of continuous K-nearest neighbor queries in spatio-temporal databasesrdquo in Proceedings of the 21st InternationalConference on Data Engineering (ICDE rsquo05) pp 643ndash654 April2005

[21] G Zhao K XuanW Rahayu et al ldquoVoronoi-based continuous120581 nearest neighbor search in mobile navigationrdquo IEEE Transac-tions on Industrial Electronics vol 58 no 6 pp 2247ndash2257 2011

[22] KMouratidis D Papadias S Bakiras and Y Tao ldquoA threshold-based algorithm for continuous monitoring of k nearest neigh-borsrdquo IEEE Transactions on Knowledge and Data Engineeringvol 17 no 11 pp 1451ndash1464 2005

[23] S-H Wu K-T Chuang C-M Chen and M-S Chen ldquoDIK-NN an itinerary-based KNN query processing algorithm formobile sensor networksrdquo inProceedings of the 23rd InternationalConference on Data Engineering (ICDE rsquo07) pp 456ndash465 April2007

[24] D T Lee ldquoOn k-nearest neighbor voronoi diagrams in the pla-nerdquo IEEE Transactions on Computers vol 31 no 6 pp 478ndash4871982

[25] K Patroumpas TMinogiannis andT Sellis ldquoApproximate ord-er-k Voronoi cells over positional streamsrdquo in Proceedings of the15th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo07) pp 276ndash283 November 2007

International Journal of

AerospaceEngineeringHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

RoboticsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Active and Passive Electronic Components

Control Scienceand Engineering

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

RotatingMachinery

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

Journal ofEngineeringVolume 2014

Submit your manuscripts athttpwwwhindawicom

VLSI Design

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Shock and Vibration

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawi Publishing Corporation httpwwwhindawicom

Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

SensorsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Navigation and Observation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

DistributedSensor Networks

International Journal of

Page 15: Research Article Distributed Continuous k Nearest Neighbors ...downloads.hindawi.com/journals/ijdsn/2013/125145.pdfmobile environments like WSNs, which consist of a number of mobile

International Journal of Distributed Sensor Networks 15

10 20 30 40 50 60 700

5

10

15

20

25

30

35

40

45

Number of objects

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

10 20 30 40 50 60 70100

150

200

250

300

350

400

450

Number of objects

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

10 20 30 40 50 60 7080

85

90

95

100

105

Number of objects

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

10 20 30 40 50 60 70Number of objects

Aver

age r

espo

nse t

ime (

s)

096

098

1

102

104

106

108

11

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 15 The effects of the number of objects on (a) update frequency (b) number of messages (c) accuracy and (d) response time

When the area becomes larger the density becomeslower So the number of objects in each objectrsquos transmissionrange is fewer Under such a circumstance DC119896NN usesless computation and the response time is shorter as shownin Figure 13(d) In contrast the Safe-time(S) and the Safe-time(M) need to collect information before performing eachnew query and cause longer response time Since Safe-time(M) and Safe-time(S) use the same method and proce-dure to handle the first query the response time of these twomethods will be almost the same

62 Effects of Grid Size In this simulation experiment setwe want to observe the update efficiency of each object inthe third phase of DC119896NN Recall that we consider the grid-based and VD-base safe distances to derive a proper safe-time In this experiment DC119896NN(G) uses grid-based safe

distance to determine the safe time for the next update andDC119896NN(V) uses VD-base safe distance to derive the safetime The sensing area is fixed to 600lowast600m2 and there are30 data objects We compare DC119896NN(V) with DC119896NN(G)by observing the impacts of different grid sizes All theother settings have the similar trends in our experimentalresults In Figure 14(a) the update frequency of the objectsin DC119896NN(G) is high when the grid size is 50lowast50m2 andbecomes less when the grid size decreases Since the sensingarea is 600lowast600m2 and 30 objects are given the averagedistance between an object and the boundary of a Voronoicell is about 25 to 50 meters With the setting of grid size50lowast50m2 the average distance obtained in DC119896NN(G) isabout 25 meters Thus the safe time of DC119896NN(V) is longerIn general as Figures 14(a) and 14(b) show the update

16 International Journal of Distributed Sensor Networks

1 3 5 10 200

10

20

30

40

50

60

k

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

1 3 5 10 200

100

200

300

400

500

600

700

800

k

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

1 3 5 10 2080

85

90

95

100

105

k

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

1 3 5 10 20k

Aver

age r

espo

nse t

ime (

s)

08

09

1

11

12

13

14

15

16

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 16 The impacts of different values of 119896 on (a) update frequency (b) number of messages (c) accuracy and (d) response time

frequency of the objects and the number of messages sentby the objects decrease as the grid size increases

When the grid size is large the safe time becomes longand less number of updates are issued Hence the resultsbecome more inaccurate As shown in Figure 14(c) whenthe grid sizes are 50lowast50m2 75lowast75m2 100lowast100m2 and150lowast150m2 the corresponding accuracies are 95 9285 and 78 respectively While the grid size increases to200lowast200m2 the accuracy is significantly reduced to 69and the right answer thus can not be guaranteed On theother hand Figure 14(d) shows that the response times ofDC119896NN(G) and DC119896NN(V) are not much different becausethe size of grid is not the major factor to influence thecomplexity of obtaining information for the first query

63 Number of Objects In this subsection we discuss theresults as the number of data objects varies The area in thepresented experiment set is 600lowast600 (m2) with grid size of50lowast50 (m2) As shown in Figure 15(a) when the number ofobjects increases the number of updates in DC119896NN is stillrelatively less than the ones in Safe-time(S) and Safe-time(M)If the number of objects increases the number of repliedmessages per second to the central server in naıve will growdramatically With 20 to 60 objects the number of repliedmessages to the server is from 1200 to 3600 (packetsmin)By observing the results in Figures 15(b) and 15(c) as moreobjects are in the area the number of messages increasesfor the other three methods and the accuracy reduces inSafe-time(S) These match the trends for different areas we

International Journal of Distributed Sensor Networks 17

20 40 60 80 1000

5

10

15

20

25

30

35

40

45

Moving objects ()

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

20 40 60 80 1000

100

200

300

400

500

600

Moving objects ()

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

20 40 60 80 100

80

70

75

85

90

95

100

105

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

Moving objects ()

(c) Accuracy

20 40 60 80 100

Aver

age r

espo

nse t

ime (

s)

09

095

1

11

105

115

12

125

13

DCkNNSafe-time(S)Safe-time(M)

Moving objects ()

(d) Response time

Figure 17 The effects of the moving objects on (a) update frequency (b) number of messages (c) accuracy and (d) response time

discussed earlier due to the density Similarly the responsetime can be expected as shown in Figure 15(d) where theresponse time of DC119896NN is still the shortest

64 Different Values of 119896 It is obvious that the value of119896 affects the performance of query processing significantlyWhen the value of 119896 becomes larger the number of relatedobjects required to be checked also increases In other wordswe need to spend more cost to find out which 119896 objectsare currently in the result for the C119896NN query Thereforethe changes in the value of 119896 mainly affect the amountof data required for the first query and the update costfor maintaining the 119896th and the (119896 + 1)th objects So inFigure 16(a) when the value of 119896 is large more updates arenecessary for all the three methods As Figure 16(b) shows

the influence on the number of transmitted messages inSafe-time(M) is more serious than the one in Safe-time(S)Due to the mobility the number of influenced objects inSafe-time(M) will increase as the value of 119896 increases Inparticular the update frequency in Safe-time(M) becomesnearly twofold the update frequency in Safe-time(S)

Figure 16(c) presents the impact on the accuracy fordifferent values of 119896 With a larger value of 119896 an object inSafe-time(S) will have a higher chance to derive the incorrectsafe time thus causing lower accuracy When the value of 119896increases the response time of all threemethods will increasesignificantly as shown in Figure 16(d) The reason is thatall DC119896NN Safe-time(S) and Safe-time(M) need to searchmore objects and collect more information for answering thequery when the value of 119896 increases to a certain number For

18 International Journal of Distributed Sensor Networks

2 4 6 8 100

10

20

30

40

50

60

Speed (ms)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

2 4 6 8 100

100

200

300

400

500

600

700

800

Speed (ms)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

2 4 6 8 1070

75

80

85

90

95

100

105

Speed (ms)

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

2 4 6 8 1009

095

1

105

11

115

12

125

13

Speed (ms)

Aver

age r

espo

nse t

ime (

s)

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 18 The impacts of speed on (a) update frequency (b) number of messages (c) accuracy and (d) response time

DC119896NN DC119896NN only needs to store local Voronoi diagramwhere the information required is less than required in Safe-time(S) and Safe-time(M) so the response time of DC119896NN isthe shortest

65 The Effect of Moving Objects In this experiment set weconsider different percentages of moving objects in all thedata objects The default value is 20 which means that ifthere is a total of 30 objects then there are sixmoving objectsIn Figures 17(a) and 17(b) as the percentage ofmoving objectsincreases the overall number of updates required between theobjects increases relatively and the change rate of answer totheDC119896NNaccelerates thus increasing the update frequencyof the query and the number of messages However DC119896NNstill keeps the best performance Figure 17(c) shows the accu-racy of the result for different percentage of moving objectsDC119896NN and Safe-time(M) both have higher accuracy and

Safe-time(S) is still the worst The safe time of each object inSafe-time(S) is calculated using the maximum speed of theobjects Hence whether the object is moving or not does notdirectly result in the incorrectness of the answer collectionIn fact in Safe-time(S) one of the main reasons to affectthe accuracy is the directions of moving objects Last asFigure 17(d) shows the percentage of moving objects doesnot impact the response time too much

66 Effects of Speed If each object moves faster the relativevelocities between objects may also become faster This willmake the safe time shorter and the update frequency ofeach object and query increases The safe time used inSafe-time(S) and Safe-time(M) is directly affected by themaximum speed of objects and does not consider the direc-tion of each objectrsquos movement and the speed of individualmovement No matter the objects move or not and move

International Journal of Distributed Sensor Networks 19

fast or slow both of the above methods directly use themaximum speed of objects to calculate the safe time forupdating On the other hand DC119896NN considers the movingdirection of objects and the proper safe-time for updatesIn this experiment the number of moving objects is 20of all the objects As Figure 18(a) shows as the movingobjects speed up the update cost increases and DC119896NN stillperforms best As the speed increases the safe-time in Safe-time(S) and the Safe-time(M) becomes much shorter due toa larger maximum speed among all the objects The trendbecomes even worse as the speed increases

Figure 18(b) shows the trend about the number of trans-mitted messages when the speed is up DC119896NN still hasthe best performance on the number of messages There are42781 messages sent in average when the speed of object is10ms However the Safe-time(M) needs 67913 messagesThe accuracy will not be effected as the speed changesfor DC119896NN and Safe-time(M) because both of them aredesigned or adapted for themoving objects and queries Safe-time(S) will have more inaccurate results as the speed is highas shown in Figure 18(c) However the response time doesnot have a significant impact on the response time for all thethree methods Figure 18(d) presents this trend

7 Conclusions

In this paper we propose a new approach DC119896NN whichuses the local Voronoi diagram and proper safe-time toeffectively process the C119896NNquery in distributed andmobileenvironments such as wireless sensor networks The propersafe-time can be quickly derived by a simple formulaBy comparing our proposed DC119896NN with other existingapproaches Safe-time(S) DC119896NN can effectively improvesearch efficiency reduce response time and the numberof messages and keep the accuracy of the result highAdditionally DC119896NN reduces more 30 of transmissionmessages than Safe-time(M) because the characteristics of theVoronoi diagram are used and each objectrsquos moving directionis considered instead of directly using the maximum speedof the objects as Safe-time method The derived safe-timeis more precise As a result DC119896NN needs less updatefrequency reduces a great number of messages transmittedand yields more accurate results In this work simulationexperiments are also performed The experimental resultsvalidate the proposed DC119896NN approach for the continuous119896 nearest neighbor query in distributed and mobile environ-ments where all the data objects and query can move

Acknowledgment

This work is partially supported by NSC under the Grant98-2220-E-027-007 100-2221-E-027-087-MY2 and 102-2221-E-027-088-

References

[1] O Bohl S Manouchehri and U Winand ldquoMobile informationsystems for the private everyday liferdquo Mobile InformationSystems vol 3 no 3-4 pp 135ndash152 2007

[2] Y Tao andD Papadias ldquoTime-parameterized queries in spatio-temporal databasesrdquo in Proceedings of the ACM SIGMODInternational Conference on Managment of Data pp 334ndash345June 2002

[3] Y Tao D Papadias and Q Shen ldquoContinuous nearest neighborsearchrdquo in Proceedings of the 28th International Conference onVery Large Data Bases (VLDB rsquo02) pp 287ndash298 2002

[4] F Aurenhammer ldquoVoronoi diagramsmdasha survey of a fundamen-tal geometric data structurerdquo ACM Computing Surveys vol 23no 3 pp 345ndash405 1991

[5] K Kim Y Cai andW Tavanapong ldquoSafe-time distributed real-time monitoring of cKNN in mobile peer-to-peer networksrdquo inProceedings of the 9th IEEE International Conference on MobileData Management (MDM rsquo08) pp 124ndash131 April 2008

[6] M Kolahdouzan and C Shahabi ldquoVoronoi-based k nearest nei-ghbor search for spatial network databasesrdquo in Proceedings ofthe 30th International Conference on Very Large Data Bases vol30 pp 840ndash851 2004

[7] M R Kolahdouzan and C Shahabi ldquoAlternative solutions forcontinuous K nearest neighbor queries in spatial networkdatabasesrdquo GeoInformatica vol 9 no 4 pp 321ndash341 2005

[8] D Papadias Y Tao K Mouratidis and C K Hui ldquoAggregatenearest neighbor queries in spatial databasesrdquo ACM Transac-tions on Database Systems vol 30 no 2 pp 529ndash576 2005

[9] T Imielinski S Viswanathan and B R Badrinath ldquoData on airorganization and accessrdquo IEEE Transactions on Knowledge andData Engineering vol 9 no 3 pp 353ndash372 1997

[10] S Hambrusch C-M Liu and S Prabhakar ldquoBroadcasting andquerying multi-dimensional index trees in a multi-channelenvironmentrdquo Information Systems vol 31 no 8 pp 870ndash8862006

[11] C-M Liu and K-F Lin ldquoDisseminating dependent data inwireless broadcast environmentsrdquo Distributed and ParallelDatabases vol 22 no 1 pp 1ndash25 2007

[12] T-C Su and C-M Liu ldquoOn-demand data broadcasting for dataitems with time constraints on multiple broadcast channelsrdquo inDatabase Systems for Advanced Applications vol 6193 of LectureNotes in Computer Science pp 458ndash469 2010

[13] B Zheng J Xu W-C Lee and D L Lee ldquoGrid-partition ind-ex a hybrid method for nearest-neighbor queries in wirelesslocation-based servicesrdquo The VLDB Journal vol 15 no 1 pp21ndash39 2006

[14] B Gedik A Singh and L Liu ldquoEnergy efficient exact kNN sear-ch in wireless broadcast environmentsrdquo in Proceedings of the12th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo04) pp 137ndash146 November 2004

[15] KMouratidis S Bakiras and D Papadias ldquoContinuousmonit-oring of spatial queries in wireless broadcast environmentsrdquoIEEE Transactions onMobile Computing vol 8 no 10 pp 1297ndash1311 2009

[16] G Chatzimilioudis D Zeinalipour-Yazti W-C Lee and M DDikaiakos ldquoContinuous all k-nearest-neighbor querying insmartphone networksrdquo in Proceedings of the 13th IEEE Interna-tional Conference on Mobile Data Management (MDM rsquo12) pp79ndash88 2012

[17] T-Y Fu W-C Peng and W-C Lee ldquoParallelizing itinerary-basedKNNquery processing inwireless sensor networksrdquo IEEETransactions on Knowledge and Data Engineering vol 22 no 5pp 711ndash729 2010

[18] T P Nghiem A B Waluyo and D Taniar ldquoA pure peer-to-peerapproach for kNNquery processing inmobile ad hoc networksrdquo

20 International Journal of Distributed Sensor Networks

Personal and Ubiquitous Computing vol 17 no 5 pp 973ndash9852013

[19] HD Chon D Agrawal andA El Abbadi ldquoRange and kNNqu-ery processing for moving objects in Grid modelrdquo MobileNetworks and Applications vol 8 no 4 pp 401ndash412 2003

[20] X Xiong M F Mokbel and W G Aref ldquoSEA-CNN scalableprocessing of continuous K-nearest neighbor queries in spatio-temporal databasesrdquo in Proceedings of the 21st InternationalConference on Data Engineering (ICDE rsquo05) pp 643ndash654 April2005

[21] G Zhao K XuanW Rahayu et al ldquoVoronoi-based continuous120581 nearest neighbor search in mobile navigationrdquo IEEE Transac-tions on Industrial Electronics vol 58 no 6 pp 2247ndash2257 2011

[22] KMouratidis D Papadias S Bakiras and Y Tao ldquoA threshold-based algorithm for continuous monitoring of k nearest neigh-borsrdquo IEEE Transactions on Knowledge and Data Engineeringvol 17 no 11 pp 1451ndash1464 2005

[23] S-H Wu K-T Chuang C-M Chen and M-S Chen ldquoDIK-NN an itinerary-based KNN query processing algorithm formobile sensor networksrdquo inProceedings of the 23rd InternationalConference on Data Engineering (ICDE rsquo07) pp 456ndash465 April2007

[24] D T Lee ldquoOn k-nearest neighbor voronoi diagrams in the pla-nerdquo IEEE Transactions on Computers vol 31 no 6 pp 478ndash4871982

[25] K Patroumpas TMinogiannis andT Sellis ldquoApproximate ord-er-k Voronoi cells over positional streamsrdquo in Proceedings of the15th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo07) pp 276ndash283 November 2007

International Journal of

AerospaceEngineeringHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

RoboticsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Active and Passive Electronic Components

Control Scienceand Engineering

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

RotatingMachinery

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

Journal ofEngineeringVolume 2014

Submit your manuscripts athttpwwwhindawicom

VLSI Design

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Shock and Vibration

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawi Publishing Corporation httpwwwhindawicom

Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

SensorsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Navigation and Observation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

DistributedSensor Networks

International Journal of

Page 16: Research Article Distributed Continuous k Nearest Neighbors ...downloads.hindawi.com/journals/ijdsn/2013/125145.pdfmobile environments like WSNs, which consist of a number of mobile

16 International Journal of Distributed Sensor Networks

1 3 5 10 200

10

20

30

40

50

60

k

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

1 3 5 10 200

100

200

300

400

500

600

700

800

k

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

1 3 5 10 2080

85

90

95

100

105

k

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

1 3 5 10 20k

Aver

age r

espo

nse t

ime (

s)

08

09

1

11

12

13

14

15

16

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 16 The impacts of different values of 119896 on (a) update frequency (b) number of messages (c) accuracy and (d) response time

frequency of the objects and the number of messages sentby the objects decrease as the grid size increases

When the grid size is large the safe time becomes longand less number of updates are issued Hence the resultsbecome more inaccurate As shown in Figure 14(c) whenthe grid sizes are 50lowast50m2 75lowast75m2 100lowast100m2 and150lowast150m2 the corresponding accuracies are 95 9285 and 78 respectively While the grid size increases to200lowast200m2 the accuracy is significantly reduced to 69and the right answer thus can not be guaranteed On theother hand Figure 14(d) shows that the response times ofDC119896NN(G) and DC119896NN(V) are not much different becausethe size of grid is not the major factor to influence thecomplexity of obtaining information for the first query

63 Number of Objects In this subsection we discuss theresults as the number of data objects varies The area in thepresented experiment set is 600lowast600 (m2) with grid size of50lowast50 (m2) As shown in Figure 15(a) when the number ofobjects increases the number of updates in DC119896NN is stillrelatively less than the ones in Safe-time(S) and Safe-time(M)If the number of objects increases the number of repliedmessages per second to the central server in naıve will growdramatically With 20 to 60 objects the number of repliedmessages to the server is from 1200 to 3600 (packetsmin)By observing the results in Figures 15(b) and 15(c) as moreobjects are in the area the number of messages increasesfor the other three methods and the accuracy reduces inSafe-time(S) These match the trends for different areas we

International Journal of Distributed Sensor Networks 17

20 40 60 80 1000

5

10

15

20

25

30

35

40

45

Moving objects ()

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

20 40 60 80 1000

100

200

300

400

500

600

Moving objects ()

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

20 40 60 80 100

80

70

75

85

90

95

100

105

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

Moving objects ()

(c) Accuracy

20 40 60 80 100

Aver

age r

espo

nse t

ime (

s)

09

095

1

11

105

115

12

125

13

DCkNNSafe-time(S)Safe-time(M)

Moving objects ()

(d) Response time

Figure 17 The effects of the moving objects on (a) update frequency (b) number of messages (c) accuracy and (d) response time

discussed earlier due to the density Similarly the responsetime can be expected as shown in Figure 15(d) where theresponse time of DC119896NN is still the shortest

64 Different Values of 119896 It is obvious that the value of119896 affects the performance of query processing significantlyWhen the value of 119896 becomes larger the number of relatedobjects required to be checked also increases In other wordswe need to spend more cost to find out which 119896 objectsare currently in the result for the C119896NN query Thereforethe changes in the value of 119896 mainly affect the amountof data required for the first query and the update costfor maintaining the 119896th and the (119896 + 1)th objects So inFigure 16(a) when the value of 119896 is large more updates arenecessary for all the three methods As Figure 16(b) shows

the influence on the number of transmitted messages inSafe-time(M) is more serious than the one in Safe-time(S)Due to the mobility the number of influenced objects inSafe-time(M) will increase as the value of 119896 increases Inparticular the update frequency in Safe-time(M) becomesnearly twofold the update frequency in Safe-time(S)

Figure 16(c) presents the impact on the accuracy fordifferent values of 119896 With a larger value of 119896 an object inSafe-time(S) will have a higher chance to derive the incorrectsafe time thus causing lower accuracy When the value of 119896increases the response time of all threemethods will increasesignificantly as shown in Figure 16(d) The reason is thatall DC119896NN Safe-time(S) and Safe-time(M) need to searchmore objects and collect more information for answering thequery when the value of 119896 increases to a certain number For

18 International Journal of Distributed Sensor Networks

2 4 6 8 100

10

20

30

40

50

60

Speed (ms)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

2 4 6 8 100

100

200

300

400

500

600

700

800

Speed (ms)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

2 4 6 8 1070

75

80

85

90

95

100

105

Speed (ms)

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

2 4 6 8 1009

095

1

105

11

115

12

125

13

Speed (ms)

Aver

age r

espo

nse t

ime (

s)

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 18 The impacts of speed on (a) update frequency (b) number of messages (c) accuracy and (d) response time

DC119896NN DC119896NN only needs to store local Voronoi diagramwhere the information required is less than required in Safe-time(S) and Safe-time(M) so the response time of DC119896NN isthe shortest

65 The Effect of Moving Objects In this experiment set weconsider different percentages of moving objects in all thedata objects The default value is 20 which means that ifthere is a total of 30 objects then there are sixmoving objectsIn Figures 17(a) and 17(b) as the percentage ofmoving objectsincreases the overall number of updates required between theobjects increases relatively and the change rate of answer totheDC119896NNaccelerates thus increasing the update frequencyof the query and the number of messages However DC119896NNstill keeps the best performance Figure 17(c) shows the accu-racy of the result for different percentage of moving objectsDC119896NN and Safe-time(M) both have higher accuracy and

Safe-time(S) is still the worst The safe time of each object inSafe-time(S) is calculated using the maximum speed of theobjects Hence whether the object is moving or not does notdirectly result in the incorrectness of the answer collectionIn fact in Safe-time(S) one of the main reasons to affectthe accuracy is the directions of moving objects Last asFigure 17(d) shows the percentage of moving objects doesnot impact the response time too much

66 Effects of Speed If each object moves faster the relativevelocities between objects may also become faster This willmake the safe time shorter and the update frequency ofeach object and query increases The safe time used inSafe-time(S) and Safe-time(M) is directly affected by themaximum speed of objects and does not consider the direc-tion of each objectrsquos movement and the speed of individualmovement No matter the objects move or not and move

International Journal of Distributed Sensor Networks 19

fast or slow both of the above methods directly use themaximum speed of objects to calculate the safe time forupdating On the other hand DC119896NN considers the movingdirection of objects and the proper safe-time for updatesIn this experiment the number of moving objects is 20of all the objects As Figure 18(a) shows as the movingobjects speed up the update cost increases and DC119896NN stillperforms best As the speed increases the safe-time in Safe-time(S) and the Safe-time(M) becomes much shorter due toa larger maximum speed among all the objects The trendbecomes even worse as the speed increases

Figure 18(b) shows the trend about the number of trans-mitted messages when the speed is up DC119896NN still hasthe best performance on the number of messages There are42781 messages sent in average when the speed of object is10ms However the Safe-time(M) needs 67913 messagesThe accuracy will not be effected as the speed changesfor DC119896NN and Safe-time(M) because both of them aredesigned or adapted for themoving objects and queries Safe-time(S) will have more inaccurate results as the speed is highas shown in Figure 18(c) However the response time doesnot have a significant impact on the response time for all thethree methods Figure 18(d) presents this trend

7 Conclusions

In this paper we propose a new approach DC119896NN whichuses the local Voronoi diagram and proper safe-time toeffectively process the C119896NNquery in distributed andmobileenvironments such as wireless sensor networks The propersafe-time can be quickly derived by a simple formulaBy comparing our proposed DC119896NN with other existingapproaches Safe-time(S) DC119896NN can effectively improvesearch efficiency reduce response time and the numberof messages and keep the accuracy of the result highAdditionally DC119896NN reduces more 30 of transmissionmessages than Safe-time(M) because the characteristics of theVoronoi diagram are used and each objectrsquos moving directionis considered instead of directly using the maximum speedof the objects as Safe-time method The derived safe-timeis more precise As a result DC119896NN needs less updatefrequency reduces a great number of messages transmittedand yields more accurate results In this work simulationexperiments are also performed The experimental resultsvalidate the proposed DC119896NN approach for the continuous119896 nearest neighbor query in distributed and mobile environ-ments where all the data objects and query can move

Acknowledgment

This work is partially supported by NSC under the Grant98-2220-E-027-007 100-2221-E-027-087-MY2 and 102-2221-E-027-088-

References

[1] O Bohl S Manouchehri and U Winand ldquoMobile informationsystems for the private everyday liferdquo Mobile InformationSystems vol 3 no 3-4 pp 135ndash152 2007

[2] Y Tao andD Papadias ldquoTime-parameterized queries in spatio-temporal databasesrdquo in Proceedings of the ACM SIGMODInternational Conference on Managment of Data pp 334ndash345June 2002

[3] Y Tao D Papadias and Q Shen ldquoContinuous nearest neighborsearchrdquo in Proceedings of the 28th International Conference onVery Large Data Bases (VLDB rsquo02) pp 287ndash298 2002

[4] F Aurenhammer ldquoVoronoi diagramsmdasha survey of a fundamen-tal geometric data structurerdquo ACM Computing Surveys vol 23no 3 pp 345ndash405 1991

[5] K Kim Y Cai andW Tavanapong ldquoSafe-time distributed real-time monitoring of cKNN in mobile peer-to-peer networksrdquo inProceedings of the 9th IEEE International Conference on MobileData Management (MDM rsquo08) pp 124ndash131 April 2008

[6] M Kolahdouzan and C Shahabi ldquoVoronoi-based k nearest nei-ghbor search for spatial network databasesrdquo in Proceedings ofthe 30th International Conference on Very Large Data Bases vol30 pp 840ndash851 2004

[7] M R Kolahdouzan and C Shahabi ldquoAlternative solutions forcontinuous K nearest neighbor queries in spatial networkdatabasesrdquo GeoInformatica vol 9 no 4 pp 321ndash341 2005

[8] D Papadias Y Tao K Mouratidis and C K Hui ldquoAggregatenearest neighbor queries in spatial databasesrdquo ACM Transac-tions on Database Systems vol 30 no 2 pp 529ndash576 2005

[9] T Imielinski S Viswanathan and B R Badrinath ldquoData on airorganization and accessrdquo IEEE Transactions on Knowledge andData Engineering vol 9 no 3 pp 353ndash372 1997

[10] S Hambrusch C-M Liu and S Prabhakar ldquoBroadcasting andquerying multi-dimensional index trees in a multi-channelenvironmentrdquo Information Systems vol 31 no 8 pp 870ndash8862006

[11] C-M Liu and K-F Lin ldquoDisseminating dependent data inwireless broadcast environmentsrdquo Distributed and ParallelDatabases vol 22 no 1 pp 1ndash25 2007

[12] T-C Su and C-M Liu ldquoOn-demand data broadcasting for dataitems with time constraints on multiple broadcast channelsrdquo inDatabase Systems for Advanced Applications vol 6193 of LectureNotes in Computer Science pp 458ndash469 2010

[13] B Zheng J Xu W-C Lee and D L Lee ldquoGrid-partition ind-ex a hybrid method for nearest-neighbor queries in wirelesslocation-based servicesrdquo The VLDB Journal vol 15 no 1 pp21ndash39 2006

[14] B Gedik A Singh and L Liu ldquoEnergy efficient exact kNN sear-ch in wireless broadcast environmentsrdquo in Proceedings of the12th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo04) pp 137ndash146 November 2004

[15] KMouratidis S Bakiras and D Papadias ldquoContinuousmonit-oring of spatial queries in wireless broadcast environmentsrdquoIEEE Transactions onMobile Computing vol 8 no 10 pp 1297ndash1311 2009

[16] G Chatzimilioudis D Zeinalipour-Yazti W-C Lee and M DDikaiakos ldquoContinuous all k-nearest-neighbor querying insmartphone networksrdquo in Proceedings of the 13th IEEE Interna-tional Conference on Mobile Data Management (MDM rsquo12) pp79ndash88 2012

[17] T-Y Fu W-C Peng and W-C Lee ldquoParallelizing itinerary-basedKNNquery processing inwireless sensor networksrdquo IEEETransactions on Knowledge and Data Engineering vol 22 no 5pp 711ndash729 2010

[18] T P Nghiem A B Waluyo and D Taniar ldquoA pure peer-to-peerapproach for kNNquery processing inmobile ad hoc networksrdquo

20 International Journal of Distributed Sensor Networks

Personal and Ubiquitous Computing vol 17 no 5 pp 973ndash9852013

[19] HD Chon D Agrawal andA El Abbadi ldquoRange and kNNqu-ery processing for moving objects in Grid modelrdquo MobileNetworks and Applications vol 8 no 4 pp 401ndash412 2003

[20] X Xiong M F Mokbel and W G Aref ldquoSEA-CNN scalableprocessing of continuous K-nearest neighbor queries in spatio-temporal databasesrdquo in Proceedings of the 21st InternationalConference on Data Engineering (ICDE rsquo05) pp 643ndash654 April2005

[21] G Zhao K XuanW Rahayu et al ldquoVoronoi-based continuous120581 nearest neighbor search in mobile navigationrdquo IEEE Transac-tions on Industrial Electronics vol 58 no 6 pp 2247ndash2257 2011

[22] KMouratidis D Papadias S Bakiras and Y Tao ldquoA threshold-based algorithm for continuous monitoring of k nearest neigh-borsrdquo IEEE Transactions on Knowledge and Data Engineeringvol 17 no 11 pp 1451ndash1464 2005

[23] S-H Wu K-T Chuang C-M Chen and M-S Chen ldquoDIK-NN an itinerary-based KNN query processing algorithm formobile sensor networksrdquo inProceedings of the 23rd InternationalConference on Data Engineering (ICDE rsquo07) pp 456ndash465 April2007

[24] D T Lee ldquoOn k-nearest neighbor voronoi diagrams in the pla-nerdquo IEEE Transactions on Computers vol 31 no 6 pp 478ndash4871982

[25] K Patroumpas TMinogiannis andT Sellis ldquoApproximate ord-er-k Voronoi cells over positional streamsrdquo in Proceedings of the15th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo07) pp 276ndash283 November 2007

International Journal of

AerospaceEngineeringHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

RoboticsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Active and Passive Electronic Components

Control Scienceand Engineering

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

RotatingMachinery

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

Journal ofEngineeringVolume 2014

Submit your manuscripts athttpwwwhindawicom

VLSI Design

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Shock and Vibration

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawi Publishing Corporation httpwwwhindawicom

Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

SensorsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Navigation and Observation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

DistributedSensor Networks

International Journal of

Page 17: Research Article Distributed Continuous k Nearest Neighbors ...downloads.hindawi.com/journals/ijdsn/2013/125145.pdfmobile environments like WSNs, which consist of a number of mobile

International Journal of Distributed Sensor Networks 17

20 40 60 80 1000

5

10

15

20

25

30

35

40

45

Moving objects ()

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

20 40 60 80 1000

100

200

300

400

500

600

Moving objects ()

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

20 40 60 80 100

80

70

75

85

90

95

100

105

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

Moving objects ()

(c) Accuracy

20 40 60 80 100

Aver

age r

espo

nse t

ime (

s)

09

095

1

11

105

115

12

125

13

DCkNNSafe-time(S)Safe-time(M)

Moving objects ()

(d) Response time

Figure 17 The effects of the moving objects on (a) update frequency (b) number of messages (c) accuracy and (d) response time

discussed earlier due to the density Similarly the responsetime can be expected as shown in Figure 15(d) where theresponse time of DC119896NN is still the shortest

64 Different Values of 119896 It is obvious that the value of119896 affects the performance of query processing significantlyWhen the value of 119896 becomes larger the number of relatedobjects required to be checked also increases In other wordswe need to spend more cost to find out which 119896 objectsare currently in the result for the C119896NN query Thereforethe changes in the value of 119896 mainly affect the amountof data required for the first query and the update costfor maintaining the 119896th and the (119896 + 1)th objects So inFigure 16(a) when the value of 119896 is large more updates arenecessary for all the three methods As Figure 16(b) shows

the influence on the number of transmitted messages inSafe-time(M) is more serious than the one in Safe-time(S)Due to the mobility the number of influenced objects inSafe-time(M) will increase as the value of 119896 increases Inparticular the update frequency in Safe-time(M) becomesnearly twofold the update frequency in Safe-time(S)

Figure 16(c) presents the impact on the accuracy fordifferent values of 119896 With a larger value of 119896 an object inSafe-time(S) will have a higher chance to derive the incorrectsafe time thus causing lower accuracy When the value of 119896increases the response time of all threemethods will increasesignificantly as shown in Figure 16(d) The reason is thatall DC119896NN Safe-time(S) and Safe-time(M) need to searchmore objects and collect more information for answering thequery when the value of 119896 increases to a certain number For

18 International Journal of Distributed Sensor Networks

2 4 6 8 100

10

20

30

40

50

60

Speed (ms)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

2 4 6 8 100

100

200

300

400

500

600

700

800

Speed (ms)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

2 4 6 8 1070

75

80

85

90

95

100

105

Speed (ms)

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

2 4 6 8 1009

095

1

105

11

115

12

125

13

Speed (ms)

Aver

age r

espo

nse t

ime (

s)

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 18 The impacts of speed on (a) update frequency (b) number of messages (c) accuracy and (d) response time

DC119896NN DC119896NN only needs to store local Voronoi diagramwhere the information required is less than required in Safe-time(S) and Safe-time(M) so the response time of DC119896NN isthe shortest

65 The Effect of Moving Objects In this experiment set weconsider different percentages of moving objects in all thedata objects The default value is 20 which means that ifthere is a total of 30 objects then there are sixmoving objectsIn Figures 17(a) and 17(b) as the percentage ofmoving objectsincreases the overall number of updates required between theobjects increases relatively and the change rate of answer totheDC119896NNaccelerates thus increasing the update frequencyof the query and the number of messages However DC119896NNstill keeps the best performance Figure 17(c) shows the accu-racy of the result for different percentage of moving objectsDC119896NN and Safe-time(M) both have higher accuracy and

Safe-time(S) is still the worst The safe time of each object inSafe-time(S) is calculated using the maximum speed of theobjects Hence whether the object is moving or not does notdirectly result in the incorrectness of the answer collectionIn fact in Safe-time(S) one of the main reasons to affectthe accuracy is the directions of moving objects Last asFigure 17(d) shows the percentage of moving objects doesnot impact the response time too much

66 Effects of Speed If each object moves faster the relativevelocities between objects may also become faster This willmake the safe time shorter and the update frequency ofeach object and query increases The safe time used inSafe-time(S) and Safe-time(M) is directly affected by themaximum speed of objects and does not consider the direc-tion of each objectrsquos movement and the speed of individualmovement No matter the objects move or not and move

International Journal of Distributed Sensor Networks 19

fast or slow both of the above methods directly use themaximum speed of objects to calculate the safe time forupdating On the other hand DC119896NN considers the movingdirection of objects and the proper safe-time for updatesIn this experiment the number of moving objects is 20of all the objects As Figure 18(a) shows as the movingobjects speed up the update cost increases and DC119896NN stillperforms best As the speed increases the safe-time in Safe-time(S) and the Safe-time(M) becomes much shorter due toa larger maximum speed among all the objects The trendbecomes even worse as the speed increases

Figure 18(b) shows the trend about the number of trans-mitted messages when the speed is up DC119896NN still hasthe best performance on the number of messages There are42781 messages sent in average when the speed of object is10ms However the Safe-time(M) needs 67913 messagesThe accuracy will not be effected as the speed changesfor DC119896NN and Safe-time(M) because both of them aredesigned or adapted for themoving objects and queries Safe-time(S) will have more inaccurate results as the speed is highas shown in Figure 18(c) However the response time doesnot have a significant impact on the response time for all thethree methods Figure 18(d) presents this trend

7 Conclusions

In this paper we propose a new approach DC119896NN whichuses the local Voronoi diagram and proper safe-time toeffectively process the C119896NNquery in distributed andmobileenvironments such as wireless sensor networks The propersafe-time can be quickly derived by a simple formulaBy comparing our proposed DC119896NN with other existingapproaches Safe-time(S) DC119896NN can effectively improvesearch efficiency reduce response time and the numberof messages and keep the accuracy of the result highAdditionally DC119896NN reduces more 30 of transmissionmessages than Safe-time(M) because the characteristics of theVoronoi diagram are used and each objectrsquos moving directionis considered instead of directly using the maximum speedof the objects as Safe-time method The derived safe-timeis more precise As a result DC119896NN needs less updatefrequency reduces a great number of messages transmittedand yields more accurate results In this work simulationexperiments are also performed The experimental resultsvalidate the proposed DC119896NN approach for the continuous119896 nearest neighbor query in distributed and mobile environ-ments where all the data objects and query can move

Acknowledgment

This work is partially supported by NSC under the Grant98-2220-E-027-007 100-2221-E-027-087-MY2 and 102-2221-E-027-088-

References

[1] O Bohl S Manouchehri and U Winand ldquoMobile informationsystems for the private everyday liferdquo Mobile InformationSystems vol 3 no 3-4 pp 135ndash152 2007

[2] Y Tao andD Papadias ldquoTime-parameterized queries in spatio-temporal databasesrdquo in Proceedings of the ACM SIGMODInternational Conference on Managment of Data pp 334ndash345June 2002

[3] Y Tao D Papadias and Q Shen ldquoContinuous nearest neighborsearchrdquo in Proceedings of the 28th International Conference onVery Large Data Bases (VLDB rsquo02) pp 287ndash298 2002

[4] F Aurenhammer ldquoVoronoi diagramsmdasha survey of a fundamen-tal geometric data structurerdquo ACM Computing Surveys vol 23no 3 pp 345ndash405 1991

[5] K Kim Y Cai andW Tavanapong ldquoSafe-time distributed real-time monitoring of cKNN in mobile peer-to-peer networksrdquo inProceedings of the 9th IEEE International Conference on MobileData Management (MDM rsquo08) pp 124ndash131 April 2008

[6] M Kolahdouzan and C Shahabi ldquoVoronoi-based k nearest nei-ghbor search for spatial network databasesrdquo in Proceedings ofthe 30th International Conference on Very Large Data Bases vol30 pp 840ndash851 2004

[7] M R Kolahdouzan and C Shahabi ldquoAlternative solutions forcontinuous K nearest neighbor queries in spatial networkdatabasesrdquo GeoInformatica vol 9 no 4 pp 321ndash341 2005

[8] D Papadias Y Tao K Mouratidis and C K Hui ldquoAggregatenearest neighbor queries in spatial databasesrdquo ACM Transac-tions on Database Systems vol 30 no 2 pp 529ndash576 2005

[9] T Imielinski S Viswanathan and B R Badrinath ldquoData on airorganization and accessrdquo IEEE Transactions on Knowledge andData Engineering vol 9 no 3 pp 353ndash372 1997

[10] S Hambrusch C-M Liu and S Prabhakar ldquoBroadcasting andquerying multi-dimensional index trees in a multi-channelenvironmentrdquo Information Systems vol 31 no 8 pp 870ndash8862006

[11] C-M Liu and K-F Lin ldquoDisseminating dependent data inwireless broadcast environmentsrdquo Distributed and ParallelDatabases vol 22 no 1 pp 1ndash25 2007

[12] T-C Su and C-M Liu ldquoOn-demand data broadcasting for dataitems with time constraints on multiple broadcast channelsrdquo inDatabase Systems for Advanced Applications vol 6193 of LectureNotes in Computer Science pp 458ndash469 2010

[13] B Zheng J Xu W-C Lee and D L Lee ldquoGrid-partition ind-ex a hybrid method for nearest-neighbor queries in wirelesslocation-based servicesrdquo The VLDB Journal vol 15 no 1 pp21ndash39 2006

[14] B Gedik A Singh and L Liu ldquoEnergy efficient exact kNN sear-ch in wireless broadcast environmentsrdquo in Proceedings of the12th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo04) pp 137ndash146 November 2004

[15] KMouratidis S Bakiras and D Papadias ldquoContinuousmonit-oring of spatial queries in wireless broadcast environmentsrdquoIEEE Transactions onMobile Computing vol 8 no 10 pp 1297ndash1311 2009

[16] G Chatzimilioudis D Zeinalipour-Yazti W-C Lee and M DDikaiakos ldquoContinuous all k-nearest-neighbor querying insmartphone networksrdquo in Proceedings of the 13th IEEE Interna-tional Conference on Mobile Data Management (MDM rsquo12) pp79ndash88 2012

[17] T-Y Fu W-C Peng and W-C Lee ldquoParallelizing itinerary-basedKNNquery processing inwireless sensor networksrdquo IEEETransactions on Knowledge and Data Engineering vol 22 no 5pp 711ndash729 2010

[18] T P Nghiem A B Waluyo and D Taniar ldquoA pure peer-to-peerapproach for kNNquery processing inmobile ad hoc networksrdquo

20 International Journal of Distributed Sensor Networks

Personal and Ubiquitous Computing vol 17 no 5 pp 973ndash9852013

[19] HD Chon D Agrawal andA El Abbadi ldquoRange and kNNqu-ery processing for moving objects in Grid modelrdquo MobileNetworks and Applications vol 8 no 4 pp 401ndash412 2003

[20] X Xiong M F Mokbel and W G Aref ldquoSEA-CNN scalableprocessing of continuous K-nearest neighbor queries in spatio-temporal databasesrdquo in Proceedings of the 21st InternationalConference on Data Engineering (ICDE rsquo05) pp 643ndash654 April2005

[21] G Zhao K XuanW Rahayu et al ldquoVoronoi-based continuous120581 nearest neighbor search in mobile navigationrdquo IEEE Transac-tions on Industrial Electronics vol 58 no 6 pp 2247ndash2257 2011

[22] KMouratidis D Papadias S Bakiras and Y Tao ldquoA threshold-based algorithm for continuous monitoring of k nearest neigh-borsrdquo IEEE Transactions on Knowledge and Data Engineeringvol 17 no 11 pp 1451ndash1464 2005

[23] S-H Wu K-T Chuang C-M Chen and M-S Chen ldquoDIK-NN an itinerary-based KNN query processing algorithm formobile sensor networksrdquo inProceedings of the 23rd InternationalConference on Data Engineering (ICDE rsquo07) pp 456ndash465 April2007

[24] D T Lee ldquoOn k-nearest neighbor voronoi diagrams in the pla-nerdquo IEEE Transactions on Computers vol 31 no 6 pp 478ndash4871982

[25] K Patroumpas TMinogiannis andT Sellis ldquoApproximate ord-er-k Voronoi cells over positional streamsrdquo in Proceedings of the15th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo07) pp 276ndash283 November 2007

International Journal of

AerospaceEngineeringHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

RoboticsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Active and Passive Electronic Components

Control Scienceand Engineering

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

RotatingMachinery

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

Journal ofEngineeringVolume 2014

Submit your manuscripts athttpwwwhindawicom

VLSI Design

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Shock and Vibration

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawi Publishing Corporation httpwwwhindawicom

Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

SensorsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Navigation and Observation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

DistributedSensor Networks

International Journal of

Page 18: Research Article Distributed Continuous k Nearest Neighbors ...downloads.hindawi.com/journals/ijdsn/2013/125145.pdfmobile environments like WSNs, which consist of a number of mobile

18 International Journal of Distributed Sensor Networks

2 4 6 8 100

10

20

30

40

50

60

Speed (ms)

Upd

ate c

ost (

frequ

ency

)

(a) Update frequency

2 4 6 8 100

100

200

300

400

500

600

700

800

Speed (ms)

Num

ber o

f mes

sage

s (pa

cket

sm

in)

(b) Number of messages

2 4 6 8 1070

75

80

85

90

95

100

105

Speed (ms)

Accu

racy

()

DCkNNSafe-time(S)Safe-time(M)

(c) Accuracy

2 4 6 8 1009

095

1

105

11

115

12

125

13

Speed (ms)

Aver

age r

espo

nse t

ime (

s)

DCkNNSafe-time(S)Safe-time(M)

(d) Response time

Figure 18 The impacts of speed on (a) update frequency (b) number of messages (c) accuracy and (d) response time

DC119896NN DC119896NN only needs to store local Voronoi diagramwhere the information required is less than required in Safe-time(S) and Safe-time(M) so the response time of DC119896NN isthe shortest

65 The Effect of Moving Objects In this experiment set weconsider different percentages of moving objects in all thedata objects The default value is 20 which means that ifthere is a total of 30 objects then there are sixmoving objectsIn Figures 17(a) and 17(b) as the percentage ofmoving objectsincreases the overall number of updates required between theobjects increases relatively and the change rate of answer totheDC119896NNaccelerates thus increasing the update frequencyof the query and the number of messages However DC119896NNstill keeps the best performance Figure 17(c) shows the accu-racy of the result for different percentage of moving objectsDC119896NN and Safe-time(M) both have higher accuracy and

Safe-time(S) is still the worst The safe time of each object inSafe-time(S) is calculated using the maximum speed of theobjects Hence whether the object is moving or not does notdirectly result in the incorrectness of the answer collectionIn fact in Safe-time(S) one of the main reasons to affectthe accuracy is the directions of moving objects Last asFigure 17(d) shows the percentage of moving objects doesnot impact the response time too much

66 Effects of Speed If each object moves faster the relativevelocities between objects may also become faster This willmake the safe time shorter and the update frequency ofeach object and query increases The safe time used inSafe-time(S) and Safe-time(M) is directly affected by themaximum speed of objects and does not consider the direc-tion of each objectrsquos movement and the speed of individualmovement No matter the objects move or not and move

International Journal of Distributed Sensor Networks 19

fast or slow both of the above methods directly use themaximum speed of objects to calculate the safe time forupdating On the other hand DC119896NN considers the movingdirection of objects and the proper safe-time for updatesIn this experiment the number of moving objects is 20of all the objects As Figure 18(a) shows as the movingobjects speed up the update cost increases and DC119896NN stillperforms best As the speed increases the safe-time in Safe-time(S) and the Safe-time(M) becomes much shorter due toa larger maximum speed among all the objects The trendbecomes even worse as the speed increases

Figure 18(b) shows the trend about the number of trans-mitted messages when the speed is up DC119896NN still hasthe best performance on the number of messages There are42781 messages sent in average when the speed of object is10ms However the Safe-time(M) needs 67913 messagesThe accuracy will not be effected as the speed changesfor DC119896NN and Safe-time(M) because both of them aredesigned or adapted for themoving objects and queries Safe-time(S) will have more inaccurate results as the speed is highas shown in Figure 18(c) However the response time doesnot have a significant impact on the response time for all thethree methods Figure 18(d) presents this trend

7 Conclusions

In this paper we propose a new approach DC119896NN whichuses the local Voronoi diagram and proper safe-time toeffectively process the C119896NNquery in distributed andmobileenvironments such as wireless sensor networks The propersafe-time can be quickly derived by a simple formulaBy comparing our proposed DC119896NN with other existingapproaches Safe-time(S) DC119896NN can effectively improvesearch efficiency reduce response time and the numberof messages and keep the accuracy of the result highAdditionally DC119896NN reduces more 30 of transmissionmessages than Safe-time(M) because the characteristics of theVoronoi diagram are used and each objectrsquos moving directionis considered instead of directly using the maximum speedof the objects as Safe-time method The derived safe-timeis more precise As a result DC119896NN needs less updatefrequency reduces a great number of messages transmittedand yields more accurate results In this work simulationexperiments are also performed The experimental resultsvalidate the proposed DC119896NN approach for the continuous119896 nearest neighbor query in distributed and mobile environ-ments where all the data objects and query can move

Acknowledgment

This work is partially supported by NSC under the Grant98-2220-E-027-007 100-2221-E-027-087-MY2 and 102-2221-E-027-088-

References

[1] O Bohl S Manouchehri and U Winand ldquoMobile informationsystems for the private everyday liferdquo Mobile InformationSystems vol 3 no 3-4 pp 135ndash152 2007

[2] Y Tao andD Papadias ldquoTime-parameterized queries in spatio-temporal databasesrdquo in Proceedings of the ACM SIGMODInternational Conference on Managment of Data pp 334ndash345June 2002

[3] Y Tao D Papadias and Q Shen ldquoContinuous nearest neighborsearchrdquo in Proceedings of the 28th International Conference onVery Large Data Bases (VLDB rsquo02) pp 287ndash298 2002

[4] F Aurenhammer ldquoVoronoi diagramsmdasha survey of a fundamen-tal geometric data structurerdquo ACM Computing Surveys vol 23no 3 pp 345ndash405 1991

[5] K Kim Y Cai andW Tavanapong ldquoSafe-time distributed real-time monitoring of cKNN in mobile peer-to-peer networksrdquo inProceedings of the 9th IEEE International Conference on MobileData Management (MDM rsquo08) pp 124ndash131 April 2008

[6] M Kolahdouzan and C Shahabi ldquoVoronoi-based k nearest nei-ghbor search for spatial network databasesrdquo in Proceedings ofthe 30th International Conference on Very Large Data Bases vol30 pp 840ndash851 2004

[7] M R Kolahdouzan and C Shahabi ldquoAlternative solutions forcontinuous K nearest neighbor queries in spatial networkdatabasesrdquo GeoInformatica vol 9 no 4 pp 321ndash341 2005

[8] D Papadias Y Tao K Mouratidis and C K Hui ldquoAggregatenearest neighbor queries in spatial databasesrdquo ACM Transac-tions on Database Systems vol 30 no 2 pp 529ndash576 2005

[9] T Imielinski S Viswanathan and B R Badrinath ldquoData on airorganization and accessrdquo IEEE Transactions on Knowledge andData Engineering vol 9 no 3 pp 353ndash372 1997

[10] S Hambrusch C-M Liu and S Prabhakar ldquoBroadcasting andquerying multi-dimensional index trees in a multi-channelenvironmentrdquo Information Systems vol 31 no 8 pp 870ndash8862006

[11] C-M Liu and K-F Lin ldquoDisseminating dependent data inwireless broadcast environmentsrdquo Distributed and ParallelDatabases vol 22 no 1 pp 1ndash25 2007

[12] T-C Su and C-M Liu ldquoOn-demand data broadcasting for dataitems with time constraints on multiple broadcast channelsrdquo inDatabase Systems for Advanced Applications vol 6193 of LectureNotes in Computer Science pp 458ndash469 2010

[13] B Zheng J Xu W-C Lee and D L Lee ldquoGrid-partition ind-ex a hybrid method for nearest-neighbor queries in wirelesslocation-based servicesrdquo The VLDB Journal vol 15 no 1 pp21ndash39 2006

[14] B Gedik A Singh and L Liu ldquoEnergy efficient exact kNN sear-ch in wireless broadcast environmentsrdquo in Proceedings of the12th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo04) pp 137ndash146 November 2004

[15] KMouratidis S Bakiras and D Papadias ldquoContinuousmonit-oring of spatial queries in wireless broadcast environmentsrdquoIEEE Transactions onMobile Computing vol 8 no 10 pp 1297ndash1311 2009

[16] G Chatzimilioudis D Zeinalipour-Yazti W-C Lee and M DDikaiakos ldquoContinuous all k-nearest-neighbor querying insmartphone networksrdquo in Proceedings of the 13th IEEE Interna-tional Conference on Mobile Data Management (MDM rsquo12) pp79ndash88 2012

[17] T-Y Fu W-C Peng and W-C Lee ldquoParallelizing itinerary-basedKNNquery processing inwireless sensor networksrdquo IEEETransactions on Knowledge and Data Engineering vol 22 no 5pp 711ndash729 2010

[18] T P Nghiem A B Waluyo and D Taniar ldquoA pure peer-to-peerapproach for kNNquery processing inmobile ad hoc networksrdquo

20 International Journal of Distributed Sensor Networks

Personal and Ubiquitous Computing vol 17 no 5 pp 973ndash9852013

[19] HD Chon D Agrawal andA El Abbadi ldquoRange and kNNqu-ery processing for moving objects in Grid modelrdquo MobileNetworks and Applications vol 8 no 4 pp 401ndash412 2003

[20] X Xiong M F Mokbel and W G Aref ldquoSEA-CNN scalableprocessing of continuous K-nearest neighbor queries in spatio-temporal databasesrdquo in Proceedings of the 21st InternationalConference on Data Engineering (ICDE rsquo05) pp 643ndash654 April2005

[21] G Zhao K XuanW Rahayu et al ldquoVoronoi-based continuous120581 nearest neighbor search in mobile navigationrdquo IEEE Transac-tions on Industrial Electronics vol 58 no 6 pp 2247ndash2257 2011

[22] KMouratidis D Papadias S Bakiras and Y Tao ldquoA threshold-based algorithm for continuous monitoring of k nearest neigh-borsrdquo IEEE Transactions on Knowledge and Data Engineeringvol 17 no 11 pp 1451ndash1464 2005

[23] S-H Wu K-T Chuang C-M Chen and M-S Chen ldquoDIK-NN an itinerary-based KNN query processing algorithm formobile sensor networksrdquo inProceedings of the 23rd InternationalConference on Data Engineering (ICDE rsquo07) pp 456ndash465 April2007

[24] D T Lee ldquoOn k-nearest neighbor voronoi diagrams in the pla-nerdquo IEEE Transactions on Computers vol 31 no 6 pp 478ndash4871982

[25] K Patroumpas TMinogiannis andT Sellis ldquoApproximate ord-er-k Voronoi cells over positional streamsrdquo in Proceedings of the15th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo07) pp 276ndash283 November 2007

International Journal of

AerospaceEngineeringHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

RoboticsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Active and Passive Electronic Components

Control Scienceand Engineering

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

RotatingMachinery

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

Journal ofEngineeringVolume 2014

Submit your manuscripts athttpwwwhindawicom

VLSI Design

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Shock and Vibration

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawi Publishing Corporation httpwwwhindawicom

Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

SensorsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Navigation and Observation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

DistributedSensor Networks

International Journal of

Page 19: Research Article Distributed Continuous k Nearest Neighbors ...downloads.hindawi.com/journals/ijdsn/2013/125145.pdfmobile environments like WSNs, which consist of a number of mobile

International Journal of Distributed Sensor Networks 19

fast or slow both of the above methods directly use themaximum speed of objects to calculate the safe time forupdating On the other hand DC119896NN considers the movingdirection of objects and the proper safe-time for updatesIn this experiment the number of moving objects is 20of all the objects As Figure 18(a) shows as the movingobjects speed up the update cost increases and DC119896NN stillperforms best As the speed increases the safe-time in Safe-time(S) and the Safe-time(M) becomes much shorter due toa larger maximum speed among all the objects The trendbecomes even worse as the speed increases

Figure 18(b) shows the trend about the number of trans-mitted messages when the speed is up DC119896NN still hasthe best performance on the number of messages There are42781 messages sent in average when the speed of object is10ms However the Safe-time(M) needs 67913 messagesThe accuracy will not be effected as the speed changesfor DC119896NN and Safe-time(M) because both of them aredesigned or adapted for themoving objects and queries Safe-time(S) will have more inaccurate results as the speed is highas shown in Figure 18(c) However the response time doesnot have a significant impact on the response time for all thethree methods Figure 18(d) presents this trend

7 Conclusions

In this paper we propose a new approach DC119896NN whichuses the local Voronoi diagram and proper safe-time toeffectively process the C119896NNquery in distributed andmobileenvironments such as wireless sensor networks The propersafe-time can be quickly derived by a simple formulaBy comparing our proposed DC119896NN with other existingapproaches Safe-time(S) DC119896NN can effectively improvesearch efficiency reduce response time and the numberof messages and keep the accuracy of the result highAdditionally DC119896NN reduces more 30 of transmissionmessages than Safe-time(M) because the characteristics of theVoronoi diagram are used and each objectrsquos moving directionis considered instead of directly using the maximum speedof the objects as Safe-time method The derived safe-timeis more precise As a result DC119896NN needs less updatefrequency reduces a great number of messages transmittedand yields more accurate results In this work simulationexperiments are also performed The experimental resultsvalidate the proposed DC119896NN approach for the continuous119896 nearest neighbor query in distributed and mobile environ-ments where all the data objects and query can move

Acknowledgment

This work is partially supported by NSC under the Grant98-2220-E-027-007 100-2221-E-027-087-MY2 and 102-2221-E-027-088-

References

[1] O Bohl S Manouchehri and U Winand ldquoMobile informationsystems for the private everyday liferdquo Mobile InformationSystems vol 3 no 3-4 pp 135ndash152 2007

[2] Y Tao andD Papadias ldquoTime-parameterized queries in spatio-temporal databasesrdquo in Proceedings of the ACM SIGMODInternational Conference on Managment of Data pp 334ndash345June 2002

[3] Y Tao D Papadias and Q Shen ldquoContinuous nearest neighborsearchrdquo in Proceedings of the 28th International Conference onVery Large Data Bases (VLDB rsquo02) pp 287ndash298 2002

[4] F Aurenhammer ldquoVoronoi diagramsmdasha survey of a fundamen-tal geometric data structurerdquo ACM Computing Surveys vol 23no 3 pp 345ndash405 1991

[5] K Kim Y Cai andW Tavanapong ldquoSafe-time distributed real-time monitoring of cKNN in mobile peer-to-peer networksrdquo inProceedings of the 9th IEEE International Conference on MobileData Management (MDM rsquo08) pp 124ndash131 April 2008

[6] M Kolahdouzan and C Shahabi ldquoVoronoi-based k nearest nei-ghbor search for spatial network databasesrdquo in Proceedings ofthe 30th International Conference on Very Large Data Bases vol30 pp 840ndash851 2004

[7] M R Kolahdouzan and C Shahabi ldquoAlternative solutions forcontinuous K nearest neighbor queries in spatial networkdatabasesrdquo GeoInformatica vol 9 no 4 pp 321ndash341 2005

[8] D Papadias Y Tao K Mouratidis and C K Hui ldquoAggregatenearest neighbor queries in spatial databasesrdquo ACM Transac-tions on Database Systems vol 30 no 2 pp 529ndash576 2005

[9] T Imielinski S Viswanathan and B R Badrinath ldquoData on airorganization and accessrdquo IEEE Transactions on Knowledge andData Engineering vol 9 no 3 pp 353ndash372 1997

[10] S Hambrusch C-M Liu and S Prabhakar ldquoBroadcasting andquerying multi-dimensional index trees in a multi-channelenvironmentrdquo Information Systems vol 31 no 8 pp 870ndash8862006

[11] C-M Liu and K-F Lin ldquoDisseminating dependent data inwireless broadcast environmentsrdquo Distributed and ParallelDatabases vol 22 no 1 pp 1ndash25 2007

[12] T-C Su and C-M Liu ldquoOn-demand data broadcasting for dataitems with time constraints on multiple broadcast channelsrdquo inDatabase Systems for Advanced Applications vol 6193 of LectureNotes in Computer Science pp 458ndash469 2010

[13] B Zheng J Xu W-C Lee and D L Lee ldquoGrid-partition ind-ex a hybrid method for nearest-neighbor queries in wirelesslocation-based servicesrdquo The VLDB Journal vol 15 no 1 pp21ndash39 2006

[14] B Gedik A Singh and L Liu ldquoEnergy efficient exact kNN sear-ch in wireless broadcast environmentsrdquo in Proceedings of the12th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo04) pp 137ndash146 November 2004

[15] KMouratidis S Bakiras and D Papadias ldquoContinuousmonit-oring of spatial queries in wireless broadcast environmentsrdquoIEEE Transactions onMobile Computing vol 8 no 10 pp 1297ndash1311 2009

[16] G Chatzimilioudis D Zeinalipour-Yazti W-C Lee and M DDikaiakos ldquoContinuous all k-nearest-neighbor querying insmartphone networksrdquo in Proceedings of the 13th IEEE Interna-tional Conference on Mobile Data Management (MDM rsquo12) pp79ndash88 2012

[17] T-Y Fu W-C Peng and W-C Lee ldquoParallelizing itinerary-basedKNNquery processing inwireless sensor networksrdquo IEEETransactions on Knowledge and Data Engineering vol 22 no 5pp 711ndash729 2010

[18] T P Nghiem A B Waluyo and D Taniar ldquoA pure peer-to-peerapproach for kNNquery processing inmobile ad hoc networksrdquo

20 International Journal of Distributed Sensor Networks

Personal and Ubiquitous Computing vol 17 no 5 pp 973ndash9852013

[19] HD Chon D Agrawal andA El Abbadi ldquoRange and kNNqu-ery processing for moving objects in Grid modelrdquo MobileNetworks and Applications vol 8 no 4 pp 401ndash412 2003

[20] X Xiong M F Mokbel and W G Aref ldquoSEA-CNN scalableprocessing of continuous K-nearest neighbor queries in spatio-temporal databasesrdquo in Proceedings of the 21st InternationalConference on Data Engineering (ICDE rsquo05) pp 643ndash654 April2005

[21] G Zhao K XuanW Rahayu et al ldquoVoronoi-based continuous120581 nearest neighbor search in mobile navigationrdquo IEEE Transac-tions on Industrial Electronics vol 58 no 6 pp 2247ndash2257 2011

[22] KMouratidis D Papadias S Bakiras and Y Tao ldquoA threshold-based algorithm for continuous monitoring of k nearest neigh-borsrdquo IEEE Transactions on Knowledge and Data Engineeringvol 17 no 11 pp 1451ndash1464 2005

[23] S-H Wu K-T Chuang C-M Chen and M-S Chen ldquoDIK-NN an itinerary-based KNN query processing algorithm formobile sensor networksrdquo inProceedings of the 23rd InternationalConference on Data Engineering (ICDE rsquo07) pp 456ndash465 April2007

[24] D T Lee ldquoOn k-nearest neighbor voronoi diagrams in the pla-nerdquo IEEE Transactions on Computers vol 31 no 6 pp 478ndash4871982

[25] K Patroumpas TMinogiannis andT Sellis ldquoApproximate ord-er-k Voronoi cells over positional streamsrdquo in Proceedings of the15th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo07) pp 276ndash283 November 2007

International Journal of

AerospaceEngineeringHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

RoboticsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Active and Passive Electronic Components

Control Scienceand Engineering

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

RotatingMachinery

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

Journal ofEngineeringVolume 2014

Submit your manuscripts athttpwwwhindawicom

VLSI Design

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Shock and Vibration

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawi Publishing Corporation httpwwwhindawicom

Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

SensorsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Navigation and Observation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

DistributedSensor Networks

International Journal of

Page 20: Research Article Distributed Continuous k Nearest Neighbors ...downloads.hindawi.com/journals/ijdsn/2013/125145.pdfmobile environments like WSNs, which consist of a number of mobile

20 International Journal of Distributed Sensor Networks

Personal and Ubiquitous Computing vol 17 no 5 pp 973ndash9852013

[19] HD Chon D Agrawal andA El Abbadi ldquoRange and kNNqu-ery processing for moving objects in Grid modelrdquo MobileNetworks and Applications vol 8 no 4 pp 401ndash412 2003

[20] X Xiong M F Mokbel and W G Aref ldquoSEA-CNN scalableprocessing of continuous K-nearest neighbor queries in spatio-temporal databasesrdquo in Proceedings of the 21st InternationalConference on Data Engineering (ICDE rsquo05) pp 643ndash654 April2005

[21] G Zhao K XuanW Rahayu et al ldquoVoronoi-based continuous120581 nearest neighbor search in mobile navigationrdquo IEEE Transac-tions on Industrial Electronics vol 58 no 6 pp 2247ndash2257 2011

[22] KMouratidis D Papadias S Bakiras and Y Tao ldquoA threshold-based algorithm for continuous monitoring of k nearest neigh-borsrdquo IEEE Transactions on Knowledge and Data Engineeringvol 17 no 11 pp 1451ndash1464 2005

[23] S-H Wu K-T Chuang C-M Chen and M-S Chen ldquoDIK-NN an itinerary-based KNN query processing algorithm formobile sensor networksrdquo inProceedings of the 23rd InternationalConference on Data Engineering (ICDE rsquo07) pp 456ndash465 April2007

[24] D T Lee ldquoOn k-nearest neighbor voronoi diagrams in the pla-nerdquo IEEE Transactions on Computers vol 31 no 6 pp 478ndash4871982

[25] K Patroumpas TMinogiannis andT Sellis ldquoApproximate ord-er-k Voronoi cells over positional streamsrdquo in Proceedings of the15th ACM International Symposium on Advances in GeographicInformation Systems (GIS rsquo07) pp 276ndash283 November 2007

International Journal of

AerospaceEngineeringHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

RoboticsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Active and Passive Electronic Components

Control Scienceand Engineering

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

RotatingMachinery

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

Journal ofEngineeringVolume 2014

Submit your manuscripts athttpwwwhindawicom

VLSI Design

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Shock and Vibration

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawi Publishing Corporation httpwwwhindawicom

Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

SensorsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Navigation and Observation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

DistributedSensor Networks

International Journal of

Page 21: Research Article Distributed Continuous k Nearest Neighbors ...downloads.hindawi.com/journals/ijdsn/2013/125145.pdfmobile environments like WSNs, which consist of a number of mobile

International Journal of

AerospaceEngineeringHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

RoboticsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Active and Passive Electronic Components

Control Scienceand Engineering

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

RotatingMachinery

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

Journal ofEngineeringVolume 2014

Submit your manuscripts athttpwwwhindawicom

VLSI Design

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Shock and Vibration

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawi Publishing Corporation httpwwwhindawicom

Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

SensorsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Navigation and Observation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

DistributedSensor Networks

International Journal of