persim.gromov_hausdorff

persim.gromov_hausdorff(AG, AH=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:
  • AG ((N,N) np.array) – (Sparse) adjacency matrix of graph G with N vertices, or an iterable of adjacency matrices if AH=None.

  • AH ((M,M) np.array) – (Sparse) adjacency matrix of graph H with M vertices, or None.

  • mapping_sample_size_order ((2,) np.array) – 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 AH=None.

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