Bölüm 4.2 · SimülatörA* Pathfinding Algorithm? ← Bölüm 4.2 Find Path Cancel Clear Path Random Walls Empty GridSpeed Slow Normal Fast Ready.Explored0Open0Path– Start Goal Open set Explored Path WallKapatA* Pathfinding AlgorithmClick cells to add or remove walls, then run A* to see explored cells and the final shortest path.How to useStart is the top-left cell, the goal is the bottom-right cell. Click a cell to toggle a wall; drag to draw or erase several walls at once.Find Path animates the search. Orange cells have been expanded (closed set), light cells are waiting in the open set, and the blue cells form the final path.Cancel stops the animation, Clear Path removes the search overlay but keeps the walls, Random Walls fills about 20% of the grid with walls and Empty Grid removes them all.How A* worksA* combines the cost already travelled, g(n), with a heuristic estimate to the goal, h(n). Here the heuristic is Manhattan distance, which is appropriate because movement is limited to up, down, left, and right.In each iteration the node with the smallest f(n) = g(n) + h(n) is removed from the open set and expanded. Because Manhattan distance never overestimates the true remaining cost on this grid (it is admissible and consistent), the first time the goal is removed from the open set its path is a shortest path.ComplexityWith a binary heap the running time is O(E log V); this demo uses a simple linear scan of the open set, which is O(V²) for a V-cell grid. With h(n) = 0, A* becomes Dijkstra's algorithm and explores many more cells.