0% found this document useful (0 votes)
45 views47 pages

Unit 2

KPRIET AI Fundamentals and Machine Learning Unit 2

Uploaded by

22cs103
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views47 pages

Unit 2

KPRIET AI Fundamentals and Machine Learning Unit 2

Uploaded by

22cs103
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 47

UNIT II Local Search Problems, CSP

and Planning
Local Search Algorithms and Optimization
Problems – Constraint Satisfaction Problems :
Map coloring Problem, N Queens Problem –
Classical Planning: Air Cargo Transport Problem,
Spare tire Problem – Block World Problem –
Algorithms for Planning as a State Space Search
Local Search
Example for Local Search Algorithm
• Hill climbing algorithm
• Simulated annealing
• Local beam search
• Evolutionary Algorithm – Genetic
Algorithm
Genetic Algorithms
Genetic algorithms represent another approach to ML
optimization. The principle that lays behind the logic of these
algorithms is an attempt to apply the theory of evolution to
machine learning.
Mathematical Optimization

• For example, if you are working with a


k-means algorithm, you will manually search
for the right number of clusters. However, if
there are hundreds and thousands of options
that you have to consider, it becomes
unbearably heavy and slow. This makes
brute-force search inefficient in the majority
of real-life cases.
Exhaustive Exploration
Optimization
• Time complexity
• Space Complexity
• Turn around time
• Waiting time
• Repose time
Gradient descent
• Gradient descent is the most common
algorithm for model optimization for
minimizing the error. In order to perform
gradient descent, you have to iterate over the
training dataset while re-adjusting the model.
Constraint Satisfaction Problems
Map coloring Problem
N-Queens Problem
classical planning in artificial
Intelligence
• Example Planning Problem: Making Tea
• Think about what the robot must do to make tea, e.g.:

It must put water in the kettle


• heat the kettle
• get a cup
• pour hot water into the cup (after the water is hot enough)
• get a tea bag
• leave the tea bag in the water for enough time
• remove the tea bag
• add milk
• add sugar
• mix the tea
• serve the tea
Problems
• Air Cargo Transport Problem
• Spare tire Problem
• Block World Problem
Block-world planning problem
• The block-world problem is known as the Sussmann
anomaly.
• The non-interlaced planners of the early 1970s were
unable to solve this problem. Therefore it is
considered odd.
• When two sub-goals, G1 and G2, are given, a
non-interleaved planner either produces a plan for G1
that is combined with a plan for G2 or vice versa.
• In the block-world problem, three blocks labeled 'A',
'B', and 'C' are allowed to rest on a flat surface. The
given condition is that only one block can be moved at
a time to achieve the target.
Components of the planning system
• The plan includes the following important steps:
• Choose the best rule to apply the next rule based
on the best available guess.
• Apply the chosen rule to calculate the new
problem condition.
• Find out when a solution has been found.
• Detect dead ends so they can be discarded and
direct system effort in more useful directions.
• Find out when a near-perfect solution is found.
Target stack plan
• It is one of the most important planning
algorithms used by STRIPS.
• Stacks are used in algorithms to capture the
action and complete the target. A knowledge
base is used to hold the current situation and
actions.
• A target stack is similar to a node in a search
tree, where branches are created with a
choice of action.
Algorithms for Planning as a State
Space Search
• In artificial intelligence, a process known as
state space search is used to explore all
potential configurations or states of an
instance until one with the necessary feature
is found.
1. Forward State Space Planning (FSSP)

• FSSP behaves in the same way as


forwarding state-space search. It says that
given an initial state S in any domain, we
perform some necessary actions and obtain a
new state S' (which also contains some new
terms), called a progression. It continues until
we reach the target position. Action should be
taken in this matter.
• Disadvantage: Large branching factor
• Advantage: The algorithm is Sound
2. Backward State Space Planning
(BSSP)
• BSSP behaves similarly to backward state-space
search. In this, we move from the target state g to the
sub-goal g, tracing the previous action to achieve that
goal. This process is called regression (going back to
the previous goal or sub-goal). These sub-goals should
also be checked for consistency. The action should be
relevant in this case.
• Disadvantages: not sound algorithm (sometimes
inconsistency can be found)
• Advantage: Small branching factor (much smaller than
FSSP)

You might also like