A strategy for searching with different access costs

  • Authors:
  • Eduardo Sany Laber;Ruy Luiz Milidiú;Artur Alves Pessoa

  • Affiliations:
  • Departamento de Informática, PUC-Rio, Brazil;Departamento de Informática, PUC-Rio, Brazil;Departamento de Informática, PUC-Rio, Brazil

  • Venue:
  • Theoretical Computer Science
  • Year:
  • 2002

Quantified Score

Hi-index 5.23

Visualization

Abstract

Let us consider an ordered set of keys A = {a1 ... an}, where the probability of searching ai is 1/n, for i = 1,..., n. If the cost of testing each key is similar, then the standard binary search is the strategy with minimum expected access cost. However, if the cost of testing ai is ci, for i = 1 .... , n, then the standard binary search is not necessarily the best strategy.In this paper, we prove that the expected access cost of an optimal search strategy is bounded above by 4Cln(n + 1)/n, where C= Σi=1n ci . Furthermore, we show that this upper bound is asymptotically tight up to constant factors. The proof of this upper bound is constructive and generates a 4ln(n + 1)-approximated algorithm for constructing near-optimal search strategies. This algorithm runs in O(n2) time and requires O(n) space, which can be useful for practical cases, since the best known exact algorithm for this problem runs in O(n3) time and requires O(n2) space.