0% found this document useful (0 votes)
13 views8 pages

BAI Summary

The document provides an overview of search algorithms in artificial intelligence, covering uninformed and informed search methods, including breadth-first, depth-first, and A* search. It discusses constraint satisfaction problems (CSPs), their representation, and methods for solving them, emphasizing the role of heuristics and incremental repair algorithms. Key concepts include the importance of problem structure and the application of heuristics to improve search efficiency.

Uploaded by

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

BAI Summary

The document provides an overview of search algorithms in artificial intelligence, covering uninformed and informed search methods, including breadth-first, depth-first, and A* search. It discusses constraint satisfaction problems (CSPs), their representation, and methods for solving them, emphasizing the role of heuristics and incremental repair algorithms. Key concepts include the importance of problem structure and the application of heuristics to improve search efficiency.

Uploaded by

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

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.

3. Appropriate Problems for Search:


Suitable for static, observable, discrete, and deterministic environments.

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 (DFS):


Expands the deepest nodes first.
Uses a stack to manage nodes.
Not optimal and has potential high time complexity.

3. Iterative Deepening Search (IDS):


Combines depth-first search's space efficiency with breadth-first search's
optimality.
Searches to increasing depth limits.

Analysis and Comparison:


1. Breadth-First Search:
Complete if the branching factor is finite.
Optimal for uniform step cost.
Time and space complexity: O(b^(d+1)).

2. Depth-First Search:
Complete if the search space is finite.
Not optimal.
Time complexity: O(b^m), space complexity: O(b*m).

3. Iterative Deepening Search:


Complete if the branching factor is finite.
Optimal for uniform step cost.
Time complexity: O(b^d), space complexity: O(b*d).

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.

Best-First Search Strategies:


- Expands the best node according to a criterion.
- Breadth-first uses node depth, depth-first uses negative node depth.
- Informed search uses a heuristic function h(n)which estimates the cost from
node \( n \) to the goal.

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.

Properties of Heuristic Functions:


- A* may fail to find the optimal solution if the heuristic is admissible but not
consistent.
- Consistent heuristics ensure that A* remains complete and optimal.
- Dominating heuristics (higher values) result in fewer nodes being expanded.

Heuristic Function Examples:


- Misplaced tiles and Manhattan distance for sliding-block puzzles.
- Heuristics that dominate others expand fewer nodes and are more efficient.

Iterative Improvement Search:


- Focuses on finding solutions rather than paths.
- Local search involves improving the current state.
- Applied in optimization problems (e.g., finding maxima/minima of objective
functions).

Examples of Local Search Problems:


- Traveling Salesman Problem: Find the shortest non-intersecting cycle through
all nodes.
- 8-Queens Problem: Place 8 non-attacking queens on a chessboard.

Solving Local Search Problems:


- Exponential time required for solutions as problem size grows.
- Can get stuck in local minima.
- Heuristic algorithms: hill-climbing/gradient descent, simulated annealing, and
genetic algorithms.

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.

Genetic Algorithm Examples:


- 8-Queens Optimization: Uses fitness functions and crossover operations for
non-attacking queen placement.
- Traveling Salesman Problem: Finds shortest tour through a list of cities using
permutation and mutation operations.

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.

Constraint Satisfaction Problems


Overview:

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:

 Given a set of variables with domains and a set of constraints.


 Find an assignment of values to variables such that all constraints are
satisfied.
 Types of variables:
o Discrete with finite domains (easiest).
o Discrete with infinite domains (e.g., job scheduling).
o Continuous variables (e.g., linear optimization).
 Types of constraints:
o Unary, binary, and higher-order constraints.

Constraint Graphs:

 Binary CSPs can be represented by graphs with nodes as variables and


edges as constraints.

Solving CSPs:

 Methods include constraint propagation, depth-first search, depth-first


search with heuristics, and iterative improvement search.
 Focus on heuristic search.

CSPs as Search Problems:

 Initial state: empty variable assignment.


 Successor function: assign a value to an unassigned variable.
 Goal test: all variable assignments are consistent.
 Path cost: uniform for each step.
 Use depth-first search since all solutions are at the depth of the number of
variables.

Backtracking Search:

 Depth-first search with improvements to avoid redundant work and to


check constraints early.
 Fix order of variable assignments and check for constraint violations.
Heuristic Improvements to Backtracking:

1. Minimum Remaining Values (MRV):


o Select the variable with the fewest legal values remaining.
o Early failure detection prunes the search tree.

2. Degree Heuristic:
o As a tie-breaker for MRV, choose the variable with the most
constraints.
o Reduces branching factor.

3. Least Constraining Value:


o Choose the value that leaves the most choices for neighbors.
o Less restrictive assignments guide the search.

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:

 Extend forward checking to more than one step.


 Detect conflicts among variables not directly considered (e.g., arc
consistency).

Arc Consistency:

 An arc is consistent if every value of one variable has a consistent value in


the neighboring variable.
 Inconsistencies lead to value removal, and the process iterates to maintain
consistency.

Incremental Repair Algorithms:

 Focus on the solution rather than the path to it.


 Assign values randomly, then use local search to minimize conflicts.
 Effective strategy: min-conflicts heuristic (choose variable with conflicts,
assign the value that violates the fewest constraints).

Taking Advantage of Problem Structure:

 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:

 CSPs involve placing constraints on variables.


 Binary CSPs can be represented as graphs.
 Heuristics improve backtracking search efficiency.
 Incremental repair algorithms are effective for some problems.
 Constraint trees are faster to solve than graphs.
 Problem decomposition can make large problems more tractable.

You might also like