0% found this document useful (0 votes)
12 views28 pages

Lect. 3: Search: Bics3033 - Artificial Intelligence

The document covers search strategies in artificial intelligence, focusing on blind search techniques like Depth First Search and Breadth First Search, as well as heuristic search methods such as Hill Climbing, Best First Search, and Branch and Bound. It explains the importance of search space and the need for efficient algorithms when dealing with complex problems. Additionally, it discusses the limitations of certain heuristic methods and provides examples of their applications.

Uploaded by

radifmalaysia2
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)
12 views28 pages

Lect. 3: Search: Bics3033 - Artificial Intelligence

The document covers search strategies in artificial intelligence, focusing on blind search techniques like Depth First Search and Breadth First Search, as well as heuristic search methods such as Hill Climbing, Best First Search, and Branch and Bound. It explains the importance of search space and the need for efficient algorithms when dealing with complex problems. Additionally, it discusses the limitations of certain heuristic methods and provides examples of their applications.

Uploaded by

radifmalaysia2
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/ 28

Lect.

3: Search
BICS3033 – ARTIFICIAL INTELLIGENCE
TOPIC TO BE COVERED:

1. Blind Search Strategies


✔ Depth First Search
✔ Breadth First Search
2. Heuristic Search
✔ Hill Climbing
✔ Best First Search
✔ Branch and Bound
Introduction
General idea :

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.

E.g. in chapter 2 - backward chaining searching strategies – try a possible


sequence of inference steps which will constitute a proof to some goal.

In other applications we may be searching for the sequence of steps that


will solve a puzzle, a sequence of moves that will results in winning a
game, etc.
Introduction (cont.)
Process searching start from initial state (e.g., unsolved puzzle; middle of game;
etc.) to target state (e.g., solve puzzle; won game; etc.)

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.

For more complex search space – a huge number of possible states to


explore – impossible to try them all – then heuristic searches – to
guess which paths are likely to a solution.
Introduction (cont.)
Important Terminologies:

❑ 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.

Also known as search tree

Example of Blind Search Strategies


❑ Depth First Search – Tree
▪ Algorithm using stack

❑ Breadth First Search – Tree


▪ Algorithm using queue.
Blind Search Strategies (cont.)
Example:

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:

❑ l (library) -> s-> h


-> f -> p -> n -> u ->
m (end)

m (mosque)
Blind Search Strategies (cont.)
The choice of Breadth and Depth

❑ Are you looking for the shortest path ?


▪ Breadth first may be better.

❑ Is memory likely to be a problem ?


▪ Depth first require less memory.

❑ Do you want to find a solution quickly?


▪ Depend …
Heuristic Search
If search space is too big – impossible to search every node.

Alternatively – construct some reasoning function that can be used to


provide an estimate as to which paths seem promising.

The basic idea – focus on paths that seem to be getting you nearer to
your goal state.

We use scoring or evaluating function that contains score/ guess a node


according to how close to the target/ goal.

Many algorithms such as :


❑ Hill climbing
❑ Best 1st. search
❑ Machine learning, i.e., genetic algorithm.
Heuristic Search (cont.)
Example of Straight Line Measure:

▪ Convert to tree .
▪ Measure straight-line distances
from each node to the goal.

Graph for simple map


Heuristic Search (cont.)

Tree Representation
Heuristic Search (cont.)

Example of Scoring Function:

▪ Always head towards the best


successor node (and only if that
node is better than the current one).
Heuristic Search – Hill Climbing
Hill climbing algorithm is a local search algorithm which continuously moves in the direction
of increasing elevation/value to find the peak of the mountain or best solution to the
problem. It terminates when it reaches a peak value where no neighbor has a higher value.

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.

Hill Climbing is mostly used when a good heuristic is available.

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:

1. Start with current-state = initial-state.


2. Until current-state = goal-state OR no change in current-state
3. Get the successors of current-state and use the evaluation function to
assign a score to each successor.
4. If one of the successor has a better score than current-state then set
the new current-state to be the successor with the best score.
Heuristic Search – Hill Climbing (cont.)
Limitation of Hill Climbing

❑ Local Maximum: A local maximum is a peak state in the


landscape which is better than each of its neighboring states,
but there is another state also present which is higher than the
local maximum.

❑ Plateau: A plateau is the flat area of the search space in which


all the neighbor states of the current state contains the same
value, because of this algorithm does not find any best
direction to move. A hill-climbing search might be lost in the
plateau area.

❑ Ridges: A ridge is a special form of the local maximum. It has


an area which is higher than its surrounding areas, but itself
has a slope, and cannot be reached in a single move.
Heuristic Search – Best First Search
In BFS and DFS, when we are at a node, we can consider any of the
adjacent as next node.

So both BFS and DFS blindly explore paths without considering any
cost function.

The idea of Best First Search is to use an evaluation function to


decide which adjacent is most promising and then explore.
Heuristic Search – Best First Search (cont.)

We start from source "S" and search for


goal "I" using given costs and Best
First search.
Heuristic Search – Best First Search (cont.)
1) Open = [ ] 7) Open = [I5, E8, D9, F12, G14]
Closed = [ ] Closed = [S, A3, C5, B6, H7]

2) Open = [S] 8) Open = [E8, D9, F12, G14]


Closed = [ ] Closed = [S, A3, C5, B6, H7, I5]

3) Open = [A3, C5, B6]


Closed = [S] The best path is:
[S, A, C, H, I]
4) Open = [C5, B6, E8, D9]
Closed = [S, A3]

5) Open = [B6, H7, E8, D9]


Closed = [S, A3, C5]

6) Open = [H7, E8, O9, F12, G14]


Closed = [S, A3, C5, B6]
Heuristic Search – Branch and Bound

Like Best 1st. – looking for the best path.

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

Further improve of branch-and-bound.

Weeding out redundant partial path – leading to search efficiency.


Thank You

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy