|
Boost Users : |
Subject: Re: [Boost-users] how to use no_init dijkstra
From: Alex Hagen-Zanker (ahh34_at_[hidden])
Date: 2011-05-12 04:02:53
On 11/05/2011 23:40, Fletcher Foti wrote:
> Now my problem is that I have to do this search many, many times -
> performance is very important - and I don't want to initialize the
> values for a half a million nodes when I'm only going to visit 20. I
> therefore want to use a std::map to store distances, and I want a key
> missing from that map to indicate an unvisited node, right?
Another option would be to use a combination of a vector and a list of
visited nodes. Initialize the full vector only once, and for every
search re-initialize those nodes in the list and clear the list.
The list can be made using the Visitor that you already use to escape
the algorithm.
The advantage is that the algorithm will find its values in a vector
which is faster than a map. (AFAIK)
-- Alex
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net