Professional Documents
Culture Documents
Introduction
• Artificial Intelligence:
• Introduction,
• Typical Applications.
• State Space Search:
• Depth First Search
• Breadth First Search
• Depth Bounded DFS,
• Depth First Iterative Deepening.
• Heuristic Search:
• Heuristic Functions,
• Best First Search,
• Hill Climbing, Variable Neighborhood Descent, Beam Search, Tabu Search.
• Optimal Search:
• A * algorithm, Iterative Deepening A* ,
• Recursive Best First Search,
• Pruning the CLOSED and OPEN Lists
• Textbook:
1) Deepak Khemani, “A First Course in Artificial Intelligence”, McGraw
Hill Education(India), 2013, ISBN : 978-1-25-902998-1 2.
2) Elaine Rich, Kevin Knight and Nair, “Artificial Intelligence”, TMH,
ISBN-978-0-07- 008770-5
What is AI ?
AI = Artificial + Intelligence
(Non Natural) (Ability to understand, think and learn)
• 3 ways:
• 1. Through Introspection : trying to catch our thoughts as they go by
• 2. Through psychological experiments: observing a person in action
• 3. Brain Imaging: Observing the brain in action.
• By help of cognitive science, we can design a machine which think like human
3) Thinking rationally: The “laws of thought” approach
• What is meant of Rationally?
• The ones on the right measure against an ideal performance measure called rationally.
• In other words thinking rationally means right thinking.
• E.g. 2+2=3 Wrong
2+2=4 Right
• How can machine think rationally?
• If machine is able to develop right logic, then machine can be able to think rationally.
• E.g.
Socrates is a man
All men are mortal.
Is Socrates is mortal?
Answer is Yes
• These laws of thought were supposed to govern the operation of the mind; their study initiated the
field called logic.
4) Acting rationally: The rational agent approach
• All computer programs do something, but computer agents are expected to do
more. They are
• Operate autonomously
• Perceive the environment
• Persist over a prolonged time period
• Adapt to change
• Create and pursue goals
• Perception
–Machine vision
–Speech understanding
–Touch ( tactile or haptic) sensation
• Robotics
• Natural Language Processing
–Natural Language Understanding
–Speech Understanding
–Language Generation
–Machine Translation
• Planning
• Expert Systems
• Machine Learning
• Theorem Proving
• Symbolic Mathematics
• Game Playing
State Space Search
• Aspects of AI:
1) Problem Solving
2) Knowledge representation
3) Learning
4) Planning
• Problem Solving Aspect:
Problem Solution
Decisions, Techniques, methods, steps,
Problem Solving
Knowledge Base Search Techniques
State Space
Memory Based
Tree and Graph Searching Techniques
Rule Based
• State Space:
The state space of a problem is the set of all states reachable from the initial state
by executing any sequence of actions.
Path Cost: 4
2) Water Jug Problem
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?
• Solution:
The state space for this problem can be described as the set of ordered pairs of
integers (x,y) Where,
X represents the quantity of water in the 4-gallon jug X= 0,1,2,3,4
Y represents the quantity of water in 3-gallon jug Y=0,1,2,3
Start State: (0,0)
Goal State: (2,y)
3. Tower of Hanoi Problem
Path Cost : 7
4) Missionaries and Cannibals Problem
Three missionaries and three cannibals are on one side of a river, along with
a boat that can hold one or two people. Now we have to find a way to
get everyone to the other side, without ever leaving a group of
missionaries in one place outnumbered by the cannibals in another side.
Initial State =>State(3,3,0)
Final State => State(0, 0, 1).
It uses knowledge for the searching process. It does not uses knowledge for searching process
It finds solution more quickly It find solution slow as compared to informed search
It provides the direction regarding the solution No suggestion is given regarding the solution
A* algorithm, Hill Climbing, Steepest Hill climbing Best First Breadth First Search, Depth First Search, uniform cost search,
search, Greedy search Depth limited search
Breadth First Search
• What is the Breadth-First Search Algorithm?
Breadth-First Search algorithm is a graph traversing technique, where you select
a initial node (source or root node) and start traversing the graph layer-wise in
such a way that all the nodes and their respective children nodes are visited and
explored.
• Data Structure:
1) Queue
2) Open : Expanded
3) Closed : Visited
• Algorithm:
1. Begin
1. Open = [start];
2. Closed =[];
3. While open != [] do
4. Begin
1. Remove leftmost state from open(i.e. top of queue element) call it x;
2. If x is a goal then return success
3. Else
1. Begin
1. Generate children of x;
2. Put x on closed;
3. Put children on right end of open;
2. End
5. End
6. Return Failure
2.End
• Advantages:
• BFS will provide a solution if any solution exists.
• If there are more than one solutions for a given problem, then BFS will provide the minimal
solution which requires the least number of steps
• Disadvantages:
• It requires lots of memory since each level of the tree must be saved into memory to expand the
next level.
• BFS needs lots of time if the solution is far away from the root node.
• Disadvantages:
• There is no guarantee of finding the solution.
• DFS algorithm goes for deep down searching and sometime it may go to the infinite loop.
• Space Complexity:
• The space complexity of IDDFS will be O(bd).
Bidirectional Search
• Bidirectional search algorithm runs two simultaneous searches, one form initial
state called as forward-search and other from goal node called as backward-
search, to find the goal node. Bidirectional search replaces one single search
graph with two small subgraphs in which one starts the search from an initial
vertex and other starts from goal vertex. The search stops when these two graphs
intersect each other.
• Bidirectional search can use search techniques such as BFS, DFS, DLS, etc.
• Advantages:
• Bidirectional search is fast.
• Bidirectional search requires less memory
• Disadvantages:
• Implementation of the bidirectional search tree is difficult.
• In bidirectional search, one should know the goal state in advance.
• Time Complexity: Time complexity of bidirectional search using BFS
is O(bd).