Trip Planning Queries F. Li, D. Cheng, M. Hadjieleftheriou, G. Kollios, S.-H. Teng Boston University Motivation MapQuest, Google Maps, etc. have become essential web services. Albeit, they provide simple driving directions given a start and an end point. The same is true for vehicle navigation systems, GPS devices, etc… It is time to support more advanced services! A Novel Idea Trip Planning Queries (TPQ): Given a starting location, a destination and arbitrary points of interest try to find the best possible trip. Example: Minimize the total traveling time from Boston to Providence, while visiting a post office, a hardware store and a gas station. Visual Example Home Work Gas station We can minimize the total distance, time, etc. We can have different categories of points of interest (gas stations, hotels, etc.). Formally Solve TPQ on metric graphs (e.g., transportation networks). Given a metric graph G(V, E), a set R of categories, a starting vertex S and an ending vertex D, find a vertex traversal T (or trip) from S to D that visits at least one vertex from each category in R and has the minimum possible cost. Define the cost of a trip C(T) appropriately. Observations TPQ is harder than Traveling Salesman Problem (TSP): Given any TSP instance assume that every vertex belongs to its own unique category. To answer TPQ in practice we need to develop approximate solutions The Nearest Neighbor Algorithm B2 A2 S D C2 B3 B1 A1 C1 a 2m+1 - 1 approximation where m is the total number of categories. Yields The Minimum Distance Algorithm B2 A2 S D C2 B3 B1 A1 Yields C1 an m-approximation where m is the total number of categories. The Minimum Distance Algorithm The Minimum Distance Algorithm restricts the search space/region as an ellipse. p3 p1 S candidate p p2 D search region SR Other Algorithms Previous algorithms give approximations in terms of m. Approximations in terms of the maximum category cardinality r: Use Integer Linear Programming. Approximations in terms of both m and r: Use the generalized minimum spanning tree. The Algorithms in Practice Can we use the previous algorithms in practice for spatial databases? Applications in Euclidean spaces using R- trees. Applications in Road networks using specialized indices NN Algorithm on R-trees Starting from S locate the nearest neighbor of S that belongs to any category in R. Iteratively continue until all categories have been covered. Connect the last vertex found with D. Use any NN algorithm on R-trees MD Algorithm on R-trees We need to locate one point per category such that L=|Sp| + |pD| is minimized. We implement a NN search that tries to minimize L instead of MinDist when sorting the R-tree MBRs: B M D p A S MD Algorithm on Road Network As before, locate the m points that minimize the total network distance from S to D. We implement a specialized algorithm for finding such points on a road network: Expand all paths from S to D. Separate into two categories: Paths that have located a point of interest p and ones that have not. The first compete to find a shortest path to p. The latter compete to find a shortest path from p to D. Return the path that minimizes the sum. An Example in Road Network We represent the point on a road network by its distance to the node with smaller index. n4 n4 p2(3.2) 4.0 p2(3.2) 5.0 D(3.0) 4.0 4.0 4.0 n1 p1(1.0) S(2.0)n2 p3(0.8) 6.0 n3 S->n2->p3->n2->D, 6.6 n1 5.0 p1(1.0) S(2.0)n2 p4(3.2) D(3.0) p3(0.8) 6.0 n3 S->n2-> p4 ->D, 5.4 Experimental Evaluation We used synthetic datasets on real road networks (Oldenburg) and real datasets from the state of California. We varied the total number of categories m, the density per category r, and the network sizes. We compare the NN and MD algorithms on road networks using R-trees. Datasets Average Trip Length Query Cost Conclusion Introduced a novel query for spatial databases. Designed four approximation algorithms with various approximation guarantees. Implemented the algorithms in practice using R-trees for Euclidean spaces and road networks. Contacted a comprehensive experimental evaluation. Thank you!