The Intractability of Computing the Hamming Distance

  • Bodo Manthey
  • Rüdiger Reischuk
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2906)


Given a string x and a language L, the Hamming distance of x to L is the minimum Hamming distance of x to any string in L. The edit distance of a string to a language is analogously defined.

First, we prove that there is a language in AC 0 such that both Hamming and edit distance to this language are hard to approximate; they cannot be approximated with a factor \(O(n^{\frac{1}{3}-\epsilon})\), for any ε > 0, unless P = NP (n denotes the length of the input string).

Second, we show the parameterized intractability of computing the Hamming distance. We prove that for every t ∈ ℕ there exists a language in AC 0 for which computing the Hamming distance is W[t]-hard. Moreover, there is a language in P for which computing the Hamming distance is W[P]-hard.

Finally, we show that the problems of computing the Hamming distance and of computing the edit distance are in some sense equivalent by presenting reductions from the former to the latter and vice versa.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Aho, A.V., Petersen, T.G.: A minimum distance error-correcting parser for context-free languages. SIAM Journal on Computing 1(4), 305–312 (1972)zbMATHCrossRefMathSciNetGoogle Scholar
  2. 2.
    Downey, R.G., Fellows, M.R.: Parameterized Complexity. Springer, Heidelberg (1999)Google Scholar
  3. 3.
    Furst, M., Saxe, J.B., Sipser, M.: Parity, circuits, and the polynomial-time hierarchy. Mathematical Systems Theory 17(1), 13–27 (1984)zbMATHCrossRefMathSciNetGoogle Scholar
  4. 4.
    Greenlaw, R., Hoover, H.J., Ruzzo, W.L.: Limits to Parallel Computation: P-Completeness Theory. Oxford University Press, Oxford (1995)zbMATHGoogle Scholar
  5. 5.
    Gusfield, D.M.: Algorithms on Strings, Trees, and Sequences: Computer Science and Computational Biology. Cambridge University Press, Cambridge (1997)zbMATHCrossRefGoogle Scholar
  6. 6.
    Halldórsson, M.M.: Approximating the minimum maximal independence number. Information Processing Letters 46(4), 169–172 (1993)zbMATHCrossRefMathSciNetGoogle Scholar
  7. 7.
    Hemachandra, L.A.: Algorithms from complexity theory: Polynomial-time operations for complex sets. In: Asano, T., Imai, H., Ibaraki, T., Nishizeki, T. (eds.) SIGAL 1990. LNCS, vol. 450, pp. 221–231. Springer, Heidelberg (1990)Google Scholar
  8. 8.
    Irons, E.T.: An error-correcting parse algorithm. Communications of the ACM 6(11), 669–673 (1963)zbMATHCrossRefGoogle Scholar
  9. 9.
    Karp, R.M.: Mapping the genome: Some combinatorial problems arising in molecular biology. In: Proc. of the 25th Ann. ACM Symp. on Theory of Computing (STOC), pp. 278–285 (1993)Google Scholar
  10. 10.
    Ladner, R.E.: The circuit value problem is log space complete for P. SIGACT News 7(1), 18–20 (1975)CrossRefMathSciNetGoogle Scholar
  11. 11.
    Lyon, G.: Syntax-directed least-errors analysis for context-free languages: A practical approach. Communications of the ACM 17(1), 3–14 (1974)zbMATHCrossRefGoogle Scholar
  12. 12.
    Navarro, G.: A guided tour to approximate string matching. ACM Computing Surveys 33(1), 31–88 (2001)CrossRefGoogle Scholar
  13. 13.
    Pevzner, P.A.: Computational Molecular Biology: An Algorithmic Approach. MIT Press, Cambridge (2000)zbMATHGoogle Scholar
  14. 14.
    Pighizzini, G.: How hard is computing the edit distance? Information and Computation 165(1), 1–13 (2001)zbMATHCrossRefMathSciNetGoogle Scholar
  15. 15.
    Spielman, D.A.: The complexity of error-correcting codes. In: Chlebus, B.S., Czaja, L. (eds.) FCT 1997. LNCS, vol. 1279, pp. 67–84. Springer, Heidelberg (1997)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2003

Authors and Affiliations

  • Bodo Manthey
    • 1
  • Rüdiger Reischuk
    • 1
  1. 1.Institut für Theoretische InformatikUniversität zu LübeckLübeckGermany

Personalised recommendations