01 IA Uninformed Search CP
01 IA Uninformed Search CP
• initial state
• actions
• transition model
• goal test
• path cost function
Approach
• Start with a frontier that contains the initial state.
• Start with an empty explored set.
• Repeat:
• If the frontier is empty, then no solution.
• Remove a node from the frontier.
• If node contains goal state, return the solution.
• Add the node to the explored set.
• Expand node, add resulting nodes to the frontier if they
aren't already in the frontier or the explored set.
Uninformed Search
• Breadth-first search
• Depth-first search
• Depth limited search
• Iterative deepening search
• Bi-direction search
• Uniform search
Exercise 1.
Define in your own words the following terms: state, state space,
search tree, search node, goal, action, transition model, and
branching factor.
Exercise 2.
Define the initial state, target test, successor function, and cost
function for each of the following cases. Choose a formulation that
is precise enough to be implemented:
a) Color a flat map using only four colors, so that two adjacent
regions do not have the same color.
b) A three-foot-tall monkey is in a room where some bananas are
suspended from the eight-foot-high ceiling. He would like to get
the bananas. The room contains two stackable, movable, and
scalable three-foot-high boxes.
Exercise 2. (Cont.)
Define the initial state, target test, successor function, and cost
function for each of the following cases. Choose a formulation that
is precise enough to be implemented:
c) You have a program that outputs the message "illegal login log"
when we insert a certain login log file. You know that the
treatment of each record is independent of other records. You
want to find out what is illegal.
d) You have three jars, with capacities 12 gallons, eight gallons,
and three gallons, and a water faucet. You can fill the jars or
empty them from one to another or onto the floor. You should
get exactly one gallon.
Exercise 3.
On a table are two empty jugs, one with a capacity of 3 liters and
the other of 4 litres. Either of them can be filled with water from a
tap. It is possible to pour all the water from one jar to the other or
empty it into a pond. Find a sequence of operators that leaves
exactly two litres of water in the 4-liter jug, if additional measuring
devices are not available.
a) Model this problem as a search problem. For this purpose,
define the initial state, the set of target states, the operators
(specifying their preconditions and postconditions), as well as
the cost of each operator.
b) Find a solution to the problem.
Exercise 4.
The graph below defines a search problem. Each node represents
a state; the arcs model the application of operators. Suppose A is
the initial state and K and E are goal states.
a) Build the search tree that generates breadth-first search, without
filtering out repeated states. Which of the goal nodes is found
first? Specify the order in which the nodes are expanded. Put
the open list status in each step of the algorithm.
b) Perform the same procedure using depth-first search.
Exercise 4 (Cont.)
Exercise 5.
Suppose that in the presented road network an agent is located in
Craiova (C) and wants to move to Fagaras (F).
a. Develop the search tree that is generated by performing depth-
first search. Assume that simple cycles are filtered. Indicate the
order in which the nodes are expanded.
b. Set the state of the open list at each step of the algorithm.
c. Perform the same procedure applying breadth-first search.
Exercise 5 (Cont.)
Artificial Intelligence