Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Beyond Compare software algorithm work?

I'm curious to know how does the algorithm of 'Beyond Compare' work?

I guess there's a standard (well-known?) algorithm they used to implement the "character .vs. character" comparison. Do you know the name of this algorithm? Thank you

like image 426
dilip Avatar asked Apr 08 '15 06:04

dilip


1 Answers

Beyond Compare uses a number of different algorithms depending on the file type and configuration. In v4 the line alignment algorithms are explicitly named in the interface:

  • Standard alignment - This is a proprietary algorithm; we haven't made the details publicly available.

  • Myers O(ND) alignment - This is the same one that the GNU diff utility and most other applications use. It's based on the paper "An O(ND) difference algorithm and its variations" by Eugene Myers (1986).

  • Patience Diff alignment - This is the "Patience Diff" algorithm that Bram Cohen originally developed for Bazaar, which he talks about here.

The character alignment to highlight differences within lines is based on the Myers O(ND) algorithm with some post-processing to clean up the results.

like image 167
Zoë Peterson Avatar answered Sep 20 '22 11:09

Zoë Peterson