You are on page 1of 5

Name: SMIT THAKORE Roll No.

: 21BCP370
Internal Assessment: 1: Unit 1 AI Semester: 6 Division: 6

Answer the following with appropriate diagrams where necessary.

1. Complete the following table with relevant analysis of the systems mentioned in first column.

System Performance Environment (E) Actuator (A) Sensor (S)


Measure (P)
Lego-based House Accuracy and Indoor, Robotic arm or - Cameras or
Design Assistance efficiency in controlled mechanism for computer vision
from available creating Lego- environme placing Legos for Lego detection
Legos based designs ntwith
Lego
components
Augmented Engagement, Virtual Display for visual Cameras for
reality learning outcomes environmen augmentation environment
environment t overlaid on perception
for the
toddler learning real world
Water Jug Optimality of Physical space Mechanism Sensors to detect
Problem Solution solution with water jugs forpouring water levels
water
between jugs
Tic tac toe Strategic Virtual or Mechanism Sensors for
decision- physical formoving detecting
making, board game player
win/loss for playing pieces moves
rates
Grass trimming Efficiency in grass Outdoor Mower blades or Sensors
robot cutting environmentwith cutting for
grass mechanism obstacle
detection,
navigation

2. Considering the generic search algorithm mentioned below complete the given table.

function Search(graph, start, goal):

0. Initialize

agenda = [ [start] ]

extended_list = []

while agenda is not empty:

1. path = agenda.pop(0) # get first element from agenda & return it


2. if is-path-to-goal(path, goal) return path

3. otherwise extend the current path if not already extended

for each connected node

make a new path (don't add paths with loops!)

4. add new paths from 3 to agenda and reorganize agenda

(algorithms differ here see table below)

Fail!

Search Algo Properties Type of Example Type of agent(s) What it


problems it of generally usingthe does with
can be problem algorithm agenda in
applicable to step 4
BFS Complete, Shortest pathin Finding Agents Add new
Optimal for un- weighted shortest exploring pathsto
un-weighted graphs path unknown the end of
graphs territory the queue
DFS Not complete,not Solving Maze Agents with Add new
optimal puzzles, solving, limited memory pathsto
finding gaming the front of
solutions trees the stack
Uniform Complete, Shortest pathwith Routing in Agents withcost- Add new
Cost optimal for varying edge costs networks awaredecisions pathsbased
non-negative on path
costs cost
Iterative Complete, Finding shortest Puzzle Memory Add new
Deepening Optimal for path solving constrained pathsup to
unit step agents a depth
Depth Not complete,not Finding AI game Agents withdepth- Add new
Limited optimal solutions playing restricted search pathsup to
Search within depth a depth
limit limit
Bidirectional Complete, Shortest pathin Network Memory Merge
Search optimal for certain cases routing, constrainedagents pathsfrom
some puzzle both
problems solving directions

3. Write an algorithm for bidirectional search


implementing BFS in both subtrees.
Input:
graph: A graph representation
start: The starting node
goal: The goal node

➢ Create empty forward_queue and backward_queue.


➢ Create empty sets forward_visited and backward_visited.
➢ Create empty dictionaries forward_parent and backward_parent.
➢ Set intersection_node to None.
➢ Bidirectional BFS(){
• While both forward_queue and backward_queue are not empty:
Forward BFS:
Dequeue a node node_forward from forward_queue.
Add node_forward to forward_visited.
If node_forward is in backward_visited:
Set intersection_node to node_forward.
Break the loop.
For each unvisited neighbor neighbor of node_forward:
Add neighbor to forward_queue.
Add neighbor to forward_visited.
Store node_forward as the parent of neighbor in forward_parent.
Backward BFS:
Dequeue a node node_backward from backward_queue.
Add node_backward to backward_visited.
If node_backward is in forward_visited:
Set intersection_node to node_backward.
Break the loop.
For each unvisited neighbor neighbor of node_backward:
Add neighbor to backward_queue.
Add neighbor to backward_visited.
Store node_backward as the parent of neighbor in backward_parent.

• Path Reconstruction (if intersection_node is found):

Create an empty list path.

Set current_node to intersection_node.

While current_node is not None:

Prepend current_node to path.

Set current_node to its parent in forward_parent.

Set current_node to the parent of intersection_node in backward_parent.

While current_node is not None:

Prepend current_node to path.


Set current_node to its parent in backward_parent.

• Return the path if found, otherwise return None

4. Comment on the requirement of Heuristic search


techniques. Mention its benefits and drawbacks as
compared to blind search techniques.
Benefits:

1. Efficiency Improvement:

Heuristic search techniques use domain-specific information, known as heuristics, to guide the
search efficiently.

2.Faster Convergence:

Heuristics help in focusing the search on promising areas, leading to faster convergence to the
goal state.

3.Adaptability to Problem Structure:

Heuristic techniques can adapt to the specific structure and characteristics of the problem

Drawbacks:

1.Incomplete Solutions:

Heuristic methods might not always find the optimal solution.

2.Sensitivity to Heuristic Quality:

The effectiveness of heuristic search depends on the quality of the heuristic function. 3.Difficulty
in Heuristic Design:

Designing effective heuristics can be challenging for certain problems.

5. Give the details to complete the following heuristic


search comparison table:
Technique Properties Required Performance What it does with
parameters Measures agenda in step 4 of
generic algo
mentioned in Q-2
Greedy Best Incomplete, fast Heuristic Time Adds new paths
FirstSearch function complexity, based on heuristic
Solution quality value only
Heuristic Complete ifconsistent, Heuristic Time Adds new paths
Search Efficient function complexity, based on heuristic
Solution quality value combined with
path cost
A* Search Complete, Heuristic Time Adds new paths
Optimal if function,Cost complexity, based on total
consistent, function Solution quality estimated cost
Efficient
Simulated Probabilistic, Temperature Time Accepts worse
complexity,

You might also like