Skip to content

Commit df79e4d

Browse files
committed
Updated README
1 parent 90dac70 commit df79e4d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Yeah! The idea of the A* algorithm is that starting from the start point we visi
3737
The A* algorithm is basically the following:
3838

3939
```python
40-
def a_star(graph, start, end):
40+
def a_star_search(graph, start, end):
4141
"""
4242
Calculates the shortest path from start to end.
4343
@@ -58,7 +58,7 @@ def a_star(graph, start, end):
5858

5959
current_node = frontier.pop()
6060

61-
if current_node.point == end:
61+
if not current_node or current_node.point == end:
6262
return frontier
6363

6464
for neighbor in graph.neighbors( current_node.point ):
@@ -104,7 +104,7 @@ current_node = frontier.pop()
104104
Each iteration we pop an element from the DijkstraHeap. This element always has the lowest cost element because the DijkstraHeap has this property ( because is a heap and heaps are awesome ).
105105

106106
```python
107-
if current_node.point == end:
107+
if not current_node or current_node.point == end:
108108
return frontier
109109
```
110110

0 commit comments

Comments
 (0)