BAI Summary
BAI Summary
Uninformed Search
Overview:
1. Problem Solving Through Search:
Representation of search problems.
Differences between tree search and graph search.
Types of searches: depth-first, breadth-first, and iterative deepening.
2. Basics of Search:
Representing the world using states and actions.
Building a graph in state space and defining path costs.
Defining goal conditions and representing problems as search trees.
4. Examples:
Vacuum-cleaner world: Uses states (dirt locations and cleaner position) and
actions (move and clean) with uniform path costs.
Sliding-block puzzle: Describes states as permutations of tiles and actions as
tile movements with uniform path costs.
5. Search Algorithms:
Systematic traversal of state space to find goal states by expanding nodes and
constructing search trees.
Nodes represent states, and edges represent actions with associated costs.
Difference in algorithms based on node expansion order.
Specific Algorithms:
1. Breadth-First Search (BFS):
Expands the shallowest nodes first.
Uses a queue to manage nodes.
Complete and optimal for uniform step cost but has high space complexity.
2. Depth-First Search:
Complete if the search space is finite.
Not optimal.
Time complexity: O(b^m), space complexity: O(b*m).
Summary:
- Search is fundamental to AI problem-solving.
- Abstraction helps in identifying relevant domain aspects.
- Essential elements include initial state, successor function, goal test, and path
cost.
- Distinction between states and search nodes.
- Uninformed search relies solely on problem definitions, with basic algorithms
including BFS, DFS, and IDS.
Informed Search
Overview:
1. Greedy Search
2. A* Search
3. More on Heuristics
4. Iterative Improvement Algorithms
Search Problems:
- Characterized by initial state, successor function, goal test, and path cost.
- Solved using search algorithms, such as breadth-first, depth-first, and iterative
deepening search.
Search Algorithms:
- Informed vs. Uninformed: Informed search uses heuristics to guide the search
process.
- Performance measures: completeness, optimality, time complexity, and space
complexity.
Greedy Search:
- Criterion function f(n) = h(n)
- Expands the node that seems closest to the goal.
- Example heuristic: straight-line distance to the goal.
Properties of Greedy Search:
- Not optimal and not complete.
- Can avoid infinite loops by keeping track of visited states.
- The number of nodes expanded depends on the heuristic used.
A* Search:
- Uses f(n) = g(n ) + h(n)where g(n) is the cost to the node and h(n) is the
heuristic.
- Complete and optimal if the heuristic h is admissible (never overestimates the
true cost to the goal).
- Optimally efficient: no other optimal search algorithm (with the same heuristic)
expands fewer nodes.
Genetic Algorithms:
- Retain multiple states (population) with states encoded as genotypes.
- Fitness function determines propagation chances.
- States combine through crossover and mutate.
- Used for approximations to global optima in complex problems.
Summary:
- Use heuristics for informed search.
- Greedy search uses only heuristics.
- A* search combines heuristic and distance.
- A* is better than greedy search.
- The speed of A* depends on the heuristic.
- Iterative improvement search modifies states.
- Genetic algorithms explore many solution candidates simultaneously.
1. CSP Examples
2. Solving CSPs by Search
3. Improving Search by Heuristics
4. Iterative Improvement Algorithms
CSP Examples:
Image Understanding:
o Labeling edges in images to understand object shapes, using labels
like boundary (arrow), convex (+), or concave (–).
o Propagating constraints to label intersections correctly.
Map Coloring:
o Coloring a map so that no adjacent territories share the same color.
Problem Statement:
Constraint Graphs:
Solving CSPs:
Backtracking Search:
2. Degree Heuristic:
o As a tie-breaker for MRV, choose the variable with the most
constraints.
o Reduces branching factor.
4. Forward Checking:
o Propagate constraints to neighboring variables whenever a variable
is assigned.
o Reduces search effort by keeping track of remaining legal values.
Constraint Propagation:
Arc Consistency:
Constraint Trees:
o More efficient to solve than graphs.
o Use a linear order on variables and ensure arc consistency.
Cutset Conditioning:
o Convert conflict graphs to trees by removing cycle cutsets.
o Solve CSP for cutset, then solve for the tree, iterating until no
conflicts remain.
Summary: