Skip to content

Commit 0554344

Browse files
committed
deploy: fix a* code format
1 parent 41f8a9b commit 0554344

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

content/Unit 4/Algorithms/A(star) Search Algorithm.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ Take the unvisited node with least $F(n)$ as next node.
2222
> [!note]- Python 3 (NetworkX)
2323
> ```python
2424
> import networkx as nx
25-
>
26-
def best_first_search(graph: nx.Graph, heuristic, start, end):
25+
>
26+
> def best_first_search(graph: nx.Graph, heuristic, start, end):
2727
    unvisited = list(graph.nodes)
2828
    node_distances = {node: float('inf') for node in graph.nodes}
2929
    node_distances[start] = 0
@@ -35,7 +35,7 @@ Take the unvisited node with least $F(n)$ as next node.
3535
        for neighbour in graph.neighbors(node):
3636
            if neighbour in unvisited:
3737
                node_distances[neighbour] = min(node_distances[neighbour], node_distances[node] + graph.edges[node, neighbour]['weight'])
38-
    return []
39-
    ```
38+
    return []
39+
> ```
4040
4141
[^1]: https://theory.stanford.edu/~amitp/GameProgramming/Heuristics.html

0 commit comments

Comments
 (0)