• Move the disks from the leftmost post to the rightmost post while never putting a larger disk on top of a
smaller one;
• move one disk at a time, from one peg to another; middle post can be used for intermediate storage.
• Play the game in the smallest number of moves possible.
• Possible state transitions in the Towers of Hanoi puzzle with 2 disks.
Tree Searching
• Goal Reduction, Constraint Network
• Tree searched through many nodes to obtain goal node and it gives the path from source
node to destination node
• If each node of the entire tree is explored while search for the goal node, it is called as
exhaustive search.
• All Searching techniques broadly classified as
• Uninformed Searching
• Informed Searching
AI Searching Techniques Classification
• Shortest solution is the sequence of transitions from the top state downward to the lower left.
Goal Reduction
• Goal-reduction procedures are a special case of the procedural representations of
knowledge in AI; an alternative to declarative, logic- based representations.
• The process involves the hierarchical sub-division of goals into sub- goals, until
the sub-goals which have an immediate solution are reached and said “goal has
been satisfied”.
• Goal-reduction process is illustrated in the form of AND/OR tree drawn upside-
down.
• Goal levels : Higher-level goals are higher in the tree, and lower- level goals are lower in the tree.
• Arcs are directed from a higher-to-lower level node represents the reduction of higher-level goal to lower-level sub-
goal.
• Nodes at the bottom of the tree represent irreducible action goals.
• An AND-OR tree/graph structure can represent relations between goals and sub-
goals, alternative sub-goals and conjoint sub-goals.
Example Goal Reduction
• AND-OR tree/graph structure to
represent facts such as
“enjoyment”, “earning/save
money”, “old age” etc.
• The above AND-OR tree/graph
structure describes
• Hierarchical relationships between
goals and sub goals
• Alternative ways of trying to solve
a goal
• Conjoint sub-goals
Constraint Satisfaction Techniques
is a logical relation among variables. e.g. “circle is inside
• Constraint
the square” – The constraints relate objects without precisely
specifying their positions; moving any one, the relation is still
maintained.
is a process of finding a solution to a set of
• Constraint satisfaction
constraints – the constraints express allowed values for variables and
finding solution is evaluation of these variables that satisfies all
constraints.
Constraint Satisfaction Problem (CSP) and its solution
Machine
Planning
Learning
Expert
NLP Vision Robotics Systems
Classic AI Search Problems
• 3*3*3 Rubik’s Cube Problem
Classic AI Search Problems
• 8 Puzzle
N-Queens problem Definition
• Place N queens on an N*N board so that
no queen is attacking another queen.
• A queen can move horizontally, vertically,
or diagonally.
• The problem can be solved with genetic
algorithm for a n queens problem. (n is
between 8 and 30)
Here N=8
Classic AI Search Problems
• River Problem
• On one bank of a river are three missionaries and three cannibals.
There is one boat available that can hold up to two people and that
they would like to use to cross the river. If the cannibals ever
outnumber the missionaries on either of the river’s banks, the
missionaries will get eaten.
How can the boat be used to safely carry all the missionaries and
cannibals across the river?
• The initial state is shown to the right here, where black triangles
represent missionaries and red circles represent cannibals.
Classic AI Search Problems
• River Problem
Classic AI Search Problems
• Research showed that intelligence requires knowledge and
knowledge holds some less desirable properties like
• It is enormous
• It is tough to characterize precisely
• It is dynamic
• It is structured in a way that matches to the ways it will be used
Heuristic Search
• Very large search space
• Large databases
• Image sequences
• Game playing
• Algorithms
• Guaranteed best answer
• Can be slow – literally years
• Heuristics
• “Rules of thumb”
• Very fast
• Good answer likely, but not guaranteed!
• Searching foreign intelligence for terrorist activity.
Computer Vision
• Computationally taxing
• Millions of bytes of data per frame
• Thirty frames per second
• Computers are scalar / Images are
multidimensional
• Image Enhancement vs. Image
Understanding
• Can you find the terrorist in this
picture?
Adversarial Search
• Game theory...
• Two player, zero sum – checkers, chess, etc.
• Minimax
• My side is MAX
• Opponent is MIN
• Alpha-Beta
• Evaluation function...”how good is board”
• Not reliable...play game (look ahead) as deep as possible and use minimax.
• Select “best” backed up value.
• Where will Al-Qaeda strike next?
Adversarial Search
1
X X O
MIN O
...
2 6
X X O X X O
MAX O O O O
X X
3 4 5 7 8 9
X X O X X O X X O X X O X X O X X O
O O X O O O O X O O O O O O
X X X X X X X X X X
• Predefined strategy:
• 1. Win
• 2. Block
• 3. Take center
• 4. Take corner
• 5. Take any open square
Example: Tic Tac Toe #3
• Given a board, consider all possible moves (future boards) and pick the best one
• Look ahead (opponent’s best move, your best move…) until end of game
• Functions needed:
• Next move generator
• Board evaluation function
Linguistic
Light Moderate Heavy Values
Membership
Grade
determiner noun
“The big grey dog” S1 S2 S3
preposition NOUNG
“by the table in the corner” S1 S2 S3
determiner noun
“The big grey dog by the S1 S2 S3
table in the corner”
Knowledge Representation
• Predicate Logic
• On(table, lamp)
• In(corner, table)
• Near(table, dog)
• Prolog
• Graph Based
• Semantic Networks
• Frames
• Rule Based
• Expert Systems
Planning
• Robotics
• If a robot enters a room and sits
down, what is the “route”.
Table
• Closed world
• Rule based systems
Chair
• Blocks world
Planning
Robot
Hand
• Pickup(x)
• Ontable(x), clear(x), handempty(),
C
• Holding(x)
• Putdown(x) A B
• Holding(x) Clear(B) On(C, A) OnTable(A)
• Ontable(x), clear(x), handempty() Clear(C) Handempty OnTable(B)
• Stack(x, y)
• Holding(x), clear(y)
• Handempty(), on(x, y), clear(x) A
• Unstack(x, y)
B
• Handempty(), clear(x), on(x, y)
• Holding(x), clear(x) C
Goal: [On(B, C) ^ On(A, B)]
Learning
• Neural Networks
• Evolutionary Computing
• Knowledge in Learning
• Reinforcement Learning