prg_djk_all_sources_compute()
Abstract
Runs Dijkstra's shortest path algorithm for all vertices in a graph and builds up routing tables on every vertex in the graph.
Syntax
prg_djk_all_sources_compute (graph_ptr)
| Argument | Type | Description |
|---|---|---|
graph_ptr |
PrgT_Graph * |
The graph on which to run the all pairs shortest path algorithm. |
Return Type
PrgT_Compcode
PrgC_Compcode_Success if the routing tables are build on every vertex in the graph, PrgC_Compcode_Failure otherwise.
Header
prg_djk.h
Details
Performs prg_djk_single_source_compute() on every vertex in the graph. If some vertices had the routing table built, the function will not re-build the table, but just use the result.
With this function it is possible to find the shortest path from every source to every destination because the routing table now exists on every vertex.
Calling the function more than once will not recompute the routing tables. If you wish to recompute, in cases where the graph was changed, call prg_djk_graph_init() to re-initialize the graph.