UNIT-1
UNIT-1
NOTES
Introduction to AI
APPLICATIONS OF AI
1. Healthcare
• Diagnostics: AI algorithms analyze medical images (e.g., X-rays, MRIs)
to identify diseases like cancer or fractures.
• Personalized Medicine: AI tailors treatments based on individual genetic
profiles.
• Robotic Surgery: Robots assist surgeons with precision.
• Drug Discovery: AI accelerates the identification of new drugs
End BFS
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.
• It also helps in finding the shortest path in goal state, since it needs all
nodes at the same hierarchical level before making a move to nodes at
lower levels.
• It is also very easy to comprehend with the help of this we can assign the
higher rank among path types.
Example:
End DFS
Advantage:
• DFS requires very less memory as it only needs to store a stack of the
nodes on the path from root node to the current node.
• It takes less time to reach to the goal node than BFS algorithm (if it
traverses in the right path).
• With the help of this we can stores the route which is being tracked in
memory to save time as it only needs to keep one at a particular time.
Return "Failure"
End DLS
End UCS
Example1:
The numbers written on edges represent the distance between the nodes.
The numbers written on nodes represent the heuristic value.
Find the most cost-effective path to reach from start state A to final state J using
A* Algorithm.
Solution-
Step-01:
• We start with node A.
• Node B and Node F can be reached from node A.
Path- A → F → G
Step-03:
Node I can be reached from node G.
A* Algorithm calculates f(I).
f(I) = (3+1+3) + 1 = 8
It decides to go to node I.
Path- A → F → G → I
Step-04:
Node E, Node H and Node J can be reached from node I.
A* Algorithm calculates f(E), f(H) and f(J).
• f(E) = (3+1+3+5) + 3 = 15
Algorithm:
Key Characteristics:
1. Greedy Approach: Always chooses the immediate best option.
2. Local Optimum: Can get stuck at a point that’s better than its neighbors
but not the best overall.
3. No Backtracking: Once a move is made, it doesn’t revisit previous states.
Generate Neighbors:
Move the queen in column 1 to rows 1, 2, 4, 5, 6, 7, 8.
Move the queen in column 2 to rows 1, 2, 3, 4, 5, 6, 8.
Repeat for all columns.
Evaluate Neighbors:
Suppose moving the queen in column 1 to row 2 results in [2, 7, 2, 8, 5, 1, 4, 6]
with 3 conflicts.
This is better than the current state (5 conflicts), so move to this state.
Repeat:
Continue generating and evaluating neighbors until no better state is found.
1. Define Variables
3. Apply Constraints