Roads Belong in Databases Jagan Sankaranarayanan and Hanan

					Niveditha Baskar
Why Road Networks?
 Increasing Queries in Real time
 Eg: Shortest route between two locations, nearest
  objects like gas stations, restaurants.
 Popular services : Google Maps, Microsoft Bing and
  Yahoo maps
Representing Road Networks

Image Source:
Road Networks in Databases
 How the current system works? External Graph
  processing module
 All operations are Graph operations
 Cannot be cast as relational operators => Cannot be
  expressed using SQL
 Why expressing in SQL critical?
- Expressive and English-like language
- Easy to build applications
Current Trends and Challenges
 Road Network operations are expensive
 Algorithm used: Djikstra
   Better approach: Transit node routing
   But these involve searches on graphs during run time
   Computationally complex
   Unsuitable for real-time large scale system
   Current web services: Use Euclidean distance for
    complicate d queries => Introducing approximation

Pre Computation
 Graph data structure transformed to an alternate
  representation called Oracle
 Pre computing shortest paths and distances between
  every pair of vertices
 Resides in a database and SQL can be used
Is this feasible? Yes
 By investing upon sufficient time and hardware
Problem 1: Computation
 New graph Algorithms like Henzinger
  + Hardware techniques like GPU, Parallel computing
   = Linear time computation of Shortest Paths in a
Problem 2: Storage
     Storage of all shortest path is O(n3) space : All
                vertices in a path stored

  Storage of just the next hop between Source and
               destination O(n2+k) space

 Work of authors: Representation of the data in O(n)
More justifications for pre
 Decouples the data from applications/domains
 Many data sets can use the pre computed network
 Road networks are static unlike mobile networks and
  hence pre computation is a one time affair
Road Network Oracle
 Relation representation: O(AB, c) and O(AB, dapx )

 A: Group of source vertices
 B: Group of destination vertices
 c: Common Intermediate Vertex
 dapx : Approximate distance between two groups

      Can be combined as O(AB, c, dapx )
Road Network Oracle
Operations on Oracle
R : Relation of Restaurants
Schema: (id, type, price)

Q: Set of Movie theaters
Schema: (id, movie_id)

p: Source; q: Destination
Z(p,q): Function that maps p,q to a group AB in Oracle
B-tree searches for AB in the Oracle
 Approximate Network distance: Given a source p
  and destination q, obtain an approximate network
  distance between them.
  SELECT O. dapx FROM O WHERE O.AB = Z(p, q)

 Region Search: Given a query location q, obtain all
  restaurants in R that are within 10 miles of q which
  serve Italian cuisine
 SELECT, O.dapx FROM R, O WHERE O.AB = Z(q, and
 R.type = “Italian” and O. dapx ≤ 10 miles
 k-Nearest Neighbor Search: Given a query location
  q, determine the k closest restaurants in R to q which
  serve Italian cuisine.
 SELECT, O.dapx FROM R, O WHERE O.AB = Z(q, and
 R.type = “Italian” ORDER BY O.dapx LIMIT k

 Distance Join: Find the k closest pairs of restaurants
  in R and movie theaters in Q, such that Q is playing a
  movie of movie id m.
 SELECT,, O.dapx FROM R, Q, O WHERE O.AB = Z(, AND id = m ORDER BY O.dapx LIMIT k
Implementation 1: SILC Oracle
 SILC: Spatially Induced Linkage Cognizance
 Coloring operation on all vertices
Quad tree representation
Shortest Path Quad tree for a

 Figure 3: (a) Example road network, (b) the shortest-
 path quadtree of vertex s, and (c) the shortest-path
 quadtree of vertex t.
SILC Oracle
 Shortest path quadtree for each vertex is stored as
  O(q, B, c, dapx )
 Storage requirement: O(n1.5)
 Two dimensional Indexing on q, B using B tree
 Retrieving intermediate vertex and dapx takes O(logn)
 Disadvantage:
  Approximation errors can be large
Implementation 2: Path-Distance
 Uses path coherence
Path-Distance Oracle
 Partitioning: Done by WSP (Well – Separated Pair)
 (AB, c, dε )
 Advantages
- Linear storage
- No redundancy
- Quick Retrieval
   Alternative representation for road networks
   Resides in a database and supports SQL operations
   Scalable, Efficient, Database friendly
   Supports Real-time operations
   Linear time storage implementation using Path-
    Distance Oracle
Related Papers from the authors
 Scalable network distance browsing in spatial
 Efficient query processing on spatial networks
 Distance join queries on spatial networks
 Distance oracles for spatial networks
 Query processing using distance oracles for spatial
 Path oracles for spatial networks
Future Directions
 Dynamic Oracles to deal with changing road
 Dynamic Oracles to also deal with Traffic conditions
 Query Optimization of operations involving Oracles

Shared By: