VOOZH about

URL: https://www.geeksforgeeks.org/artificial-intelligence/uniformed-search-algorithms-in-ai/

⇱ Uninformed Search Algorithms in AI - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Uninformed Search Algorithms in AI

Last Updated : 11 Jun, 2026

Uninformed Search Algorithms, also called Blind Search Algorithms, are search methods that find a solution using only the problem's initial state, available actions and goal state, without any additional guidance or heuristic information.

  • Use only the initial state, available actions and goal state to find a solution.
  • Do not rely on heuristic information or prior knowledge.
  • Explore the search space in a systematic manner.
  • Commonly applied in pathfinding, puzzle-solving and state-space search problems.
  • Can be less efficient because many unnecessary states may be explored before reaching the goal.

Types of Uninformed Search Algorithms

1. Breadth-First Search (BFS)

Breadth-First Search is an uninformed search algorithm that explores nodes level by level. It visits all nodes at the current depth before moving to the next depth level and uses a Queue (FIFO) to manage the search process.

  • The bfs() function uses Breadth-First Search (BFS) to find the shortest path in a 2D maze.
  • It explores neighboring cells level by level using a queue (FIFO) and avoids revisiting cells with a visited set.
  • When the goal is reached, the function returns the complete path from the start to the goal.
  • The visualize_maze() function uses Matplotlib to display the maze, highlighting the start position, goal position, and the path found by BFS.
  • imshow() is used to draw the maze, while scatter() marks important positions and the solution path.

Output:

👁 download-(3)
Graphical Representation of the maze grid with start position represented by yellow circle and goal position represented by purple circle.

2. Depth-First Search (DFS)

Depth-First Search (DFS) is an uninformed search algorithm that explores one path as deeply as possible before backtracking. It uses a Stack (LIFO) to keep track of nodes during the search.

  • The dfs() function uses Depth-First Search (DFS) to find a path in a 2D maze.
  • It explores one path as deeply as possible using a stack (LIFO) and avoids revisiting cells with a visited set.
  • When the goal is reached, the function returns the path from the start to the goal.
  • The visualize_maze() function uses Matplotlib to display the maze, highlighting the start position, goal position and the path found by DFS.
  • imshow() is used to draw the maze, while scatter() marks important positions and the solution path.

Output:

👁 download-(4)
The output represents he maze grid with start position represented by yellow circle and goal position represented by purple circle.

3. Depth-Limited Search (DLS)

Depth Limited Search (DLS) is a variation of Depth-First Search (DFS) that restricts the search to a predefined depth limit. This helps prevent infinite exploration in large or infinite search spaces.

  • The dls() function uses Depth-Limited Search (DLS) to find a path in a 2D maze within a specified depth limit.
  • It explores nodes in a depth-first manner and stops when the depth limit is reached.
  • A visited set prevents revisiting cells during the search.
  • If the goal is found, the function returns the path; otherwise, it returns None.
  • The visualize_maze() function uses Matplotlib to display the maze and the path found by DLS.

Output:

👁 output
The DLS algorithm found a path from the start node to the goal node while avoiding obstacles.

4. Iterative Deepening Depth-First Search (IDDFS)

Iterative Deepening Depth-First Search (IDDFS) combines the advantages of BFS and DFS by repeatedly performing Depth-First Search with increasing depth limits until the goal is found.

  • The iddfs() function uses Iterative Deepening Depth-First Search (IDDFS) to find a path in a 2D maze.
  • It repeatedly performs Depth-Limited Search (DLS) with increasing depth limits until the goal is found.
  • This combines the low memory usage of DFS with the completeness of BFS.
  • If the goal is found, the function returns the path; otherwise, it returns None.
  • The visualize_maze() function uses Matplotlib to display the maze and the path found by IDDFS.
👁 output34
Output

The IDDFS algorithm successfully found a path from the start node to the goal node by gradually increasing the search depth while avoiding obstacles.

5. Uniform-Cost Search (UCS)

Uniform-Cost Search (UCS) is an uninformed search algorithm that expands the node with the lowest path cost first. Unlike BFS, it considers the cost of reaching each node and guarantees the optimal path when all costs are non-negative.

  • The uniform_cost_search() function finds the least-cost path in a weighted graph.
  • It uses a priority queue to always explore the lowest-cost node first.
  • If the goal is reached, the function returns the optimal path.
  • The visualize_graph() function displays the graph and highlights the path found by UCS.

Output:

Path from A to D : ['A', 'B', 'D']

👁 download-(5)
The graph represent the optimal path determined by the UCS algorithm

Download complete code from here

Applications

  • Used in navigation systems and robotics to find paths between locations.
  • Helps solve puzzles such as the Eight Puzzle and Fifteen Puzzle by finding a sequence of valid moves.
  • Supports game AI by exploring possible moves and strategies.
  • Assists robots in planning routes while avoiding obstacles.
  • Used in web crawling to systematically discover and index web pages through links.

Limitations

  • May explore many unnecessary states before finding a solution.
  • Can be slow and inefficient for large or complex search spaces.
  • Some algorithms do not guarantee the shortest or optimal solution.
  • Often require high memory or computational resources as the search space grows.
  • Performance decreases significantly when the number of possible states is very large.
Comment

Explore