C++ code for calculating bottleneck distance between two peristence diagrams with mex code for Matlab interop
Based on the Hopcroft-Karp algorithm
Depends on g++ compiler
makeFrom the Matlab command line, run
cd <THIS_DIRECTORY>
mex bottleneck_distance.cppThen from your Matlab code you can call
bottleneck_distance(mat1, mat2)where mat1 and mat2 are two Mx2 matrices representing persistence diagrams.
The function outputs the distance between the two matrices.
You can also run from the command line if you have saved the persistence diagrams to files
./bottleneck pers_dia1.txt pers_dia2.txtrun test_bottleneck.sh
./test_bottleneck.shWritten by Miro Kramer (2013), modified/optimized by Kelvin Abrokwa (2016)