Space-Efficient Frameworks for Top-kString Retrieval

作者:Hon Wing Kai*; Shah Rahul; Thankachan Sharma V; Vitter Jeffrey Scott
来源:Journal of the ACM, 2014, 61(2): 9.
DOI:10.1145/2590774

摘要

The inverted index is the backbone of modern web search engines. For each word in a collection of web documents, the index records the list of documents where this word occurs. Given a set of query words, the job of a search engine is to output a ranked list of the most relevant documents containing the query. However, if the query consists of an arbitrary string-which can be a partial word, multiword phrase, or more generally any sequence of characters-then word boundaries are no longer relevant and we need a different approach. In string retrieval settings, we are given a set D = {d(1), d(2), d(3),..., dD} of D strings with n characters in total taken from an alphabet set Sigma = [sigma], and the task of the search engine, for a given query pattern P of length p, is to report the "most relevant" strings in D containing P. The query may also consist of two or more patterns. The notion of relevance can be captured by a function score(P, d(r)), which indicates how relevant document dr is to the pattern P. Some example score functions are the frequency of pattern occurrences, proximity between pattern occurrences, or pattern-independent PageRank of the The first formal framework to study such kinds of retrieval problems was given byMuthukrishnan [SODA 2002]. He considered two metrics for relevance: frequency and proximity. He took a threshold-based approach on these metrics and gave data structures that use O(nlog n) words of space. We study this problem in a somewhat more natural top-k framework. Here, k is a part of the query, and the top k most relevant (highestscoring) documents are to be reported in sorted order of score. We present the first linear-space framework (i. e., using O( n) words of space) that is capable of handling arbitrary score functions with near-optimal O(p + klog k) query time. The query time can be made optimal O(p + k) if sorted order is not necessary. Further, we derive compact space and succinct space indexes (for some specific score functions). This space compression comes at the cost of higher query time. At last, we extend our framework to handle the case of multiple patterns. Apart from providing a robust framework, our results also improve many earlier results in index space or query time or both.