Transcript Slide 1

A Lecture on
Searching Techniques
Dr. Priti Srinivas Sajja
Reader
G H Patel P G Department of Computer
Science and Technology
Sardar Patel University
Vallabh Vidyanagar-388 120
Introduction and Contact Information:
•
•
Name: Dr. Priti Srinivas Sajja
Communication:
•
•
•
Email : [email protected]
Mobile : 9824926020
URL : pritisajja.info
•
•
•
•
Academic qualifications : Ph. D in Computer Science
Thesis title: Knowledge Based Systems for Socio-Economic Rural Development
Subject area of specialization : Artificial Intelligence
Publications : 84 International and National books, chapters and papers.
•
Academic positions held : Associate Professor at
Department of Computer Science,
Sardar Patel University,
Vallabh Vidyanagar 388120
Lecture Plan:
•
•
•
•
•
Introduction to Artificial Intelligence (AI)
Traditional Searching Processes
Blind and Weak Searching Methods
AI oriented Search Processes
Research Trends
Artificial Intelligence:
• “Artificial Intelligence(AI) is the
study of how to make computers
do things at which, at the moment,
people are better”
• -Elaine Rich, Artificial Intelligence, Mcgraw Hill
Publications, 1986
AI involves
1. Studying the thought
process of humans
2. Dealing with representing those
processes via machines
AI implementation leads to:
•
•
•
•
Intelligence become permanent
Speedy problem solving
Ease of duplication
Less expensive
• Ease of documentation etc.
Some Domains of AI:
• Some of the problems that fall within the
scope of AI.
• Mundane tasks
• Perception (Vision, Speech, Smell, etc.)
• Natural Language Processing ( understanding,
generation and translation)
• Common sense reasoning
• Robot control
Scope of AI (Contd.):
• Formal Tasks
• Games(Chess, Checkers, etc.)
• Mathematics(Geometry, Logic,
Integral calculus, Proving
properties of programs)
Scope of AI (Contd.):
• Expert Problem Solving
• Scientific Analysis
• Medical Diagnosis
• Financial Analysis
• Engineering Design(Designing,
Fault Finding and Manufacturing
Planning)
The Turing Test:
?
?
?
Knowledge Based Systems:
K
Knowledge Based Systems (KBS) are
Productive Artificial Intelligence Tool
working in a narrow domain.
How Knowledge is organized?:
Volume
Complexity &
Sophistication
Wisdom(experience)
Knowledge(synthesis)
Information(analysis)
Data
Data Pyramid
Source: Tuthill & Leavy, modified
Components of Knowledge:
Source: Tuthhill & Levy
Facts
Concepts
Rules
Heuristic
Examples of Knowledge:
• When it
rains…
 Finding the paths (Also
finding the underground water…)
 Normal balancing while
walking
Characteristics of Knowledge:
• It is hard to characterize.
(fuzzy, uncertain and
incomplete…)
It
It
is Voluminous.
is continuously changing.
How
to
define
a tree?
Forms of Knowledge:
Rules
Facts
Heuristics
Knowledge Base
Heuristic…:
• Are rule of thumbs, practical hints about
design making
• Not guaranty to success
• Give affordable solution in acceptable time
Worst
Solution
Acceptable
good
Solution in
acceptable
time t (tends to
be zero)
Best Solution
(may take
infinite time)
Structure of KBS:
Explanation
/
Knowledge Base
Reasoning
Inference Engine
User Interface
Self
Learning
Knowledge Based
System:Categories
• Expert systems
• Hyper media
• Database management systems with
intelligent front end
• CASE based systems
• Intelligent tutoring systems
Traditional Search Process:
Boolean Operators:
AND
OR
NOT
Problem Solving through AI:
• Defining the problem as a state space
search
• Production system
• Control strategy
• Problem characteristics
• Basic problem solving methods
Defining the problem as a state space
search : An example:
Water Jug Problem
You are given two jugs, a 4-gallon one
and a 3-gallon 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
gallons of water into the 4-gallon jug?
Solution:
• Fill 4 gallon jug fully with water.
• Pour some water from 4-gallon jug
to 3-gallon jug until the 3-gallon jug
is full.
• Empty the 3-gallon jug.
Solution
(Contd.):
• Pour all water from 4-gallon jug to
3-gallon jug.
• Fill 4-gallon jug fully with water
• Pour some water from 4-gallon jug
to 3-gallon jug until 3-gallon jug is
full.
A Search Tree for the Problem:
Action  Fill Jug X
fully.
Root status
(0 , 0)
(4,0)
(0,3)
(1,3)
(1,0)
(4, 3)
(0, 0)
....
(0, 0)
(0,1)
....
(4,1)
....
(2,3)
(3,0)
Goal status
(4,3)
Production Rules:
• (x,y / x<4) -> (4,y)
• Fill the 4-gallon jug.
• (x,y / y<3) -> (x,3)
• Fill the 3-gallon jug
• (x,y / x>0) -> (x-d,y) • Pour some water out of
the 4-gallon jug
Production Rules (contd.):
• (x,y / y>0) -> (x,y-d)
• Pour some water out of
the 3-gallon jug
• (x,y / y>0) -> (x,0)
• Empty the 3-gallon jug
on ground.
• (x,y / x+y>=4 ^ y>0)-> • Pour water from 3gallon jug to the 4gallon jug until the 4(4,y-(4-x))
gallon jug is full.
Production System:
• A production System consists of:
• A set of rules, each consisting of a
left side that determines the
applicability of the rule, and right
side that describes the actions to be
performed if the rule is applied.
Some Sample Problems:
• 8 Puzzle:
4
2
3
7
1
6
5
8
Some Sample Problems (Contd.):
• Blocks World
A
B
C
Some Sample Problems (Contd.):
Eight Queen’s Problem:
Some Sample Problems (Contd.):
• Chess Playing
• Travelling Salesman Problem
• Tower of Hanoi
• Cryptarithmatic
Send
+ More
----------Money
Basic Problem Solving Methods
• Forward from the Start state
• Backward from the Goal state.
• Matching
• Tree and/or Graph
• Heuristic Methods
etc.
Depth-first Search:
• In depth-first search, we start with the
root node and
• Completely explore the descendants of a
node before exploring its siblings, and
• siblings are explored in a left-to-right
fashion.
• Depth-first traversal: A  B  D  E
CFG
• Prolog uses depth-first search during B
backtracking.
D
A
C
E
F
G
The worst case:
• In the worst case, the depth-first search will
visit all the nodes in the tree (up to
maximum depth ) before finding a solution.
Breath-first Search:
• Breadth-first search, where we
explore (right-hand) siblings
before children.
• Breadth-first traversal: A  B 
CDEFG
A
B
D
C
E
F
G
Characteristics of Blind Methods:
• Can not handle combinatorial and
exponential growth problem efficiently.
• ‘Blind’ in nature
• Offers optimization but not practical
• Not ability to deal with partial, incomplete
and uncertain information
Weak Methods:
• Complexity analysis of the various basic search
algorithms has shown that they are unlikely to
produce results for slightly more complex
problems than we have considered here.
• In general, there is no way around this problem. In
practice, however, good heuristics that tell us
which part of the search tree to explore next, can
often help to find solutions, specially for larger
problem instances.
• No guaranty for solution
Heuristic Based Search:
• Heuristics can be used to guide a search
algorithm in a large search space.
• Heuristic is a strategy or procedure used to aid in
the efficient solution of a problem.
• It is nothing but a practical rule of thumb
derived by domain expert.
• Also known as “Objective Function” in search
algorithms.
• There are different ways of defining a
heuristic function h to estimate how far off
the goal a given node is;
• and there are different ways of using h to
decide which node is “best”.
Generate and Test:
Simplest steps like:
• Generate a possible solution (path or
point).
• Test to see it for solution (compare the end
points of the path or compare the points).
• If found, quit else return to step 1.
• If the generation of the possible solution is done
systematically, then this procedure will find a
‘good’ if it exists.
• In case of the large problem space, this might
takes a long time.
• Even if with the help of heuristic function, this
algorithm is not very effective, so most of the time
it is used to restrict the search space.
Hill Climbing/Greedy local search:
•
It is a variant of generate and test.
•
From the feedback the direction of the search is determined.
The steps are:
1. Evaluate the initial state. If it is the Goal, return
otherwise continue.
2. Repeat until a solution is found or there are no new
operators left to be applied of current state:
a) Select an operator and apply it to produce new
state.
b) Evaluate the new state.
i. If it is a goal, return and quit
ii. Else, if it is better than current state, make it current
state else continue.
• The key difference in the generate and test and
this hill climbing one is the use of an evaluation
function.
• For the algorithm to work, the definition of
“better” must be provided as every time we are
comparing as “the generated solution is better
than the existing one or not”.
• It is also possible to consider all the moves from
the current state and a best among them is
selected. This is Steepest-Ascent Hill Climbing.
Best-first search:
• The central idea of best-first search based
on heuristic is to expand the path that
seems most promising.
• This is the way of combining the
advantages of depth first and breadth first
search into a single method.
Problem Reduction:
• Deals with And-Or graphs
Acquire TV set
Steal set
Earn some money
Buy TV set
Other search techniques:
•
•
•
•
•
•
•
•
A*
AO*
Beam Search
Stochastic Beam Search
Genetic Algorithm Based Search
Steepest-Ascent Hill Climbing
Constraint satisfaction
etc.
Issues in the Design of Search
Programs:
• The direction in which to conduct search
(forward Vs. backward)
• How to select applicable rules (matching)
• How to present each node process
(knowledge representation and frame)
Research Trends:
• Heuristics function development and
Hierarchical Searching
• Bi-directional Searching
• Searching for text from heterogeneous
network environment and data mining
• Searching and filtering
• etc.
References:
• Robert J Schalkoff, “Artificial Intelligence”, McGRAW
Hill International Editions, 1990
• Rich and Knight, “Artificial Intelligence”, Tata
McGRAW Hill Editions, 2001
• Russell and Norvig, “Artificial Intelligence: A Modern
Approach”, Pearson Prentice Hall, 2005
• D W Patterson, “Introduction to Artificial Intelligence
and Expert Systems”, Prentice Hall of India, 1998