persim.bottleneck

persim.bottleneck(dgm1, dgm2, matching=False)[source]

Perform the Bottleneck distance matching between persistence diagrams. Assumes first two columns of S and T are the coordinates of the persistence points, but allows for other coordinate columns (which are ignored in diagonal matching).

See the distances notebook for an example of how to use this.

Parameters:
  • dgm1 (Mx(>=2)) – array of birth/death pairs for PD 1

  • dgm2 (Nx(>=2)) – array of birth/death paris for PD 2

  • matching (bool, default False) – if True, return matching infromation and cross-similarity matrix

Returns:

  • d (float) – bottleneck distance between dgm1 and dgm2

  • matching (ndarray(Mx+Nx, 3), Only returns if matching=True) – A list of correspondences in an optimal matching, as well as their distance, where: * First column is index of point in first persistence diagram, or -1 if diagonal * Second column is index of point in second persistence diagram, or -1 if diagonal * Third column is the distance of each matching