You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
This lesson covers the A (A-star) algorithm* — a heuristic-based search algorithm that finds the shortest path more efficiently than Dijkstra's in many cases. It is part of the OCR A-Level Computer Science (H446) specification, section 2.3.
A* (pronounced "A-star") is a best-first search algorithm that finds the shortest path between a start vertex and a goal vertex by combining:
The algorithm selects the next vertex to explore based on:
f(n) = g(n) + h(n)
Where f(n) is the estimated total cost of the path through vertex n.
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.