Skip to content

Instantly share code, notes, and snippets.

@MJacobs1985
Created September 29, 2021 08:15
Show Gist options
  • Save MJacobs1985/a8d010ade3e5b805f36c9782518dc1a5 to your computer and use it in GitHub Desktop.
Save MJacobs1985/a8d010ade3e5b805f36c9782518dc1a5 to your computer and use it in GitHub Desktop.
Network Graphs for Epidemiology
K_5 = nx.complete_graph(5)
nx.draw(K_5, with_labels=True, font_weight='bold', font_color='white', node_color='black', node_size=500, alpha=0.8, edge_color='orange')
K_3_5 = nx.complete_bipartite_graph(3, 5)
nx.draw(K_3_5, with_labels=True, font_weight='bold', font_color='white', node_color='black', node_size=500, alpha=0.8, edge_color='orange')
barbell = nx.barbell_graph(10, 10)
nx.draw(barbell , with_labels=True, font_weight='bold', font_color='white', node_color='black', node_size=500, alpha=0.8, edge_color='orange')
lollipop = nx.lollipop_graph(10, 20)
nx.draw(lollipop, with_labels=True, font_weight='bold', font_color='white', node_color='black', node_size=500, alpha=0.8, edge_color='orange')
er = nx.erdos_renyi_graph(100, 0.1)
nx.draw(er, with_labels=True, font_weight='bold', font_color='white', node_color='black', node_size=300, alpha=0.8, edge_color='orange')
ws = nx.watts_strogatz_graph(30, 3, 0.1)
nx.draw(ws, with_labels=True, font_weight='bold', font_color='white', node_color='black', node_size=300, alpha=0.8, edge_color='orange')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment