| igraph Reference Manual |
|---|
int igraph_get_shortest_paths(const igraph_t *graph, igraph_vector_ptr_t *res, igraph_integer_t from, const igraph_vs_t to, igraph_neimode_t mode);
If there is more than one geodesic between two vertices, this function gives only one of them.
Arguments:
graph: |
The graph object. |
||||||
res: |
The result, this is a pointer vector, each element points to a vector object. These should be initialized before passing them to the function, which will properly clear and/or resize them and fill the ids of the vertices along the geodesics from/to the vertices. |
||||||
from: |
The id of the vertex from/to which the geodesics are calculated. |
||||||
to: |
Vertex sequence with the ids of the vertices to/from which the shortest paths will be calculated. A vertex might be given multiple times. |
||||||
mode: |
The type of shortest paths to be use for the calculation in directed graphs. Possible values:
|
Returns:
|
Error code:
|
Time complexity: O(|V|+|E|), |V| is the number of vertices, |E| the number of edges in the graph.
See also:
|
|
<< 2.1. igraph_shortest_paths — The length of the shortest paths between vertices. |
2.3. igraph_get_all_shortest_paths — Finds all shortest paths (geodesics) from a vertex to all other vertices >> |