prg_djk_next_max_hops_get()
Abstract
Given a vertex and a destination vertex, returns a size-limited set of next hop edges to take in order to get to the destination vertex along the shortest path.
Syntax
prg_djk_next_max_hops_get (src_vertex_ptr, dest_vertex_ptr, num_hops)
| Argument | Type | Description |
|---|---|---|
src_vertex_ptr |
PrgT_Graph_Vertex * |
The source vertex whose next hops are being found in the routing table. |
dest_vertex_ptr |
PrgT_Graph_Vertex * |
The destination vertex of interest. |
num_hops |
int |
Maximum number of hops to get, or PRGC_DJK_PATH_GET_ALL_HOPS to get all of the next hops in the routing table. |
Return Type
PrgT_Vector *
Vector of PrgT_Graph_Edge* edges that are next hops from this src_vertex_ptr to the dest_vertex_ptr. The vector is owned by the caller and must be destroyed using prg_vector_destroy (hops_vptr, 0).
Header
prg_djk.h
Details
This function works similarly to prg_djk_next_hops_get(), but limits the size of the returned vector to num_hops hops (or the actual number of hops to the destination, if this is less than num_hops).
This function can be called only if a routing table exists at the src_vertex_ptr. The routing table is built up either by calling prg_djk_single_source_compute() or prg_djk_all_sources_compute().