View
214
Download
2
Embed Size (px)
Citation preview
Computational Data Modeling and Query Processing in Road Networks
Irina Aleksandrova, Augustas Kligys, Laurynas Speičys
4-th WIM meeting, Aalborg 2002
Problem Setting
RoadNetwork
MobileUser
Ph
road networks
Application domain:
mobile users issue queries about stationary objects “Find the 3 nearest open pharmacies”
Scenario:
data modelingalgorithms, underlying computation of the query
result
Main issues:
Topic:location-based services
Outline
Data Model of road networks 2D representation Graph representation
Query Processing Algorithms Data selection Search in a graph
Proposals
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:
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
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
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 a turn around on the segment is allowed
1
1 11
),(1
1),()(n
i
s
l
bothl
r
k
ppsdrkii prprppdpthTD ii
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
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
Outline
Data Model of road networks 2D representation Graph representation
Query Processing Algorithms Data selection Search in a graph
Proposals
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
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
Outline
Data Model of road networks 2D representation Graph representation
Query Processing Algorithms Data selection Search in a graph
Proposals
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.
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”}
“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”}
Outline
Data Model of road networks 2D representation Graph representation
Query Processing Algorithms Data selection Search in a graph
Proposals
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
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
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
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
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
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
Outline
Data Model of road networks 2D representation Graph representation
Query Processing Algorithms Data selection Search in a graph
Proposals
Proposals
Active result:
impact of grid cell size on varying density of data points (city vs. country)
Quick selection:
comparison of grid to other spatial indexing techniques (e.g., quad-trees) performance of “raw” implementation vs. use of DBMS (e.g., Oracle)
Comparison of difference in precision and update intensity with: update after passing an intersection update in regular intervals
Implementations, Improvements, Alternatives, Testing