Порівняльний аналіз часової ефективності алгоритмів пошуку підрядка
Loading...
Date
2025
Journal Title
Journal ISSN
Volume Title
Publisher
Український державний університет науки і технологій, ІВК «Системні технології», Дніпро
Abstract
UKR: У статті проведено порівняльний аналіз часової ефективності чотирьох класичних алгоритмів пошуку підрядка (string searching algorithms), що намагаються знайти позицію, де один або декілька текстових рядків (зразків) входять у довший рядок або текст. Порівнювались наступні алгоритми: наївного пошуку (перебору, або ж брут-форс), Кнута-Морріса-Пратта (КМП), Боєра-Мура та Рабіна-Карпа. Дослідження проводилось на трьох різних архітектурах процесорів та з трьома наборами вхідних даних різного обсягу. Алгоритми тестувались за умов як холодного, так і прогрітого кешу. Для зниження впливу сторонніх чинників було реалізовано запуск на одному процесорному ядрі та примусове очищення пам’яті після кожного тесту. Результати експериментів проаналізовано за допомогою розрахунків S- та R-показників ефективності, надано рекомендації щодо доцільності застосування кожного окремого алгоритму в різних умовах.
ENG: This paper presents a comparative analysis of the time efficiency of four classical string searching algorithms that attempt to identify the position where one or more pattern strings occur within a longer string or text. The evaluated algorithms include the naive (brute-force) method, Knuth–Morris–Pratt (KMP), Boyer–Moore, and Rabin–Karp. The experiments were conducted on three different processor architectures using three datasets of varying sizes. Each algorithm was tested under both cold and warm cache conditions. To reduce external influence, the benchmarking was limited to a single CPU core, and memory was forcibly cleaned after each run. The experimental results were analyzed using S- and R-indicators of efficiency, and practical recommendations are provided regarding the applicability of each algorithm under different operating conditions.
ENG: This paper presents a comparative analysis of the time efficiency of four classical string searching algorithms that attempt to identify the position where one or more pattern strings occur within a longer string or text. The evaluated algorithms include the naive (brute-force) method, Knuth–Morris–Pratt (KMP), Boyer–Moore, and Rabin–Karp. The experiments were conducted on three different processor architectures using three datasets of varying sizes. Each algorithm was tested under both cold and warm cache conditions. To reduce external influence, the benchmarking was limited to a single CPU core, and memory was forcibly cleaned after each run. The experimental results were analyzed using S- and R-indicators of efficiency, and practical recommendations are provided regarding the applicability of each algorithm under different operating conditions.
Description
І. Клименко: ORCID 0000-0001-5149-3974
Keywords
інформаційна технологія, машинний експеримент, S- та R-показники, алгоритм пошуку підрядка, часова ефективність алгоритму, information technology, machine-based benchmarking, S- and R-metrics, substring search algorithm, time efficiency of algorithms, КІТ
Citation
Клименко І. В., Лебідь Є. А. Порівняльний аналіз часової ефективності алгоритмів пошуку підрядка. Інформаційні технології в металургії та машинобудуванні – ІТММ’2025 : тези доп. Міжнародної наук.-техн. конф. (м. Дніпро, 23-24 березня 2025 р.). Дніпро, 2025. C. 256–261. DOI: 10.34185/1991-7848.itmm.2025.01.045.