spacenet.helpers.remove_nodes_from_distance_cache#

spacenet.helpers.remove_nodes_from_distance_cache(spatial_network, nodes_to_remove=None)#

Removes specified nodes from the distance cache of a spatial network. This function is used to maintain the integrity of the distance cache when nodes are removed from the spatial network, ensuring that any cached distances involving the removed nodes are also removed from the cache.

Parameters:
spatial_networkNetworkX graph

The spatial network for which to remove nodes from the distance cache.

nodes_to_removearray-like, optional

A list or array of node indices to remove from the distance cache. If None, no nodes will be removed from the cache. Default is None.

Returns:
None

This function modifies the distance cache of the spatial network in place and does not return any value.