I define an unordered_map
like this:
std::unordered_map edges;
Is there a efficient way to choose a rando
The solution of
std::unordered_map edges;
auto random_it = std::next(std::begin(edges), rand_between(0, edges.size()));
is extremely slow....
A much faster solution will be:
std::vector vec
int index
ranging from 0
to vec.size() - 1
edges[vec[index]]