ARTIFICIAL INTELLIGENCE
for
T.E. Computer Engg. / I. T
As per Revised KBCNMU Syllabus (w.e.f. 2019-2020)
Notes prepared by:
Mr. Pravin K. Patil
Assistant Professor, Computer Engineering Department
SSBT’s College of Engineering and Technology Bambhori Jalgaon
Based on Reference Book:
Elaine Rich, Kevin Knight and Shivshankar Nair "Artificial Intelligence".
3rd Edition TMH.
UNIT – I
INTRODUCTION TO ARTIFICIAL INTELLIGENCE
Contents:
Definitions of AI
History
Turing Test
AI Problems and Techniques:
o Problem as a State Space Search
o Problem Characteristics
Production System:
o Water Jug Problem
Heuristic Searching Techniques:
o BFS
o DFS
o A*
o AO*
o Means Ends Analysis
Definitions of AI
AI is the branch of computer science which deals with the Symbolic, Non
Algorithmic method of problem solving. It is the study of how to make
computer to things at a movement like as human.
Artificial Intelligence is concerned with the design of intelligence in an
artificial device. The term was coined by John McCarthy (Father of AI) in
1956.
There are two ideas in the definition.
1. Intelligence
2. Artificial device
A system with intelligence is expected to behave as intelligently as a human
and a system with intelligence is expected to behave in the best possible
manner.
Artificial intelligence is about designing systems that are as intelligent as
humans. This involves trying to understand human thought and an effort to
build machines that emulate the human thought process. This view is the
cognitive science approach to AI.
History of AI
Intellectual roots of AI date back to the early studies of the nature of knowledge and
reasoning. The dream of making a computer imitate humans also has a very early history.
The concept of intelligent machines is found in Greek mythology. There is a story in the 8th
century A.D about Pygmalion Olio, the legendary king of Cyprus. He fell in love with an
ivory statue he made to represent his ideal woman. The king prayed to the goddess Aphrodite,
and the goddess miraculously brought the statue to life. Other myths involve human-like
artifacts. As a present from Zeus to Europa, Hephaestus created Talos, a huge robot. Talos
was made of bronze and his duty was to patrol the beaches of Crete.
Aristotle (384-322 BC) developed an informal system of syllogistic logic, which is the basis
of the first formal deductive reasoning system.
Early in the 17th century, Descartes proposed that bodies of animals are nothing more than
complex machines.
Pascal in 1642 made the first mechanical digital calculating machine.
In the 19th century, George Boole developed a binary algebra representing (some) "laws of
thought."
Charles Babbage & Ada Byron worked on programmable mechanical calculating machines.
In the late 19th century and early 20th century, mathematical philosophers like Gottlob Frege,
Bertram Russell, Alfred North Whitehead, and Kurt Gödel built on Boole's initial logic
concepts to develop mathematical representations of logic problems.
The advent of electronic computers provided a revolutionary advance in the ability study
intelligence.
In 1943 McCulloch & Pitts developed a Boolean circuit model of brain. They wrote the paper
“A Logical Calculus of Ideas Immanent in Nervous Activity”, which explained how it is
possible for neural networks to compute.
Marvin Minsky and Dean Edmonds built the SNARC in 1951, which is the first randomly
wired neural network learning machine (SNARC stands for Stochastic NeuralAnalog
Reinforcement Computer).It was a neural network computer that used 3000 vacuum tubes and
a network with 40 neurons.
In 1950 Turing wrote an article on “Computing Machinery and Intelligence” which
articulated a complete vision of AI. Turing’s paper talked of many things, of solving
problems by searching through the space of possible solutions, guided by heuristics. He
illustrated his ideas on machine intelligence by reference to chess. He even propounded the
possibility of letting the machine alter its own instructions so that machines can learn from
experience.
In 1956 a famous conference took place in Dartmouth. The conference brought together the
founding fathers of artificial intelligence for the first time. In this meeting the term “Artificial
Intelligence” was adopted.
Between 1952 and 1956, Samuel had developed several programs for playing checkers. In
1956, Newell & Simon’s Logic Theorist was published. It is considered by many to be the
first AI program. In 1959, Gelernter developed a Geometry Engine. In 1961 James Slagle
(PhD dissertation, MIT) wrote a symbolic integration program, SAINT. It was written in
LISP and solved calculus problems at the college freshman level. In 1963, Thomas Evan's
program Analogy was developed which could solve IQ test type analogy problems.
In 1963, Edward A. Feigenbaum & Julian Feldman published Computers and Thought, the
first collection of articles about artificial intelligence.
In 1965, J. Allen Robinson invented a mechanical proof procedure, the Resolution Method,
which allowed programs to work efficiently with formal logic as a representation language. In
1967, the Dendral program (Feigenbaum, Lederberg, Buchanan, Sutherland at Stanford) was
demonstrated which could interpret mass spectra on organic chemical compounds. This was
the first successful knowledge-based program for scientific reasoning.
In 1969 the SRI robot, Shakey, demonstrated combining locomotion, perception and problem
solving.
The years from 1969 to 1979 marked the early development of knowledge-based systems In
1974: MYCIN demonstrated the power of rule-based systems for knowledge representation
and inference in medical diagnosis and therapy. Knowledge representation schemes were
developed. These included frames developed by Minski. Logic based languages like Prolog
and Planner were developed.
In the 1980s, Lisp Machines developed and marketed. Around 1985, neural networks return
to popularity In 1988, there was a resurgence of probabilistic and decision-theoretic methods
The early AI systems used general systems, little knowledge. AI researchers realized that
specialized knowledge is required for rich tasks to focus reasoning.
The 1990's saw major advances in all areas of AI including the machine learning, data
mining, intelligent tutoring, case-based reasoning, multi-agent planning, scheduling, uncertain
reasoning, natural language understanding and translation, vision, virtual reality, games, and
other topics.
Rod Brooks' COG Project at MIT, with numerous collaborators, made significant progress in
building a humanoid robot
The first official Robo-Cup soccer match featuring table-top matches with 40 teams of
interacting robots was held in 1997. For details, see the site
In the late 90s, Web crawlers and other AI-based information extraction programs become
essential in widespread use of the world-wide-web. Interactive robot pets ("smart toys")
become commercially available, realizing the vision of the 18th century novelty toy makers.
In 2000, the Nomad robot explores remote regions of Antarctica looking for meteorite
samples.
We will now look at a few famous AI system that has been developed over the years.
1. ALVINN: Autonomous Land Vehicle In a Neural Network
In 1989, Dean Pomerleau at CMU created ALVINN. This is a system which learns to
control vehicles by watching a person drive. It contains a neural network whose input is a
30x32 unit two dimensional camera image. The output layer is a representation of the
direction the vehicle should travel. The system drove a car from the East Coast of USA to
the west coast, a total of about 2850 miles. Out of this about 50 miles were driven by a
human and the rest solely by the system.
2. Deep Blue
In 1997, the Deep Blue chess program created by IBM, beat the current world chess
champion, Gary Kasparov.
3. Machine translation
A system capable of translations between people speaking different languages will be a
remarkable achievement of enormous economic and cultural benefit. Machine translation
is one of the important fields of endeavour in AI. While some translating systems have
been developed, there is a lot of scope for improvement in translation quality.
4. Autonomous agents
In space exploration, robotic space probes autonomously monitor their surroundings,
make decisions and act to achieve their goals. NASA's Mars rovers successfully
completed their primary three-month missions in April, 2004. The Spirit rover had been
exploring a range of Martian hills that took two months to reach. It is finding curiously
eroded rocks that may be new pieces to the puzzle of the region's past. Spirit's twin,
Opportunity, had been examining exposed rock layers inside a crater.
5. Internet agents
The explosive growth of the internet has also led to growing interest in internet agents to
monitor users' tasks, seek needed information, and to learn which information is most
useful.
Turing Test
Turing held that in future computers can be programmed to acquire abilities rivaling
human intelligence. As part of his argument Turing put forward the idea of an
'imitation game', in which a human being and a computer would be interrogated under
conditions where the interrogator would not know which was which, the
communication being entirely by textual messages. Turing argued that if the
interrogator could not distinguish them by questioning, then it would be unreasonable
not to call the computer intelligent. Turing's 'imitation game' is now usually called 'the
Turing test' for intelligence.
Consider that there are two rooms, A and B. One of the rooms contains a computer.
The other contains a human. The interrogator is outside and does not know which one
is a computer. He can ask questions through a teletype and receives answers from
both A and B. The interrogator needs to identify whether A or B are humans. To pass
the Turing test, the machine has to fool the interrogator into believing that it is human.
Applications of AI
1. Artificial Intelligence in Healthcare: Companies are applying machine learning to
make better and faster diagnoses than humans. One of the best-known technologies is
IBM’s Watson. It understands natural language and can respond to questions asked of
it. The system mines patient data and other available data sources to form a
hypothesis, which it then presents with a confidence scoring schema. AI is a study
realized to emulate human intelligence into computer technology that could assist
both, the doctor and the patients in the following ways:
By providing a laboratory for the examination, representation and cataloguing
medical information
By devising novel tool to support decision making and research
By integrating activities in medical, software and cognitive sciences
By offering a content rich discipline for the future scientific medical
communities.
2. Artificial Intelligence in business: Robotic process automation is being applied to
highly repetitive tasks normally performed by humans. Machine learning algorithms
are being integrated into analytics and CRM (Customer relationship management)
platforms to uncover information on how to better serve customers. Chatbots have
already been incorporated into websites and e companies to provide immediate
service to customers. Automation of job positions has also become a talking point
among academics and IT consultancies.
3. AI in education: It automates grading, giving educators more time. It can also assess
students and adapt to their needs, helping them work at their own pace.
4. AI in Autonomous vehicles: Just like humans, self-driving cars need to have sensors
to understand the world around them and a brain to collect, processes and choose
specific actions based on information gathered. Autonomous vehicles are with
advanced tool to gather information, including long range radar, cameras, and
LIDAR. Each of the technologies are used in different capacities and each collects
different information. This information is useless, unless it is processed and some
form of information is taken based on the gathered information. This is where
artificial intelligence comes into play and can be compared to human brain. AI has
several applications for these vehicles and among them the more immediate ones are
as follows:
Directing the car to gas station or recharge station when it is running low on
fuel.
Adjust the trips directions based on known traffic conditions to find the
quickest route.
Incorporate speech recognition for advanced communication with passengers.
Natural language interfaces and virtual assistance technologies.
5. AI for robotics will allow us to address the challenges in taking care of an aging
population and allow much longer independence. It will drastically reduce, may be even
bring down traffic accidents and deaths, as well as enable disaster response for dangerous
situations for example the nuclear meltdown at the fukushima power plant.
6. Cyborg Technology: One of the main limitations of being human is simply our own
bodies and brains. Researcher Shimon Whiteson thinksthat in the future, we will be able
to augment ourselves with computers and enhance many of our own natural abilities.
Though many of these possible cyborg enhancements would be added for convenience,
others may serve a more practical purpose. Yoky Matsuka of Nest believes that AI will
become useful for people with amputated limbs, as the brain will be able to communicate
with a robotic limb to give the patient more control. This kind of cyborg technology
would significantly reduce the limitations that amputees deal with daily.
7. Game Playing: You can buy machines that can play master level chess for a few hundred
dollars. There is some AI in them, but they play well against people mainly through brute
force computation--looking at hundreds of thousands of positions. To beat a world
champion by brute force and known reliable heuristics requires being able to look at 200
million positions per second.
8. Speech Recognition: In the 1990s, computer speech recognition reached a practical level
for limited purposes. Thus United Airlines has replaced its keyboard tree for flight
information by a system using speech recognition of flight numbers and city names. It is
quite convenient. On the other hand, while it is possible to instruct some computers using
speech, most users have gone back to the keyboard and the mouse as still more
convenient.
9. Understanding Natural Language: Just getting a sequence of words into a computer is
not enough. Parsing sentences is not enough either. The computer has to be provided with
an understanding of the domain the text is about, and this is presently possible only for
very limited domains.
10. Computer Vision: The world is composed of three-dimensional objects, but the inputs to
the human eye and computers & TV cameras are two dimensional. Some useful programs
can work solely in two dimensions, but full computer vision requires partial three-
dimensional information that is not just a set of two-dimensional views. At present there
are only limited ways of representing three-dimensional information directly, and they are
not as good as what humans evidently use.
11. Expert Systems: A ``knowledge engineer'' interviews experts in a certain domain and
tries to embody their knowledge in a computer program for carrying out some task. One
of the first expert systems was MYCIN in 1974, which diagnosed bacterial infections of
the blood and suggested treatments. It did better than medical students or practicing
doctors, provided its limitations were observed. Namely, its ontology included bacteria,
symptoms, and treatments and did not include patients, doctors, hospitals, death,
recovery, and events occurring in time. Its interactions depended on a single patient being
considered. Since the experts consulted by the knowledge engineers knew about patients,
doctors, death, recovery, etc., it is clear that the knowledge engineers forced what the
experts told them into a predetermined framework. The usefulness of current expert
systems depends on their users having common sense.
Q. Define Artificial Intelligence. Explain applications of Artificial Intelligence (KBCNMU
December 2019 Examination)
AI Problems and Techniques
AI Problem:
o AI Problem is solved by using AI Technique. The problem which is solve by
using knowledge & logic is called as AI problem.
o Knowledge consist of
Facts
Concepts
Theories
Procedures
Relationships between them
AI Technique
o In the real world, the knowledge has some unwelcomed properties −
Its volume is huge, next to unimaginable.
It is not well-organized or well-formatted.
It keeps changing constantly
o AI Technique is a technique which is used to solve AI problem.
o AI Technique is a manner to organize and use the knowledge efficiently. It is a
Method that exploits knowledge that should represent in such a way that –
a) The knowledge captures generalization.
b) It can be understood by people, who provide it.
c) It can be easily modified to correct errors & to reflect the changes in
world.
Problem as a State Space Search:
Problem Space: It is a Hypothetical space in which, we represent all the states of
problem including Initial, Intermediate & Final state.
Steps to solve AI Problem:
o Define problem precisely (Specify the problem)
o Analyse the problem
o Isolate & represent the task knowledge i.e. necessary
o Choose the best problem solving technique & apply it, to the particular
problem
Characteristics of AI Problem:
1. Is a problem decomposable into a set of independent, smaller or easier sub
problem?
2. Can solution steps be ignored or at least undone if they proved unwise?
3. Is a problem universal predictable? (Confirm we get the solution)
4. Is a root solution to the problem obvious without comparing to all other solutions?
5. Is the knowledgebase we use for solving the problem, is internally consistent?
6. Is the large amount of knowledge accurately required to solve the problem?
7. Were the solutions of problems required interaction between computer & human?
Production System
A production system (or production rule system) is a computer program typically used
to provide some form of artificial intelligence, which consists primarily of a set of
rules about behaviour.
These rules, termed productions, are a basic representation found useful in automated
planning, expert systems and action selection.
A production system provides the mechanism necessary to execute productions in
order to achieve some goal for the system.
Productions consist of two parts: a sensory precondition (or "IF" statement) and an
action (or "THEN").
If a production's precondition matches the current state of the world, then the
production is said to be triggered.
If a production's action is executed, it is said to have fired.
A production system also contains a database, sometimes called working memory,
which maintains data about current state or knowledge, and a rule interpreter.
WATER – JUG PROBLEM
Problem Statement: You are given two jugs, a 4-gallon one and a 3-gallon one, a pump
which has unlimited water which you can use to fill the jug, and the ground on which water
may be poured. Neither jug has any measuring markings on it. How can you get exactly 2
gallons of water in the 4-gallon jug?
One possible solution without using AI technique and Production System:
Initially both the jugs will be empty.
Fill the 3 gallon jug
Pour the water from 3 gallon jug into 4 gallon jug ( After pouring 3 gallon water into
4 gallon jug, the 4 gallon jug will still have capacity of 1 gallon empty)
Now the 3 gallon jug is empty, so again fill the 3 gallon jug
Pour some water from 3 gallon jug into 4 gallon jug, until the 4 gallon jug is full
(After this, 3 gallon jug will have 2 gallon of water left)
Empty the 4 gallon jug on ground
Pour the 2 gallon of water from the 3 gallon jug into 4 gallon jug.
One possible solution by using AI technique and Production System:
State Representation and Initial State
We will represent a state of the problem as a tuple (x, y) where x represents the
amount of water in the 4-gallon jug and y represents the amount of water in the 3-gallon jug.
Now, we must define a set of production rules, which will take us from Initial (Start) State to
Goal State. The Production Rules are as follows:
Production Rules for Water Jug Problem
Possible Solution
Q. What is Production Systems? Solve the following Water – Jug Problem: If you are given two
jugs, 8-gallon one and a 6-gallon one, a pump which has unlimited water which you can use to fill
the jug, and the ground on which water may be poured. Neither jug has any measuring markings
on it. How can you get exactly 4 gallons of water in the 8-gallon jug (KBCNMU December 2019
Examination)
Heuristic Searching Techniques
Breadth First Search (BFS)
It starts from the root node, explores the neighbouring nodes first and moves towards
the next level neighbours.
It generates one tree at a time until the solution is found.
BFS searches breadth-wise in the problem space.
Breadth-First search is like traversing a tree where each node is a state which may be
a potential candidate for solution.
It expands nodes from the root of the tree and then generates one level of the tree at a
time until a solution is found.
Example: Construct a tree with initial state as root. Generate all its child nodes.
Now for each leaf node, generate all its successors by applying appropriate rules.
Continue the process until goal state is reached. This is called Breadth First Search.
Algorithm - Breadth First Search
1. Create a variable called NODE - LIST and set it to the initial state.
2. Loop until the goal state is found or NODE - LIST is empty.
i. Remove the first element from the NODE – LIST, say E. If
NODE - LIST was empty then quit.
ii. For each way that each rule can match the state described in E
do:
a) Apply the rule to generate a new state.
b) If the new state is the goal state, quit and return this
state.
c) Otherwise add this state to the end of NODE-LIST
Working of Breadth First Search Algorithm with example
Advantages of Breadth – First Search
1. BFS will never get trapped.
2. If there is a solution, then BFS is guaranteed to find it. Furthermore, if there
are multiple solutions, then BFS will give the minimal solution. This is
guaranteed by the fact that BFS will never explore the longer paths, until all
shorter ones have been examined.
3. BFS will always find shortest path to the goal.
Disadvantages of Breadth – First Search:
1. The main drawback of Breadth first search is its memory requirement. Since
each level of the tree must be saved in order to generate the next level, and the
amount of memory is proportional to the number of nodes stored. As a result,
BFS is severely space-bound in practice so will exhaust the memory available
on typical computers in a matter of minutes.
2. If the solution is farther away from the root, breath first search will consume
lot of time.
Depth - First Search (DFS)
In DFS, we pursue a single branch of the tree until it yields a solution or a decision to
terminate the path is made.
In such cases backtracking occurs.
The most recently visited node will be revisited and new path will be created.
This search procedure is called Depth – First Search.
Depth – First Search
Algorithm - Depth First Search
1. If the initial state is a goal state, quit and return success.
2. Otherwise, loop until success or failure is signalled.
a) Generate a state, say E, and let it be the successor of the initial state
there is no successor, signal failure.
b) Call Depth - First Search with E as the initial state
c) If success is returned, signal success. Otherwise continue in this loop.
Working of Depth - First Search Algorithm with example
Advantages of Depth – First Search
1. Depth – First Search requires less memory since only the nodes to the current
path are stored.
2. Sometimes, depth – first search may find a solution without examining much
of the other nodes at all.
Disadvantages of Depth – First Search
1. Depth-First Search is not guaranteed to find the solution.
2. There is no guarantee to find a minimal solution, if more than one solution
exists.
Q. Explain Breadth First Search and Depth First Search algorithm with its advantages.
(KBCNMU December 2019 Examination)
Best First Search
Best First Search is a combination of both Depth first search & Breadth first search. In
Best First Search we follow single path at a time but we can switch from that path
whenever some other path looks more promising than current path.
At each step of Best First Search, we select the most promising node by applying an
appropriate Heuristic Function to each of them.
For the practical implementation of Best First Search, we need to use two lists of
nodes:
1. OPEN: Nodes that have been generated and have had Heuristic Function
applied to them but which have not been yet examined.
2. CLOSED: Nodes that have already been examined. We have to keep these
nodes in memory for backtracking in future
3. Heuristic Function : f’(n) = g (n) + h’ (n)
4. Where,
a) g (n) = cost from the initial state to current state n.
b) h’ (n) = cost from current state n to goal node.
Algorithm – Best First Search
1. Start with OPEN, containing just the initial state.
2. Until the goal node is found or there are no nodes left in OPEN, do:
a) Pick the best node in OPEN
b) Generate its successors
c) For each successor, do:
i. If it has not been generated before, evaluate it, add it to OPEN
and record its parent.
ii. If it has been generated before, change the parent if this new
path is better than the previous one. In this case, update the
cost of getting to this node and to any successors that this node
may already have.
Example:
1. Step 1: OPEN {A} CLOSED {}
2. Step 2: OPEN {A,B,C,D} CLOSED {}
3. Step 3: OPEN {A,B,C,E,F} CLOSED {D}
4. Step 4: OPEN {A,C,D,E,F,G,H} CLOSED {B,D}
5. Step 5: OPEN {A,C,D,F,G,H,I,J} CLOSED{B,D,E}
A* Algorithm
A* algorithm is the practical implementation of Best First Search which was first
presented by Peter Hart, Nils Nilsson and Bertram Raphael of Stanford Research
Institute, first described the algorithm in 1968.
Similar to the Best First Search, it uses two nodes of lists:
1. OPEN: nodes that have been generated, but have not examined.
2. CLOSED: nodes that have already been examined.
Whenever a new node is generated, check whether it has been generated before.
It uses a heuristic evaluation function, f(n)
f (n) is the approximate distance of a node, n, from a goal node.
For two node m and n, if f(m) < f(n), than m is more likely to be on an optimal path
f(n) may not be 100% accurate, but it should give better results than pure guesswork.
f’(n) = g(n)+ h’(n)
Where,
g(n) = cost from the initial state to the current state n
h’(n) = estimated cost from node n to a goal node
Algorithm
1. Start with OPEN which contain only initial node. calculate its F’
2. Until goal node found repeat the following procedure:
a) If there is no nodes in OPEN report failure, otherwise pick the node from
OPEN having lowest F’ treat it as BEST node.
b) Remove it from OPEN and put it on CLOSED. If BEST node is goal
node then exit. Otherwise generate the successor of BEST node. For each
successor do the following:
i. For each successor calculate its F’
ii. Check whether the successor is in OPEN; if it is shown then call
that node i.e. OLD node.
iii. If successor are not OPEN, then see it is in CLOSED. At that time
all that node has CLOSED OLD node.
iv. If successor was not on OPEN or CLOSE. Then put it in OPEN &
calculate its F’
Example 1: 8 puzzle problem using A* Algorithm
Example 2: 8 puzzle problem using A*Algorithm
Video Tutorial on 8 puzzle problem using A* algorithm:
https://www.youtube.com/watch?v=wJu3IZq1NFs&t=333s
Q. Write A* Algorithm with example. (KBCNMU December 2019 Examination)
AO* Algorithm
AO* algorithm was proposed by Nilsson in 1980.
Rather than using two lists, OPEN and CLOSED, that were used in A* algorithm,
AO* algorithm will use a single structure GRAPH G, representing the part of search
graph that has been explicitly generated so far.
Each node in the graph will point down to its immediate successors and up to its
immediate predecessors.
Each node will also have its associated h’ value.
Algorithm:
1. Let GRAPH G consist only the node representing the initial state. (Call this
node INIT). Compute h' (INIT).
2. Until INIT is labelled SOLVED or h’ becomes greater than FUTILITY,
repeat the following procedure.
a) Trace the labelled arcs from INIT and select unexpanded nodes on this
path. Call this node as NODE.
b) Generate the successors of NODE. If there are no successors then
assign FUTILITY as h' value of NODE. This means that NODE is not
solvable. If there are successors then for each one do the following:
i. Add SUCCESSOR to GRAPH G
ii. If successor is not a terminal node, mark it solved and assign
zero to its h ' value.
iii. If successor is not a terminal node, compute it h' value.
c) Propagate the newly discovered information up the graph by doing the
following:
Let S be the set of nodes that have been marked SOLVED. Initialize S
to NODE. Until S is empty repeat the following procedure:
i. Select a node from S calls it CURRENT and remove it from S.
ii. Compute h' of each of the arcs emerging from CURRENT,
Assign minimum h' to CURRENT.
iii. Mark the minimum cost path as the best out of CURRENT.
iv. Mark CURRENT SOLVED if all of the nodes connected to it
through the new marked arc have been labelled SOLVED.
v. If CURRENT has been marked SOLVED or its h' has just
changed, its new status must be propagate backwards up the
graph. Hence all the ancestors of CURRENT are added to S.
Video Tutorial on AO* algorithm with example:
https://www.youtube.com/watch?v=PhRayhkbJCo
Means – Ends Analysis
Most of the search strategies either go for forward or backward approach, however
often a mixture of the two directions is appropriate.
Such mixed strategy would make it possible to solve the major parts of problem first
and solve the smaller part later, Such a technique is called "Means - Ends Analysis".
The means -ends analysis process centers around finding the difference between
current state and goal state.
The problem space of means - ends analysis has an initial state and one or more goal
state, a set of operator with a set of preconditions and difference functions that
computes the difference between two states i.e. current state & goal state.
Means- Ends Analysis is useful for many human planning activities.
Example: Problem for Household Robot (Means End Analysis)
Here goal is to move the desk with 2 things on it from one room to another.
Main difference between start and goal state is location.
Difference Table
Following table shows the available set of operators with its Pre – Conditions and
Results
Algorithm
1. Compare CURRENT to GOAL. If no differences, return.
2. Otherwise select most important difference and reduce it by doing the
following until success or failure is indicated.
a) Select an as yet untried operator O that is applicable to the current
difference. If there are no such operators then signal failure.
b) Attempt to apply O to the current state. Generate descriptions of two
states O-START a state in which O’s preconditions are satisfied and O-
RESULT, the state that would result if O were applied in O-START.
c) If (FIRST-PART MEA (CURRENT,O-START) AND (LAST-PART
MEA (O-RESULT, GOAL) are successful then signal success.