prg_djk_path_get_options()
Abstract
Returns a vector of shortest paths from the source to the destination vertex, but allows client control of certain options.
Syntax
prg_djk_path_get _options (src_vertex_ptr, dest_vertex_ptr, options)
| Argument | Type | Description |
|---|---|---|
src_vertex_ptr |
PrgT_Graph_Vertex* |
A source vertex of the path. |
dest_vertex_ptr |
PrgT_Graph_Vertex* |
A destination vertex of the path. |
options |
int |
Option flags (see Details). |
Return Type
PrgT_Vector *
Returns the vector where each element is a path.
Header
prg_djk.h
Details
This function works similarly to prg_djk_path_get(), except that it lets you pass in option flags further controlling the least-cost path calculation process. The options values are:
- PRGC_DJK_PATH_GET_OPT_NONE — equivalent to calling prg_djk_path_get().
- PRGC_DJK_PATH_GET_OPT_FIRST_FOUND — causes the package to return the first least-cost-path as soon as it is found, instead of continuing to search for other equal-cost paths. Note that the path returned is still guaranteed to be the least-cost path. However, it may not be the only least-cost path. Callers should use this function if they want to speed up the finding of least-cost paths and if they wish to save memory when running the Dijkstra algorithm on graphs with many cycles in them.
- PRGC_DJK_PATH_GET_OPT_RETAIN_PREDECESSORS — deprecated option, do not use
- PRGC_DJK_PATH_GET_OPT_CONSIDER_PATH — causes the package to use the callback registered by prg_djk_path_consider_proc_register() to accept or reject each shortest path.
Note: If a path_consider_proc is registered, you must explicitly use prg_djk_path_get_options() with the PRGC_DJK_PATH_GET_OPT_CONSIDER_PATH option instead of prg_djk_path_get().