$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-users] [Graph] Caching Dijkstra results
From: Sensei (senseiwa_at_[hidden])
Date: 2014-05-14 05:14:07
Dear all,
I need to find the shortest path from a node to another, and this
operation will be performed several times with different
source/destination nodes. In many cases, I would need the same source,
so I was thinking about caching the results from Dijkstra.
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?
Thanks & Cheers!