spacenet.helpers.update_node_node_distance_cache#

spacenet.helpers.update_node_node_distance_cache(spatial_network, sources, network_distances, weight='Distance', limit=inf)#

Update the node-node distance cache in the spatial network with new distances for a given weight and limit.

Parameters:
spatial_networkNetworkX graph

The spatial network for which to update the node-node distance cache.

sourcesarray-like

A list or array of source node indices for which the distances were computed.

network_distancesdict

A dictionary mapping each source node to a dictionary of shortest path distances to all other nodes in the graph. The inner dictionary maps target node indices to their corresponding shortest path distances from the source node.

weightstr, optional

The name of the edge attribute to use as the weight for computing shortest path distances. Default is ‘Distance’.

limitfloat, optional

The maximum distance to consider when computing shortest path distances. Nodes that are farther than this distance from the source will be ignored. Default is np.inf (no limit).

Returns:
None