In [1]:
import pickle
import src.bottleneck as bottleneck

# Load data from pickle file
with open('results/dragon_complexes.pkl', 'rb') as f:
    complex_res = pickle.load(f)

for sample_name in list(complex_res.keys()):

    sample_complexes = complex_res[sample_name]

    print(f"\n{'='*80}")
    print(f"BOTTLENECK DISTANCES FOR {sample_name.upper()}")
    print(f"{'='*80}")

    distances = bottleneck.compute_bottleneck_distances(sample_complexes)
    mds_results = bottleneck.compute_mds(distances)
    bottleneck.visualize_bottleneck_distances(mds_results, sample_complexes.keys())
================================================================================
BOTTLENECK DISTANCES FOR DRAGON 500
================================================================================

Computing dimension 0...

Complex             rips              cech              delaunay_cech     alpha             delaunay_alpha    witness           relaxed_witness   strong_witness    
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rips                0.000             0.00679752        0.00679752        0.00679752        0.00679752        0.00679752        0.00679752        0.00679752        
cech                0.00679752        0.000             0.00000000        0.00339876        0.00339876        0.00002310        0.00002310        0.00005313        
delaunay_cech       0.00679752        0.00000000        0.000             0.00339876        0.00339876        0.00002310        0.00002310        0.00005313        
alpha               0.00679752        0.00339876        0.00339876        0.000             0.00000000        0.00339876        0.00339876        0.00339876        
delaunay_alpha      0.00679752        0.00339876        0.00339876        0.00000000        0.000             0.00339876        0.00339876        0.00339876        
witness             0.00679752        0.00002310        0.00002310        0.00339876        0.00339876        0.000             0.00000000        0.00005313        
relaxed_witness     0.00679752        0.00002310        0.00002310        0.00339876        0.00339876        0.00000000        0.000             0.00005313        
strong_witness      0.00679752        0.00005313        0.00005313        0.00339876        0.00339876        0.00005313        0.00005313        0.000             

Computing dimension 1...

Complex             rips              cech              delaunay_cech     alpha             delaunay_alpha    witness           relaxed_witness   strong_witness    
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rips                0.000             inf               0.00425640        inf               0.00425640        inf               0.00425640        0.00425640        
cech                inf               0.000             inf               0.01020214        inf               inf               inf               inf               
delaunay_cech       0.00425640        inf               0.000             inf               0.00246345        inf               0.00015595        0.00018729        
alpha               inf               0.01020214        inf               0.000             inf               inf               inf               inf               
delaunay_alpha      0.00425640        inf               0.00246345        inf               0.000             inf               0.00246345        0.00246345        
witness             inf               inf               inf               inf               inf               0.000             inf               inf               
relaxed_witness     0.00425640        inf               0.00015595        inf               0.00246345        inf               0.000             0.00015603        
strong_witness      0.00425640        inf               0.00018729        inf               0.00246345        inf               0.00015603        0.000             

Using replacement value for infinity intervals in dimension 1: 0.032675883505129455

Computing dimension 2...

Complex             rips              cech              delaunay_cech     alpha             delaunay_alpha    witness           relaxed_witness   strong_witness    
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rips                0.000             inf               inf               inf               inf               inf               inf               inf               
cech                inf               0.000             inf               0.01021854        inf               inf               inf               inf               
delaunay_cech       inf               inf               0.000             inf               0.00632185        0.00021858        inf               inf               
alpha               inf               0.01021854        inf               0.000             inf               inf               inf               inf               
delaunay_alpha      inf               inf               0.00632185        inf               0.000             0.00632185        inf               inf               
witness             inf               inf               0.00021858        inf               0.00632185        0.000             inf               inf               
relaxed_witness     inf               inf               inf               inf               inf               inf               0.000             inf               
strong_witness      inf               inf               inf               inf               inf               inf               inf               0.000             

Using replacement value for infinity intervals in dimension 2: 0.03541411138860276
No description has been provided for this image
================================================================================
BOTTLENECK DISTANCES FOR DRAGON 1000
================================================================================

Computing dimension 0...

Complex             rips              cech              delaunay_cech     alpha             delaunay_alpha    witness           relaxed_witness   strong_witness    
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rips                0.000             0.00528380        0.00528380        0.00528380        0.00528380        0.00528380        0.00528380        0.00528380        
cech                0.00528380        0.000             0.00000000        0.00264190        0.00264190        0.00001396        0.00001396        0.00002849        
delaunay_cech       0.00528380        0.00000000        0.000             0.00264190        0.00264190        0.00001396        0.00001396        0.00002849        
alpha               0.00528380        0.00264190        0.00264190        0.000             0.00000000        0.00264190        0.00264190        0.00264190        
delaunay_alpha      0.00528380        0.00264190        0.00264190        0.00000000        0.000             0.00264190        0.00264190        0.00264190        
witness             0.00528380        0.00001396        0.00001396        0.00264190        0.00264190        0.000             0.00000000        0.00002849        
relaxed_witness     0.00528380        0.00001396        0.00001396        0.00264190        0.00264190        0.00000000        0.000             0.00002849        
strong_witness      0.00528380        0.00002849        0.00002849        0.00264190        0.00264190        0.00002849        0.00002849        0.000             

Computing dimension 1...

Complex             rips              cech              delaunay_cech     alpha             delaunay_alpha    witness           relaxed_witness   strong_witness    
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rips                0.000             inf               inf               inf               inf               inf               inf               inf               
cech                inf               0.000             inf               0.00760415        inf               inf               inf               inf               
delaunay_cech       inf               inf               0.000             inf               0.00270284        inf               0.00010490        inf               
alpha               inf               0.00760415        inf               0.000             inf               inf               inf               inf               
delaunay_alpha      inf               inf               0.00270284        inf               0.000             inf               0.00270284        inf               
witness             inf               inf               inf               inf               inf               0.000             inf               inf               
relaxed_witness     inf               inf               0.00010490        inf               0.00270284        inf               0.000             inf               
strong_witness      inf               inf               inf               inf               inf               inf               inf               0.000             

Using replacement value for infinity intervals in dimension 1: 0.027238812436306097

Computing dimension 2...

Complex             rips              cech              delaunay_cech     alpha             delaunay_alpha    witness           relaxed_witness   strong_witness    
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rips                0.000             inf               inf               inf               inf               inf               inf               inf               
cech                inf               0.000             inf               0.00761862        inf               inf               inf               inf               
delaunay_cech       inf               inf               0.000             inf               0.00696125        0.00021607        inf               inf               
alpha               inf               0.00761862        inf               0.000             inf               inf               inf               inf               
delaunay_alpha      inf               inf               0.00696125        inf               0.000             0.00696125        inf               inf               
witness             inf               inf               0.00021607        inf               0.00696125        0.000             inf               inf               
relaxed_witness     inf               inf               inf               inf               inf               inf               0.000             0.00009190        
strong_witness      inf               inf               inf               inf               inf               inf               0.00009190        0.000             

Using replacement value for infinity intervals in dimension 2: 0.033721059177937635
No description has been provided for this image
================================================================================
BOTTLENECK DISTANCES FOR DRAGON 1501
================================================================================

Computing dimension 0...

Complex             rips              cech              delaunay_cech     alpha             delaunay_alpha    witness           relaxed_witness   strong_witness    
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rips                0.000             0.00423837        0.00423837        0.00423837        0.00423837        0.00423837        0.00423837        0.00423837        
cech                0.00423837        0.000             0.00000000        0.00211918        0.00211918        0.00000898        0.00000898        0.00002768        
delaunay_cech       0.00423837        0.00000000        0.000             0.00211918        0.00211918        0.00000898        0.00000898        0.00002768        
alpha               0.00423837        0.00211918        0.00211918        0.000             0.00000000        0.00211918        0.00211918        0.00211918        
delaunay_alpha      0.00423837        0.00211918        0.00211918        0.00000000        0.000             0.00211918        0.00211918        0.00211918        
witness             0.00423837        0.00000898        0.00000898        0.00211918        0.00211918        0.000             0.00000000        0.00002768        
relaxed_witness     0.00423837        0.00000898        0.00000898        0.00211918        0.00211918        0.00000000        0.000             0.00002768        
strong_witness      0.00423837        0.00002768        0.00002768        0.00211918        0.00211918        0.00002768        0.00002768        0.000             

Computing dimension 1...

Complex             rips              cech              delaunay_cech     alpha             delaunay_alpha    witness           relaxed_witness   strong_witness    
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rips                0.000             inf               inf               inf               inf               inf               inf               inf               
cech                inf               0.000             inf               0.00614140        inf               inf               inf               inf               
delaunay_cech       inf               inf               0.000             inf               0.00311728        inf               inf               inf               
alpha               inf               0.00614140        inf               0.000             inf               inf               inf               inf               
delaunay_alpha      inf               inf               0.00311728        inf               0.000             inf               inf               inf               
witness             inf               inf               inf               inf               inf               0.000             inf               inf               
relaxed_witness     inf               inf               inf               inf               inf               inf               0.000             inf               
strong_witness      inf               inf               inf               inf               inf               inf               inf               0.000             

Using replacement value for infinity intervals in dimension 1: 0.02771711829641324

Computing dimension 2...

Complex             rips              cech              delaunay_cech     alpha             delaunay_alpha    witness           relaxed_witness   strong_witness    
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rips                0.000             inf               inf               inf               inf               inf               0.01309256        0.01301792        
cech                inf               0.000             inf               0.00613580        inf               inf               inf               inf               
delaunay_cech       inf               inf               0.000             inf               0.00721874        0.00021837        inf               inf               
alpha               inf               0.00613580        inf               0.000             inf               inf               inf               inf               
delaunay_alpha      inf               inf               0.00721874        inf               0.000             0.00721874        inf               inf               
witness             inf               inf               0.00021837        inf               0.00721874        0.000             inf               inf               
relaxed_witness     0.01309256        inf               inf               inf               inf               inf               0.000             0.00008880        
strong_witness      0.01301792        inf               inf               inf               inf               inf               0.00008880        0.000             

Using replacement value for infinity intervals in dimension 2: 0.03351575254836972
No description has been provided for this image
================================================================================
BOTTLENECK DISTANCES FOR DRAGON 2000
================================================================================

Computing dimension 0...

Complex             rips              cech              delaunay_cech     alpha             delaunay_alpha    witness           relaxed_witness   strong_witness    
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rips                0.000             0.00382158        0.00382158        0.00382158        0.00382158        0.00382158        0.00382158        0.00382158        
cech                0.00382158        0.000             0.00000000        0.00191079        0.00191079        0.00000730        0.00000730        0.00002432        
delaunay_cech       0.00382158        0.00000000        0.000             0.00191079        0.00191079        0.00000730        0.00000730        0.00002432        
alpha               0.00382158        0.00191079        0.00191079        0.000             0.00000000        0.00191079        0.00191079        0.00191079        
delaunay_alpha      0.00382158        0.00191079        0.00191079        0.00000000        0.000             0.00191079        0.00191079        0.00191079        
witness             0.00382158        0.00000730        0.00000730        0.00191079        0.00191079        0.000             0.00000000        0.00002432        
relaxed_witness     0.00382158        0.00000730        0.00000730        0.00191079        0.00191079        0.00000000        0.000             0.00002432        
strong_witness      0.00382158        0.00002432        0.00002432        0.00191079        0.00191079        0.00002432        0.00002432        0.000             

Computing dimension 1...

Complex             rips              cech              delaunay_cech     alpha             delaunay_alpha    witness           relaxed_witness   strong_witness    
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rips                0.000             inf               inf               inf               inf               inf               inf               inf               
cech                inf               0.000             inf               0.00549064        inf               inf               inf               inf               
delaunay_cech       inf               inf               0.000             inf               0.00333262        inf               inf               inf               
alpha               inf               0.00549064        inf               0.000             inf               inf               inf               inf               
delaunay_alpha      inf               inf               0.00333262        inf               0.000             inf               inf               inf               
witness             inf               inf               inf               inf               inf               0.000             inf               inf               
relaxed_witness     inf               inf               inf               inf               inf               inf               0.000             inf               
strong_witness      inf               inf               inf               inf               inf               inf               inf               0.000             

Using replacement value for infinity intervals in dimension 1: 0.025297357823818086

Computing dimension 2...

Complex             rips              cech              delaunay_cech     alpha             delaunay_alpha    witness           relaxed_witness   strong_witness    
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rips                0.000             inf               inf               inf               inf               inf               inf               inf               
cech                inf               0.000             inf               0.00548992        inf               inf               inf               inf               
delaunay_cech       inf               inf               0.000             inf               0.00827169        0.00023280        inf               inf               
alpha               inf               0.00548992        inf               0.000             inf               inf               inf               inf               
delaunay_alpha      inf               inf               0.00827169        inf               0.000             0.00827169        inf               inf               
witness             inf               inf               0.00023280        inf               0.00827169        0.000             inf               inf               
relaxed_witness     inf               inf               inf               inf               inf               inf               0.000             0.00004304        
strong_witness      inf               inf               inf               inf               inf               inf               0.00004304        0.000             

Using replacement value for infinity intervals in dimension 2: 0.03351575254836972
No description has been provided for this image
================================================================================
BOTTLENECK DISTANCES FOR DRAGON 3002
================================================================================

Computing dimension 0...

Complex             rips              cech              delaunay_cech     alpha             delaunay_alpha    witness           relaxed_witness   strong_witness    
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rips                0.000             0.00302919        0.00302919        0.00302919        0.00302919        0.00302919        0.00302919        0.00302919        
cech                0.00302919        0.000             0.00000000        0.00151459        0.00151459        0.00000459        0.00000459        0.00001719        
delaunay_cech       0.00302919        0.00000000        0.000             0.00151459        0.00151459        0.00000459        0.00000459        0.00001719        
alpha               0.00302919        0.00151459        0.00151459        0.000             0.00000000        0.00151459        0.00151459        0.00151459        
delaunay_alpha      0.00302919        0.00151459        0.00151459        0.00000000        0.000             0.00151459        0.00151459        0.00151459        
witness             0.00302919        0.00000459        0.00000459        0.00151459        0.00151459        0.000             0.00000000        0.00001719        
relaxed_witness     0.00302919        0.00000459        0.00000459        0.00151459        0.00151459        0.00000000        0.000             0.00001719        
strong_witness      0.00302919        0.00001719        0.00001719        0.00151459        0.00151459        0.00001719        0.00001719        0.000             

Computing dimension 1...

Complex             rips              cech              delaunay_cech     alpha             delaunay_alpha    witness           relaxed_witness   strong_witness    
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rips                0.000             inf               inf               inf               inf               inf               inf               inf               
cech                inf               0.000             inf               0.00447035        inf               inf               inf               inf               
delaunay_cech       inf               inf               0.000             inf               0.00315005        inf               inf               inf               
alpha               inf               0.00447035        inf               0.000             inf               inf               inf               inf               
delaunay_alpha      inf               inf               0.00315005        inf               0.000             inf               inf               inf               
witness             inf               inf               inf               inf               inf               0.000             inf               inf               
relaxed_witness     inf               inf               inf               inf               inf               inf               0.000             inf               
strong_witness      inf               inf               inf               inf               inf               inf               inf               0.000             

Using replacement value for infinity intervals in dimension 1: 0.01987790418560008

Computing dimension 2...

Complex             rips              cech              delaunay_cech     alpha             delaunay_alpha    witness           relaxed_witness   strong_witness    
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rips                0.000             inf               inf               inf               inf               inf               inf               0.00960040        
cech                inf               0.000             inf               0.00448437        inf               inf               inf               inf               
delaunay_cech       inf               inf               0.000             inf               0.00874656        0.00023680        inf               inf               
alpha               inf               0.00448437        inf               0.000             inf               inf               inf               inf               
delaunay_alpha      inf               inf               0.00874656        inf               0.000             0.00874656        inf               inf               
witness             inf               inf               0.00023680        inf               0.00874656        0.000             inf               inf               
relaxed_witness     inf               inf               inf               inf               inf               inf               0.000             inf               
strong_witness      0.00960040        inf               inf               inf               inf               inf               inf               0.000             

Using replacement value for infinity intervals in dimension 2: 0.03342454617542934
No description has been provided for this image
================================================================================
BOTTLENECK DISTANCES FOR DRAGON 3476
================================================================================

Computing dimension 0...

Complex             rips              cech              delaunay_cech     alpha             delaunay_alpha    witness           relaxed_witness   strong_witness    
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rips                0.000             0.00306256        0.00306256        0.00306256        0.00306256        0.00306256        0.00306256        0.00306256        
cech                0.00306256        0.000             0.00000000        0.00153128        0.00153128        0.00000469        0.00000469        0.00001345        
delaunay_cech       0.00306256        0.00000000        0.000             0.00153128        0.00153128        0.00000469        0.00000469        0.00001345        
alpha               0.00306256        0.00153128        0.00153128        0.000             0.00000000        0.00153128        0.00153128        0.00153128        
delaunay_alpha      0.00306256        0.00153128        0.00153128        0.00000000        0.000             0.00153128        0.00153128        0.00153128        
witness             0.00306256        0.00000469        0.00000469        0.00153128        0.00153128        0.000             0.00000000        0.00001345        
relaxed_witness     0.00306256        0.00000469        0.00000469        0.00153128        0.00153128        0.00000000        0.000             0.00001345        
strong_witness      0.00306256        0.00001345        0.00001345        0.00153128        0.00153128        0.00001345        0.00001345        0.000             

Computing dimension 1...

Complex             rips              cech              delaunay_cech     alpha             delaunay_alpha    witness           relaxed_witness   strong_witness    
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rips                0.000             inf               inf               inf               inf               inf               inf               0.00894296        
cech                inf               0.000             inf               0.00418528        inf               inf               inf               inf               
delaunay_cech       inf               inf               0.000             inf               0.00305947        inf               inf               inf               
alpha               inf               0.00418528        inf               0.000             inf               inf               inf               inf               
delaunay_alpha      inf               inf               0.00305947        inf               0.000             inf               inf               inf               
witness             inf               inf               inf               inf               inf               0.000             inf               inf               
relaxed_witness     inf               inf               inf               inf               inf               inf               0.000             inf               
strong_witness      0.00894296        inf               inf               inf               inf               inf               inf               0.000             

Using replacement value for infinity intervals in dimension 1: 0.027581578598318775

Computing dimension 2...

Complex             rips              cech              delaunay_cech     alpha             delaunay_alpha    witness           relaxed_witness   strong_witness    
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rips                0.000             inf               inf               inf               inf               inf               inf               inf               
cech                inf               0.000             inf               0.00418471        inf               inf               inf               inf               
delaunay_cech       inf               inf               0.000             inf               0.00882740        0.00023637        inf               inf               
alpha               inf               0.00418471        inf               0.000             inf               inf               inf               inf               
delaunay_alpha      inf               inf               0.00882740        inf               0.000             0.00882740        inf               inf               
witness             inf               inf               0.00023637        inf               0.00882740        0.000             inf               inf               
relaxed_witness     inf               inf               inf               inf               inf               inf               0.000             inf               
strong_witness      inf               inf               inf               inf               inf               inf               inf               0.000             

Using replacement value for infinity intervals in dimension 2: 0.03332338137116013
No description has been provided for this image
================================================================================
BOTTLENECK DISTANCES FOR DRAGON 4000
================================================================================

Computing dimension 0...

Complex             rips              cech              delaunay_cech     alpha             delaunay_alpha    witness           relaxed_witness   strong_witness    
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rips                0.000             0.00271259        0.00271259        0.00271259        0.00271259        0.00271259        0.00271259        0.00271259        
cech                0.00271259        0.000             0.00000000        0.00135629        0.00135629        0.00000368        0.00000368        0.00001235        
delaunay_cech       0.00271259        0.00000000        0.000             0.00135629        0.00135629        0.00000368        0.00000368        0.00001235        
alpha               0.00271259        0.00135629        0.00135629        0.000             0.00000000        0.00135629        0.00135629        0.00135629        
delaunay_alpha      0.00271259        0.00135629        0.00135629        0.00000000        0.000             0.00135629        0.00135629        0.00135629        
witness             0.00271259        0.00000368        0.00000368        0.00135629        0.00135629        0.000             0.00000000        0.00001235        
relaxed_witness     0.00271259        0.00000368        0.00000368        0.00135629        0.00135629        0.00000000        0.000             0.00001235        
strong_witness      0.00271259        0.00001235        0.00001235        0.00135629        0.00135629        0.00001235        0.00001235        0.000             

Computing dimension 1...

Complex             rips              cech              delaunay_cech     alpha             delaunay_alpha    witness           relaxed_witness   strong_witness    
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rips                0.000             inf               inf               inf               inf               inf               inf               inf               
cech                inf               0.000             inf               0.00393038        inf               inf               inf               inf               
delaunay_cech       inf               inf               0.000             inf               0.00335759        inf               inf               inf               
alpha               inf               0.00393038        inf               0.000             inf               inf               inf               inf               
delaunay_alpha      inf               inf               0.00335759        inf               0.000             inf               inf               inf               
witness             inf               inf               inf               inf               inf               0.000             inf               inf               
relaxed_witness     inf               inf               inf               inf               inf               inf               0.000             inf               
strong_witness      inf               inf               inf               inf               inf               inf               inf               0.000             

Using replacement value for infinity intervals in dimension 1: 0.028151630473491066

Computing dimension 2...

Complex             rips              cech              delaunay_cech     alpha             delaunay_alpha    witness           relaxed_witness   strong_witness    
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rips                0.000             inf               inf               inf               inf               inf               inf               inf               
cech                inf               0.000             inf               0.00393086        inf               inf               inf               inf               
delaunay_cech       inf               inf               0.000             inf               0.00898840        0.00024000        inf               inf               
alpha               inf               0.00393086        inf               0.000             inf               inf               inf               inf               
delaunay_alpha      inf               inf               0.00898840        inf               0.000             0.00898840        inf               inf               
witness             inf               inf               0.00024000        inf               0.00898840        0.000             inf               inf               
relaxed_witness     inf               inf               inf               inf               inf               inf               0.000             inf               
strong_witness      inf               inf               inf               inf               inf               inf               inf               0.000             

Using replacement value for infinity intervals in dimension 2: 0.03350828642183624
No description has been provided for this image