Jump to content

Ukkonen's algorithm

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Dexbot (talk | contribs) at 01:26, 29 August 2015 (Bot: Deprecating Template:Cite doi and some minor fixes). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

In computer science, Ukkonen's algorithm is a linear-time, online algorithm for constructing suffix trees, proposed by Esko Ukkonen in 1995.[1]

The algorithm begins with an implicit suffix tree containing the first character of the string. Then it steps through the string adding successive characters until the tree is complete. This order addition of characters gives Ukkonen's algorithm its "on-line" property. The original algorithm presented by Peter Weiner proceeded backward from the last character to the first one from the shortest to the longest suffix.[2] A simpler algorithm was found by Edward M. McCreight, going from the longest to the shortest suffix.[3]

The naive implementation for generating a suffix tree going forward requires O(n2) or even O(n3) time complexity in big O notation, where n is the length of the string. By exploiting a number of algorithmic techniques, Ukkonen reduced this to O(n) (linear) time, for constant-size alphabets, and O(n log n) in general, matching the runtime performance of the earlier two algorithms.

References

  1. ^ Ukkonen, E. (1995). "On-line construction of suffix trees" (PDF). Algorithmica. 14 (3): 249–260. doi:10.1007/BF01206331.
  2. ^ Weiner, Peter (1973). "Linear pattern matching algorithms". 14th Annual Symposium on Switching and Automata Theory (SWAT 1973). pp. 1–11. doi:10.1109/SWAT.1973.13. {{cite book}}: External link in |contributionurl= (help); Unknown parameter |contributionurl= ignored (|contribution-url= suggested) (help)
  3. ^ McCreight, Edward Meyers (1976). "A Space-Economical Suffix Tree Construction Algorithm". Journal of the ACM. 23 (2): 262–272. doi:10.1145/321941.321946.