Prevent the same vertex to be added twice to the front in find_shortest_path.