persim.gromov_hausdorff

persim.gromov_hausdorff(A_G, A_H=None, mapping_sample_size_order=array([0.5, 1. ]))[source]

Estimate the mGH distance between simple unweighted graphs, represented as compact metric spaces based on their shortest path lengths.

Parameters:
  • A_G (np.array (|V(G)|×|V(G)|)) – (Sparse) adjacency matrix of graph G, or an iterable of adjacency matrices if A_H=None.
  • A_H (np.array (|V(H)|×|V(H)|)) – (Sparse) adjacency matrix of graph H, or None.
  • mapping_sample_size_order (np.array (2)) – Parameter that regulates the number of mappings to sample when tightening upper bound of the mGH distance.
Returns:

  • lb (float) – Lower bound of the mGH distance, or a square matrix holding lower bounds of pairwise mGH distances if A_H=None.
  • ub (float) – Upper bound of the mGH distance, or a square matrix holding upper bounds of pairwise mGH distances if A_H=None.