0% found this document useful (0 votes)
10 views

Lab 1 - Search Algorithms

The document discusses search algorithms including uniform cost search, depth-first search, breadth-first search, and A* search. Pseudo-code is provided for uniform cost search and an implementation in Python is referenced. The task is to implement DFS, BFS, and A* search for a given maze.

Uploaded by

hleyhelcharbel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Lab 1 - Search Algorithms

The document discusses search algorithms including uniform cost search, depth-first search, breadth-first search, and A* search. Pseudo-code is provided for uniform cost search and an implementation in Python is referenced. The task is to implement DFS, BFS, and A* search for a given maze.

Uploaded by

hleyhelcharbel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Lab 1- Search Algorithms

The pseudo-code of the Uniform Cost Search algorithm is shown below:


function UNIFORM-COST-SEARCH(problem) returns a solution, or failure
frontier ← a priority queue ordered by pathCost, with a node for the initial state
visited ← a set of visited nodes; initially empty

while frontier is not empty do


parent ← pop(frontier)
if parent not in visited then
add parent to visited
if parent = goal then return solution (solution = path + cost)
else
for child in successors(parent) do
s ← child.state
if s is not in visited then
add child to the frontier
if child is a goal then
solution = child
return solution

The implementa;on of the above pseudo-code in Python is given in the file UCS_Maze. ipynb for
a template maze.

For the following maze, and from the pseudo-Code of the UCS algorithm and the aFached Python
code:
1. Implement the Depth-First Search (DFS) algorithm
2. Implement the Breadth-First Search (BFS) algorithm
3. Implement the A* algorithm

You might also like