Lect. 3: Search: Bics3033 - Artificial Intelligence
Lect. 3: Search: Bics3033 - Artificial Intelligence
3: Search
BICS3033 – ARTIFICIAL INTELLIGENCE
TOPIC TO BE COVERED:
We have many actions that may lead to a solution but we don’t know
which ones.
We can search through all possibilities to find one that will give us a
solution.
The set of possible paths that is reachable from the initial state to find out if it is
a goal state is called search space.
Introduction (cont.)
Searching Algorithm
Introduction (cont.)
If the search space is small, simple search techniques are adequate -
which try every possible paths – known as blind search techniques,
e.g., Depth First Search (finite space) and Breadth First Search.
❑ Nodes
❑ Link/ vertices/ edges: directed or undirected.
❑ Successor :
▪ A neighboring node, reachable by a link
▪ l has successor s,h;
▪ Successor for s is f,
▪ and f no successor.
❑ Path : Sequence of nodes connecting two nodes via links.
Introduction (cont.)
Example:
Blind Search Strategies
Searching involve finding a path from a start to a target.
Mosque
Blind Search Strategies (cont.)
Depth First Search:
❑ l (library), s, f, h,
p, n, u, m(end).
m (mosque)
Blind Search Strategies (cont.)
Breadth First
Search:
m (mosque)
Blind Search Strategies (cont.)
The choice of Breadth and Depth
The basic idea – focus on paths that seem to be getting you nearer to
your goal state.
▪ Convert to tree .
▪ Measure straight-line distances
from each node to the goal.
Tree Representation
Heuristic Search (cont.)
Hill climbing algorithm is a technique which is used for optimizing the mathematical
problems. One of the widely discussed examples of Hill climbing algorithm is
Traveling-salesman Problem in which we need to minimize the distance traveled by the
salesman.
It is also called greedy local search as it only looks to its good immediate neighbor state
and not beyond that.
A node of hill climbing algorithm has two components which are state and value.
In this algorithm, we don't need to maintain and handle the search tree or graph as it only
keeps a single current state.
Heuristic Search – Hill Climbing (cont.)
Algorithm:
So both BFS and DFS blindly explore paths without considering any
cost function.
Always keep tracks all partial paths for further consideration where
the shortest path so for will be selected for extension.
The process repeated until the goal is reached – since the shortest
path is always chosen for extension, once it reach the goal, is likely to
be the optimal path.
We can extend further the partial to be certain that the optimal path
found is shorter than further extended paths.
Heuristic Search – Branch and Bound (cont.)
Heuristic Search – Branch and Bound (cont.)
Heuristic Search – Extended Branch and Bound