Vietoris‐Rips Lifting (Graph to Simplicial) - geometric-intelligence/TopoBench GitHub Wiki
Although typically used for point cloud data, this method can be adapted to graphs by treating vertices as points and defining edges based on graph distances. A k-simplex is included if the pairwise distances between its vertices are all below a certain threshold.
To construct a Vietoris-Rips complex:
- Define a distance metric based on the graph (e.g., shortest path distance).
- Select a threshold distance.
- Form simplices for all sets of vertices with pairwise distances less than the threshold distance.
We use nx.all_pairs_shortest_path_length to calculate the shortest path distances between all pairs of nodes in the graph. The VietorisRipsLifting class includes a distance_threshold parameter to specify the maximum allowed distance for simplex formation.