Question: Write PYTHON code to update infected status, infection rate and store the data by using the networkx pseudocode code and description below. import networkx as
Write PYTHON code to update infected status, infection rate and store the data by using the networkx pseudocode code and description below.

import networkx as nx G = nx.gnm_random_graph(15, 50) for i in range(0, 15): G.nodes[i]['infected'] = False # Person is not infected G.nodes[@]['infected'] = True # Choose the first infected person data = [] t = 0 tmax = 20 while t = 3: P becomes infected at the next time step (t+1). else P will remain healthy in the next time step. end end 11 IT II # Update the infected status # Calculate the infection rate for time step t and store the data t += 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
