BQS 5 – “?”

Wu Dian
November 16, 2010
Professor Craig Graci
Csc416
BQS 5 – “?”
This assignment is answering a series of questions based on chapter 4. It
mainly teaches us how to deals with search methodologies including
characterizing state space search, depth first iterative deepening search
and so on.
1. BASIC QUESTIONS ABOUT STATE SPACE PROBLEM SOLVING
Answer in concise, precise terms.
(a) What is a problem space?
A representation of a problem that contains knowledge of the initial state and the goal
state of the problem as well as possible intermediate states that must be searched in
order to link up the beginning and the end of the task.
(b) What does forward chaining refer to?
Forward chaining refers to starting from an initial state and using actions that are
allowed to move forward until a goal is reached.
(c) What does backward chaining refer to?
(d) Backward chaining refers to starting from a goal state and working back toward a start
state, by seeing what moves could have led to the goal state.
2. CHARACTERIZING STATE SPACE SEARCH
In English, characterize each of the following search methods according to how the list of
unexplored nodes is maintained.
(a) Breadth-first search.
Breadth-first search starts by examining all nodes one level down from the root node. If
a goal state id reached here, success is reported. Otherwise, search continues by
expanding paths from all the nodes in the current level down to the next level.
(b) Depth-first search
Depth-first search is an search that start from the first child node of the search tree and
goes deeper and deeper until a goal node is found, or until it reaches a node that has no
children. Then the search backtracks, returning to the most recent node it hasn't
finished exploring.
3. DEPTH FIRST ITERATIVE DEEPENING SEARCH
Describe, in English, depth first iterative deepening search. Explain why DFID is reasonably
efficient. Explain why DFID might be preferable to use than depth first search.
Depth first iterative deepening search combines depth-first search and breadth-first search.
It repeatedly carries out depth-first searches on the tree, starting with a depth-first search
limited to a depth of one, then depth two, until a goal node is found.
DFID is reasonably efficient because for most trees, the majority of nodes are in the last level,
meaning that all three approaches spend most of their time examining these nodes. As the
tree gets larger, DFID is as efficient as breadth-first search or depth-first search.
It shares the advantage of breadth-first search that it will always find the path that involves
the fewest steps through the tree, and it also has good space efficiency, therefore, DFID
might be preferable to use than depth first search
4. SEARCH TERMS
Explain what is meant by the following terms in relation to search methods:
 Complexity
Complexity is to describe how efficient a method is. The time complexity of a method is
related to the length of time that the method would take to find a goal state. The space
complexity is related to the amount of memory that the method needs to use. It is
normal to use Big-O notation to describe the complexity of a method.
 Completeness
A search method is described as being complete if it is guaranteed to find a goal state if
one exists.
 Optimality.
A search method is optimal if it will find the path to a goal state that involves taking the
least number of steps.
5. HEURISTICS
Provide a definition of the word “heuristic”. In what ways can heuristics be useful in search?
Name three ways in which you use heuristics in your everyday life.
A heuristic is some information that can be used to direct the search better.
The heuristic used in search is one that provides an estimate of the distance from any given
node to a goal node. This estimate may or may not be accurate, but it should at least provide
better results than pure guesswork.
1. Find a specific book that I need in a classified book shelf.
2. Buy a coat in a big mall.
3. Buy a gift for my mother.
6. HEURISTICS AND THE EIGHTS PUZZLE
Consider the following state of an eights puzzle:
631
2B4
785
Also, suppose that this particular eights puzzle has the following goal:
123
8B4
765
(a) Write down, each in the form of a two dimensional array, the four children of the given
state.
6B1 631 631 631
234 B24 24B
284
785 785 785 7B5
(c1)
(c2)
(c3)
(c4)
(c) Write down, in English, heuristic H1 for the eights puzzle, as described in the text.
The heuristic H1 for the eights puzzle is the number of tiles that are in the wrong
position.
(d) Compute the value of H1 for each of the four children of the given state. Which move
would be made according to heuristic H1?
c1 = 5, c2 = 5, c3 = 6, c4 = 5
c1, c2, c3 would be made according to H1.
(e) Write down, in English, heuristic H2 for the eights puzzle, as described in the text.
The heuristic H2 for the eights puzzle is the distance of each tile from its correct
position.
(f) Compute the value of H2 for each of the four children of the given state. Which move
would be made according to heuristic H2?
c1 = 2 + 2 + 2 + 2 + 0 + 0 + 3 + 0 = 11
c2 = 2 + 1 + 1 + 2 + 0 + 0 + 3 + 0 = 9
c3 = 2 + 2 + 1 + 2 + 1 + 0 + 3 + 0 = 11
c4 = 2 + 2 + 1 + 1 + 0 + 0 + 3 + 0 = 9
The move c2 or c4 would be made according to heuristic H2.
7. CHARACTERIZING STATE SPACE SEARCH
In English, characterize each of the following search methods according to how the list of
unexplored nodes is maintained.
(a) Best first search
With best first search, the entire queue is sorted after new paths have been added to it,
rather than adding a set of sorted paths.
(b) Beam search
Beam search works using a threshold so that only the best few paths are followed
downward at each level.
8. OPTIMAL PATH SEARCH
For each of the following approaches to optimal path search, search the Web for a site that
you think provides an interesting introduction to the search technique. For each
technique/site, write down the URL along with a short description of what you like about the
site.
 British Museum procedure
Site: http://en.wikipedia.org/wiki/British_Museum_algorithm
The British Museum algorithm is a general approach to find a solution by checking all
possibilities one by one, beginning with the smallest. The term refers to a conceptual, not a
practical, technique where the number of possibilities are enormous.

A*
Site: http://en.wikipedia.org/wiki/A*_search_algorithm
In computer science, A* (pronounced "A star") is a computer algorithm that is widely
used in pathfinding and graph traversal, the process of plotting an efficiently traversable
path between points, called nodes. Noted for its performance and accuracy, it enjoys
widespread use.
 Uniform cost search
Site: http://en.wikipedia.org/wiki/Uniform_cost_search
In computer science, uniform-cost search (UCS) is a tree search algorithm used for
traversing or searching a weighted tree, tree structure, or graph. The search begins at
the root node. The search continues by visiting the next node which has the least total
cost from the root. Nodes are visited in this manner until a goal state is reached.
 Greedy search
Site: http://en.wikipedia.org/wiki/Greedy_search
A greedy algorithm is any algorithm that follows the problem solving metaheuristic of
making the locally optimal choice at each stage[1] with the hope of finding the global
optimum.
9. FILE SYSTEM SEARCH
Investigate the file search facility on your computer.
(a) Which type of search method do you think it uses?
I guess depth first iterative deepening search.
(b) Why do you think this particular search method was chosen?
It combines the advantages of depth-first search with the advantages of breadth-first
search.
(c) What problems could this approach cause it?
When there are only fewer amounts of files, it is not so efficient.
(d) How well does it work when it is searching directories with large numbers of files in
them?
First, using this search method, the memory use can be efficient. Second, with the
amount of files becoming larger, it will not sidetrack the search. What’s more, it will
always find the path that involves the fewest steps.