On binary searching with non-uniform costs
On binary searching with non-uniform costs
复制标题
关于非均匀成本的二分搜索
DOI:
--
复制
发表时间:
2001
期刊:
影响因子:
--
通讯作者:
A. Pessoa
中科院分区:
文献类型:
--
作者:
E. Laber;R. Milidiú;A. Pessoa
Let us consider an ordered vector A[1 : n]. If the cost of testing each position is similar, then the standard binary search is the best strategy to search the vector. This is true in both average and worst case. However, if the costs are non-uniform, then the best strategy is not necessarily the standard binary search. The best algorithm to construct a strategy that minimizes the expected search cost runs in &Ogr;(n3) time and requires &Ogr;(n2) space. The same complexities hold for the best algorithm to construct a strategy that minimizes the worst case search cost.
Here, we show how to efficiently construct search strategies that are at most at a constant factor from the optimal one. These constructions take linear time and use only linear space. For the problem of minimizing the expected search cost, we present an algorithm that requires &Ogr;(n) space and gives a (2 + ∈ + &Ogr;(1))-approximated solution in &Ogr;(n) time, for any fixed value of ∈ > 0. On the other hand, for the problem of minimizing the worst case search cost, we describe an algorithm that requires &Ogr;(n) space and gives a (2 + ∈ + &Ogr;(1))- approximated solution in &Ogr;(n) time, for any fixed value of ∈ > 0. These two problems arise when processing a query in a distributed text database indexed by a suffix array.