Is std::map efficient for this problem?
Greetings all,
I have an assignment where certain "paths" ( one coordinate to another ) need to eventually be processed using Dijkstra's algorithm.
First, a collection of coordinates (stored in a queue) are processed to find any valid paths. Because of the nature of the objects in the queue, there will be possible redundant paths being found.
A path is valid if it's "slope" is within a given range. If so, it's valid, and should be used later on (with Dijkstra's algorithm).
My question is:
std::map has the find() function to check if a given path is in the map. So is it efficient enough to put the paths in the std::map, using find to make sure a redundant path is NOT put in the map? Or is there possibly a more efficient data structure to use here like a matrix?
Thank you in advance