14 May
2014
14 May
'14
9:14 a.m.
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!