21
An Efficient and Scalable Approach to CNN Queries in a Road Network Hyung-Ju Cho and Chin-Wan Chung Dept. of EECS, KAIST VLDB 2005

An Efficient and Scalable Approach to CNN Queries in a Road Network Hyung-Ju Cho and Chin-Wan Chung Dept. of EECS, KAIST VLDB 2005

  • View
    215

  • Download
    0

Embed Size (px)

Citation preview

Page 1: An Efficient and Scalable Approach to CNN Queries in a Road Network Hyung-Ju Cho and Chin-Wan Chung Dept. of EECS, KAIST VLDB 2005

An Efficient and Scalable Approach to CNN Queries in a Road Network

Hyung-Ju Cho and Chin-Wan Chung

Dept. of EECS, KAIST

VLDB 2005

Page 2: An Efficient and Scalable Approach to CNN Queries in a Road Network Hyung-Ju Cho and Chin-Wan Chung Dept. of EECS, KAIST VLDB 2005

2

Contents

Introduction Related Work Nearest Neighbor Search (NN Search) Continuous Nearest Neighbor Search (CNN Search) Performance Study Conclusions

Page 3: An Efficient and Scalable Approach to CNN Queries in a Road Network Hyung-Ju Cho and Chin-Wan Chung Dept. of EECS, KAIST VLDB 2005

3

Introduction

CNN searches in a road network Emerging location-based services and real-life GIS applications. Interesting and intuitive problems from the practical as well as

theoretical point of view.

The following two conditions are assumed for the CNN searches

I. Moving objects (e.g., cars) run on a road network and static objects (e.g., gas stations) are located on the road network.

II. The distance measure is defined as the shortest path length (network distance).

Page 4: An Efficient and Scalable Approach to CNN Queries in a Road Network Hyung-Ju Cho and Chin-Wan Chung Dept. of EECS, KAIST VLDB 2005

4

Fig 1. Example continuous search (a,b,c,d,e : gas stations)

Introduction (cont’d)

Example Queries on Figure 1 NN Query : Retrieve the 3 closest gas stations from a query point n1. CNN Query : Find the 2 closest gas stations from all points on the

path P from n1 to n6 (i.e., P = {n1, n2, n3, n4, n5, n6}).

Page 5: An Efficient and Scalable Approach to CNN Queries in a Road Network Hyung-Ju Cho and Chin-Wan Chung Dept. of EECS, KAIST VLDB 2005

5

NN Queries in a Road Network INE (Incremental Network Expansion)

Based on Dijkstra’s algorithm INE suffers from highly computational cost when objects of interest

are sparsely distributed. VN3 (Voronoi-based Network NN Search)

VN3 evaluates k NN queries using the Voronoi diagram If the density of objects increases, VN3 suffers from computational o

verhead of precalculating network Voronoi polygons

Unfortunately, the performance of existing approaches depends largely on the densities of the objects.

Figure 2: Sample network Voronoi diagram

Related Work

Page 6: An Efficient and Scalable Approach to CNN Queries in a Road Network Hyung-Ju Cho and Chin-Wan Chung Dept. of EECS, KAIST VLDB 2005

6

CNN Queries in a Road Network UBA (Upper Bound Algorithm) for CNN queries

The intuition is that when a query object is moved slightly, it is likely that its k NNs remain the same during the threshold.

(k+1) NN queries are used to determine the threshold values and these NN queries are executed using VN3.

However, depending on the data density and the number of NNs requested, it leads to requiring many NN queries for determining these threshold values.

Related Work (cont’d)

Page 7: An Efficient and Scalable Approach to CNN Queries in a Road Network Hyung-Ju Cho and Chin-Wan Chung Dept. of EECS, KAIST VLDB 2005

7

UNICONS (UNIque CONtinuous Search algorithms) for NN queries It incorporates the precomputed NN lists in using Dijkstra’s algorithm f

or NN queries A node where three or more edges meet is called an intersection point a

nd an intersection point which maintains precomputed NNs is called a condensing point.

n1

n2

{(a, 26), (b, 49)}

{(c, 53), (d, 74)} q

64

Fig 3. Example NN query processing (n1,n2 : condensing points)

Q : Which objects are the two NNs of q? A : The two NNs of q are a (4+26) and b (4+49).

Nearest Neighbor Search

Page 8: An Efficient and Scalable Approach to CNN Queries in a Road Network Hyung-Ju Cho and Chin-Wan Chung Dept. of EECS, KAIST VLDB 2005

8

The 1st basic idea To perform a continuous search along a path P ={ni, ni+1, …, nj}, it is su

fficient to retrieve objects on the query path and to run a static query at each node nk (i k j).

The 2nd basic idea The change in the network distance between a moving query point and

a static object of interest can be expressed as a piecewise linear equation.

Two Basic Ideas of CNN Search

a qd(q,a) = |q–a|

Page 9: An Efficient and Scalable Approach to CNN Queries in a Road Network Hyung-Ju Cho and Chin-Wan Chung Dept. of EECS, KAIST VLDB 2005

9

Example of the two Basic Ideas

Fig 4. d(q,a), d(q,b), and d(q,c)

q

|5|),(,1|3|),(|,1|),( qcqdqbqdqaqd

1 2 3 4 5path path n n n n nR O R R R R R

Page 10: An Efficient and Scalable Approach to CNN Queries in a Road Network Hyung-Ju Cho and Chin-Wan Chung Dept. of EECS, KAIST VLDB 2005

10

Our CNN search algorithm based on the divide and conquer method proceeds with the following three steps:

[Step 1] Divide a query path into subpaths based on intersection points

[Step 2] Determine valid intervals for each subpath

[Step 3] Merge valid intervals of adjacent subpaths

Sketch of CNN Search Algorithm

Page 11: An Efficient and Scalable Approach to CNN Queries in a Road Network Hyung-Ju Cho and Chin-Wan Chung Dept. of EECS, KAIST VLDB 2005

11

[Step 2] consists of the four sub-steps as follows:

[Step 2.1] Retrieve objects on the subpath

[Step 2.2] Issue two NN queries from the start and end points of the subpath

[Step 2.3] Remove some tuples obtained from Steps 2.1 and 2.2 using the cover relationship

[Step 2.4] Divide the subpath into valid intervals

Sketch of CNN Search Algorithm (cont’d)

Page 12: An Efficient and Scalable Approach to CNN Queries in a Road Network Hyung-Ju Cho and Chin-Wan Chung Dept. of EECS, KAIST VLDB 2005

12

The result R of Steps 2.1 and 2.2 is the set of (obj, x, y) tuples If obj (e.g, a) is located on the subpath, x = d(sSP, obj) and y = 0.

If obj (e.g, b) is an object satisfying the query predicate at sSP, x = 0 and y = d(sSP, obj ).

If obj (e.g, c) is an object satisfying the query predicate at eSP, x = LSP and y = d(eSP, obj)

CNN Search Algorithm for the subpath

sSP eSP

a

bc

d(sSP, b) d(eSP, c)

LSP

d(q,obj)

(0,0) LSPd(sSP, a)

d(sSP, b)

d(eSP, c)

a

b

c

q

Fig 5. Plotting tuples on the chart ( q : location of the query point)

Page 13: An Efficient and Scalable Approach to CNN Queries in a Road Network Hyung-Ju Cho and Chin-Wan Chung Dept. of EECS, KAIST VLDB 2005

13

The cover relationship It is applied to tuples with the same object

A tuple (obj, x, y) on the chart gives the network distance from q to obj as follows: d(q, obj) = |q − x| + y

The Cover Relationship

Fig 6. t1 covers t2 iff y2 ≥ |x2-x1|+y1

q

Page 14: An Efficient and Scalable Approach to CNN Queries in a Road Network Hyung-Ju Cho and Chin-Wan Chung Dept. of EECS, KAIST VLDB 2005

14

For static objects a to e on the road network of Figure 7, continuously display the two closest objects from any position on the query path P = {n3, n5, n7, n8}.

Fig 7. Example Road Network

[Step1] Divide a query path into subpaths

: SP1 = {n3,n5,n7} and SP2 = {n7,n8}

[Step 2] Determine valid intervals for each subpath

: Detailed explanation is provided in the next slide

[Step 3] Merge valid intervals of adjacent subpaths

Example of CNN Query Processing

Page 15: An Efficient and Scalable Approach to CNN Queries in a Road Network Hyung-Ju Cho and Chin-Wan Chung Dept. of EECS, KAIST VLDB 2005

15

[Step 2.1] Retrieve the objects on SP1 = {n3,n5,n7}

[Step 2.2] Retrieve the qualifying objects on two end points and

[Step 2.3] Remove redundant tuples using the cover relationship

1{( ,2,0)}SPO c

1 1{( ,0,1), ( ,0,1)} and {( ,4,1), ( , 4, 2)}SP SPS a b E e c

1 1 1{( ,2,0), ( ,0,1), ( ,0,1), ( , 4,1), ( , 4, 2)}SP SP SPR O S E c a b e c

{( ,4,2)} {( ,2,0), ( ,0,1), ( ,0,1), ( , 4,1)}R R c R c a b e

1SPs1SPe

Fig 8. Plotting 5 tuples in R on the chart

q

Fig 9. Filtering redundant tuples

c

q

Page 16: An Efficient and Scalable Approach to CNN Queries in a Road Network Hyung-Ju Cho and Chin-Wan Chung Dept. of EECS, KAIST VLDB 2005

16

[Step 2.4] Divide the subpath into valid intervals with a set of the same NNs

Fig 10. Dividing the query path into valid intervals

(a) Initial Result (b) Final Result

Fig 11. CNN Search result for SP1={n3, n5, n7}

Example of CNN Query Processing (cont’d)

q

Page 17: An Efficient and Scalable Approach to CNN Queries in a Road Network Hyung-Ju Cho and Chin-Wan Chung Dept. of EECS, KAIST VLDB 2005

17

In the same way, if we compute the CNN result for SP2={n7, n8}, we can obtain

[Step 3] Merge and for SP1 and SP2, respectively, in order to obtain the final query result RP

Interval Results

{a,b}

{a,c}

[2,4] {c,e}

[4,7] {d,e}

Fig 12. CNN Search result for P={n3, n5, n7 , n8}

Example of CNN Query Processing (cont’d)

2{([4,7],{ , })}SPR d e

1SPR2SPR

1 2

1 12 2{([0, ],{ , }), ([ , 2],{ , }), ([2,4],{ , }), ([4,7],{ , })}P SP SPR R R a b a c c e d e

12[0, ]

12[ , 2]

Page 18: An Efficient and Scalable Approach to CNN Queries in a Road Network Hyung-Ju Cho and Chin-Wan Chung Dept. of EECS, KAIST VLDB 2005

18

Experimental Environment LRU buffer of 16 MB (about 10% of the road data) Map data - Tiger/Line data for the state of Wisconsin

Road data : # of nodes = 1,469,468, # of edges = 1,594,867 Object data : shopping centers (178), campgrounds (423), parks (1,

154), schools (2,979), lakes or ponds (5,177), and composite data (9,911)

# of intersection points : 223,569, # of condensing points : 64,748 The size of precomputed NN list is fixed to 10

Performance Study

Page 19: An Efficient and Scalable Approach to CNN Queries in a Road Network Hyung-Ju Cho and Chin-Wan Chung Dept. of EECS, KAIST VLDB 2005

19

UNICONS outperforms VN3 by up to 3.5 times in a realistic experimental environment.

Fig 13. Performance comparison for NN queries

Experimental Results for NN queries

Page 20: An Efficient and Scalable Approach to CNN Queries in a Road Network Hyung-Ju Cho and Chin-Wan Chung Dept. of EECS, KAIST VLDB 2005

20

UNICONS outperforms UBA by up to 5 times in a realistic experimental environment.

Fig 14. Execution time for CNN queries

Experimental Results for CNN queries

Page 21: An Efficient and Scalable Approach to CNN Queries in a Road Network Hyung-Ju Cho and Chin-Wan Chung Dept. of EECS, KAIST VLDB 2005

21

We developed new continuous search algorithms which answer NN queries at any point of a given path

Our continuous search algorithms require a small number of static queries in producing the continuous search result

Experimental results with TIGER/Line data demonstrated that UNICONS outperforms its competitors for various number of NNs required and data sets.

Conclusions