PE 459 LECTURE 2- natural gas basic concepts and properties
AI3391 ARTIFICAL INTELLIGENCE Session 5 Problem Solving Agent and searching for solutions.pptx
1. AI3391 ARTIFICAL INTELLIGENCE
(II YEAR (III Sem))
Department of Artificial Intelligence and Data Science
Session 5
by
Asst.Prof.M.Gokilavani
NIET
11/14/2023 Department of AI & DS 1
2. TEXTBOOK:
• Artificial Intelligence A modern Approach, Third Edition, Stuart
Russell and Peter Norvig, Pearson Education.
REFERENCES:
• Artificial Intelligence, 3rd Edn, E. Rich and K.Knight (TMH).
• Artificial Intelligence, 3rd Edn, Patrick Henny Winston, Pearson
Education.
• Artificial Intelligence, Shivani Goel, Pearson Education.
• Artificial Intelligence and Expert Systems- Patterson, Pearson
Education.
11/14/2023 Department of CSE (AI/ML) 2
3. Topics covered in session 5
11/14/2023 Department of CSE (AI/ML) 3
Unit I: Intelligent Agent
• Introduction to AI
• Agents and Environments
• Concept of Rationality
• Nature of environment
• Structure of Agents
• Problem solving agents
• Search Algorithm
• Uniform search Algorithm
4. Problem-solving agent
• An important application of Artificial
Intelligence is Problem Solving.
• Define problem statement first.
• Generating the solution by keeping the
different condition in mind.
• Searching is the most commonly used
technique of problem solving in artificial
intelligence.
• Problem solving agent: A problem-
solving agent is a goal-driven agent and
focuses on satisfying the goal.
11/14/2023 Department of CSE (AI/ML) 4
5. Problem Solving by Searching
Why Reflex agent is not used in AI?
• Base their actions on
• A direct mapping from states to actions
• But cannot work well in environments
• which this mapping would be too large to store
• would take too long to learn
• Hence, goal-based agent is used.
Problem-solving agent
• A kind of goal-based agent
• It solves problem by
• finding sequences of actions that lead to desirable states (goals).
• To solve a problem,
• the first step is the goal formulation, based on the current situation.
11/14/2023 Department of CSE (AI/ML) 5
6. Step perform by problem solving agent
11/14/2023 Department of CSE (AI/ML) 6
7. Goal Formulation
• The goal is formulated
• as a set of world states, in which the goal is satisfied
• Reaching from initial state goal state
• Actions are required
• Actions are the operators
• causing transitions between world states
• Actions should be abstract enough at a certain degree, instead of
very detailed.
• E.g., turn left VS turn left 30 degree, etc.
11/14/2023 Department of CSE (AI/ML) 7
8. Problem formulation
• The process of deciding
• what actions and states to consider
• E.g., driving Amman Zarqa
• In-between states and actions defined
• States: Some places in Amman & Zarqa
• Actions: Turn left, Turn right, go straight, accelerate & brake, etc.
11/14/2023 Department of CSE (AI/ML) 8
9. Search Algorithm
• Because there are many ways to achieve the same goal
• Those ways are together expressed as a tree
• Multiple options of unknown value at a point,
• The agent can examine different possible sequences of actions, and
choose the best
• This process of looking for the best sequence is called search.
• The best sequence is then a list of actions, called solution.
• Defined as
• taking a problem
• and returns a solution
• Once a solution is found
• the agent follows the solution
• and carries out the list of actions – execution phase
• Design of an agent
• “Formulate, search, execute”
11/14/2023 Department of CSE (AI/ML) 9
10. Well defined problems and solutions
A problem can be defined formally by five components:
• The initial state that the agent starts in. State Space
• A description of the possible actions available to the agent.
• A description of what each action does; the formal name for this is the
transition model.
• The goal test, which determines whether a given state is a goal state.
Sometimes there is an explicit set of possible goal states, and the test
simply checks whether the given state is one of them.
• A path cost function that assigns a numeric cost to each path. The
problem-solving agent chooses a cost function that reflects its own
performance measure.
11/14/2023 Department of CSE (AI/ML) 10
13. Example: Romania
• On holiday in Romania; currently in Arad.
• Flight leaves tomorrow from Bucharest
• Formulate goal:
• be in Bucharest
• Formulate problem:
• states: various cities
• actions: drive between cities
• Find solution:
• sequence of cities, e.g., Arad, Sibiu, Fagaras, Bucharest
11/14/2023 Department of CSE (AI/ML) 13
14. Example Problems
• Toy problems
• those intended to illustrate or exercise various problem-solving methods
• E.g., puzzle, chess, etc.
• Real-world problems
• Tend to be more difficult and whose solutions people actually care about
• E.g., Design, planning, etc.
11/14/2023 Department of CSE (AI/ML) 14
15. Toy Problem
Number of states: 8
Initial state: Any
Number of actions: 4
left, right, suck,
noOperation
Goal: clean up all dirt
Goal states: {7, 8}
Path Cost:
Each step costs 1
11/14/2023 Department of CSE (AI/ML) 15
17. 8 Puzzle Problem
• State: A state description specifies the location of each of the eight
tiles and the blank in one of the nine squares.
• Initial state: Any state can be designated as the initial state.
• Actions: The simplest formulation defines the actions as movements
of the blank space Left, Right, Up, or Down. Different subsets of these
are possible depending on where the blank is. Goal State Initial State
11/14/2023 Department of CSE (AI/ML) 17
18. 8 Puzzle Problem
• Transition model: Given a state and action, this returns the resulting
state.
• Goal test: This check whether the state matches the goal
configuration. (Other goal configurations are possible.)
• Path cost: Each step costs 1, so the path cost is the number of steps in
the path. Goal State Initial State.
Conclusion:
• the right formulation makes a big difference to the size of the
search space
11/14/2023 Department of CSE (AI/ML) 18
19. 8 Puzzle Problem
The goal of the 8-queens problem is to place
eight queens on a chess-board such that no
queen attacks any other.
• States: Any arrangement of 0 to 8 queens
on the board is a state.
• Initial state: No queens on the board.
• Actions: Add a queen to any empty
square.
• Transition model: Returns the board with
a queen added to the specified square.
• Goal test: 8 queens are on the board, none
attacked.
11/14/2023 Department of CSE (AI/ML) 19