0% found this document useful (0 votes)
16 views20 pages

CMP 446 Basic Search Strategies - Module 2 - B Uninformed Search Strategies

Uploaded by

geehustle06
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)
16 views20 pages

CMP 446 Basic Search Strategies - Module 2 - B Uninformed Search Strategies

Uploaded by

geehustle06
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/ 20

CMP 446 BASIC SEARCH

STRATEGIES
DR. S.A. AREKETE
COURSE CONTENTS
• Problem spaces (states, goals and operators), problem solving by
search, Factored representation (factoring state into variables),
Uninformed search (breadth-first, depth-first, depth-first with
iterative deepening), Heuristics and informed search (hill-
climbing, generic best-first, A*), Space and time efficiency of
search, Two-player games (Introduction to mini-max search),
Constraint satisfaction (backtracking and local search methods),
Review of propositional and predicate logic (cross-reference
DS/Basic Logic), Resolution and theorem proving (propositional
logic only), Forward chaining, backward chaining, Review of
probabilistic reasoning, Bayes theorem
Work Plan
Week# Topics Activity/Assignments

1 Problem spaces (states, goals and operators), problem solving by search, Factored
representation (factoring state into variables)
2-4 Uninformed search (Random Search, Generate and test breadth-first, depth-first, depth-first Assignment 1
with iterative deepening)
5-6 Heuristics and informed search (hill-climbing, generic best-first, A*), Space and time
efficiency of search, Two-player games (Introduction to mini-max search)
7 Continuous Assessment Test 1

8 Student Presentations

9 Space and time efficiency of search, Two-player games (Introduction to mini-max search), Assignment 2
Constraint satisfaction (backtracking and local search methods)
10 Constraint satisfaction (backtracking and local search methods), Review of propositional and
predicate logic (cross-reference DS/Basic Logic),
11-12 Resolution and theorem proving (propositional logic only), Forward chaining, backward Assignment 3
chaining, Review of probabilistic reasoning, Bayes theorem

13 Revision
Other Uninformed Search
Algorithms
Depth-Limited Search (DLS)

• Depth-Limited Search (DLS) is a modification of depth-first


search that minimizes the depth that the search algorithm may
go.
• In addition to starting with a root and goal node, a depth is
provided that the algorithm will not descend below.
• Any nodes below that depth are omitted from the search.
• This modification keeps the algorithm from indefinitely cycling
by halting the search after the pre-imposed depth.
• Figure 2.12 illustrates this search with a depth of two (no nodes
deeper than level two are searched).
Depth-Limited Search (DLS)
Depth-Limited Search (DLS)

• While the algorithm does remove the possibility of infinitely looping


in the graph, it also reduces the scope of the search.
• If the goal node had been one of the nodes marked ‘X’, it would not
have been found, making the search algorithm incomplete.
• The algorithm can be complete if the search depth is that of the tree
itself (in this case d is three).
• The technique is also not optimal since the first path may be found to
the goal instead of the shortest path.
• The time and space complexity of depth-limited search is similar to
DFS, from which this algorithm is derived.
• Space complexity is O(bd) and time complexity is O(bd), but d in this
case is the imposed depth of the search and not the maximum depth
of the graph.
Iterative Deepening Search (IDS)

• Iterative Deepening Search (IDS) is a derivative of DLS and combines


the features of depth-first search with that of breadth-first search.
• IDS operates by performing DLS searches with increased depths until
the goal is found.
• The depth begins at one, and increases until the goal is found, or no
further nodes can be enumerated (see Figure 2.13).
• As shown in Figure 2.13, IDS combines depth-first search with
breadth-first search.
• By minimizing the depth of the search, we force the algorithm to also
search the breadth of the graph.
• If the goal is not found, the depth that the algorithm is permitted to
search is increased and the algorithm is started again.
Iterative Deepening Search (IDS)
Bidirectional Search

• The Bidirectional Search algorithm is a derivative of BFS.


• It operates by performing two breadth-first searches
simultaneously, one beginning from the root node and the other
from the goal node.
• When the two searches meet in the middle, a path can be
reconstructed from the root to the goal.
• The searches meeting is determined when a common node is
found (a node visited by both searches, see Figure 2.15).
• This is accomplished by keeping a closed list of the nodes visited.
Bidirectional Search..
Bidirectional Search..
Bidirectional Search..

• Bidirectional search is an interesting idea, but requires that we


know the goal that we’re seeking in the graph, a situation that is
not always practical, which limits the application of the
algorithm.
• When it can be determined, the algorithm has useful
characteristics.
• The time and space complexity for bidirectional search is
O(bd/2), since we’re only required to search half of the depth of
the tree.
• Since it is based on BFS, bidirectional search is both complete
and optimal.
Uniform-Cost Search (UCS)

• BFS has the advantage of being able to find the shallowest


solution.
• But consider the edge having a cost associated with it.
• The shallowest solution may not be the best, and a deeper
solution with a reduced path cost would be better (for example,
see Figure 2.16).
• Uniform-Cost Search (UCS) can be applied to find the least-cost
path through a graph by maintaining an ordered list of nodes in
order of descending cost.
• This allows us to evaluate the least cost path first
Uniform-Cost Search (UCS)..
Uniform-Cost Search (UCS)..

• The algorithm for UCS uses the accumulated path cost and a priority
queue to determine the path to evaluate.
• The priority queue is sorted from least cost to greatest and contains
the nodes to be evaluated.
• As node children are evaluated, we add their cost to the node with
the aggregate sum of the current path.
• This node is then added to the queue, and when all children have
been evaluated, the queue is sorted in order of ascending cost.
• When the first element in the priority queue is the goal node, then
the best solution has been found.
Uniform-Cost Search (UCS)..
Uniform-Cost Search (UCS)..

• The UCS algorithm is easily demonstrated using our example


graph in Figure 2.16.
• Figure 2.17 shows the state of the priority queue as the nodes
are evaluated.
• At step one, the initial node has been added to the priority
queue, with a cost of zero.
• At step two, each of the three connected nodes are evaluated
and added to the priority queue.
• When no further children are available to evaluate, the priority queue is
sorted to place them in ascending cost order.
Uniform-Cost Search (UCS)..

• At step three, children of node C are evaluated.


• In this case, we find the desired goal (E), but since its accumulated
path cost is eight, it ends up at the end of the queue.
• For step four, we evaluate node D and again find the goal node.
• The path cost results in seven, which is still greater than our B node in
the queue.
• Finally, at step five, node B is evaluated.
• The goal node is found again, with a resulting path cost of six.
• The priority queue now contains the goal node at the top, which
means at the next iteration of the loop, the algorithm will exit with a
path of A->B->E (working backwards from the goal node to the initial
node).
Uniform-Cost Search (UCS)..

• To limit the size of the priority queue, it’s possible to prune entries that are
redundant.
• For example, at step 4 in Figure 2.17, the entry for E(8) could have been
safely removed, as another path exists that has a reduced cost (E(7)).
• The search of the graph is shown in Figure 2.18, which identifies the path
cost at each edge of the graph.
• The path cost shown above the goal node (E) makes it easy to see the least-
cost path through the graph, even when it’s not apparent from the initial
node.
• UCS is optimal and can be complete, but only if the edge costs are non-
negative (the summed path cost always increases).
• Time and space complexity are the same as BFS, O(bd) for each, as it’s
possible for the entire tree to be evaluated.

You might also like