0% found this document useful (0 votes)
2 views

AI Search Techniques Assignment

The document outlines an assignment for CS2203: Artificial Intelligence, focusing on simulating a pandemic outbreak using the Breadth-First Search (BFS) algorithm. Students are required to analyze the spread of the Crimson Plague in a town represented as a grid, track infections and deaths, and output the timeline of the outbreak. Additional tasks include considering multiple infection sources, vaccination programs, and resource allocation effects on the death toll.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

AI Search Techniques Assignment

The document outlines an assignment for CS2203: Artificial Intelligence, focusing on simulating a pandemic outbreak using the Breadth-First Search (BFS) algorithm. Students are required to analyze the spread of the Crimson Plague in a town represented as a grid, track infections and deaths, and output the timeline of the outbreak. Additional tasks include considering multiple infection sources, vaccination programs, and resource allocation effects on the death toll.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

CS2203: Artificial Intelligence

BFS
Date: 21/01/2025​ ​ ​ ​ ​ ​ ​ ​ Max Marks: 30
Deadline: 27/01/2025

Instructions:
1.​ The assignment should be completed and uploaded by the deadline.
2.​ Please make a detailed report in PDF format for the assignment.
3.​ Markings will be based on the correctness and soundness of the outputs. Marks
will be deducted in case of plagiarism.
4.​ Proper indentation and appropriate comments are mandatory.
5.​ You should zip all the required files and name the zip file as:
roll_no_of_all_group_members.zip , eg. 2301cs11_2301cs03_2321cs05.zip.
6.​ Upload your assignment (the zip file) in the following link:
https://tinyurl.com/4sdaaamb
For any queries regarding this assignment, you can contact:
Utsav Kumar ([email protected])
—------------------------------------------------------------------------------------------------------------------
The Outbreak: A Pandemic Simulation

The Tale of the Crimson Plague

In the distant town of Epidemica, an outbreak of the Crimson Plague has begun. The infection
starts with just one person, spreading rapidly with each passing hour. Once infected, individuals
have only a limited time before succumbing to the illness. The town leaders, desperate to save as
many lives as possible, have called upon you, the renowned AI epidemiologist, to analyze the
outbreak's progression and predict the number of deaths over time.

Your mission is to use the Breadth-First Search (BFS) algorithm to simulate the spread of the
disease and calculate the death toll at each time step.

The Town Map

The town is represented as a N x M grid:

●​ Each cell represents a house.


●​ 0: Healthy and uninfected.
●​ 1: Infected person.
●​ X: Impassable (e.g., a wall or barrier).
The infection spreads from an infected person (1) to their healthy neighbors (0) in the next time
step. Neighbors are those directly above, below, left, or right—diagonal spread is not allowed.
An infected person dies after a fixed number of time steps D (e.g., 3 steps).

Input: First take 3 integers N, M and D as input. Where N represents the number of rows in the maze and
M represents the number of columns in the maze and An infected person dies after a fixed number of
time steps D. Then take N x M input to make a grid.

Output:
●​ Track Infections and Deaths: At each time step:
○​ Infect healthy neighbors.
○​ Track when infected individuals die.
●​ Output the Timeline: Print the state of the grid and the cumulative death toll at each time step.
●​ Termination: If there is no change in the Town Map in consecutive time steps.

Sample Input: N=5, M=5, D = 3

town = [
[0, 0, 1, 0, 0],
[0, 'X', 0, 'X', 0],
[0, 0, 0, 0, 0],
['X', 0, 0, 0, 'X'],
[0, 0, 0, 0, 0],
]

Sample Output:
Please visit the file to see the output:
https://docs.google.com/document/d/1YnsY_1k-2R6TekMLkZtVsMAD45hfGEw8d2v9RjI4ymw/edit?us
p=sharing

Questions:
●​ Single Infection Sources: First write code for a single infection point.
●​ Multiple Infection Sources: Add multiple starting infection points. Analyze how the outbreak
changes with multiple origins.
●​ What factors most influence the number of deaths (e.g., town size, barriers, initially infected
individuals, walls)? Please plot the graph between the factor vs time step to show the results.
●​ Vaccination Program: Introduce a "vaccinated" state (V) where individuals cannot be infected.
Modify the simulation to account for vaccinated individuals.
●​ Resource Allocation: Add Healer (H) to the grid that can "cure" nearby infected individuals and
make them healers. Simulate how hospitals impact the outbreak.
●​ How do factors (Vaccination Program, Resource Allocation) influence the number of deaths?
Please plot the graph between the factor vs time step to show the results.
●​ Variable Time to Death: Allow different individuals to have different times to death. Update the
BFS accordingly. (Optional)

You might also like