0% found this document useful (0 votes)
4 views2 pages

Extended Search Algorithms AI

The document discusses four search algorithms used in Artificial Intelligence: Depth-First Search (DFS), Breadth-First Search (BFS), Uniform-Cost Search (UCS), and Greedy Best-First Search (GBFS). Each algorithm has its own advantages and disadvantages, making them suitable for different scenarios, particularly in transportation networks like Pakistan Railways. Examples are provided to illustrate how each algorithm can be applied in real-world situations.
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)
4 views2 pages

Extended Search Algorithms AI

The document discusses four search algorithms used in Artificial Intelligence: Depth-First Search (DFS), Breadth-First Search (BFS), Uniform-Cost Search (UCS), and Greedy Best-First Search (GBFS). Each algorithm has its own advantages and disadvantages, making them suitable for different scenarios, particularly in transportation networks like Pakistan Railways. Examples are provided to illustrate how each algorithm can be applied in real-world situations.
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/ 2

Search Algorithms in AI (DFS, BFS, UCS, GBFS)

Search algorithms are fundamental techniques in Artificial Intelligence used to find solutions or paths

in problem spaces.

1. Depth-First Search (DFS):

- DFS explores a path as deeply as possible before backtracking.

- It uses a stack data structure.

- Pros: Low memory use.

- Cons: May get stuck in deep paths or infinite loops.

- Example: Pakistan Railways can use DFS to track a train's path from one station deeply into a

route until the destination or a dead-end is reached.

2. Breadth-First Search (BFS):

- BFS explores all neighbor nodes at the current level before going deeper.

- It uses a queue data structure.

- Pros: Always finds the shortest path if all costs are equal.

- Cons: Requires more memory than DFS.

- Example: BFS can help find the shortest route from one railway station to another based on

equal-distance segments.

3. Uniform-Cost Search (UCS):

- UCS expands the least-cost node first and considers path cost (g(n)).

- It is useful when costs vary.

- Pros: Guarantees the lowest-cost path.

- Cons: Can be slow if costs are large or complex.


- Example: Pakistan Railways could use UCS to choose a route that uses the least fuel or

operational cost between two destinations.

4. Greedy Best-First Search (GBFS):

- GBFS selects nodes based on a heuristic (estimated cost to goal, h(n)).

- It focuses on reaching the goal quickly.

- Pros: Fast, useful when time is limited.

- Cons: May not find the optimal path.

- Example: GBFS helps reroute a train quickly during a breakdown by selecting the nearest station

towards the blocked segment using estimated distance.

Each of these search methods is suitable for different scenarios in transportation networks like

Pakistan Railways.

You might also like