prg_djk_graph_cache_disable()
Abstract
Disables graph caching, allowing the DJK package to recompute internal graph data structures.
Syntax
prg_djk_graph_cache_disable (graph_ptr)
| Argument | Type | Description |
|---|---|---|
graph_ptr |
PrgT_Graph * |
The graph that has the DJK package initialized on it, and that was previously used as an argument to prg_djk_graph_cache_enable(). |
Return Type
void
No return value.
Header
prg_djk.h
Details
The DJK package calculates shortest paths by first converting its associated graph into internal data structures for efficient calculation. This conversion of the graph is done for each call to find shortest paths since the DJK package does not know whether or not the graph changed since the last graph was evaluated, which can be wasteful if the graph does not change from call to call.
Clients call this function if after calling prg_djk_graph_cache_enable() and performing shortest-paths finding, they must notify the DJK package that the graph may have been modified. By calling this function, the existing internal graph cache is cleared, and the next call to find shortest paths will recompute a new internal representation of the graph. This function should be called if the client knows that the graph has been modified, or if there is a chance that the graph will be modified before the next call to prg_djk_path_get().