Digitala Vetenskapliga Arkivet

Change search
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf
Evaluation of the Boyer-Moore and Knuth-Morris-Pratt String-Searching
University of Gävle, Faculty of Engineering and Sustainable Development, Department of Computer and Geospatial Sciences.
2025 (English)Independent thesis Basic level (professional degree), 180 HE creditsStudent thesis
Abstract [en]

The utilization of string searching algorithms holds significant importance within the

field of computer science, including applications in diverse areas such as text pro-

cessing and data analysis. With the advancement of technology, we strive to opti-

mize our search methods for text, whether it is for words, or phrases. Therefore,

the choice of algorithm used to search for a specific string becomes crucial in achiev-

ing the fastest possible results. While many studies have compared string searching

algorithms, limited work has explored how various factors influence their perfor-

mance, particularly in terms of execution time. Accordingly, this work aims to in-

vestigate and evaluate the performance of commonly used string searching algo-

rithms, namely Boyer-Moore, and Knuth-Morris-Pratt, under varying conditions

such as text size, pattern length, RAM, CPU, and choice of compiler. The work in-

volves also a comparative analysis of their performance using the java programming

language with two different IDEs compilers, namely the NetBeans JDK and ECJ

compiler as well as different RAM and CPU configurations. To determine the im-

pact of these factors on the efficiency of the two algorithms, we use factorial analy-

sis, which enables us to assess the relative importance of each factor and identify

their interactions. This work bridges the gap in existing work by investigating how

these factors impact the execution time of string searching algorithms. The analysis

provides valuable insights into the strength and limitations of different algorithms,

offering guidance for optimizing their use and contributing to the development of

more efficient solutions for string searching tasks. In summary, the findings indicate

that the text size and compiler choice have a significant influence on the execution

times of the Boyer-Moore (BM) and Knuth-Morris-Pratt (KMP), algorithms, with

text size having the greatest impact on the execution time.

Abstract [sv]

Användning av strängsökningsalgoritmer har stor betydelse inom datavetenskapen

och tillämpas inom olika områden som textbehandling och dataanalys. Med den tek-

nologiska utvecklingen strävar vi efter att optimera våra sökmetoder för text, oav-

sett om det gäller ord eller fraser. Därför blir valet av algoritm för att söka efter en

specifik sträng avgörande för att uppnå snabbast möjliga resultat. Trotts att ett flertal

studier har genomfört jämförelser av strängsökningsalgoritmer, är det relativt få

undersökningar som har fokuserat på att analysera hur olika faktorer inverkar på de-

ras prestanda, särskilt med avseende på exekveringstid. Följaktligen var syftet med

detta arbete att undersöka och utvärdera prestanda hos två vanliga algoritmer för

strängsökning, Boyer-Moore (BM) och Knuth-Morris-Pratt (KMP), under varie-

rande förhållanden såsom textstorlek, mönsterlängd, tillgänglig RAM, CPU, och val

av kompilator. För att utföra studien genomfördes en jämförande analys av deras

prestanda genom att implementera algoritmerna i programmeringsspråket Java och

använda två olika kompilatorer, nämligen NetBeans JDK och Eclipse kompilator för

java (ECJ). För att bestämma den optimala kombinationen av faktorer användes fak-

toranalys, som möjliggjorde bedömning av den relativa betydelsen av varje faktor

samt identifiering av deras interaktioner. Detta arbete överbygger gapet i befintlig

forskning genom att undersöka hur dessa faktorer påverkar exekveringstiden för

strängsökningsalgoritmer. Analysen ger värdefulla insikter om styrkan och begräns-

ningarna hos olika algoritmer, ger vägledning för att optimera deras användning och

bidrar till utvecklingen av mer effektiva lösningar för strängsökningsuppgifter. Sam-

manfattningsvis antyder resultaten att både textstorleken och valet av kompilator har

en betydande inverkan på exekveringstiden för BM- och KMP-algoritmerna, där

textstorleken har den största inverkan på exekveringstiden.

Place, publisher, year, edition, pages
2025. , p. 29
Keywords [en]
String searching algorithm, Boyer-Moore, Knuth-Morris-Pratt, String matching, Factorial analysis
National Category
Engineering and Technology
Identifiers
URN: urn:nbn:se:hig:diva-46653OAI: oai:DiVA.org:hig-46653DiVA, id: diva2:1946712
Subject / course
Computer science
Educational program
Högskoleingenjör
Presentation
, Gävle (Swedish)
Supervisors
Examiners
Available from: 2025-04-28 Created: 2025-03-23 Last updated: 2025-04-28Bibliographically approved

Open Access in DiVA

Evaluation of the Boyer-Moore and Knuth-Morris-Pratt String-Searching(659 kB)9 downloads
File information
File name FULLTEXT01.pdfFile size 659 kBChecksum SHA-512
148706563f07248df7452410ab592cd0fc0a7e3c35ed5d7f5db9e65a05b590909aa6e71ce573ebdca9fa150fa8061b906647ee0f377b780a54563152497ff384
Type fulltextMimetype application/pdf

Search in DiVA

By author/editor
Lolo, Rim
By organisation
Department of Computer and Geospatial Sciences
Engineering and Technology

Search outside of DiVA

GoogleGoogle Scholar
Total: 9 downloads
The number of downloads is the sum of all downloads of full texts. It may include eg previous versions that are now no longer available

urn-nbn

Altmetric score

urn-nbn
Total: 10 hits
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf