I think you forgot to add static_cast<float> before using ceil
int reserve_capacity = int(ceil((*root_nodes).size() / num_threads)) * neighs;
it should be
int reserve_capacity = int(ceil( static_cast<float>((*root_nodes).size() / num_threads))) * neighs;