prg_djk_k_paths_compute()
Abstract
Computes the k shortest paths from a source to a destination.
Syntax
prg_djk_k_paths_compute (src_vertex_ptr, dest_vertex_ptr, k_value)
| Argument | Type | Description |
|---|---|---|
src_vertex_ptr |
PrgT_Graph_Vertex * |
The source vertex in the paths. |
dest_vertex_ptr |
PrgT_Graph_Vertex * |
The destination vertex in the paths. |
k_value |
int |
The number of paths to compute between the source and destination. |
Return Type
PrgT_Vector *
Vector of routes where each route is also a PrgT_Vector* of edges. The caller should destroy the vector of routes using prg_vector_destroy (routes_vptr, 1).
Header
prg_djk.h
Details
This function is similar to prg_djk_path_get(), except that several (k) shortest paths are computed. The paths in the route vector are in the order from shortest to longest. If there are multiple equal-cost paths, the order of the equal-cost paths is based on the first found. The paths found by this function are not necessarily node and link disjoint, but will differ from each other by at least one edge.