CS 404 – Artificial Intelligence

advertisement
CS 404 – Artificial Intelligence
HW 2
100pt
Due Oct 16 @ 10pm, via SUCourse
Late Oct 18 @ 10pm, via SUCourse
Please type your answers and use only the allocated space.
Make your final answers red for easy grading please
Objective: To deepend the understanding of time and space complexity in search algorithms and
deciding on suitable algorithms for a given problem.
Note: You should answer most questions with a one line formula. Add one line of explanation if
ambiguous or specifically asked.
Expected duration: 1 hr if you know the material.
1) 10pt – How many nodes are there in a complete tree of depth d and branching factor b (i.e.
each node, except for the nodes at the bottom level, has exactly b children).
Exact formula: ……………………………………………… in terms of b and d.
Remember that we use the convention of having the root node at depth 0.
2) 40pt –Answer the following using the general Tree Search algorithm (remove front
node from the fringe/queue – goal test – expand).
Note: You can use the following equality for compactness:
1 + b + b2 + … bd = (bd+1-1)/(b-1)
a) 10pt - How many nodes are visited (chosen from the queue, goal tested and expanded) in the
worst case using Breadth-First search, when the solution is at depth d, and the branching
factor is b, and the depth of the maximum branch is m?
Give a formula.
…………………………………………………………………………………………..
b) 10pt- How many nodes are generated (added to the queue as a result of expanding the parent)
in the worst case using Breadth-First search, when the solution is at depth d, and the
branching factor is b, and the depth of the maximum branch is m?
…………………………………………………………………………………………..
c) 10pts - Draw a sample tree (illustrate), showing where /when you find the goal in the worst
case.
d) 10pt - What is the maximum size of the queue using Depth-First search, when the solution
is at depth d, and the branching factor is b, and the depth of the maximum branch is m?
…………………………………………………………………………………………..
3) 50pt – 10pts each - In bi-directional search, two searches occur in parallel, one from the initial state,
the other from the goal state.
We are considering using bi-directional search for finding whether 6-degrees of separation holds
between any 2 given people in the world. For this case, which of the following search algorithms
would be suitable to be used as the component in this bidirectional search: breadth first search,
depth first search, depth limited search DFS, iterative deepening DFS?
Give your answer with one-line explanations for each search algorithm indicating first as suitable
or not suitable or suitable under these conditions only; with a short explanation.
BFS: ……………………………………………………………………………………………
………………………………………………….…………………………………………………
DFS (no depth limit, no repeated state checking): ……………………………………………
………………………………………………….…………………………………………………
Depth Limited DFS (limit should be .....................): ………………………….…………………
………………………………………………….…………………………………………………...
Iterative Deepening DFS:………………………………………………………………………....
………………………………………………….……………………………………………………
Favorite search algorithm based on the above: ………………………………………………….
(no further explanation necessary)
Download