Skip to content

Semestrial work of a course Artificial Inteligence (4IZ431) at Prague University of Economics and Business. Implementations of DFS (Depth First Search) and BFS (Breadth First Search) algorithms.

Notifications You must be signed in to change notification settings

dmitrijt9/pacman-search-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pacman's Search Agent

Semestrial work of a course Artificial Inteligence (4IZ431) at Prague University of Economics and Business.

We have to choose two algorithms from AI Berkeley Pacman's project and implement them.

I chose DFS (Depth First Search) and BFS (Breadth First Search) algorithms in P1 - Search section.

Run

# DFS
bin/start-dfs <LAYOUT> <OTHER OPTIONS>

# BFS
bin/start-bfs <LAYOUT> <OTHER OPTIONS>

# Exmples
bin/start-dfs smallMaze

bin/start-bfs bigMaze -z .5 --frameTime 0

Run Autograder

bin/start-autograder

DFS vs BFS

DFS is implemented in recursive way.

BFS is implemented in iterative way.

Small Maze

DFS BFS
Total Cost 37 19
Nodes Expanded 93 92
Game score 473 491

Medium Maze

DFS BFS
Total Cost 246 68
Nodes Expanded 269 269
Game score 264 442

Big Maze

DFS BFS
Total Cost 210 210
Nodes Expanded 466 620
Game score 300 300

In overall BFS returns better cost/scoring results than DFS.

Since cost of each action in this Search example is 1, BFS will find optimal solution. But DFS only a "leftmost" solution.

In Big Maze is accidentally DFS's solution also an optimal.

About

Semestrial work of a course Artificial Inteligence (4IZ431) at Prague University of Economics and Business. Implementations of DFS (Depth First Search) and BFS (Breadth First Search) algorithms.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published