AI Search

Introduction

Pacman is in a maze world and would like to find a way out of the labyrinth. There are several different search strategies that Pacman could employ to reach its goal. These strategies include:

  • Depth First Search
  • Breadth First Search
  • Uniform Cost Search
  • A* Search

Final result

DFS

The following demonstrates Pacman using DFS to find its way out. The intensity of red in the path indicates the number of times that path has been considered by Pacman to determine the way out.

BFS

Breadth first strategy is used in the following.

Pacman is able to find its way using A* and heuristics in the below.

Reference to the stub code