<p>We typically call this problem modelling contagion on a network, or epidemics on networks. Specifically you are trying to simulate an SIR model (read up on that).</p>
<p>There are several libraries on this you may want to check out:</p>
<ul>
<li>EoN <a href="https://arxiv.org/pdf/2001.02436.pdf" rel="nofollow noreferrer">https://arxiv.org/pdf/2001.02436.pdf</a></li>
<li>igraph</li>
<li>Netpidemix</li>
<li>epydemic</li>
<li>EpiModel</li>
<li>Graph-tool</li>
</ul>
<p>You may also want to clarify:</p>
<ul>
<li>What do you mean by the 'labelling of the graph'? Are you talking about time steps? This is confusing: &quot;what is the average number of infections that occurs in each possible labeling of the graph?&quot;</li>
<li>Are you using python or networkx or c++ ...?</li>
<li>Are you saying there is a 100% chance of infection if connected to node with status I? re &quot;If there is an edge between an I and V node., an infection occurs.&quot;</li>
</ul>
How to compute average number of infections in a graph?
<p>Hi I am working on a graph problem for a research project and I am curious how other people would approach the following problem.  Apologies if this is the wrong forum for posting this.</p>
<p>Say you have a graph G with. N nodes and E edges between the nodes (edges are bi directional / go both ways).</p>
<p>I is the number of nodes which are infected, V are the number of nodes which are vulnerable, and the rest of the nodes are R (resistant).  If there is an edge between an I and V node., an infection occurs.  Any other edges result in no infection.  Even if a V node is connected to many I nodes, it only counts as one infection.</p>
<p>Now, among all possible ways you can label the nodes, what is the average number of infections that occurs in each possible labeling of the graph?</p>