[Lemon-user] Removing a node while executing dijkstra.

Alpár Jüttner alpar at cs.elte.hu
Mon Dec 20 16:39:57 CET 2010


On Mon, 2010-12-20 at 12:25 +0100, Maarten Bovijn wrote:
> Hi everyone,
> 
> I've got a question concerning the dijkstra algorithm.
> I was wondering if it's possible to prune a node while executing the
> algorithm.

Our Dijkstra implementation cannot do it out-of box, but it is pretty
easy to implement this functionality, it takes no more than say 10 lines
of new code.

I really suggest issuing a feature request, in the bug tracker with some
motivation why this feature is important. I believe it will be
implemented very soon then.

Regards,
Alpae


> An example makes it more clear.
> 
> Dijkstra<ListDigraph> dijkstra(graph, mylengthmap);
> dijkstra.init();
> dijkstra.addSource(a); 
> while (!dijkstra.emptyQueue()) {  
>     ListDigraph::Node x = dijkstra.nextNode();
>     if (!condition) { 
>         remove x from the queue;
>     } else {
>         dijkstra.processNextNode();
>     }
> }
> 
> The problem is that I don't know how to prune the node.
> 
> Ty,
> Maarten
> _______________________________________________
> Lemon-user mailing list
> Lemon-user at lemon.cs.elte.hu
> http://lemon.cs.elte.hu/mailman/listinfo/lemon-user





More information about the Lemon-user mailing list