Computational Data Modeling and Queries for Location-Based Services in Road Networks Irina...

31
Computational Data Modeling and Queries for Location-Based Services in Road Networks Irina Aleksandrova, Augustas Kligys, Laurynas Speičys
  • date post

    22-Dec-2015
  • Category

    Documents

  • view

    223
  • download

    0

Transcript of Computational Data Modeling and Queries for Location-Based Services in Road Networks Irina...

Page 1: Computational Data Modeling and Queries for Location-Based Services in Road Networks Irina Aleksandrova, Augustas Kligys, Laurynas Speičys.

Computational Data Modeling andQueries for Location-Based Services in Road Networks

Irina Aleksandrova, Augustas Kligys, Laurynas Speičys

Page 2: Computational Data Modeling and Queries for Location-Based Services in Road Networks Irina Aleksandrova, Augustas Kligys, Laurynas Speičys.

Problem Setting

RoadNetwork

MobileUser

Ph

road networks

Application domain:

mobile users issue queries about stationary objects “Find the 3 nearest open pharmacies”

Scenario:

data modelingsystem architecture for query processingalgorithms, underlying computation of the query

result

Main issues:

Topic:location-based services

Page 3: Computational Data Modeling and Queries for Location-Based Services in Road Networks Irina Aleksandrova, Augustas Kligys, Laurynas Speičys.

Outline

Problem Setting

Data Model and Transformation

Querying

System Architecture

Query Processing Algorithms

Future Work

Page 4: Computational Data Modeling and Queries for Location-Based Services in Road Networks Irina Aleksandrova, Augustas Kligys, Laurynas Speičys.

Road Network Data Model

RoadNetwork

2D traffic regulations on intersections

Road elements:

Segments:

bi-directional, one-directional roads separating lines different properties on different directions of the single road (e.g., surface quality, speed limit)

Connections:

Page 5: Computational Data Modeling and Queries for Location-Based Services in Road Networks Irina Aleksandrova, Augustas Kligys, Laurynas Speičys.

Objects’ Data Model

Objects on the road network:

Query point: position

Data points:

2D

PhPh

RoadNetwork

Ph

qp

position several locations accessibility from different movement directions properties

Page 6: Computational Data Modeling and Queries for Location-Based Services in Road Networks Irina Aleksandrova, Augustas Kligys, Laurynas Speičys.

Transformation: the Idea

Transformation

70km/h100km/h

100km/h

Identify chains of segments two segments meet the same movement directions the same properties

Transform:

ending connections of chains to vertices

chains to edges

Page 7: Computational Data Modeling and Queries for Location-Based Services in Road Networks Irina Aleksandrova, Augustas Kligys, Laurynas Speičys.

Transformation: Segments to Edges

A chain of segments ch = {s1, … , sn} An edge e = (vs, ve, w, l) Co-edge relation coE

Components:

Weight is computed according to travel distance of paths of a chain:

70km/h

100km/h

100km/h

pth1

pth2

e1

e2

vs, ve corresponds to ends of chains l corresponds to a sum of road distances of chain’s segments

(e1, e2) coE if turn around on segments is allowed

1

1 11

),(1

1),()(n

i

s

l

bothl

r

k

ppsdrkii prprppdpthTD ii

Page 8: Computational Data Modeling and Queries for Location-Based Services in Road Networks Irina Aleksandrova, Augustas Kligys, Laurynas Speičys.

Transformation: Connections To Vertices

Single Vertex

qp

no restrictions c v Mapping according to restrictions on movement on v:

any restrictions c {v1,…,vn}{ ,…, }

Connections

qp

Multiple Vertices

qp

X

X

Components: connection c =(p, mx) vertex v

Semantics of vertex: can move to any outgoing edge from any ingoing edge

01e 0

me

Page 9: Computational Data Modeling and Queries for Location-Based Services in Road Networks Irina Aleksandrova, Augustas Kligys, Laurynas Speičys.

Transformation: Objects

Graph: dpG = (e , posl, posw, speedw, t)

Query point: 2D: qp2D = (p, s)

12

12

tt

posposspeed

tw

tw

w

posl = RD(pth) + d(pk, qp)

posw = TD (pth) + TDs (pk, qp)

QP

t1

t2

pth poswposl

qpqp

pk

p1

Page 10: Computational Data Modeling and Queries for Location-Based Services in Road Networks Irina Aleksandrova, Augustas Kligys, Laurynas Speičys.

Transformation: Objects

DP

lc1 Graph: dpG = (e , posl , posw)

Data point: 2D: dp2D = (prop={…}, loc={lc1,lc2,…})

Graph: dpG = (e , posl, posw, speedw, t)

Query point: 2D: qp2D = (p, s)

One location to one (two) data point: lc1 dp1

G, lc2 dp2G, …

Ph

lc2

QP

t1

t2

pth posw

12

12

tt

posposspeed

tw

tw

w

poslqp

qp

posl = RD(pth) + d(pk, qp)

posw = TD (pth) + TDs (pk, qp)

pk

p1

Page 11: Computational Data Modeling and Queries for Location-Based Services in Road Networks Irina Aleksandrova, Augustas Kligys, Laurynas Speičys.

Outline

Problem Setting

Data Model and Transformation

Querying

System Architecture

Query Processing Algorithms

Future Work

Page 12: Computational Data Modeling and Queries for Location-Based Services in Road Networks Irina Aleksandrova, Augustas Kligys, Laurynas Speičys.

Querying

Query: ”Find 2 nearest pharmacies”

Problem: compute k-NN T=t1 Answer: {A,B}

Problem: active result T=t2 Answer: {B,A}

A

B

Page 13: Computational Data Modeling and Queries for Location-Based Services in Road Networks Irina Aleksandrova, Augustas Kligys, Laurynas Speičys.

Outline

Problem Setting

Data Model and Transformation

Querying

System Architecture

Query Processing Algorithms

Future Work

Page 14: Computational Data Modeling and Queries for Location-Based Services in Road Networks Irina Aleksandrova, Augustas Kligys, Laurynas Speičys.

Scenario of Processing a New Query

User issues a query providing NNs, their number k, and Max Road Distance

Client searches for k NNs and validates the data set:

Client issues a query to Server with user’s query and current position (x, y) Server “quickly” selects l NNCs from an area around (x, y),

0 l max NNCs in map.

Position tracking

Active result

Quick selection

k NN search

Visual.

Client

Server

Find not less than 3 open pharmacies around (157, 52)

not further than 10 km

Find 3 nearest open pharmacies

within 10 km,

User

4 open pharmacies,location of the query window

Visualization of 3 pharmacies

Validation

upon invalid data set reissues the query + Minimal Road Distance upon valid data set maintains an active result and visualizes the result

GPS

Page 15: Computational Data Modeling and Queries for Location-Based Services in Road Networks Irina Aleksandrova, Augustas Kligys, Laurynas Speičys.

Outline

Problem Setting Data Model and Transformation Querying System Architecture Query Processing Algorithms

Future work

“Quick” Selection Validation k NN Search Algorithms Handling Updates

Page 16: Computational Data Modeling and Queries for Location-Based Services in Road Networks Irina Aleksandrova, Augustas Kligys, Laurynas Speičys.

X10 X11

Y30

Y31

1.825 1.850 1.875

425

400

375

Grid Data Structure

A 2D map is covered by a grid.

Each data point in the map is associated with a cell.

Each cell has information about all data points within it.

A cell is accessed directly.

Page 17: Computational Data Modeling and Queries for Location-Based Services in Road Networks Irina Aleksandrova, Augustas Kligys, Laurynas Speičys.

y5

y4

y3

y2

y1

x1 x2 x3 x4 x5 x6

“Quick” Selection

QPoint

QWindow3

QWindow1

QWindow2

Processing initial query: Select data points from the cell of QPoint

(QWindow1) While ((NNCs < k) &

(MRD not reached) & (there are unexplored cells)){select NNCs from additional “ring”}

Page 18: Computational Data Modeling and Queries for Location-Based Services in Road Networks Irina Aleksandrova, Augustas Kligys, Laurynas Speičys.

“Quick” Selection

A new QWindow is formed reusing already selected data.

QWindow2

QPoint

QWindow3

QPoint

QWindow1

QWindow2y5

y4

y3

y2

y1

x1 x2 x3 x4 x5 x6

Only an update is sent to the Client: additional data points discarded data points

A query is received from Client

Processing subsequent query:

Processing initial query: Select data points from the cell of QPoint

(QWindow1) While ((NNCs < k) &

(MRD not reached) & (there are unexplored cells)){select NNCs from additional “ring”}

Page 19: Computational Data Modeling and Queries for Location-Based Services in Road Networks Irina Aleksandrova, Augustas Kligys, Laurynas Speičys.

Outline

Problem Setting Data Model and Transformation Querying System Architecture Query Processing Algorithms

Future work

“Quick” Selection Validation k NN Search Algorithms Handling Updates

Page 20: Computational Data Modeling and Queries for Location-Based Services in Road Networks Irina Aleksandrova, Augustas Kligys, Laurynas Speičys.

Validation

solves data shortage problem

correct, if RD(qp, nnRDlast) < dist(qp,qw)

frame = normalized TD

Frame validation:

)(1

,min pathTDa

bpdist qp

Boundb

incorrect, if TD(qp, dp’) < TD (qp,dp)

The result of the NNs list:

Validation

Page 21: Computational Data Modeling and Queries for Location-Based Services in Road Networks Irina Aleksandrova, Augustas Kligys, Laurynas Speičys.

Outline

Problem Setting Data Model and Transformation Querying System Architecture Query Processing Algorithms

Future work

“Quick” Selection Validation k NN Search Algorithms Handling Updates

Page 22: Computational Data Modeling and Queries for Location-Based Services in Road Networks Irina Aleksandrova, Augustas Kligys, Laurynas Speičys.

NN Search Algorithms

was not visited has the lowest travel distance

Next step – vertex that

Search in the graph is based on best-first search.

knnWOTturn-around is not allowed

knnWTturn-around is allowed

5

5

81

8

12

8

12

3

1

startroot edge

qp

Page 23: Computational Data Modeling and Queries for Location-Based Services in Road Networks Irina Aleksandrova, Augustas Kligys, Laurynas Speičys.

Algorithm knnWOT

Search

scans the root edge and runs the best-first search from the end point of the root edge

data points qp

data points on the root edge might appear twice in the NN list

Page 24: Computational Data Modeling and Queries for Location-Based Services in Road Networks Irina Aleksandrova, Augustas Kligys, Laurynas Speičys.

Algorithm knnWOT

Search

Active result

scans the root edge and runs the best-first search from the end point of the root edge

qp

data points on the root edge might appear twice in the NN list

discards data points from the NN list that are behind the query point

Page 25: Computational Data Modeling and Queries for Location-Based Services in Road Networks Irina Aleksandrova, Augustas Kligys, Laurynas Speičys.

Algorithm knnWT

Two search trees

the first:considers the nearest data pointsthe query point is approaching to

the second:considers the nearest data pointsthe query point is moving away

Merge results of both trees

Search

Active result

dp2

dp1

dp3

dp3

dp4

qp

co-qpdp1

changes the order of the elements in the NN list

Page 26: Computational Data Modeling and Queries for Location-Based Services in Road Networks Irina Aleksandrova, Augustas Kligys, Laurynas Speičys.

Active Result for knnWT

[14][9][4][4] dp3 dp2 dp4 dp1

-1 1.5 -3.5

now

now +1.5

CB dp1

[4]

dp3

[14]

dp2

[9]

qp

[1]

speed=1dp4

[4]

st1 nd2 rd3 th4

alarms

Page 27: Computational Data Modeling and Queries for Location-Based Services in Road Networks Irina Aleksandrova, Augustas Kligys, Laurynas Speičys.

Active Result for knnWT

[14][9][4][4] dp3 dp2 dp4 dp1

-1 1.5 -3.5

4 0 NULL

CB dp1

[4]

dp3

[14]

dp2

[9]

dp4

[4]

SWAPPING

qp

[2.5]

speed=1

st1 nd2 rd3 th4

alarms

alarms

[4]dp1 [14]dp3[4]dp4[9]dp2

now

now +1.5

Page 28: Computational Data Modeling and Queries for Location-Based Services in Road Networks Irina Aleksandrova, Augustas Kligys, Laurynas Speičys.

Outline

Problem Setting Data Model and Transformation Querying System Architecture Query Processing Algorithms

Future work

“Quick” Selection Validation k NN Search Algorithms Handling Updates

Page 29: Computational Data Modeling and Queries for Location-Based Services in Road Networks Irina Aleksandrova, Augustas Kligys, Laurynas Speičys.

Handling Updates

Insertion of the data point into the NN list

if the edge was already traversed (it is in the search tree) then insert a new data point into NN list (no other points are discarded)

Deletion of the data point from the NN list

perform NN search algorithm from the scratch

if edge was not traversed – do not insert a data point

Page 30: Computational Data Modeling and Queries for Location-Based Services in Road Networks Irina Aleksandrova, Augustas Kligys, Laurynas Speičys.

Outline

Problem Setting Data Model and Transformation Querying System Architecture Query Processing Algorithms

Future work

“Quick” Selection Validation k NN Search Algorithms Handling Updates

Page 31: Computational Data Modeling and Queries for Location-Based Services in Road Networks Irina Aleksandrova, Augustas Kligys, Laurynas Speičys.

Future Work

Moving function for query point in 2D representation

Predefined routes

Using indexing in data selection accordingto the density of roads or objects

Experiments