Professional Documents
Culture Documents
Ai Exp3
Ai Exp3
Ai Exp3
EXPERIMENT NO. 3
Name :-
Class : T.E. COMPUTER SUB : A . I
Roll No :
Date of conductance : /0 /2024 Date of submission : / 0 /2024
******************************************************************
Program :-
while queue:
current_node, path = queue.popleft()
if current_node == goal:
return path
if path_result:
print(f"Path from {initial_node} to {goal_node}: {path_result}")
else:
print(f"No path found from {initial_node} to {goal_node}")
Program Output:-
Enter the initial node: A
Enter the goal node: F
Path from A to F: ['A', 'C', 'F']