0% found this document useful (0 votes)
5 views137 pages

Module 2

SRI Ramakrishna Engineering College aims to provide world-class education in mechanical engineering, focusing on technical, analytical, and managerial skills. The program emphasizes collaboration with industry and research to develop sustainable engineering solutions. The syllabus covers AI fundamentals, problem-solving approaches, knowledge representation, and planning, with specific course outcomes aligned with engineering principles.

Uploaded by

vishnu35123
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)
5 views137 pages

Module 2

SRI Ramakrishna Engineering College aims to provide world-class education in mechanical engineering, focusing on technical, analytical, and managerial skills. The program emphasizes collaboration with industry and research to develop sustainable engineering solutions. The syllabus covers AI fundamentals, problem-solving approaches, knowledge representation, and planning, with specific course outcomes aligned with engineering principles.

Uploaded by

vishnu35123
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

SRI RAMAKRISHNA ENGINEERING COLLEGE

[Educational Service: SNR Sons Charitable Trust]


[Autonomous Institution, Reaccredited by NAAC with ‘A+’ Grade]
[Approved by AICTE and Permanently Affiliated to Anna University, Chennai]
[ISO 9001:2015 Certified and all eligible programmes Accredited by NBA]
VATTAMALAIPALAYAM, N.G.G.O. COLONY POST, COIMBATORE – 641 022

20ME224
AI for Mechanical Engineers

Semester - 6
B.E Mechanical Engineering

Academic Year : 2025-26

04-02-2026 SREC-MECH 1
VISION & MISSION OF THE INSTITUTE

Vision of the Institute


To become a world-class university excelling in multidisciplinary
engineering education through cutting-edge technologies and impactful
societal contributions for sustainable development.
Mission of the Institute
• Provide quality education that builds strong technical, analytical and
managerial skills for future professionals.
• Nurture creativity, innovation and research ecosystem for local and
global needs
• Foster ethics, leadership, entrepreneurial and life skills for holistic
development
• Develop technological solutions that enhance sustainability and
societal well-being through collaborations

04-02-2026 SREC-MECH 1
VISION AND MISSION OF THE DEPARTMENT

Vision of the Department


To be globally recognized for Mechanical Engineering Education and
Research.
Mission of the Department
• To design the Curriculum for the Mechanical Engineering program and
its effective implementation by integrating technical, managerial and
soft skills for successful professional career.
• To have active collaboration with distinguished alumni, industry experts
and academic experts for developing sustainable engineering
solutions.
• To empower individuals with holistic development; through innovation,
research, Entrepreneurial skills, and lifelong learning.

04-02-2026 SREC-MECH 1
PROGRAM EDUCATIONAL OBJECTIVES (PEOS)

The graduates of this program after three to five years will,


PEO1:
Pursue a successful career in mechanical engineering and
allied disciplines by providing innovative, effective, and
ethical engineering solutions to real-world challenges.
PEO2:
Exhibit professionalism, leadership, and entrepreneurial
skills, contributing towards sustainable technological and
societal advancement.
PEO3:
Collaborate effectively in interdisciplinary teams and
engage in lifelong learning to adapt to emerging
technologies .

04-02-2026 SREC-MECH 1
PROGRAMME OUTCOMES (POS)
Engineering Knowledge:
PO1 Apply knowledge of mathematics, natural science, computing, engineering
fundamentals and an engineering specialization as specified in WK1 to WK4
respectively to develop to the solution of complex engineering problems
Problem Analysis:
PO2 Identify, formulate, review research literature and analyse complex engineering
problems reaching substantiated conclusions with consideration for sustainable
development (WK1 to WK4)
Design/Development of Solutions:
PO3 Design creative solutions for complex engineering problems and design/ develop
systems/ components/processes to meet identified needs with consideration for the
public health and safety, whole-life cost, net zero carbon, culture, society and
environment as required (WK5)
Conduct Investigations of Complex Problems:
PO4 Conduct investigations of complex engineering problems using research-based
knowledge including design of experiments, modelling, analysis & interpretation of
data to provide valid conclusions (WK8)

04-02-2026 SREC-MECH 1
PROGRAMME OUTCOMES (POS)
Engineering Tool Usage:
PO5 Create, select and apply appropriate techniques, resources and modern engineering
& IT tools, including prediction and modelling recognizing their limitations to solve
complex engineering problems (WK2 and WK6)
The Engineer and The World:
PO6 Analyze and evaluate societal and environmental aspects while solving complex
engineering problems for its impact on sustainability with reference to economy,
health, safety, legal framework, culture and environment (WK1, WK5, and WK7)
Ethics:
PO7 Apply ethical principles and commit to professional ethics, human values, diversity
and inclusion; adhere to national & international laws (WK9)
Individual and Collaborative Team work:
PO8 Function effectively as an individual, and as a member or leader in
diverse/multi-disciplinary teams
Communication:
PO9 Communicate effectively and inclusively within the engineering community and
society at large, such as being able to comprehend and write effective language, and
learning differences
04-02-2026 SREC-MECH 1
PROGRAMME OUTCOMES (POS)

Project Management and Finance:


PO10 Apply knowledge and understanding of engineering management principles and
economic decision-making and apply these to one’s own work, as a member and
leader in a team, and to manage projects and in multidisciplinary environments
Life-Long Learning:
PO11 Recognize the need for, and have the preparation and ability for i) independent
and life-long learning ii) adaptability to new and emerging technologies and iii)
critical thinking in the broadest context of technological change (WK8)

04-02-2026 SREC-MECH 1
Program Specific Outcomes (PSOs)

Graduates of Mechanical Engineering at the time of graduation will be able to


PSO 1:
Design mechanical and allied systems using engineering principles,
computational tools and emerging technologies.
PSO 2:
Select suitable manufacturing processes for production of
components/systems considering quality, economy and sustainability.
PSO 3:
Apply the principles of thermodynamics and heat transfer to design
sustainable solutions for thermal systems.

04-02-2026 SREC-MECH 1
SYLLABUS

AI FUNDAMENTALS 6
Introduction - Definition - Examples of AI - History of AI - Future of AI - Intelligent Agents -
Rational Agent - Nature of Environment - Structure of Agents - AI Applications

PROBLEM SOLVING APPROACH TO AI PROBLEMS 8


Problem Solving Methods - Problem Formulation - Toy Problems - Real World Problems -
Search Strategies - Uninformed - Informed - Heuristics -Game Playing

KNOWLEDGE REPRESENTATION 8
Logical Agents - Knowledge based Agents -Propositional Logic- First Order Predicate
Calculus, Resolution Refutation Proofs and Answer Extraction.

PLANNING & LEARNING 8


Planning- State Space Search-Planning Graph-Real World Example for Planning (Air Cargo
Transport, Spare Tire problem, Block’s world) - Learning-Supervised &Unsupervised
Learning- Introduction to Reinforcement Learning.
Total Periods: 30

04-02-2026 SREC-MECH 1
Text Books

TEXT BOOKS
1. S. Russell and P. Norvig; Artificial Intelligence: A Modern Approach”, Prentice Hall, Fourth
Edition, 2020.
2. Nils J Nilson, “Principles of Artificial Intelligence”, Narosa Publishing House, Reprint
2002.

REFERENCES
1. Janet Finlay, “An Introduction to Artificial Intelligence”, CRC Press, 2020
2. Vinod Chandra S.S., Anand Hareendran S., “Artificial Intelligence: Principles and
Applications”, PHI Learning Private Limited, Second Edition.

NPTEL: [Link]

04-02-2026 SREC-MECH 1
Course Outcomes

CO CO Description PO
CO 1 Summarize the fundamentals of AI, the types of PO1
agents and its applications.

CO 2 Identify suitable search algorithms to solve PO1, PO4, PO12


problems using artificial intelligence techniques.

CO 3 Outline the concept of knowledge representation PO1, PO4, PO12


and predicate logic and transform the real-life
information

CO 4 Analyze the plan with the knowledge PO1, PO4, PO12


representation to solve real world problems.

CO 5 Utilize the learning model to model machines. PO1, PO4, PO12

04-02-2026 SREC-MECH 1
Module 1
AI Fundamentals

04-02-2026 SREC-MECH 1
Reflex Agent vs Problem-Solving Agent

Reflex Agent – Mapping State to Action


A reflex agent selects actions based only on the current percept (state) using
predefined rules.
State → Action
🔹 Limitation:
• When the state–action mapping becomes very large, the agent fails to operate
efficiently
• It cannot handle complex or unseen situations Example: Robot Vacuum Cleaner
• No planning or reasoning capability 🔹 Reflex Agent Behavior
•Rule:
Why Reflex Agents Fail • If dirt → clean
• Environment is complex • If wall → turn
• Too many possible states • If battery low → stop
• Mapping rules are not easily stored or performed
• No internal memory or goal awareness
👉 At this point, the problem dissolves from simple reflex handling and is sent to
a problem-solving agent.
04-02-2026 SREC-MECH 1
Problem-Solving Agent

A problem-solving agent:
• Breaks a large stored problem into smaller manageable sub-problems
• Solves them one by one
• Operates at an atomic level
• Works without maintaining an internal state history
• Uses goal-based reasoning
The same vacuum now acts as a problem-solving (goal-based) agent.
Goal:
Clean the entire house efficiently
Steps:
[Link] the problem (house layout, rooms, obstacles)
[Link] into sub-problems
Clean Room-1 Clean Room-2 Recharge battery
[Link] each sub-problem independently
[Link] best solution from several possible paths
✔ Uses smaller storage ✔ Efficient and scalable ✔ Works without storing full
environment history

04-02-2026 SREC-MECH 1
Problem-Solving Agent

A problem-solving agent:
• Breaks a large stored problem into smaller manageable sub-problems
• Solves them one by one
• Operates at an atomic level
• Works without maintaining an internal state history
• Uses goal-based reasoning
The same vacuum now acts as a problem-solving (goal-based) agent.
Goal:
Clean the entire house efficiently
Steps:
[Link] the problem (house layout, rooms, obstacles)
[Link] into sub-problems
Clean Room-1 Clean Room-2 Recharge battery
[Link] each sub-problem independently
[Link] best solution from several possible paths
✔ Uses smaller storage ✔ Efficient and scalable ✔ Works without storing full
environment history

04-02-2026 SREC-MECH 1
Goal Formulation and Problem Solving

• Goal formulation is the first step in problem solving, where the agent defines
what it wants to achieve based on the current situation and its performance
measure.
• Once the goal is defined, the agent decides which actions and states should be
considered in order to reach that goal. This process helps reduce unnecessary
exploration.
• The agent then searches for a sequence of actions that will lead from the initial
state to the goal state.
• The final outcome of problem solving is an ordered sequence of actions that
successfully achieves the goal.

Example (Navigation Agent)


• Current situation: Agent is at City A
• Goal: Reach City B with minimum distance
• Actions considered: Possible routes between cities
• Solution: Sequence of moves along the shortest path

04-02-2026 SREC-MECH 1
Searching

The process of looking for a sequence of actions that reaches the


goal is called search.
A search algorithm takes a problem as input and returns a
solution in the form of an action sequence

Formulate Search Execute

After the search phase, the agent has to carry out the actions
that are recommended by the search algorithm. This final phase
is called execution phase.
04-02-2026 SREC-MECH 1
Well-defined problems and solutions

• A problem can be defined formally by five components

• The state that the agent starts


Initial State
in • Solution to the
problem is an action
• Possible actions available to sequence that leads
Actions
the agent from initial state to
goal state
Transition • Description of what each • Solution quality is
Model action does measured by the
path cost function.
• Determines whether a given • Optimal solution
Goal Test
state is a goal state or not has the lowest path
cost among all the
• Function that assigns a solutions
Path Cost
numeric cost to each path
04-02-2026 SREC-MECH 1
Example: Romania

04-02-2026 SREC-MECH 1
Example: Romania

• On holiday in Romania; currently in Arad.


• Flight leaves tomorrow from Bucharest
• Formulate the Problem:
– Initial State – In(Arad)
– Actions – {Go(Sibiu), Go(Timisoara), Go(Zerind)}.
– Transition Model – RESULT(In(Arad),Go(Zerind)) = In(Zerind)
– Goal Test – checks for {In(Bucharest)}
– Path Cost – length in kilometres (here 75)

States
• A description of a possible state of the world
• Includes all features of the world that are pertinent to the
problem
• Here, all cities
04-02-2026 SREC-MECH 1
Example: Vacuum Cleaner

04-02-2026 SREC-MECH 1
Example: Vacuum Cleaner

• Formulate the Problem:


✔ States – agent location and the dirt locations which is 8 states
✔ Initial State – Any state can be designated as the initial state
✔ Actions – Left, Right, and Suck. Larger environments might also
include Up and Down
✔ Transition Model – [A,Clean] 🡪 Right & etc
✔ Goal Test – checks whether all the squares are clean
✔ Path Cost – Each step costs 1, so the path cost is the number of
steps in the path.

04-02-2026 SREC-MECH 1
Example: 8-puzzle

04-02-2026 SREC-MECH 1
Example: 8-puzzle

• Formulate the Problem:


– States – location of each of the eight tiles and the blank in one of
the nine squares.
– Initial State – Any state
– Actions – Left, Right, Up, or Down
– Transition Model – Given a state and action, this returns the
resulting state; for example, if we apply Left to the start state in,
the resulting state has the 5 and the blank switched
– Goal Test – checks whether the state matches the goal
configuration
– Path Cost – Each step costs 1, so the path cost is the number of
steps in the path

04-02-2026 SREC-MECH 1
Example: 8-queens problem

States: locations of 8 queens on chess


board

Initial state: one specific queens


configuration

Transition Model: move queen x to row y


and column z

Goal: no queen can attack another


(cannot be in same row, column, or
diagonal)

Path cost: 0 per move

04-02-2026 SREC-MECH 1
Sample Questions

Give a complete problem formulation for each of the following. Choose a


formulation that is precise enough to be implemented.
1. Using only four colors, you have to color a planar map in such a way that no
two adjacent regions have the same color.
2. A 3-foot-tall monkey is in a room where some bananas are suspended from
the 8-foot ceiling. He would like to get the bananas. The room contains two
stackable, movable, climbable 3-foot-high crates.
3. You have a program that outputs the message “illegal input record” when
fed a certain file of input records. You know that processing of each record
is independent of the other records. You want to discover what record is
illegal.
4. You have three jugs, measuring 12 gallons, 8 gallons, and 3 gallons, and a
water faucet. You can fill the jugs up or empty them out from one to
another or onto the ground. You need to measure out exactly one gallon.

04-02-2026 SREC-MECH 1
Search Space Definitions

• Problem formulation
– Describe a general problem as a search problem
• Search
– Process of looking for a solution
– Search algorithm takes problem as input and returns solution
– We are searching through a space of possible states
• Solution
– Sequence of actions that transitions the world from the initial
state to a goal state
• Execution
– Process of executing sequence of actions (solution)
• Solution cost (additive)
– Sum of the cost of operators
– Alternative: sum of distances, number of steps, etc.

04-02-2026 SREC-MECH 1
Search Strategies

04-02-2026 SREC-MECH 1
Search for Solutions
• Having formulated some problems…how do we solve them?
• Moving to Solution which is an action sequence
• Search through a state space
• This sequence starts from an initial state forms a search tree
• Use a search tree that is generated with an initial state and successor
functions that define the state space
A search tree is a
conceptual structure
used in Artificial
Intelligence search
algorithms to represent
all possible ways of
solving a problem
starting from an initial
state.

04-02-2026 SREC-MECH 1
Search for Solutions

04-02-2026 SREC-MECH 1
Visualize Search Space as a Tree

States are Nodes


•Each possible situation or configuration of a problem is called a state.
•In a search tree, every state is represented as a node.
Actions are Edges
•An action is a move or operation that changes one state to another.
•These actions are represented as edges (links) between nodes.
Initial State is Root
•The starting point of the problem is the initial state.
•In the search tree, it appears as the root node.
Solution is a Path from Root to Goal Node
•A solution is not just the goal state, but the sequence of actions taken.
•This sequence forms a path from the root node to the goal node.
Edges Sometimes Have Associated Costs
•Each action may have a cost (time, distance, effort, etc.).
•The total cost of a solution is the sum of edge costs along the path.
States Resulting from an Operator are Children
•Applying an operator (action) to a state generates new states.
•These newly generated states are called child nodes of the current node.

04-02-2026 SREC-MECH 1
Types of Search Strategies

04-02-2026 SREC-MECH 1
Uninformed Search Strategies

04-02-2026 SREC-MECH 1
Uninformed Search Strategies

04-02-2026 SREC-MECH 1
Uninformed Search Strategies

04-02-2026 SREC-MECH 1
Types of Search Strategies

04-02-2026 SREC-MECH 1
Uninformed Search
Strategies

04-02-2026 SREC-MECH 1
Uninformed Search Strategies

🔹 What is Uninformed Search? 🔹 Key Characteristics


•The algorithm knows only: •No heuristics are used
• Initial state •Systematic exploration of the search
• Possible actions tree
• Goal test •May explore many unnecessary
• Path cost (if any) states
•It has no information about how close a state •Guaranteed to find a solution only in
is to the goal. some strategies

Advantages Disadvantages
•Simple to implement •Time and space inefficient
•No need for problem-specific knowledge •Not suitable for large or complex
•Guaranteed completeness in BFS and UCS search spaces

04-02-2026 SREC-MECH 1
Breadth-first Search

Characteristics of BFS
🔹 How BFS Works •Explores nodes level-wise
•Starts from the initial state (root node) •Guarantees shortest path in unweighted
•Expands all immediate children first graphs
•Then moves to nodes at the next depth •Always finds a solution if one exists
•Uses a FIFO queue data structure (complete)
•Requires large memory

Algorithm Steps (Simple) Advantages


[Link] the root node into a queue •Finds the optimal solution (minimum
[Link] the front node from the queue number of steps)
[Link] if it is the goal state •Complete and systematic
[Link] not, generate all its child nodes
[Link] the children to the queue
[Link] until the goal is found or queue is Disadvantages
empty •High space complexity
•Not suitable for very large search spaces

04-02-2026 SREC-MECH 1
Breadth-first Search

04-02-2026 SREC-MECH 1
Breadth-first Search

04-02-2026 SREC-MECH 1
Breadth-first Search

A fringe, which is a data structure used to store all the


possible states (nodes) that you can go from the current
states
04-02-2026 SREC-MECH 1
Breadth-first Search

04-02-2026 SREC-MECH 1
Breadth-first Search

04-02-2026 SREC-MECH 1
Breadth-first Search

Fringe : F G H I J K L (FIFO)

04-02-2026 SREC-MECH 1
Breadth-first Search

04-02-2026 SREC-MECH 1
Breadth-first Search

04-02-2026 SREC-MECH 1
Breadth-first Search

04-02-2026 SREC-MECH 1
Breadth-first Search

04-02-2026 SREC-MECH 1
Breadth-first Search

04-02-2026 SREC-MECH 1
Breadth-first Search

04-02-2026 SREC-MECH 1
Breadth-first Search

04-02-2026 SREC-MECH 1
Breadth-first Search

04-02-2026 SREC-MECH 1
Performance Measures

Time Complexity: Time Complexity of BFS algorithm can be


obtained by the number of nodes traversed in BFS until the shallowest
Node. Where the d= depth of shallowest solution and b is a node at
every state.

Space Complexity: Space complexity of d


BFS algorithm is given by
the Memory size of frontier which is O(b ).

Completeness: BFS is complete, which means if the shallowest goal


node is at some finite depth, then BFS will find a solution.

Optimality: BFS is optimal if path cost is a non-decreasing function of


the depth of the node.

04-02-2026 SREC-MECH 1
Advantages & Disadvantages

Advantages:
•BFS will provide a solution if any solution exists.
•If there is more than one solution 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.

04-02-2026 SREC-MECH 1
Applications of BFS

Shortest Path Finding:


BFS is used in navigation systems to find the shortest route
between two locations when all paths have equal cost.
Social Networks:
BFS helps in finding friends, friends-of-friends, and degrees of
separation between users.
Web Crawling:
Search engines use BFS to crawl web pages layer by layer, starting
from a given webpage and visiting all linked pages systematically.
Customer Support Call Routing
Calls are handled in the order received (FIFO queue).

04-02-2026 SREC-MECH 1
Depth-first Search

Characteristics of DFS
How DFS Works •Explores one path fully before trying
•Starts from the initial (root) node others
•Expands the deepest unexpanded node first •Requires less memory than BFS
•When a dead end is reached, it backtracks •Does not guarantee shortest path
•Uses a stack (LIFO) or recursion
Advantages
•Low space requirement
Algorithm Steps (Simple) •Easy to implement using recursion
[Link] at the root node •Useful for problems involving
[Link] a node and mark it explored backtracking
[Link] one child and continue deeper
[Link] no child exists, backtrack to the previous Disadvantages
node •Not complete in infinite-depth spaces
[Link] until the goal is found or all nodes •Not optimal
are explored •Can get stuck exploring a deep but
irrelevant path

04-02-2026 SREC-MECH 1
Depth-first Search

04-02-2026 SREC-MECH 1
Depth-first Search

04-02-2026 SREC-MECH 1
Depth-first Search

04-02-2026 SREC-MECH 1
Depth-first Search

04-02-2026 SREC-MECH 1
Depth-first Search

04-02-2026 SREC-MECH 1
Depth-first Search

04-02-2026 SREC-MECH 1
Depth-first Search

04-02-2026 SREC-MECH 1
Depth-first Search

04-02-2026 SREC-MECH 1
Depth-first Search

04-02-2026 SREC-MECH 1
Performance Measures Depth-first Search

Completeness: DFS search algorithm is complete within finite state


space
Time Complexity: Time complexity of DFS will be equivalent to the
node traversed by the algorithm. It is given by:

Where, m= maximum depth of any node and this can be much


larger than d (Shallowest solution depth)
Space Complexity: DFS algorithm needs to store only single path
from the root node, hence space complexity of DFS is equivalent to the
size of the fringe set, which is O(bm).
Optimal: DFS search algorithm is non-optimal, as it may generate a
large number of steps or high cost to reach to the goal node.

04-02-2026 SREC-MECH 1
Advantages & Disadvantages
Depth-first Search

Advantages:
•DFS requires very little memory as it only needs to store a stack
of the nodes on the path from the root node to the current node.
•It takes less time to reach the goal node than the BFS algorithm
[which is explained later](if it traverses in the right path).

Disadvantages:
•There is the possibility that many states keep reoccurring, and
there is no guarantee of finding the solution.
•The DFS algorithm goes for deep down searching and sometimes
it may go to the infinite loop.

04-02-2026 SREC-MECH 1
Uniform Cost Search(UCS)
Uniform Cost Search (UCS) is an uninformed search strategy that expands the node with
the lowest path cost from the initial state.
Algorithm Steps (Simple)
How UCS Works [Link] the start node into a priority
•Starts from the initial (root) node. queue with cost 0
•Maintains a priority queue ordered by path [Link] the node with the lowest path
cost. cost
•At each step: [Link] it is the goal, return the solution
• Remove the node with the lowest cost. [Link], expand the node and update
• Expand it and add its children with costs of children
updated costs. [Link] until goal is found or queue is
•Stops when the goal node is removed from empty
the queue.
Advantages
Characteristics of UCS •Guarantees optimal solution
•Complete: Yes (if step costs are positive) •Suitable for weighted graphs
•Optimal: Yes (always finds least-cost path) Disadvantages
•Uses priority queue instead of stack or •High time and space complexity
FIFO queue •Slower than BFS if costs vary widely
04-02-2026 SREC-MECH 1
Uniform Cost Search(UCS)

04-02-2026 SREC-MECH 1
Uniform Cost Search(UCS)

04-02-2026 SREC-MECH 1
Performance Measures
Uniform Cost Search(UCS)
Completeness:
Uniform-cost search is complete, such as if there is a solution, UCS will find it.

Time Complexity:
Let C* is Cost of the optimal solution, and ε is each step to get closer to the
goal node. Then the number of steps is = C*/ε+1. Here we have taken +1, as we
start from state 0 and end to C*/ε.
Hence, the worst-case time complexity of Uniform-cost search is O(b1 + [C*/ε])/.

Space Complexity:
The same logic is for space1 complexity
+ [C*/ε]
so, the worst-case space complexity of
Uniform-cost search is O(b ).

Optimal:
Uniform-cost search is always optimal as it only selects a path with the lowest
path cost.

04-02-2026 SREC-MECH 1
Advantages & Disadvantages
Uniform Cost Search(UCS)

Advantages:
•Uniform cost search is optimal because at every state the path
with the least cost is chosen.

Disadvantages:
•It does not care about the number of steps involved in searching
and only concerned about path cost. Due to which this algorithm
may be stuck in an infinite loop.

04-02-2026 SREC-MECH 1
Advantages & Disadvantages
Uniform Cost Search(UCS)

Advantages:
•Uniform cost search is optimal because at every state the path
with the least cost is chosen.

Disadvantages:
•It does not care about the number of steps involved in searching
and only concerned about path cost. Due to which this algorithm
may be stuck in an infinite loop.

04-02-2026 SREC-MECH 1
Depth Limited Search(DLS)

• DLS is an uninformed search algorithm. This is similar to DFS but differs


only in a few ways.
• The sad failure of DFS is alleviated by supplying a depth-first search with a
predetermined depth limit.
• That is, nodes at depth are treated as if they have no successors. This
approach is called a depth-limited search.
• The depth limit solves the infinite-path problem.
• Depth-limited search can be halted in two cases:
Standard Failure Value(SFV): The SFV tells that there is no
solution to the problem.
Cutoff Failure Value(CFV): The Cutoff Failure Value tells that there
is no solution within the given depth-limit.

04-02-2026 SREC-MECH 1
Depth Limited Search(DLS)

04-02-2026 SREC-MECH 1
Performance Measures
Depth Limited Search(DLS)

Completeness: DLS search algorithm is complete if the solution


is above the depth-limit.

Time Complexity: Time complexity of DLS algorithm is O(bℓ).

Space Complexity: Space complexity of DLS algorithm is


O(b×ℓ).

Optimal: Depth-limited search can be viewed as a special case of


DFS, and it is also not optimal even if ℓ>d.

04-02-2026 SREC-MECH 1
Advantages & Disadvantages
Depth Limited Search(DLS)

Advantages:
Depth-limited search is Memory efficient.

Disadvantages:
The DLS has disadvantages of completeness and is not optimal if
it has more than one goal state.

04-02-2026 SREC-MECH 1
Iterative Deepening Depth First Search
(IDDFS)

• The iterative deepening algorithm is a combination of DFS and


BFS algorithms.
• This search algorithm finds out the best depth limit and does it by
gradually increasing the limit until a goal is found.
• This algorithm performs depth-first search up to a certain "depth
limit", and it keeps increasing the depth limit after each iteration
until the goal node is found.
• This Search algorithm combines the benefits of Breadth-first
search's fast search and depth-first search's memory efficiency.
• The iterative search algorithm is useful uninformed search when
search space is large, and depth of goal node is unknown.

04-02-2026 SREC-MECH 1
Iterative Deepening Depth First Search
(IDDFS)

04-02-2026 SREC-MECH 1
Performance Measures
(IDDFS)

Completeness:
This algorithm is complete if the branching factor is finite.

Time Complexity:
Let's suppose b is the branching factor and depth is d then the worst-case time
complexity is O(bd).

Space Complexity:
The space complexity of IDDFS will be O(bd).

Optimal:
IDDFS algorithm is optimal if path cost is a non- decreasing function of the depth of
the node.

04-02-2026 SREC-MECH 1
Advantages & Disadvantages
(IDDFS)

Advantages:
It combines the benefits of BFS and DFS search algorithms in
terms of fast search and memory efficiency.

Disadvantages:
The main drawback of IDDFS is that it repeats all the work from
the previous phase.

04-02-2026 SREC-MECH 1
Bidirectional Search Algorithm

• 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.

04-02-2026 SREC-MECH 1
Bidirectional Search Algorithm
Performance Measures

Completeness:
Bidirectional Search is complete if we use BFS in both searches

Time Complexity:
Time complexity of bidirectional search using BFS is O(bd/2)

Space Complexity:
Space complexity of bidirectional search is O(bd/2)

Optimal:
Bidirectional search is Optimal

04-02-2026 SREC-MECH 1
Bidirectional Search Algorithm
Advantages & Disadvantages

Advantages:
Since BS uses various techniques like DFS, BFS, DLS, etc, it is
efficient and requires less memory.

Disadvantages:
Implementation of the bidirectional search tree is difficult.
In bidirectional search, one should know the goal state in
advance.

04-02-2026 SREC-MECH 1
Bidirectional Search Algorithm
Advantages & Disadvantages

Advantages:
Since BS uses various techniques like DFS, BFS, DLS, etc, it is
efficient and requires less memory.

Disadvantages:
Implementation of the bidirectional search tree is difficult.
In bidirectional search, one should know the goal state in
advance.

04-02-2026 SREC-MECH 1
Informed Search Algorithms

• Uninformed search algorithms which looked through search space


for all possible solutions of the problem without having any
additional knowledge about search space.
• Informed search algorithm contains an array of knowledge such as
how far we are from the goal, path cost, how to reach to goal
node, etc.
• This knowledge help agents to explore less to the search space and
find more efficiently the goal node.
• Informed search algorithm is more useful for large search space
• Informed search algorithm uses the idea of heuristic, so it is also
called Heuristic search.

04-02-2026 SREC-MECH 1
Heuristics

• Heuristics function: Heuristic is a function which is used in


Informed Search, and it finds the most promising path.
• It takes the current state of the agent as its input and produces the
estimation of how close agent is from the goal.
• The heuristic method, however, might not always give the best
solution, but it guaranteed to find a good solution in reasonable
time.
• It is represented by h(n), and it calculates the cost of an optimal
path between the pair of states.
• The value of the heuristic function is always positive.
• Admissibility of the heuristic function is given as h(n) <= h*(n)
• Here h(n) is heuristic cost, and h*(n) is the estimated cost. Hence
heuristic cost should be less than or equal to the estimated cost.

04-02-2026 SREC-MECH 1
Pure heuristic search

Pure heuristic search is the simplest form of heuristic search algorithms. It


expands nodes based on their heuristic value h(n). It maintains two lists,
OPEN and CLOSED list.

In the CLOSED list, it places those nodes which have already expanded
and in the OPEN list, it places nodes which have yet not been expanded.

On each iteration, each node n with the lowest heuristic value is expanded
and generates all its successors and n is placed to the closed list. The
algorithm continues until a goal state is found.

Two main algorithms which are used in informed search are


• Best First Search Algorithm(Greedy search)
• A* Search Algorithm

04-02-2026 SREC-MECH 1
Example-1

04-02-2026 SREC-MECH 1
Example-Contd..

Letter h(n) h*(n)


B 4 2
F 2 1
G 0 3
Total Cost 6 6
h(n)=h*n

04-02-2026 SREC-MECH 1
Best-first Search Algorithm
(Greedy Search)

• Greedy best-first search algorithm always selects the path which appears
best at that moment.
• It is the combination of depth-first search and breadth-first search
algorithms.
• It uses the heuristic function and search.
• Best-first search allows us to take the advantages of both algorithms.
• With the help of best-first search, at each step, we can choose the most
promising node.
• In the best first search algorithm, we expand the node which is closest to
the goal node and the closest cost is estimated by heuristic function, i.e.
f(n)= h(n),where f(n)=evaluation function, h(n)=heuristic function.
• The greedy best first algorithm is implemented by the priority queue.

04-02-2026 SREC-MECH 1
Best-first Search Algorithm
(Greedy Search)

Step 1: Place the starting node into the OPEN list.


Step 2: If the OPEN list is empty, Stop and return failure.
Step 3: Remove the node n, from the OPEN list which has the lowest value
of h(n), and places it in the CLOSED list.
Step 4: Expand the node n, and generate the successors of node n.
Step 5: Check each successor of node n, and find whether any node is a goal
node or not. If any successor node is goal node, then return success and
terminate the search, else proceed to Step 6.
Step 6: For each successor node, algorithm checks for evaluation function
f(n), and then check if the node has been in either OPEN or CLOSED list. If
the node has not been in both list, then add it to the OPEN list.
Step 7: Return to Step 2.

04-02-2026 SREC-MECH 1
Advantages & Disadvantages
Greedy Search

Advantages:
•Best first search can switch between BFS and DFS by gaining
the advantages of both the algorithms.
•This algorithm is more efficient than BFS and DFS algorithms.

Disadvantages:
•It can behave as an unguided depth-first search in the worst-case
scenario.
•It can get stuck in a loop as DFS.
•This algorithm is not optimal.

04-02-2026 SREC-MECH 1
Example 1
Greedy Search

04-02-2026 SREC-MECH 1
Example 1
Greedy Search

04-02-2026 SREC-MECH 1
Example 1
Greedy Search

04-02-2026 SREC-MECH 1
Example 2
Greedy Search

Expand the nodes of S and put in the CLOSED list


Initialization :Open [A, B], Closed [S]
Iteration1 :Open [A], Closed [S, B]
Iteration2 :Open [E, F, A], Closed[S, B]
:Open [E, A], Closed [S, B, F]
Iteration3 :Open [I, G, E, A],
Closed [S, B, F]
:Open [I, E, A],
Closed [S, B, F, G]
Hence the final solution path will be:
S----> B----->F----> G

04-02-2026 SREC-MECH 1
Example 3
Greedy Search

04-02-2026 SREC-MECH 1
Example 3 Contd…
Greedy Search

04-02-2026 SREC-MECH 1
Example 3 Contd…
Greedy Search

04-02-2026 SREC-MECH 1
Example 3 Contd…
Greedy Search

04-02-2026 SREC-MECH 1
Example 3 Contd…
Greedy Search

04-02-2026 SREC-MECH 1
Example 3 Contd…
Greedy Search

City h(n) h*(n)


Sibiu 253 140
Fagaras 176 99
Bucharest 0 211
Total Cost 429 450
h(n)<h*n

04-02-2026 SREC-MECH 1
Example-4
Greedy Search

04-02-2026 SREC-MECH 1
Performance Measures
Greedy Search

Time Complexity:
The worst case time complexity of Greedy best first search is O(bm).

Space Complexity:
The worst case space complexity of Greedy best first search is O(bm).
Where, m is the maximum depth of the search space.

Complete:
Greedy best-first search is also incomplete, even if the given state space is
finite.

Optimal:
Greedy best first search algorithm is not optimal.

04-02-2026 SREC-MECH 1
A* Search Algorithm

• A* search is the most commonly known form of best-first


search.
• It uses heuristic function h(n), and cost to reach the node n
from the start state g(n).
• It has combined features of UCS and greedy best-first
search, by which it solve the problem efficiently.
• A* search algorithm finds the shortest path through the
search space using the heuristic function.
• This search algorithm expands less search tree and provides
optimal result faster.
• A* algorithm is similar to UCS except that it uses g(n)+h(n)
instead of g(n).

04-02-2026 SREC-MECH 1
A* Search Algorithm

In A* search algorithm, we use search heuristic as well as the cost to reach


the node. Hence, we can combine both costs as following, and this sum is
called as a fitness number.

At each point in the search space, only those node is expanded


which have the lowest value of f(n), and the algorithm terminates when
the goal node is found.
04-02-2026 SREC-MECH 1
A* Search Algorithm

Step1: Place the starting node in the OPEN list.


Step2: Check if the OPEN list is empty or not, if the list is empty then
return failure and stops.
Step3: Select the node from the OPEN list which has the smallest value of
evaluation function (g+h), if node n is goal node then return success and stop,
otherwise
Step4: Expand node n and generate all of its successors, and put n into the
closed list. For each successor n', check whether n' is already in the OPEN or
CLOSED list, if not then compute evaluation function for n' and place into
Open list.
Step5: Else if node n' is already in OPEN and CLOSED, then it should be
attached to the back pointer which reflects the lowest g(n’) value.
Step 6: Return to Step 2.

04-02-2026 SREC-MECH 1
A* Search Algorithm
Advantages & Disadvantages

Advantages:
• A* search algorithm is the best algorithm than other search
algorithms.
• A* search algorithm is optimal and complete.
• This algorithm can solve very complex problems.

Disadvantages:
• It does not always produce the shortest path as it mostly based
on heuristics and approximation.
• A* search algorithm has some complexity issues.
• The main drawback of A* is memory requirement as it keeps
all generated nodes in the memory, so it is not practical for
various large-scale problems.

04-02-2026 SREC-MECH 1
A* Search Algorithm
Example 1

The heuristic value of all states is given in the below table, calculate the
f(n) of each state using the formula f(n)= g(n) + h(n), where g(n) is the
cost to reach any node from start state.

04-02-2026 SREC-MECH 1
A* Search Algorithm
Example 1 Contd…

Path h(n) g(n) f(n)


S 5 0 5
S A 5 1 6
S G 5 10 15
S A B 3 1+2 6
S A C 3 1+1 5
S A C D 2 1+1+3 7
S A C G 2 1+1+4 8

Points to remember:
• A* algorithm returns the path which occurred first,
and it does not search for all remaining paths.
• The efficiency of A* algorithm depends on the
quality of heuristic.
• A* algorithm expands all nodes which satisfy the
condition f(n)

04-02-2026 SREC-MECH 1
A* Search Algorithm
Example 2

04-02-2026 SREC-MECH 1
A* Search Algorithm
Example 2 contd…

04-02-2026 SREC-MECH 1
A* Search Algorithm
Example 2 contd…

04-02-2026 SREC-MECH 1
A* Search Algorithm
Example 2 contd…

04-02-2026 SREC-MECH 1
A* Search Algorithm
Example 2 contd…

04-02-2026 SREC-MECH 1
A* Search Algorithm
Example 2 contd…

04-02-2026 SREC-MECH 1
A* Search Algorithm
Example 2 contd…

04-02-2026 SREC-MECH 1
A* Search Algorithm
Example 2 contd…

04-02-2026 SREC-MECH 1
A* Search Algorithm
Example 3

04-02-2026 SREC-MECH 1
A* Search Algorithm
Example 3 contd…

04-02-2026 SREC-MECH 1
A* Search Algorithm
Example 3 contd…

04-02-2026 SREC-MECH 1
A* Search Algorithm
Example 3 contd…

04-02-2026 SREC-MECH 1
A* Search Algorithm
Example 3 contd…

04-02-2026 SREC-MECH 1
A* Search Algorithm
Example 3 contd…

04-02-2026 SREC-MECH 1
A* Search Algorithm
Example 3 contd…

04-02-2026 SREC-MECH 1
A* Search Algorithm
Example 3 contd…

04-02-2026 SREC-MECH 1
A* Search Algorithm
Performance Measures
Complete:
A* algorithm is complete as long as: Branching factor is finite. Cost at every action is
fixed.
Optimal:
A* search algorithm is optimal if it follows below two conditions:
Admissible:
The first condition requires for optimality is that h(n) should be an admissible heuristic
for A* tree search. An admissible heuristic is optimistic in nature.
Consistency:
Second required condition is consistency for only A* graph-search. If the heuristic
function is admissible, then A* tree search will always find the least cost path.
Time Complexity:
The time complexity of A* search algorithm depends on heuristic function, and the
number of nodes expanded is exponential to the depth of solution d. So the time
complexity is O(b^d), where b is the branching factor.
Space Complexity:
The space complexity of A* search algorithm is O(b^d)

04-02-2026 SREC-MECH 1
A* Search Algorithm
Example 4

Find the most cost-effective path to reach from start state A to final state J
using A* Algorithm.

04-02-2026 SREC-MECH 1
A* Search Algorithm
Example 4(Solution)

04-02-2026 SREC-MECH 1
A* Search Algorithm
Example 5

04-02-2026 SREC-MECH 1
A* Search Algorithm
Example 5(Solution)

04-02-2026 SREC-MECH 1
A* Search Algorithm
Example 6

04-02-2026 SREC-MECH 1
A* Search Algorithm
Example 6(Solution)

04-02-2026 SREC-MECH 1
A* Search Algorithm
Example 6

Let A be the start node and H be the goal


node.

04-02-2026 SREC-MECH 1
A* Search Algorithm
Example 6(Solution)

04-02-2026 SREC-MECH 1

You might also like