Finding the shortest path in nvGraph and SSSP

I am a newbie to nvGraph. I would like to not only find the weight of the shortest path, but the actual path (i.e. sequence of vertices) from the source to each destination vertex. I am seeing one other person asking the same question, but it has not been answered for the past two years.

Is there a way to find the traversal routes from the source to the destination for the SSSP problem. If the function call can pass out the predecessor of each vertex, then one can reconstruct the path from the destination to the source and thereby reverse it and find the forward path.

Please advice on how to do this using nvGraph.


I would also like to return the paths… it is absolutely pointless to calculate the cost for the shortest path and then not return the actual path. If you asked google for directions and it just told you how long it would take to get there without providing the actual route I don’t think people would be googling directions anymore.