geomfum.numerics package#
Submodules#
geomfum.numerics.eig module#
geomfum.numerics.graph module#
Routines for working with graphs.
- geomfum.numerics.graph.single_source_partial_dijkstra_path_length(graph, source, k, weight='weight')[source]#
Compute shortest-path distances from a source node to the k closest nodes.
Based on cumulative path cost, using an early-stopped Dijkstra’s algorithm.
The search terminates once k nodes (including the source itself) have been reached.
- Parameters:
graph (networkx.Graph) – The input graph. Can be directed or undirected. Edge weights must be non-negative.
source (node) – The starting node for paths.
k (int) – Number of nodes to find distances to (including the source itself).
- Returns:
length (dict) – Dict keyed by node to shortest path length from source.
geomfum.numerics.optimization module#
Optimization routines.