Use unordered_map for sparse grid implementation