prg_djk_path_get()

Abstract

Returns a vector of shortest paths from the source to the destination vertex.

Syntax

prg_djk_path_get (src_vertex_ptr, dest_vertex_ptr)
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.

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.

prg_djk.h

Details

Returns the set of shortest paths from the source to the destination vertex. If prg_djk_all_sources_compute() has been run, the function will use the routing tables to compute the path and no recomputation will be done.

If prg_djk_all_sources_compute() has not been run,

  • the function will compute the shortest paths without the routing tables
  • each call to prg_djk_path_get() will recompute the paths from scratch

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.

This function also can be used to retrieve the routes from a single source to all destinations, using the workflow described for prg_djk_single_source_compute().

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com