optimize astar algorithm with an extra array for fast testing openset