prg_djk_path_get_hop_limit()
Abstract
Returns a vector of size-limited shortest paths from the source to the destination vertex.
Syntax
prg_djk_path_get_hop_limit (src_vertex_ptr, dest_vertex_ptr, hop_limit, 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. |
hop_limit |
int |
Maximum number of hops to allow in a path, or PRGC_DJK_OPT_NO_HOP_LIMIT to include all hops in each path. |
options |
int |
Option flags (see the Details for prg_djk_path_get_options() for possible values). |
Return Type
PrgT_Vector *
Returns the vector of shortest path routes, where each route is also a PrgT_Vector* of edges. The route vectors contain the sequence of PrgT_Graph_Edge objects in the route from the source to the destination.
Header
prg_djk.h
Details
This function works similarly to prg_djk_path_get_options(), except that the number of hops in each path is limited to hop_limit. Each edge in the path is a hop; thus, if the hop constraint is k, there are at most k edges in the path.
It is the caller's responsibility to deallocate the return value when it is not needed, by using a call to prg_vector_destroy():
prg_vector_destroy (routes_vptr, 1).
All paths within the vector will be deallocated when the main vector is deallocated.
The path consists of PrgT_Graph_Edge* elements. The vector of PrgT_Graph_Edge* elements makes up a single path.