Problem Solving
Problem Solving
Problem:
A problem is really a collection of
information that the agent will use to
decide what to do.
Problem means- trouble or distress.
For example, merger of company is
the problem as well opportunity.
Problem Solving
The environment of the problem is
represented by a state space.
A state space represents the set of
all possible states for a given
problem.
A path through the state space from
the initial state to a goal state is a
solution.
Problem Solving
2. Operators
3. Goal test
4. Path cost
Problem Solving
Initial state:-
The initial state that agent knows itself to
be in.
Operators:-
The set of possible actions is called
operators.
The term operator is used to denote the
description of an action in terms of which
state will be reached by carrying out the
action in particular state.
Problem Solving
Goal test:
The goal is objective to be achieved,
or final answer, or solution.
It is final destination to reach from
initial state to final or goal state .
It is simply solution to be achieved.
Problem Solving
Path cost:-
A path cost function a function that
assigns a cost to a path.
The cost of path is the sum of the
costs of the individual actions along
the path.
Problem Solving
Problem Solving is
performance/output/feedback of thinking.
mental activity of finding solution to a
problem.
it was introduced by mathematicians.
it is equivalent to decision making in the
world of business.
Problem Solving
Problem solving is the one of the major
objective of AI expert systems to solve
problems like human do.
Decision making, or problem solving, is
a difficult task, even for people.
Reasoning is the major characteristic of
intelligent behavior in problem solving.
The process of Problem Solving
Generation of Alternatives
Implementation
1. Problem identification
and definition:-
A problem (or opportunity must first
be recognized.
Its magnitude and importance are
determined and defined .
The process of Problem Solving
3. Generation of Alternatives:-
1. Informal Approach:-
2. Formal Approach:-
Formal approaches can be classified
into three categories:
1. Optimization
2. Blind Search
3. Heuristic search
Search Approaches
1. Optimization:-
It involves numeric and quantitative
analysis.
It attempts to find the best possible
solution by using mathematical
formulas that model specific
situations.
Search Approaches
The problem domain must be fairly
structured, and the optimization is
conducted by using either a one-step
formula or an algorithm.
an algorithm is a step-by-step search
process in which solutions are
generated and tested for possible
improvements.
Search Approaches
Optimization is used extensively in
non-AI technologies such as
operations research (management
science) and mathematics.
In AI, blind search and heuristic search
are used extensively.
Search Approaches/techniques
Search:-
The process of sifting through
alternative solutions to proceed
from initial state to goal state is
called a search.
In AI, you begin with initial state
and attempt to reach a goal state.
Searching Techniques
Blind Search:-
A blind search (also called an uninformed search) is a
search that has no information about its domain.
The only thing that a blind search can do is distinguish
a non-goal state from a goal state.
The description of a desired solution is given
while conducting this search.
This is called a goal.
For example, a goal can be to identify the
best location for a plant or to approve or
disapprove a request for a loan.
Blind Search
The possible steps leading from initial
conditions (e.g., information about the
alternatives or existing symptoms) to the
goal are viewed as the search steps.
Problem solving is carried out by searching
through the space of possible solutions.
Blind search techniques explore the
alternatives and events of a decision
situation, one at a time.
Blind Search
There are two types of blind search:
Complete or Exhaustive Enumeration
In complete (exhaustive) enumeration all
alternatives are considered; therefore, an optimal
solution is discovered.
Limitations:
Time Consuming
Occupies much more computer storage
It is not practical to solve the large problems
Combinatorial Explosion
It is used in many situations.
In conducting a blind search one may
encounter a situation where number of
alternatives to be considered expands
exponentially.
Such problems are the combinatorial
problems.
The major characteristic of combinatorial
problems is that the number of alternative
solutions increase much faster than the size
of the problem.
Combinatorial Explosion
Heuristic means:
-Helping to discover or learn
-Serving to discover
-an aid to discovery
A heuristic contributes to reduction of search
in a problem solving activity.
Heuristic- simply rules of thumb or “rules”
Heuristics are the decision rules regarding
how problem should be solved.
Heuristic Search
Heuristics are developed on a basis of solid, rigorous analysis of the
problem and sometimes involve designed experimentation.
Heuristic problem solving is the implementation of heuristics in
problem-solving or in decision-making situations.
problem states,
a goal, and
operators.
State-Space Representation
Problem states:-
Problem states define the problem situation and
existing conditions.
States:-
States are snapshots of varying conditions in the
environment.
For example a state can be "you cannot start your
car," or "there is an oil leak."
States can also be potential alternative solutions to
problems.
All states are unique.
State-Space Representation
Goal:-
The goal is the objective to be
achieved, a final answer, or a solution.
For example, your goal is finding what is
wrong with your car.
There may be more than one goal.
State-Space Representation
Operators:-
Operators are procedures used for changing
from one state to another.
An operator describes a process whereby
some action is taken to change initial state
into another state that more closely
approaches the goal.
Operators move the problem from one state
to the next, following the guidance of a
master control strategy, until a goal is
reached.
State-Space Representation
Control
Strategy
Figure:
Relationship between Initial state (s), Procedures, and Goal (s)
State-Space Representation
Control Strategy:-
A control strategy selects or guides the procedures.
State Space:
A state space represents the set of all
attainable states for a given problem.
Graphic Presentations
A
6 5
E
4 4 7
Start
S 3 3B 9 G
5 8 goal
C F
6
2
D
Search Tree
A search tree based on the state graph
in Figure.
The tree diagram states the same
problem but in slightly different format
The network thus formed is more like
a hierarchy.
Some of the nodes are repeated to
eliminate the cyclical loop problem
described earlier.
Search Tree
Root Node Level 0 (Root)
4
S 5
3
A B
6 9 4 2
C 8
E G A D F
5 7 6 6
H G E
5 7
G
Figure: Search Tree
H G
Search Tree
1. Breadth-First Search
2. Depth-First Search
Breadth-First Search
level
1 2 3 4
5 6 7 8
9 10
2 11
8
3 5 9
12 14
4 6 13 15 16
7
10
Figure depth first search
Depth-First Search
Again, the number inside the nodes
designate the sequence of nodes
generated or searched.
This process seeks the deepest
possible nodes.
If a goal state is not reached in this
way, the search process backtracks to
the next highest level node where
addition paths are available to follow.
Depth-First Search
This process continues downward and
in a left-to-right direction until the
state goal is discovered.
Here, the search would actually end at
node 13.
When a dead-end node is discovered,
such as node 4 in the above figure, the
search process backtracks so that any
additional branching alternative at the
next higher node level is attempted.
The search backs up to node 3.
Depth-First Search
It has no alternate paths, so the
search backtracks to node 2.
Here, another path through node
5 is available.
The path through node 6 is
explored until its depth is
exhausted.
The backtracking continues until
the goal is reached.
Depth-First Search
The depth-first search guarantees a solution,
but the search may be a long one.
Many different branches will have to be
considered to a maximum depth before a
solution is reached.
(By setting a "depth bound," it is frequently
possible to reduce the search.)
The method is especially attractive in cases
where short paths exist and where there are
no lengthy sub-branches.
Heuristic Methods
Heuristic search methods are designed to
reduce the amount of search for a solution.
When a problem is presented as a search
tree, the heuristic approach attempts to
reduce the size of the tree by pruning
nonvital or nonpromising nodes.
For example, when the Coast Guard searches
for a missing person at sea, they don’t check
the entire ocean.
BENEFITS OF HEURISTICS
I A III
II
B D
C
8 13 11
4 3 7 5
E G H
F
2 I 1 J
Figure: Hill climbing
Hill Climbing
Each production process I, II, and
III can continue for several
stages, in which several states
(nodes) exist.
The numbers above the nodes
designate the potential number of
defects in a specific product at a
certain state in the process
Hill Climbing
The more stages we go through, the fewer
defects we will find.
The target is to find the method with the
minimum number of defects.
A depth-first search goes to I, then to II, and
then to III.
If the desired number of defects is two, then
the process is speedy.
But, if the goal is one defect, then the entire
tree will have to be visited.
In the hill-climbing method, nodes B, C, and
D are compared, and a search starts in
branch I (the lowest number of defects-8).
Hill Climbing
Since one defect was not discovered,
backtracking is done to branch III.
(III is done before II since there are fewer
defects on D than on C.)
The search goes to D and H; backtracking is
then exercised and the D-G-J path leads to
the desired solution.
Path A-C-F was not visited.
Thus, hill climbing is faster than a depth-first
search.
Variations of this method exist, and the
saving over a blind search can be substantial
if large trees are involved.
Induction
Induction means to generalize from a smaller
(or simpler) version of the same problem.
Two features of induction are essential.
First, in the problem statement the problem
must be modeled in terms of the associated
(or predicted) data.
Second, the induced result must be tested
against real examples to verify its
reasonableness.
Construction
o The input for methods based on the construction
strategy is the data that defines a specific instance of
the problem.
o A solution is built up one component at a time.
o A construction strategy begins by examining this data
and attempting to identify an element that is likely to
be a valuable part of a good final solution.
o Next, successive additional elements of a solution are
added.
o Once the final solution has been built up, it may be
obvious that improvement can be made.
o Therefore, the hill-climbing procedure is often applied
to the output of the construction method.
Component Analysis Strategy
Control Strategies
Once a search method is selected it needs to be activated.
That is, it is necessary to decide which operators to apply
and when to apply them.
In a rule-based system, for example, we must decide which
rule to check next.
Four basic control strategies are common: forward chaining,
backward chaining, means-end, and least commitment.
Control Strategies
Forward Chaining
Backward Chaining
Means-End Analysis
Least Commitment
Forward Chaining