|
318 | 318 | </li> |
319 | 319 | <li class="sidebar-item"> |
320 | 320 | <div class="sidebar-item-container"> |
| 321 | +<a class="sidebar-item-text sidebar-link" href="../chapters/53-epidemiology-computational.html"> |
| 322 | +<span class="menu-text"><span class="chapter-number">17</span> <span class="chapter-title">Models of Disease-Spread</span></span></a> |
| 323 | +</div> |
| 324 | +</li> |
| 325 | +<li class="sidebar-item"> |
| 326 | +<div class="sidebar-item-container"> |
321 | 327 | <a class="sidebar-item-text sidebar-link" href="../chapters/52-epidemiology.html"> |
322 | | -<span class="menu-text"><span class="chapter-number">17</span> <span class="chapter-title">Epidemic Models on Networks</span></span></a> |
| 328 | +<span class="menu-text"><span class="chapter-number">18</span> <span class="chapter-title">Epidemic Models on Networks</span></span></a> |
323 | 329 | </div> |
324 | 330 | </li> |
325 | 331 | </ul> |
@@ -398,7 +404,7 @@ <h3 class="anchored" data-anchor-id="networks-as-graphs">Networks as Graphs</h3> |
398 | 404 | </div> |
399 | 405 | </div> |
400 | 406 | <div class="page-columns page-full"><p>Here’s an example of a famous graph: the Zachary Karate Club. Each node represents a member of a university karate club, and each edge represents a friendly social relationship between them. This graph is supplied by <code>networkx</code>, the Python software package that we’ll use throughout these notes for network analysis. </p><div class="no-row-height column-margin column-container"><span class="margin-aside">The code in this collapsed cell imports packages and sets up various plotting options</span></div></div> |
401 | | -<div class="cell" data-execution_count="1" id="854434be"> |
| 407 | +<div class="cell" data-execution_count="1" id="94512ce7"> |
402 | 408 | <details class="code-fold"> |
403 | 409 | <summary>Show code</summary> |
404 | 410 | <div class="sourceCode cell-code" id="cb1"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><a aria-hidden="true" href="#cb1-1" tabindex="-1"></a><span class="im">from</span> matplotlib <span class="im">import</span> pyplot <span class="im">as</span> plt</span> |
@@ -698,7 +704,7 @@ <h4 class="anchored" data-anchor-id="creating-a-graph-dictionary">Creating a gra |
698 | 704 | </div> |
699 | 705 | </div></div></div> |
700 | 706 | <p>It’s also possible to “go backwards” and obtain the dictionary representation from the graph object using</p> |
701 | | -<div class="cell" data-execution_count="8" id="c782c7ed"> |
| 707 | +<div class="cell" data-execution_count="8" id="0ae5e1b9"> |
702 | 708 | <div class="sourceCode cell-code" id="cb9"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb9-1"><a aria-hidden="true" href="#cb9-1" tabindex="-1"></a>nx.to_dict_of_lists(G)</span></code><button class="code-copy-button" title="Copy to Clipboard"><i class="bi"></i></button></pre></div> |
703 | 709 | <div class="cell-output cell-output-display" data-execution_count="8"> |
704 | 710 | <pre><code>{1: [2], 2: [1, 3, 4], 3: [2, 4], 4: [2, 3]}</code></pre> |
|
0 commit comments