Uses Dijkstra plus a heuristic to prioritize nodes closer to the goal, finding an optimal path with an admissible heuristic and non-negative weights.
g[start] ← 0f[start] ← h(start)open ← [start]parent[start] ← nullwhile open not empty:v ← node in open with smallest f[v]for each neighbor u of v:if g[v] + w(v,u) < g[u]:parent[u] ← v; update g[u] and f[u]if goal selected: reconstruct path