Professional Documents
Culture Documents
1
Problem Reduction
2
Goal Trees
3
Goal Trees
• Some goals can be achieved only by
solving all of its subgoals.
• Such nodes on the goal tree are and-
nodes, which represent and-goals.
• In other cases, a goal can be achieved by
achieving any one of its subgoals.
• Such goals are or-goals and are
represented on the goal tree by or-nodes.
4
Goal Trees
• Goal trees are drawn in the same way as search
trees and other semantic trees.
• An and-node is shown by drawing an arc across
the arcs that join it to its subgoals (children).
• Or-nodes are not marked in this way.
• The main difference between goal trees and
normal search trees is that in order to solve a
problem using a goal tree, a number of
subproblems (in some cases, all subproblems)
must be solved for the main problem to be
solved.
5
Top Down or Bottom Up
6
Top Down or Bottom Up
7
Goal three Example : Games
9
Search
• Search is a method that can be used by
computers to examine a problem space like this
in order to find a goal.
• Often, we want to find the goal as quickly as
possible or without using too many resources.
• A problem space can also be considered to be a
search space because in order to solve the
problem, we will search the space for a goal
state.
• We will continue to use the term search space
to describe this concept.
10
Data-Driven or Goal-Driven
Search
• There are two main approaches to
searching a search tree, which roughly
correspond to the top-down and bottom-up
approaches
• Data-driven search starts from an initial
state and uses actions that are allowed to
move forward until a goal is reached.
• This approach is also known as forward
chaining.
11
Data-Driven or Goal-Driven
Search
• Alternatively, search can start at the goal and
work back toward a start state, by seeing what
moves could have led to the goal state.
• This is goal-driven search, also known as
backward chaining.
• Goal-driven search is particularly useful in
situations in which the goal can be clearly
specified such as medical diagnosis where the
goal (the condition to be diagnosed) is known,
but the rest of the data (in this case, the causes
of the condition) need to be found.
12
Data-Driven or Goal-Driven
Search
• Data-driven search is most useful when the initial data
are provided, and it is not clear what the goal is.
• For example, a system that analyzes astronomical data
and thus makes deductions about the nature of stars and
planets would receive a great deal of data, but it would
not necessarily be given any direct goals.
• Rather, it would be expected to analyze the data and
determine conclusions of its own.
• This kind of system has a huge number of possible goals
that it might locate. In this case, data-driven search is
most appropriate.
13
Generate and Test
16
Generate and Test
1. It must be complete: In other words, it must
generate every possible solution; otherwise it
might miss a suitable solution.
2. It must be nonredundant: This means that it
should not generate the same solution twice.
3. It must be well informed: This means that it
should only propose suitable solutions and
should not examine possible solutions that do
not match the search space.
17
Depth-First Search
18
Depth-First Search
• If the leaf node does not represent a goal state,
search backtracks up to the next highest node
that has an unexplored path.
• In Figure after examining node G and
discovering that it is not a leaf node, search will
backtrack to node D and explore its other
children.
• In this case, it only has one other child, which is
H.
• Once this node has been examined, search
backtracks to the next unexpanded node, which
is A, because B has no unexplored children.
19
Depth-First Search
• This process continues until either all the
nodes have been examined, in which case
the search has failed, or until a goal state
has been reached, in which case the
search has succeeded.
• In Figure , search stops at node J, which is
the goal node.
• As a result, nodes F, K, and L are never
examined.
20
Depth-First Search
21
Depth-First Search
• Depth-first search uses a method called
chronological backtracking to move back up
the search tree once a dead end has been
found.
• Chronological backtracking is so called because
it undoes choices in reverse order of the time
the decisions were originally made.
• Depth-first search is an example of brute-force
search, or exhaustive search.
• Depth-first search is often used by computers for
search problems such as locating files on a disk,
or by search engines for spidering the Internet.
22