The problem was loosely framed around disease spread on a graph, which sounds interesting, but the actual inputs, outputs, and rules were never clearly defined.
Clarify the problem scope first: whether to simulate step-by-step spread or compute aggregate metrics like total infected or peak infection time. Then choose an appropriate model (e.g., SIR, SI) and algorithm (BFS for discrete steps, or differential equations for continuous), and discuss trade-offs between simulation and analytical approaches.
Pro tip: Demonstrate adaptability by acknowledging that real-world disease spread involves uncertainty; propose a probabilistic model and discuss how to validate it with historical data or sensitivity analysis.
Ask questions to understand the desired output: simulation over time, final metrics, or both? Clarify network properties (directed/undirected, weighted), infection model (SI, SIR, SEIR), and time granularity.
Select a compartmental model (e.g., SIR) and an algorithm: BFS for discrete-time simulation, or numerical integration for continuous-time. Consider scalability for large networks.
Represent the network as an adjacency list. Maintain state for each node (susceptible, infected, recovered). Iterate over time steps, updating states based on infection probabilities and recovery rates.
Track metrics like total infected, peak infection, and basic reproduction number (R0). Validate the model with small test cases or known results.
Address scalability (e.g., using sampling for large graphs), uncertainty (stochastic vs deterministic), and potential optimizations (parallelization, approximate methods).
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.