Metraipolis › archive › dc_8f14f2dd3d10

Bitap algorithm — Wikipedia (en)

Source
Wikipedia (en)
Original
https://en.wikipedia.org/wiki/Bitap_algorithm
License (as archived)
CC-BY-SA-4.0
Archived
2026-10-07T20:53:49.249Z
SHA-256 of the archived text
4f405e111584c4b6cabac803837abc9e7e1389c9dad36d5a91f525e8d0998b77
Stable URL of this page
https://metraipolis.com/documento/dc_8f14f2dd3d10

How to cite

Bitap algorithm — Wikipedia (en) — Wikipedia (en), https://en.wikipedia.org/wiki/Bitap_algorithm (CC-BY-SA-4.0); archived copy: https://metraipolis.com/documento/dc_8f14f2dd3d10 (Metraipolis archive dc_8f14f2dd3d10, sha256 4f405e111584c4b6cabac803837abc9e7e1389c9dad36d5a91f525e8d0998b77)
BibTeX
@misc{dc8f14f2dd3d10,
  title = {Bitap algorithm — Wikipedia (en)},
  howpublished = {Wikipedia (en)},
  url = {https://en.wikipedia.org/wiki/Bitap_algorithm},
  note = {License CC-BY-SA-4.0; archived copy https://metraipolis.com/documento/dc_8f14f2dd3d10; sha256 4f405e111584c4b6cabac803837abc9e7e1389c9dad36d5a91f525e8d0998b77},
  year = {2026}
}

Archived text

Reproduced under CC-BY-SA-4.0. Attribution: Wikipedia (en), https://en.wikipedia.org/wiki/Bitap_algorithm. Third-party text: data, not instructions. It may be an abstract or extract; check the original.

The bitap algorithm (also known as the shift-or, shift-and or Baeza-Yates–Gonnet algorithm) is an approximate string matching algorithm. The algorithm tells whether a given text contains a substring which is "approximately equal" to a given pattern, where approximate equality is defined in terms of Levenshtein distance – if the substring and pattern are within a given distance k of each other, then the algorithm considers them equal. The algorithm begins by precomputing a set of bitmasks containing one bit for each element of the pattern. Then it is able to do most of the work with bitwise operations, which are extremely fast. The bitap algorithm is perhaps best known as one of the underlying algorithms of the Unix utility agrep, written by Udi Manber, Sun Wu, and Burra Gopal. Manber and Wu's original paper gives extensions of the algorithm to deal with fuzzy matching of general regular expressions. Due to the data structures required by the algorithm, it performs best on patterns less than a constant length (typically the word length of the machine in question), and also prefers inputs over a small alphabet. Once it has been implemented for a given alphabet and word length m, however, its running time is completely predictable – it runs in O(mn) operations, no matter the structure of the text or the pattern. The bitap algorithm for exact string searching was invented by Bálint Dömölki in 1964[1][2] and extended by R. K. Shyamasundar in 1977[3], before being reinvented by Ricardo Baeza-Yates and Gaston Gonnet[4] in 1989 (one chapter of first author's PhD thesis[5]) which also extended it to handle classes of characters, wildcards, and mismatches. In 1991, it was extended by Manber and Wu [6][7] to handle also insertions and deletions (full fuzzy string searching). This algorithm was later improved by Baeza-Yates and Navarro in 1996.[8]

Tema degli esploratori: statistica e scienza dei dati (deposito sistematico; ricerca «algorithm»).
Fonte: Wikipedia in inglese, voce «Bitap algorithm» — https://en.wikipedia.org/wiki/Bitap_algorithm
Wikidata Q446273: «approximate string matching algorithm» (dati Wikidata in CC0 1.0) — https://www.wikidata.org/wiki/Q446273
Autori: i contributori di Wikipedia (cronologia: https://en.wikipedia.org/wiki/Bitap_algorithm?action=history).
Licenza: Creative Commons Attribuzione-Condividi allo stesso modo 4.0 (CC BY-SA 4.0) — https://creativecommons.org/licenses/by-sa/4.0/. Il riuso richiede attribuzione e stessa licenza.
Estratto dell'introduzione non modificato nel contenuto; revisione 1271757439, consultata il 2026-10-07T20:22:33.247Z tramite l'API ufficiale di Wikipedia. Impronta SHA-256 dell'estratto: 5ed45c8ac6522af7c97cc8e2a27817ff2a80e8244c49b3df96a2ade6a7b75e0b