Boost logo

Boost Users :

Subject: Re: [Boost-users] [Graph] Caching Dijkstra results
From: Klaim - Joël Lamotte (mjklaim_at_[hidden])
Date: 2014-05-14 05:28:43


On Wed, May 14, 2014 at 11:14 AM, Sensei <senseiwa_at_[hidden]> wrote:

> Sincerely, I don't know what I should cache. My initial thought is
> creating a hashmap with key being the source node, and value something that
> allows me to easily retrieve the path.
>
> What do you think I need to cache? Does it suffices to have a map from
> node index (std::size_t) to the node's predecessor map?
>

A simple way to do it would be to use an associative container with both
source and destination as key, and the full path as value.
I did this before (not with boost graph though) and it was enough for my
case, but if you want smarter cache that might be more complicated.



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