Search code examples
algorithmbreadth-first-searcha-star

Breadth-First Search vs A * Algorithm - Real World Example


I'm looking for a real-world example (by which I mean a software solution for a real-world problem), where the A* search algorithm is used because it radically outperforms Breadth-First Search for the same task.

Suggestions please?


Solution

  • A route planner.

    When calculating a route from San Francisco to New York, a plain BFS algorithm will extend routes in all directions. It will thus memorize intermediate routes going to Vancouver as well as to Mexico City.

    An A* algorithm, using a simple as-the-crow-flies heuristic, will favour routes that go eastwards, and so will inspect much fewer alternatives before finding the route of choice to New York.