module_2
module_2
PROBLEM SOLVING
AGENTS
The problem-solving domain which breaks the
large stored problem into the smaller storage
area and resolves one by one.
The final integrated action will be the desired
outcomes.
Problem-solving agents in AI are entities
designed to find solutions to problems by
considering various possible actions and their
outcomes.
We can also say that a problem-solving agent is
a result-driven agent and always focuses on
satisfying the goals.
There are basically three types of
problem in AI
1. Ignorable:In which solution steps
can be ignored
2. Recoverable:In which solution
steps can be undone.
3. Irrecoverable:Solution steps
cannot be undo
Steps for problem-
solving in AI
Problem definition:Detailed
specification of inputs and
acceptable system solution.
Problem analysis:Analyse the
problem thoroughly.
Knowledge
Representation:Collect detailed
information about the problem and
define all possible techniques.
Problem-solving:Selection of best
WELL DEFINED PROBLEMS
AND SOLUTIONS
Well-defined problem and solutions
are clear, unambiguous problems
with precisely specified goals and
solutions.
These types of problems are
particularly suitable for
computational approuches
A problem can be defined formally by
five components
The initial state that the agent starts
in.
A description of the possible actions
available to the agent.
A description of what each action
does
The state space forms a directed
network or graph in which the nodes
Key characteristics of well-defined problem and
solution:
Clarity
Well defined problem have clearly stated
goals,initial states,and possible actions. The
problem’s statement leaves little room from
ambiguity or interpretation.
Observable states:
The state of the problem is fully
observable .The agent can perceive and
accurately determine the current state of the
system at any point in time.
Deterministic:
The outcomes of action are
predictable and deterministic. Given
a particular state and action,the nest
state is uniquely detemined.
Known action
The set of possible actions that
an agents can take is well known and
clearly defined. The agents has a
precise understanding of the
Defined transition model:
The transition model, describing how
environment responds to action, is explicitly
known. It specifies the possible states
resulting from each action in each state.
Single goal
There is a single well-defined goal that
the agent aims to achieve. The success or
failure of the agent is unambiguously
determined by reaching or not reaching the
goal state.
No uncertainty
There is no uncertainty or randomness in the
problem. The agents has complete information
about the environment and the consequences
of its action.
A well-defined problem and solution set the
stage for effective problem-solving by providing
clarity,specificity,measurability,relevance,
Fesibility and practicality stakeholders are
crucial in ensuring that the problem and its
solution are well-defined.
A WELL-DEFINED
SOLUTION
The directly addresses the identified
problem and aligns with the established
criteria and constraints.
Solution should provide a clear path to
resolving the problem and achieving the
desired outcomes.
Key characteristics of well-defined solution
include
RELEVENCE:The solution should directly
address the root clause of the problem and
contribute to achieving the desired goals.
Feasibility:The solution should be pratical and of
available resources such as time budget and expertise
Effectiveness:The solution should be capable of
resolving the problem and producing the intended
results. It shoud have a measurable impact on the
identified issues.
Scalability:If applicable, the solution should be
scalable to accommodate future growth or changes in
the environment.
Implementation plan:A well-defined solution includes a
clear plan implementation, outlining the steps,
timeline and responsibilities for carrying out the
solution
WHAT IS SEARCH
PROBLEM
A search problem consists of
1. A State Space:Set of all possible states where
you can be
2. A Start State:The start from where the search
begins
3. A Goal State:A function that looks at the
current state return whether or not it is the goal
state.
The solution to a search problem is a sequence
of actions, called the plan that transforms the
start state to the goal state.
This plan is achieved through search algorithms.
ALGORITHM
UNINFORMED
INFORMED
UNINFORMED SEARCH
ALGORITHM
The search algorithm have no additional
information on the goal node other than the
one provided in the problem definition.
These algorithm can only generate the
successors and differentiate between the
goal state and non-goal state.
The following uniformed search algorithms
are discussed futher
1. Depth First Search
2. Breadth First Search
3. Uniform cost Search
INFORMED SEARCH
ALGORITHMS
Informed search algorithm contains an
array of knowledge such as how far we are
from the goal,path cost,how to reach to
goal node etc.
This knowledge help agents to explire less
to the search space and find mre
effeciently the goal node.
The informed search algorithm is more
useful for large search space.
Informed search algorithm also called
heuristic search
HEURISTICS FUNCTION
D
SOLUTION
solution.
A E
PATH-SABCG
B G
C G
G
ADVANTAGES AND
DISADVANTAGES
ADVANTAGES
1. Requires less memory
2. It takes less time to reach goal
DISADVANTAGES
1. States keep re occurring and there
is no guarantee of finding the
solution
2. As it traverse deep down searching
may enter in to infinite loop some
time
BREADTH-FIRST
SEARCH(BFS)
BFS is an algorithm for traversing or
searching tree or graph
It starts at the tree root and explore
all the neighbor nodes at the present
Start from node and expand to
successor node at current-level
It implemented using a queue that is
FIFO
Which solution would BFS find to
move from node S to node G if run
on the graph below?
S A B C G
D
SOLUTION
C G
G
ADVANTAGES AND
DISADVANTAGES
ADVANTAGES
1. BFS will provide a solution if there
exist a solution
2. If more then one solution are
available, it will select minimal
solution
DISADVANTAGES
1. It requires lot of memory, because
each level has to be saved into
memory
DEPTH-LIMITED SEARCH
ALGORITHM
A depth-limited search algorithm is similar to
DFS with a predetermined limit
This can solve the drawbacks of the infinite path
in the DFS
The nodes at the depth limit will treat as it has
no successor nodes further
Depth-limited search can be terminated with two
condition of failure:
1. Standard failure value:It indicates that problem
does not have any solution
2. Cutoff failure value:It defines no solution for
problem within a given depth limit.
DEPTH-LIMITES SEARCH
ALGORITHM
LEVEL-1
S
LEVEL-2
A B
LEVEL-3
C D T J
E F G H LEVEL-4
ADVANTAGES AND
DISADVANTAGES
ADVANTAGES:
1. Is memory efficient.
DISADVANTAGES
1. Also has a disadvantages of
incompleteness.
2. It may not be optimal if the problem
has more than one solution.
UNIFORM-COST SEARCH
ALGORITHM
Searching algorithm used for traversing a weighted
tree and graph
Comes into play when difference cost is available
fro each edge
Goal of the uniform-cost search is to find a path to
the goal node which has the lowest cumulative cost
A uniform-cost search algorithm is implemented by
the priority queue
It gives maximum priority to the lowest cumulative
cost
Uniform cost search is equivalent to BFS algorithm
if the path cost of all edges is the same
ADVANTAGES AND DISADVANTAGES
ADVANTAGES
Uniform cost search is optimal
because at every state the path with
the least cost is chosen
DISADVANTAGES
It does not care about the number of
steps involve in searching and only
concerned about the path cost.
ITERATIVE DEEPING DEPTH-
FIRST SEARCH
Algorithm is a combination of DFS and
BFS algorithm
This algorithm finds out the best depth
limit and does it by gradually increasing
the limit until a goal is found
The iterative search algorithm is useful
uniformed search when search space is
large and depth of goal node is unknown
This algorithm combine the benefits BFS
fast search and DFS memory efficients
Tree structure is showing the
iterative deepening depth-first
search.
1th iterationA
2nd iterationA,B,C
3rd iterationA,B,D,E,C,F,C
5 1
6
ADVANTAGES AND
DISADVANTAGES
ADVANTAGES
Bidirectional search is fast.
Bidirectional search required less
memory
DISADVANTAGES
Implementation of the bidirectional
search tree is difficult
In bidirectional search one should
know the goal state in advance
INFORMED SEARCH
ALGORITHM
Informed search algorithm contains an
array of knowledge such as how far we are
from the goal,Path,cost , how to reach to
goal node etc
This knowledge help agents to explore less
to the search space and find more
efficiently the goal node.
The informed search algorithm is more
useful for large search space.
Informed search algorithm also called
heuristic search
Here,the algorithms have
information on the goal state, which
helps in more efficient searching.
This information is obtained by
something called heuristic.
3 types of informed search
algorithms.
Greedy search(best-first Search)
A* Search
Ao* Search
GREEDY SEARCH(BEST-
FIRST-SEARCH)
Algorithm that attempts to find first
most promising path from a given
starting point to a goal.
It prioritizes paths that appear to be
the most promising, regardless of
whether or not they are actually the
shortest path.
The algorithm works by evaluating
the cost of each possible path and
then expanding the path with the
How it works!!!!!!!!
Greedy best-first Search works by evaluating the
cost of each possible path and then expanding
the path with the lowest cost.
The algorithm uses a heuristic function to
determine which path is the most promising
The heuristic function takes into account the cost
of current path and the estimated cost of the
remaining paths.
If the cost of the current path is lower than the
estimated cost of the remaining paths, then the
current path is chosen.
This process is repeated until the goal is reached.
Example
ADVANTAGES
Inaccurate Results
Local Optima
Heuristic Function
Lack of completeness
Application
Path finding
Machine Learning
Optimization
Game AI
Navigation
Natural Language Processing
Image Processing
A* SEARCH ALGORITHM