Module 2
Module 2
20ME224
AI for Mechanical Engineers
Semester - 6
B.E Mechanical Engineering
04-02-2026 SREC-MECH 1
VISION & MISSION OF THE INSTITUTE
04-02-2026 SREC-MECH 1
VISION AND MISSION OF THE DEPARTMENT
04-02-2026 SREC-MECH 1
PROGRAM EDUCATIONAL OBJECTIVES (PEOS)
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)
04-02-2026 SREC-MECH 1
Program Specific Outcomes (PSOs)
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
KNOWLEDGE REPRESENTATION 8
Logical Agents - Knowledge based Agents -Propositional Logic- First Order Predicate
Calculus, Resolution Refutation Proofs and Answer Extraction.
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.
04-02-2026 SREC-MECH 1
Module 1
AI Fundamentals
04-02-2026 SREC-MECH 1
Reflex Agent vs 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.
04-02-2026 SREC-MECH 1
Searching
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
04-02-2026 SREC-MECH 1
Example: Romania
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
04-02-2026 SREC-MECH 1
Example: 8-puzzle
04-02-2026 SREC-MECH 1
Example: 8-puzzle
04-02-2026 SREC-MECH 1
Example: 8-queens problem
04-02-2026 SREC-MECH 1
Sample Questions
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
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
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
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
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
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
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
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)
04-02-2026 SREC-MECH 1
Depth Limited Search(DLS)
04-02-2026 SREC-MECH 1
Performance Measures
Depth Limited Search(DLS)
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)
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
• The search stops when these two graphs intersect each other.
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
04-02-2026 SREC-MECH 1
Heuristics
04-02-2026 SREC-MECH 1
Pure heuristic search
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.
04-02-2026 SREC-MECH 1
Example-1
04-02-2026 SREC-MECH 1
Example-Contd..
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)
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
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
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
04-02-2026 SREC-MECH 1
A* Search Algorithm
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…
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
04-02-2026 SREC-MECH 1
A* Search Algorithm
Example 6(Solution)
04-02-2026 SREC-MECH 1