pyFM.mesh.geometry.dijkstra_from

pyFM.mesh.geometry.dijkstra_from(inds, graph)

Compute geodesic distances from one or several source vertices to all vertices, using Dijkstra’s algorithm on a precomputed edge-weighted graph.

Parameters:
  • inds (int or (p,) np.ndarray) – Index (or indices) of the source vertex/vertices.

  • graph ((n, n) scipy.sparse.csc_matrix) – Sparse graph as built by build_dijkstra_graph.

Returns:

geod_dist – Geodesic distance from each source index to every vertex. Shape (n,) if inds is a single int, or (n, p) if inds is a sequence of length p.

Return type:

np.ndarray