AI Search Techniques Assignment
AI Search Techniques Assignment
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
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.
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.
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)