100 likes | 217 Views
Homework 0. You may work in groups of one, two or three. Due on 18 of jan at beginning of class. Find a problem, and discuss how you would go about making it into a search problem (as in the water-jug example, or the tangram example below).
E N D
Homework 0 • You may work in groups of one, two or three. • Due on 18 of jan at beginning of class. • Find a problem, and discuss how you would go about making it into a search problem (as in the water-jug example, or the tangram example below). • In particular, what is the initial state, the goal state, the operators. Does the search tree have any special properties? How would that effect your choice of search algorithm… • I imagine this taking 1 to 3 pages of text, and some high quality drawings. • You must do a unique problem! Register your idea on the sign up sheet outside my door.
The Tangram Problem Informal Problem Description: Given these 7 shapes, assemble them into a square.
Note that the goal state here is implicit. We can describe it, but we cannot actually draw it out. In general, we don’t know if there is a goal state. As it happens, in this case there is 1 (not counting rotations and reflections). goal state solution At a low level, how do we know if the shapes make up the goal state?
The initial state is a “blank” square. We know the size of the square (we can simply sum the areas of the seven shapes)
What should the operators be? How about insert(shape_number,x,y,r) ? Bad idea, operators must be atomic… • We can use an insertion function that requires: • At least one edge of the shape must touch an edge of another shape or the walls of the box. • At least one vertex of the shape must coincide with a vertex of another shape or of the box.
… … …
An idea to reduce the branching factor. Since like the 8-queens problem, the order in which the shapes are inserted does not matter (unlike the 8-puzzle or FWDC) we could randomly label the shapes 1 to 7 and only attempt to insert the ith shape at the ith level 2 3 1 5 7 4 6
An BAD idea to reduce the branching factor! Since like the 8-queens problem, the order in which the shapes are inserted does not matter (true for humans, but not for search with the operators I defined) we could randomly label the shapes 1 to 7 and only attempt to insert the ith shape at the ith level Assume this labeling 1 3 2 5 7 4 6 No solution!
An good idea to reduce the branching factor. If both 6 and 7 (or 3 and 5) are still available to be inserted, only consider inserting one of them. 2 3 1 5 7 4 6
… • What can we say about the search tree? • It is exactly depth 7 • Every node at depth 7 is a solution. • How does this effect the choice of search algorithm? … …