Cognitive Scaffold

Preparing your thinking workspace

arrow_back_ios_new
MENTAL MODEL · M6506

A* Algorithm

A* Algorithm
TechnicalHigh supportAlgorithms
Included
account_tree

Updated 2026-07-30

Loading revision record…

Summary

The A* search algorithm is an algorithm for finding the lowest-cost path on a graph plane with multiple nodes. It is commonly used in NPC movement calculations in games, or in the movement calculations of bots in online games. The algorithm combines the advantages of best-first search and Dijkstra's algorithm: it improves efficiency through heuristic search while guaranteeing an optimal path (provided the heuristic function is admissible and consistent). In this algorithm, if g(n) represents the actual cost from the start node to any vertex n, ...

Definition

F = G + H. G: the actual cost from the start to the current node. H: the estimated cost from the current node to the goal (heuristic function). Scaffold use: finding a path with a map. Dijkstra's algorithm is blind search (like a headless fly), while A* introduces H (estimation), which is equivalent to knowing the general direction of the goal, thus achieving the highest search efficiency.

How to use

Finding a path with a map. Dijkstra's algorithm is blind search (like a headless fly), while A* introduces H (estimation), which is equivalent to knowing the general direction of the goal, thus achieving the highest search efficiency.

Mechanism

Based on 'best-first search'. F=G+H, where G is the actual cost and H is the heuristic estimate; a priority queue is used to expand the node with the smallest F, balancing optimality and efficiency.

Practice

In progress 0/1

Practice this model in one real situation:

Check to track your progress (stored locally)
Learning progress0%

Cases

  • Game pathfinding/map navigation uses A* to efficiently find the shortest path.

Common pitfalls

  • If H is too large, it degenerates into greedy search and does not guarantee optimality; if H is too small, it degenerates into Dijkstra and becomes slower; ignoring admissibility.
Sources

Source support: Explicit

References currently contain only Wikipedia links; primary sources still need review.

  • link
    zh.wikipedia.orghttps://zh.wikipedia.org/wiki/A%2A%E6%90%9C%E5%B0%8B%E6%BC%94%E7%AE%97%E6%B3%95ZH · Explicit
    verified
account_treeGenealogyexpand_more

RELATED MODELS