Professional Documents
Culture Documents
Initial State: ?
Operators: ?
+ TEN 850
+ TEN 850
• Goal Test: whether the expression is ----- -----
true given the complete mapping SIXTY 31486
F=2, O=9, R=7, etc.
• State: ?
• Initial State: ?
• Operators: ?
• Goal Test: ?
Water Jug Problem
Given a full 5-gallon jug and a full 2-gallon jug, fill the 2-gallon jug with
exactly one gallon of water.
• State: ?
• Initial State: ?
5
2
• Operators: ?
• Goal State: ?
Water Jug Problem
Operator table
Advantages
• Uniform cost search is an optimal search method because at every state, the path with
the least cost is chosen.
Disadvantages
• It does not care about the number of steps or finding the shortest path involved in the
search problem, and it is only concerned about path cost. This algorithm may be stuck
in an infinite loop.
Complete: Yes (if b is finite and costs are stepped, costs are zero)
Time Complexity: O(b(c/ϵ)) where, ϵ -> is the lowest cost, c -> optimal cost
Space complexity: O(b(c/ϵ))
Optimal: Yes (even for non-even cost)
• The sad failure of DFS is alleviated
by supplying a depth-first search with
a predetermined depth limit.
• The depth limit solves the infinite-
path problem.
Advantages
• Depth-limited search is Memory efficient.
Disadvantages
• The DLS has disadvantages of completeness and is not optimal if it has more than one
goal state.
Advantages
• Since BS uses various techniques like
DFS, BFS, DLS, etc., it is efficient
and requires less memory.
Disadvantages Complete: Yes
• Implementation of the bidirectional Time Complexity: O(b^(d/2))
search tree is difficult. Space complexity: O(b^(d/2))
• In bidirectional search, one should Optimal: Yes (if step cost is uniform in both
know the goal state in advance. forward and backward directions)
• Uninformed algorithms are used in search problems, where the
goal is to find a solution by exploring a large search space.
• Uninformed algorithms are often simple to implement and can be
effective in solving certain problems, but they may also be less
efficient than informed algorithms that use heuristics to guide their
search.
• Informed search algorithms use additional knowledge or
heuristics to guide the search process.
• The most popular way to give the search problem more
information about the problem is using heuristic functions.
• It is the cost estimate to reach the goal state from a particular node,
n. H(n) = 0 if n is a goal node.
• Any problem-specific function is acceptable (arbitrary and
nonnegative).
Best First Search Algorithm
• The Informed BFS follows a greedy approach for state transitions to reach
a goal.
• For every node here, an evaluation function(f(n)) is maintained, which
provides a cost estimate.
• The idea is to expand the node with the lowest f(n) every time.
• The Evaluation function here has a heuristic function h(n) component. i.e.
f(n)=h(n)
• The node that seems to be closest to the goal is therefore extended.
Open : [S]
Closed: []
Open: [A,B]
Closed: [S]
Open: [E,F,A]
Closed: [S,B]
Open: [I,G,E,A]
Closed: [S,B,F]
Open: [I,E,A]
Closed: [S,B,F,G]
• Where, g(n) is the actual cost from the initial state to the current node.
h(n) is the estimated cost from the current node to the goal state.
• The optimality of the solution for the A* search depends on the admissibility
of the heuristic function we choose.
Admissible Heuristic
• A heuristic function, h(n) is admissible if, for every node, h(n) is less
than or equal to g(n).
• An admissible heuristic never overestimates the cost of reaching the
goal.
• It is always optimistic about finding the best path to the goal node.
Hill climbing will halt because all these states have lower scores than the
current state. The process has reached a local maximum.
Block world’s problem:
• h(n) = +1 for all the blocks in the support structure if the block is
correctly positioned otherwise -1 for all the blocks in the support
structure.