Unit - 2
Unit - 2
UNIT - 2
Our discussion of problem solving begins with precise definitions of
problems and their solutions and give several examples to illustrate
these definitions. We will describe several general-purpose search
algorithms that can be used to solve these problems. We will see several
uninformed search algorithms—algorithms that are given no information
about the problem other than its definition. Although some of these
algorithms can solve any solvable problem, none of them can do so
efficiently. Informed search algorithms, on the other hand, can do quite
well given some guidance on where to look for solutions.
Uninformed search, also called blind search and naïve search, is a class
of general purpose search algorithms that operate in a bruteforce way.
These algorithms can be applied to a variety of search problems, but since
they don’t take into account the target problem, are inefficient. In contrast,
informed search methods use a heuristic to guide the search for the
problem at hand and are therefore much more efficient.
PROBLEM-SOLVING AGENTS
• Optimal? No
A* search: Minimizing the total estimated solution cost
The most widely known form of best-first search is called A∗ A
search (pronounced “A-star search”). It evaluates nodes by
combining g(n), the cost to reach the node, and h(n), the cost to
get from the node to the goal:
f(n) = g(n) + h(n) .
Since g(n) gives the path cost from the start node to node n, and
h(n) is the estimated cost of the cheapest path from n to the goal,
we have
f(n) = estimated cost of the cheapest solution through n .
Thus, if we are trying to find the cheapest solution, a reasonable
thing to try first is the node with the lowest value of g(n) + h(n).
It turns out that this strategy is more than just reasonable: provided
that the heuristic function h(n) satisfies certain conditions, A∗
search is both complete and optimal. The algorithm is identical to
UNIFORM-COST-SEARCH except that A∗ uses g + h instead of g.
A* search
• Idea: avoid expanding paths that are already expensive