Man Versus Code

The personal website of Joe Marrero.

Best-First Search

I implemented a simple best-first search (BFS) path finder for a Pac Man clone.

Here's what BFS with 4 directions looks like:



Here's what BFS with 8 directions looks like:



With BFS, a hueristic can still lead to an erroneous direction, as this image depicts:



A*, like Dijkstra, will find a shortest path, making the above erroneous path not possible. I will demonstrate, A* soon.