[Lemon-user] Shortest Path Tree using Dijkstra's Algorithm
Balázs Dezső
deba.mf at gmail.com
Wed Nov 14 16:36:08 CET 2012
You can use Dijsktra::predArc(Node v) to get the tree. You have to iterate
over the V[G] \ {u}, and get all predecessor arcs.
Balazs
On Wed, Nov 14, 2012 at 4:27 PM, João Paulo Ventura
<ventura at profusion.mobi>wrote:
> Hello,
>
> According to the Dijkstra class API, the following code
>
> Dijkstra<ListGraph, ListGraph::EdgeMap<double> > dijkstra(graph, length);
> dijkstra.init();
> dijkstra.addSource(u);
> dijkstra.start();
>
> will create the shortest path tree from the vertex u to all
> vertex V[G] of the graph.
>
> I need this tree and not the path to a single vertex v (as returned by
> dijkstra.path(v)), but I haven't figure out how this is possible in the
> API.
> So I have to iterate over all V[G] \ {u} and join all shortest paths?
>
> Thank you :-)
>
> --
> Joao Paulo Fernandes Ventura
> Computing Engineer at University of Campinas
>
>
> _______________________________________________
> Lemon-user mailing list
> Lemon-user at lemon.cs.elte.hu
> http://lemon.cs.elte.hu/mailman/listinfo/lemon-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lemon.cs.elte.hu/pipermail/lemon-user/attachments/20121114/96bc6463/attachment.html>
More information about the Lemon-user
mailing list