Search Techniques in Artificial Intelligence | Uniform & Heuristic Search Explained
Search Techniques in Artificial Intelligence
Search techniques play a crucial role in Artificial Intelligence (AI) for problem-solving agents. These techniques help agents explore various possible solutions to find the most optimal path. The search techniques are broadly categorized into two types:
- Uniformed (Blind) Search – No domain-specific knowledge.
- Informed (Heuristic) Search – Uses domain-specific knowledge for faster search.
🔍 Problem Solving Agents
Problem-solving agents are designed to reach a goal from a given starting point by searching through a space of possible states. These agents follow a standard process:
- Define the Initial State
- Define the Goal State
- Determine Possible Actions
- Formulate the Search Problem
- Apply appropriate Search Algorithms
🚩 Uniform Search Strategies (Blind Search)
Uniform search strategies don't use additional information about states. They systematically explore all possible paths.
1. Breadth-First Search (BFS)
- Explores all nodes at the current depth before moving to the next level.
- Complete: Yes
- Optimal: Yes (if cost is uniform)
- Time Complexity: O(bd)
- Space Complexity: O(bd)
- Use Case: Shortest path in unweighted graphs.
2. Depth-First Search (DFS)
- Explores as far as possible along a branch before backtracking.
- Complete: No (may go into infinite loop)
- Optimal: No
- Time Complexity: O(bm)
- Space Complexity: O(bm)
- Use Case: Memory-efficient searches.
3. Depth-Limited Search
- A variant of DFS with a predefined limit on the depth.
- Complete: Yes (if depth limit >= depth of goal)
- Optimal: No
- Time Complexity: O(bl)
- Space Complexity: O(bl)
- Use Case: Avoid infinite loops in DFS.
4. Bidirectional Search
- Search from both the initial and goal state simultaneously until they meet.
- Complete: Yes
- Optimal: Yes (if BFS used on both sides)
- Time Complexity: O(bd/2)
- Space Complexity: O(bd/2)
- Use Case: When both start and goal states are known.
🔗 Comparing Uniform Search Strategies
Algorithm | Completeness | Optimality | Time Complexity | Space Complexity |
---|---|---|---|---|
Breadth-First Search | Yes | Yes (if cost is same) | O(bd) | O(bd) |
Depth-First Search | No | No | O(bm) | O(bm) |
Depth-Limited Search | Yes (if l ≥ depth) | No | O(bl) | O(bl) |
Bidirectional Search | Yes | Yes | O(bd/2) | O(bd/2) |
💡 Heuristic Search Strategies (Informed Search)
Heuristic searches use domain-specific knowledge (heuristics) to guide the search towards the goal more efficiently.
1. Greedy Best-First Search
- Selects the node that appears to be closest to the goal based on heuristic h(n).
- Complete: No
- Optimal: No
- Time & Space Complexity: O(bm)
- Use Case: Fast but may not find the shortest path.
2. A* Search
- Uses both actual cost (g(n)) and heuristic estimate (h(n)):
- f(n) = g(n) + h(n)
- Complete: Yes
- Optimal: Yes (if h(n) is admissible)
- Time & Space Complexity: Exponential in worst case
- Use Case: Optimal pathfinding in games, maps, etc.
3. AO* Search
- Designed for problems with AND-OR graphs.
- Handles problems where solutions involve decomposing into sub-problems.
- Expands the most promising node considering both AND and OR branches.
- Use Case: Expert systems, decision trees with multiple dependencies.
4. Hill Climbing Search
- Starts with a random solution and iteratively makes small changes towards a better solution.
- Types: Simple Hill Climbing, Steepest-Ascent, Stochastic, and Random-Restart.
- Complete: No
- Optimal: No
- Issues: Local maxima, plateaus, ridges.
- Use Case: Optimization problems.
5. Simulated Annealing Search
- Probabilistic technique that allows occasional bad moves to escape local optima.
- Gradually reduces the probability of accepting worse solutions (cooling schedule).
- Complete: Yes (with proper schedule)
- Optimal: Yes (probabilistically)
- Use Case: Complex optimization, scheduling, layout problems.
📌 Conclusion
Search techniques form the backbone of problem-solving in AI. Uniform search strategies are simple but may be inefficient, while heuristic strategies provide faster solutions by leveraging domain knowledge. Selecting the right algorithm depends on the problem type, available memory, and whether optimality or speed is more important.
Comments
Post a Comment