prg_djk_k_paths_compute_hop_limit()
Abstract
Computes the k shortest paths from a source to a destination, with a specified hop limit.
Syntax
prg_djk_k_paths_compute_hop_limit (src_vertex_ptr, dest_vertex_ptr, k_value, hop_limit)
| Argument | Type | Description |
|---|---|---|
src_vertex_ptr |
PrgT_Graph_Vertex * |
The source vertex of interest. |
dest_vertex_ptr |
PrgT_Graph_Vertex * |
The destination vertex of interest. |
k_value |
int |
The number of paths to compute between the source and destination. |
hop_limit |
int |
The maximum number of hops to permit in each path, or PRGC_DJK_OPT_NO_HOP_LIMIT for an unlimited number of hops. |
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_k_paths_compute(), except that there is a hop limit specified. Each of the k paths will not exceed the specified hop limit. This means that the shortest path may not be returned if the shortest path violates the hop limit. The routes returned are ordered by length (“shortness”) and not by hops. The hop limit is a constraint, but the optimization is still with respect to the path length. The paths found by this function are not necessarily node and link disjoint, but will differ from each other by at least one edge.