Skip to main content

ukkonen

Function ukkonen 

Source
pub fn ukkonen(
    text: &[u8],
    pattern: &[u8],
    max_dist: usize,
) -> Vec<(usize, usize)>
Expand description

Ukkonen cut-off approximate matching via bounded dynamic programming.

Uses a classic DP matrix but only fills the diagonal band of width 2 * max_dist + 1, achieving O(n * max_dist) time instead of O(nm).

Returns (end_position, edit_distance) pairs for every text position where a semi-global alignment of the pattern ends with edit distance <= max_dist.