Keyword-aware Optimal Route Search

Xin Cao, Lisi Chen, Gao Cong, Xiaokui Xiao

This paper, presented at VLDB 2012, tackles a common frustration with modern map services: the lack of flexibility in trip planning. While Google Maps or Baidu can find the shortest path, they struggle when you add specific constraints like "find the most popular route that passes a pharmacy, a coffee shop, and a park, all within a 2-hour walking limit."

TL;DR

The authors define and solve the Keyword-aware Optimal Route (KOR) problem: finding a path that covers specific user keywords, stays under a budget (like time or distance), and optimizes an objective (like popularity). They introduce two approximation algorithms, OSScaling and BucketBound, which provide provable performance guarantees for this NP-hard problem.

What Problem Does This Paper Address?

Standard route planning usually focuses on a single metric (shortest distance). However, real-world travel involves trade-offs. A tourist might want a route that is "popular" (based on historical GPS or Flickr data) but must also pass through specific types of points of interest (POIs) without exceeding a total travel time.

This is computationally difficult because it combines elements of the Traveling Salesman Problem (visiting specific nodes) and the Weight-Constrained Shortest Path Problem. The authors prove that the KOR problem is NP-hard, meaning as the number of possible locations and keywords grows, finding the absolute "perfect" route becomes exponentially harder.

Methods

The authors propose three main algorithmic approaches:

  1. OSScaling (Objective Score Scaling): This is the foundational approximation algorithm. It works by scaling the objective values of edges into integers using a parameter $\epsilon$. By "rounding" the scores, the algorithm can group similar partial routes together and prune "dominated" paths (paths that are worse in every metric—keywords covered, cost, and objective score—than another path at the same node). This keeps the search space polynomial rather than exponential.
  2. BucketBound: An optimization of OSScaling. It divides potential routes into "buckets" based on their estimated final objective scores. Instead of searching until every possibility is exhausted, BucketBound can terminate early once it finds a feasible route that is guaranteed to be within a certain range of the optimal solution.
  3. Greedy Heuristic: A faster, non-guaranteed approach that picks the next node based on a weighted score of the remaining budget and the objective gain.
  4. Pre-processing: To speed up all algorithms, they use the Floyd-Warshall algorithm to pre-calculate the "best" objective and "best" budget paths between all pairs of nodes.

Datasets

The researchers evaluated their algorithms using two primary sources:

  • Flickr Dataset (Real-world): 1.5 million geo-tagged photos from New York City. They clustered these into 5,199 locations with 9,785 unique tags (keywords). "Popularity" was calculated based on the number of unique users transitioning between locations.
  • Synthetic Road Networks: Based on the NYC road network, they generated four datasets ranging from 5,000 to 20,000 nodes, assigning random keywords and objective scores to test scalability.

Key Insights and Ideas

  • Label Domination is Key: The most important trick for efficiency is "pruning." If Route A has covered all the keywords Route B has, but Route A is both cheaper and more popular, Route B can be discarded immediately.
  • The Scaling Trade-off: By adjusting the scaling parameter $\epsilon$, users (or system designers) can trade off accuracy for speed. A larger $\epsilon$ makes the algorithm run faster but results in a slightly less "optimal" route.
  • Keyword Sparsity: The authors observed that most queries contain fewer than 5 keywords. Their algorithms are designed to be exponential in the number of keywords but polynomial in the number of nodes, making them highly effective for typical search engine behavior.

Key Results

  • Efficiency: BucketBound was the star performer, running 8-10 times faster than the standard OSScaling while maintaining similar accuracy.
  • Accuracy: Both approximation algorithms stayed well within their theoretical error bounds. In practice, they often found routes very close to the true optimum.
  • Greedy Failure: While the Greedy algorithm is the fastest, it failed to find a valid route in 10-20% of cases because it "trapped" itself by not looking far enough ahead to satisfy the hard budget or keyword constraints.
  • Scalability: The algorithms scaled well to datasets with 20,000 nodes, making them viable for city-scale applications.

Limitations and Future Work

  • Pre-processing Overhead: The current approach relies on all-pairs shortest path calculations ($O(V^3)$), which is too slow for massive, continent-scale graphs. The authors suggest using graph partitioning in the future to limit pre-processing to local subgraphs.
  • Static Graphs: The model assumes that edge costs (like travel time) are static. It does not account for real-time traffic data or dynamic changes in the network.
  • Additive Objectives: The objective function (e.g., popularity) is assumed to be the sum of edge scores. More complex, non-additive objective functions might require different mathematical approaches.

Summary updated

BibTeX
@article{cao2012keyword,
  author = {Xin Cao and Lisi Chen and Gao Cong and Xiaokui Xiao},
  title = {{Keyword-aware Optimal Route Search}},
  journal = {Proc. VLDB Endow.},
  year = {2012},
  url = {https://openreview.net/forum?id=lzWdmeo3g6},
}
Figure