Chapter 3
Solving Problems by Searching
Reflex agent is simple
base their actions on
a direct mapping from states to actions
but cannot work well in environments
whichthis mapping would be too large to store
and would take too long to learn
Hence, goal-based agent is used
Problem-solving agent
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
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,
degree etc.
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.
Search
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,
theagent 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
Search algorithm
Defined as
takinga problem
and returns a solution
Once a solution is found
theagent follows the solution
and carries out the list of actions –
execution phase
Design of an agent
“Formulate, search, execute”
Well-defined problems and solutions
A problem is defined by 5
components:
Initial state
Actions
Transition model or
(Successor functions)
Goal Test.
Path Cost.
Well-defined problems and solutions
A problem is defined by 4 components:
The initial state
that the agent starts in
The set of possible actions
Transition model: description of what each action
does.
(successor functions): refer to any state reachable
from given state by a single action
Initial state, actions and Transition model define the
state space
the set of all states reachable from the initial state by any
sequence of actions.
A path in the state space:
any sequence of states connected by a sequence of actions.
Well-defined problems and solutions
The goal test
Applied to the current state to test
if the agent is in its goal
-Sometimes there is an explicit set of possible goal
states. (example: in Amman).
-Sometimes the goal is described by the properties
instead of stating explicitly the set of states
Example: Chess
the agent wins if it can capture the KING of the opponent on
next move ( checkmate).
no matter what the opponent does
Well-defined problems and solutions
A path cost function,
assigns a numeric cost to each path
= performance measure
denoted by g
to distinguish the best path from others
Usually the path cost is
thesum of the step costs of the individual
actions (in the action list)
Well-defined problems and solutions
Together a problem is defined by
Initial state
Actions
Successor function
Goal test
Path cost function
The solution of a problem is then
a path from the initial state to a state satisfying the goal
test
Optimal solution
the solution with lowest path cost among all solutions
Formulating problems
Besides the four components for problem
formulation
anything else?
Abstraction
the process to take out the irrelevant information
leave the most essential parts to the description of the
states
( Remove detail from representation)
Conclusion: Only the most important parts that are
contributing to searching are used
Evaluation Criteria
formulation of a problem as search task
basic search strategies
important properties of search
strategies
selection of search strategies for
specific tasks
(The ordering of the nodes in FRINGE
defines the search strategy)
Problem-Solving Agents
agents whose task is to solve a particular
problem (steps)
goal formulation
what is the goal state
what are important characteristics of the goal state
how does the agent know that it has reached the goal
are there several possible goal states
are they equal or are some more preferable
problem formulation
what are the possible states of the world relevant for solving
the problem
what information is accessible to the agent
how can the agent progress from state to state
Example
From our Example
1. Formulate Goal
- Be In Amman
2. Formulate Problem
- States : Cities
- actions : Drive Between Cities
3. Find Solution
- Sequence of Cities : ajlun – Jarash - Amman
Our Example
1. Problem : To Go from Ajlun to Amman
2. Initial State : Ajlween
3. Operator : Go from One City To another .
4. State Space : {Jarash , Salat , irbed,……..}
5. Goal Test : are the agent in Amman.
6. Path Cost Function : Get The Cost From The Map.
7. Solution : { {Aj Ja Ir Ma Za Am} , {Aj Ir Ma Za Am} …. {Aj Ja Am} }
8. State Set Space : {Ajlun Jarash Amman}
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
Example: Romania
Single-state problem formulation
A problem is defined by four items:
1. actions or successor function S(x) = set of action–state pairs
e.g., S(Arad) = {<Arad Zerind, Zerind>, … }
2. goal test, can be
explicit, e.g., x = "at Bucharest"
implicit, e.g., Checkmate(x)
3. path cost (additive)
e.g., sum of distances, number of actions executed, etc.
c(x,a,y) is the step cost, assumed to be ≥ 0
A solution is a sequence of actions leading from the initial state to a
goal state
initial state e.g., "at Arad"
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.
Toy problems
Example: vacuum world
Number of states: 8
Initial state: Any
Number of actions: 4
left, right, suck, noOp
Goal: clean up all dirt
Goal states: {7, 8}
Path Cost:
Each step costs 1
The 8-puzzle
The 8-puzzle
States:
a state description specifies the location of each of
the eight tiles and blank in one of the nine squares
Initial State:
Any state in state space
Successor function:
the blank moves Left, Right, Up, or Down
Goal test:
current state matches the goal configuration
Path cost:
each step costs 1, so the path cost is just the length
of the path
The 8-queens
There are two ways to formulate the
problem
All of them have the common followings:
Goal test: 8 queens on board, not attacking
to each other
Path cost: zero
The 8-queens
(1) Incremental formulation
involves operators that augment the state
description starting from an empty state
Each action adds a queen to the state
States:
any arrangement of 0 to 8 queens on board
Successor function:
add a queen to any empty square
The 8-queens
(2) Complete-state formulation
startswith all 8 queens on the board
move the queens individually around
States:
any arrangement of 8 queens, one per column in
the leftmost columns
Operators: move an attacked queen to a row,
not attacked by any other
The 8-queens
Conclusion:
the right formulation makes a big difference
to the size of the search space
Example: River Crossing
Items: Man, Wolf, Corn, Chicken.
Man wants to cross river with all items.
Wolf will eat Chicken
Chicken will eat corn.
Boat will take max of two.
Chapter -3 : Expert Systems
Basic Concepts of Expert Systems (ES)
Expertise
The extensive, task-specific knowledge that experts
possess.
The level of expertise determines the performance of
a decision.
Training, reading and experience in practice achieve
expertise.
34
Basic Concepts of Expert Systems (ES)
Features of ES
Expertise: An EX must possess expertise that enables
it to make expert-level decision
Symbolic reasoning: knowledge must be represented
symbolically
Deep knowledge: concerns the level of expertise in a
knowledge base.
Self-knowledge: must have a strong learning
capabilities to update their knowledge constantly (from
success, failure, and other knowledge resources).
35
Basic Concepts of Expert Systems (ES)
Why we need ES
1. Since experts may retire or leave, ES are an
excellent tool for preserving professional
knowledge crucial to a company's competitiveness
2. ES is an excellent tool for documenting
professional knowledge for examination or
improvement
3. ES is a good tool for training new employees and
disseminating knowledge in an organization
4. ES allow knowledge to be transferred more easily
at a lower cost
36
Applications of ES
Classical successful ES
DENDRAL: for molecular structure identification
MYCIN: for medical diagnosis
XCON: for configuration of the VAX computer
Rule-based system
A system in which knowledge is represented
completely in terms of rules (e.g., a system
based on production rules)
37
Applications of ES
Newer applications of ES
Credit analysis systems : used in banks for risk
management assessment
Pension fund advisors : help employees to plan their
retirement through their analysis that calculates their
pension benefits under different scenarios
Automated help desks: enables small business to
deal with customer requests more efficiently
Homeland security systems:
Market surveillance systems
Business process reengineering systems
38
Applications of ES
Areas for ES applications
Finance
Data processing
Marketing
Human resources
Manufacturing
Homeland security
Business process automation
Health care management
39
Structure of ES
ES environments:
1. Development environments
Parts of expert systems that are used by builders to
build the components and put knowledge into the
knowledge base.
It includes the knowledge base, the inference engine,
knowledge acquisition, and improving reasoning
capability.
The knowledge engineer and the expert are
considered part of these environments
40
Structure of ES
2. Consultation environment
The part of an expert system that is used by a non-
expert to obtain expert knowledge and advice.
It includes the workplace (backboard), inference
engine, explanation facility, recommended action,
and user interface
41
Structure of ES
42
Structure of ES
Three major components in ES are:
Knowledge base
Inference engine
User interface
ES may also contain:
Knowledge acquisition subsystem
Blackboard (workplace)
Explanation subsystem (justifier)
Knowledge refining system
43
Structure of ES
Knowledge acquisition (KA)
The extraction and formulation of knowledge derived
from various sources, especially from human experts
other sources: multimedia documents, textbooks,
DB, research reports, and the Web.
Knowledge base
A collection of facts, rules, and procedures organized
into schemas. The assembly of all the relevant
information and knowledge about a specific field of
interest
44
Structure of ES
Inference engine
The part of an expert system (program) that provides a
methodology for reasoning about information in the KB
and on the blackboard for formulating conclusions.
User interfaces
The parts of computer systems that interact with users,
accepting commands from the computer keyboard and
displaying the results generated by other parts of the
systems
45
Structure of ES
Blackboard (workplace)
An area of working memory set aside for the
description of a current problem and for recording
intermediate results in an expert system
Explanation subsystem (justifier)
The component of an expert system that can explain
the system’s reasoning and justify its conclusions
46
Structure of ES
Knowledge-refining system
A system that has the ability to analyze its
own performance, learn, and improve itself
for future consultations
47
How ES Work: Inference Mechanisms
Knowledge representation and organization
Expert knowledge must be represented in a
computer-understandable format and organized
properly in the knowledge base
Different ways of representing human knowledge
include:
Production rules: easy to understand and adding
new rules is easy
Semantic networks: A semantic network is a
knowledge structure that depicts how concepts
are related to one another and how
they interconnect
Logic statements 48
How ES Work: Inference Mechanisms
The inference process
Inference is the process of chaining
multiple rules together based on available
data to cover numerous conditions, since
expert knowledge can not be represented
in single rule.
49
How ES Work: Inference Mechanisms
Popular approaches for inferencing:
Forward chaining
A data-driven search in a rule-based system
Backward chaining
A search technique (employing IF-THEN rules)
used in production systems that begins with
the action clause of a rule and works backward
through a chain of rules in an attempt to find a
verifiable set of condition clauses
50
How ES Work: Inference Mechanisms
Development process of ES
Is the process for eliciting knowledge from experts and
then storing the knowledge in the knowledge base.
A typical process for developing ES includes:
knowledge acquisition
Knowledge representation
Selection of development tools
System prototyping
Evaluation
Improvement
51
Problem Areas Suitable for ES
Generic categories of ES
Interpretation Monitoring
Prediction Debugging
Diagnosis Repair
Design Instruction
Planning Control
52
Development of ES
The development of ES includes:
1. Defining the nature and scope of the problem
Rule-based ES are appropriate when the
nature of the problem is qualitative, knowledge
is explicit, and experts are available to solve
the problem effectively and provide their
knowledge
53
Development of ES
The development of ES includes:
2. Identifying proper experts
A proper expert should have a thorough
understanding of:
Problem-solving knowledge
The role of ES and decision support technology
Good communication skills
54
Development of ES
The development of ES includes:
3. Acquiring knowledge
Knowledge engineer
An AI specialist responsible for the technical
side of developing an expert system. The
knowledge engineer works closely with the
domain expert to capture the expert’s
knowledge in a knowledge base
55
Development of ES
The development of ES includes:
4. Selecting the building tools
There are three different kinds of
development tools:
1) General-purpose development environment
2) Expert system shell
A computer program that facilitates relatively
easy implementation of a specific expert
system. Analogous to a DSS generator
56
Development of ES
There are three different kinds of development
tools:
3) Tailored turn-key solutions
Contain specific features often required for
developing applications in a particular domain
57
Development of ES
The development of ES includes:
5. Choosing an ES development tool
Consider the cost benefits
Consider the technical functionality and
flexibility of the tool
Consider the tool's compatibility with the
existing information infrastructure
Consider the reliability of and support from the
vendor
58
Development of ES
The development of ES includes:
6. Coding the system
The major concern at this stage is whether the
coding process is efficient and properly
managed to avoid errors
7. Evaluating the system
Two kinds of evaluation:
Verification:no error in the code and achieves
results the same as that acquired by the expert
Validation: solve the problem correctly
59
Knowledge Acquisition (KA)
Knowledge Acquisition
Steps in KA
• Data Gathering : determine what data will be collected, how,
and where this data is located
• Data Organising : rearrangement of the data gathered
• Summarising : raw data is converted to information form
which can be used for analysis
• Analysing : analysis of data to find new characteristics
• Synthesizing: joining statistics and patterns with a fixed
concepts
Benefits, Limitations, and Success Factors of
ES
Benefits of ES
Increased output and productivity
Decreased decision-making time
Increased process and product quality
Reduced downtime
Capture of scarce expertise
Flexibility
Easier equipment operation
62
Benefits, Limitations, and Success Factors of
ES
Benefits of ES
Elimination of the need for expensive
equipment
Operation in hazardous environments
Accessibility to knowledge and help desks
Ability to work with incomplete or uncertain
information
Provision of training
63
Benefits, Limitations, and Success Factors of
ES
Benefits of ES
Enhancement of problem solving and decision
making
Improved decision-making processes
Improved decision quality
Ability to solve complex problems
Knowledge transfer to remote locations
Enhancement of other information systems
64
Benefits, Limitations, and Success Factors of
ES
Problems with ES
Knowledge is not always readily available
It can be difficult to extract expertise from humans
The approach of each expert to a situation assessment
may be different yet correct
It is difficult to abstract good situational assessments
when under time pressure
Users of ES have natural cognitive limits
ES work well only within a narrow domain of
knowledge
Most experts have no independent means of checking
whether their conclusions are reasonable
65
Benefits, Limitations, and Success Factors of
ES
Problems with ES
The vocabulary that experts use to express facts and
relations is often limited and not understood by others
ES construction can be costly because of the expense
of knowledge engineers
Lack of trust on the part of end users may be a barrier
to ES use
Knowledge transfer is subject to a host of perceptual
and judgmental biases
ES may not be able to arrive at conclusions in some
cases
ES sometimes produce incorrect recommendations
66
Benefits, Limitations, and Success Factors of
ES
Factors in disuse of ES
Lack of system acceptance by users
Inability to retain developers
Problems in transitioning from development to
maintenance
Shifts in organizational priorities
67
Benefits, Limitations, and Success Factors of
ES
ES success factors
Level of managerial and user involvement
Sufficiently high level of knowledge
Expertise available from at least one
cooperative expert
The problem to be solved must be mostly
qualitative
The problem must be sufficiently narrow in
scope
68
Benefits, Limitations, and Success Factors of
ES
ES success factors
The ES shell must be of high quality and
naturally store and manipulate the knowledge
The user interface must be friendly for novice
users
The problem must be important and difficult
enough to warrant development of an ES
Knowledgeable system developers with good
people skills are needed
69
Benefits, Limitations, and Success Factors of
ES
ES success factors
End-user attitudes and expectations must be
considered
Management support must be cultivated
End-user training programs are necessary
The organizational environment should favor
adoption of new technology
The application must be well defined,
structured, and it should be justified by
strategic impact
70
ES on the Web
The relationship between ES and the
Internet and intranets can be divided into
two categories:
The Web supports ES (and other AI)
applications
The support ES (and other AI methods) give to
the Web
71