Sei sulla pagina 1di 16

Problem Solving

Artificial Intelligence and Neural Network

Sujan Tamrakar
 We emphasis on how an agent can find a sequence of
actions that achieves its goals, when no single action will do.
 It is based on goal based agent called Problem solving agent
 Problem Solving Agents decide what to do by finding
sequences of actions that lead to desirable states.
 Goals help organize behaviour by limiting the objectives that
the agent is trying to achieve
 Goal formulation based on current situation and agent’s
performance measure, is the first step in problem solving.
 Agent’s task is to find out which sequence of actions will get it
to a goal state.
 Problem formulation is the process of deciding what action &
states to consider given a goal
 An agent with several immediate options of unknown value
can decide what to do by first examining different possible
sequences of actions that lead to states of known value, and
then choosing the best sequence. This process of looking for
such a sequence is called Search.

 Execution phase is process of carrying out the action once


the solution is found.

Design of an agent = Formulate, Search & Execute


 Steps:
 Formulate a goal (problem to solve)
 Agent calls a search procedure to solve
it
 Then it uses the solution to guide its
actions (whatever solution is
recommended)
 Seriesof actions in sequence is
performed
 Once solution executed, agent will
formulate new goal.
Well Defined Problem (WDP)
 A problem can be defined formally by help of 4 components
1. Initial state
 States that the agent starts in
 Any random possible scenario

2. Possible actions (State space)


 Description of possible actions available to agent
 Uses a Successor function
 Together, initial state & successor function implicitly define
state space of problem – the set of all states reachable
from initial state
Well Defined Problem (WDP)
3. Goal test function
 Determines whether a given state is a goal state

4. Path cost function


 Assigns a numeric cost to each path

 Examples:
 Vacuum world problem
 Travelling Salesperson Problem
 Tower of Hanoi
8 queen problem*
Note:
 Execute Goal test function in every node.
 Search possible actions / routes
 Use Path test function to calculate the cost of the path.

Performance of agent = Summation of all costs of paths


from Initial state to Goal state using Path cost function.
Linear planning | Goal stack planning
 Attacks problems involving conjoined (touched) goals by
solving the goals one at a time in order.

Non-Linear planning
 Different problems might cause goal interactions & in such
conditions one sub-problem may interfere with other sub-
problem. Thus, intertwined plan (twist/connect) in which
multiple sub-problems are worked on simultaneously is
required, which is known as non-linear plan.
 It is not composed of a linear sequence of complete sub-
plans.
Life is non-linear
Production Rule System
Q. You are given 2 jugs, a 4-liter one
and a 3-liter one. Neither has any
measuring markers on it. There is a
pump that can be used to fill the
jugs with water. How can you get
exactly 2-liters of water in 4-liters jug?
You can:
 fill either jug from the water source
 pour water from one jug to another
 empty a jug down the drain
4-liter 3-liter Rule
0 0 -
0 3 2
3 0 7
3 3 2
4 2 5
0 2 3
2 0 7
Solution to Water Jug Problem

Production rule for Water Jug


Problem
Production Rule System
 A production rule is a simple rule with a condition & action
 Production System is a mechanism to represent problem in AI in
which operators applicable to problem domain are represented in
the form of production rules.
 Production Rule consists of:
 A set of rules (each consisting of a left side that determines the
applicability of the rule & a right side that describes the operation to be
performed if the rule is applied)
 One or more knowledge base (containing information for appropriate
for current problem)
 A Control strategy (specifying the order in which rules will be compared
to database & a way of resolving conflicts that arise when several rules
match at once)
 A rule applier
Thank you

Potrebbero piacerti anche