Function distances::strings::needleman_wunsch::edits_recursive

source ·
pub fn edits_recursive<U: UInt>(x: &str, y: &str) -> ([Vec<Edit>; 2], U)
Expand description

Determine the set of edits needed to turn one unaligned sequence into another, as well as the edit distance between the two sequences.

Contrast to edits_iterative, which uses the iterative trace back function.

For now, in cases where there exist ties for the shortest edit distance, we only return one alignment.

§Arguments:

  • x: an unaligned sequence.
  • y: an unaligned sequence.

§Returns:

  • Two sets of edits, one to turn x into y and one to turn y into x.
  • The edit distance between x and y.