udacity / FCND-Motion-Planning

Motion planning project (P1)
65 stars 239 forks source link

Bug in A* #6

Open fabianlischka opened 4 years ago

fabianlischka commented 4 years ago

visited = set(start) must be replaced by visited = set(), visited.add(start) or so, as it doesn't add the tuple to the set, but iterates over the content of said tuple and adds that.

In [1]: point1 = (1,2) 
In [2]: point2 = (3,4)
In [3]: visited = set(point1)
In [4]: visited.add(point2)
In [5]: point2 in visited
Out[5]: True
In [6]: point1 in visited
Out[6]: False
In [7]: visited
Out[7]: {(3, 4), 1, 2}