Skip to content

Type Editor


Type Editor / @type-editor/changeset / myers-diff/run-myers-diff

myers-diff/run-myers-diff

Functions

FunctionDescription

runMyersDiff

Run Myers' diff algorithm to find the optimal sequence of changes.

Myers' algorithm uses dynamic programming to find the shortest edit script between two sequences. It explores diagonals in the edit graph, maintaining a frontier of the furthest reaching paths.

See: https://neil.fraser.name/writing/diff/myers.pdf See: https://blog.jcoglan.com/2017/02/12/the-myers-diff-algorithm-part-1/