Lecture 2 (B) Problem Solving Agents
Lecture 2 (B) Problem Solving Agents
Lecture 2 (B) Problem Solving Agents
In
Artificial Intelligence
Week 2, Lecture 2
Dr. Fazeel Abid
Assistant Professor
Department of CS & IT
The University of Lahore, Pakistan
Quiz (First Quiz) Section 7C
Group B
Group A
What is Full Observable Environment?
What is Partial Observable Environment? Discuss the Last two Elements of PEAS with Example
Discuss the First two Elements of PEAS with Example State & Explain Utility Based Agents & Model Based
State & Explain Goal Based Agents & Reflex Based Reflex Agents Further Draw respective Agents?
Agents Further Draw respective Agents?
Problem Solving
• “A problem-solving refers to a state where we wish to reach to a definite goal
from a present state or condition.”
• According to computer science, a problem-solving is a part of artificial
intelligence which encompasses a number of techniques such as algorithms,
heuristics to solve a problem.
• Lets use a map as an example, if you take fast look you can deduce that each
node represents a city, and the cost to travel from a city to another is denoted by
the number over the edge connecting the nodes of those 2 cities.
Problem Solving Agents
• The reflex agents are known as the simplest agents as they directly map states
into actions.
• However, this mapping could not be applicable in large and complex
environments in which storing the mapping and learning consume too much
such as “Automated taxi driver” environment.
• Such environments may be a better place for Goal-based agents to arise,
because such agents consider future actions and their expected outcome.
• Problem-solving agents in AI mostly used search strategies(Week3)or
algorithms to solve a specific problem and provide the best result.
• Problem solving agents are the Goal-based agents and use Atomic
representation.
• What is Atomic Representation?
Problem Solving Agents
To solve a problem an Agent pass by 2 phases of formulation:
Goal Formulation
• It is the first and simplest step in problem-solving having a goal want to reach.
• It organizes the steps/sequence required to formulate one goal out of multiple goals as well as actions to achieve
that goal.
• Goal formulation is based on the current situation and the agent’s performance measure.
Problem Formulation
• A problem formulation is deciding what actions and states to consider.
• “in(CITYNAME)” where CITYNAME is the name of the current city we are In.
• Suppose agent is updated with map in its memory, will start to study the map and consider a hypothetical
journey through the map until it reaches E from A.
• Once Agent has found the sequence of cities it should pass by to reach its goal in the following sequence.
• The process of finding such sequence is called search
• A search algorithm is like a black box which takes problem as input returns a solution
• Once the solution is found the sequence of actions it recommends is carried out is called the execution phase.
• But, How to Formulate Problem?
Formulating Problems
A problem can be defined formally by 4 components:
Initial State:
• It is state from which agents start solving the problem {e.g. in(A)}.
State Description:
• A description of the possible actions available to the agent, it is common to describe it by means of a successor
function, given state x then SUCCESSOR f(x).
• The initial state and the successor function together defined called state space which is the set of all possible
states reachable from the initial state {e.g. in(A), in(B), in(C), in(D), in(E)}.
Goal Test:
• Able to decide whether the current state is a goal state {e.i: is the current state is in(E)?}.
Path cost:
• Function that assigns a numeric value to each path, each step we take in solving the problem should be somehow
weighted, so travel from A to E agent will pass by many cities, the cost to travel between two consecutive cities
should have some cost measure, {e.i: Traveling from ‘A’ to ‘B’ costs 20 km or it can be typed as c(A, 20, B)}.
• A solution to a problem is path from the initial state to a goal state, and solution quality is measured by
the path cost, and the optimal solution has the lowest path cost among all possible solutions.
Measuring Problem-Solving Performance
A solution that can evaluate a algorithm`s performance are in four ways:
Completeness:
It measures if the algorithm guarantees to find a solution (if any solution exist).
Optimality:
It measures if the strategy searches for an optimal solution (lowest path cost)
Time Complexity:
The time taken by the algorithm to find a solution.
Space Complexity:
Amount of memory required to perform a search.
• Time and Space in complexity analysis are measured with respect to the number of nodes.
• In AI, complexity is expressed by three factors b, d and m:
b the branching factor is the maximum number of successors of any node.
d the depth of the deepest goal.
m the maximum length of any path in the state space. (To Be Discussed In Week 3)
8 Puzzle Problem & Formulation