Last active
September 29, 2021 08:13
-
-
Save MJacobs1985/e50c48f056bf097e7c3efab93150959d to your computer and use it in GitHub Desktop.
Network Graphs for Epidemiology
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import networkx as nx | |
G = nx.Graph() | |
G.add_node(1) | |
nx.draw(G, with_labels=True, font_weight='bold', font_color='white', node_color='black', node_size=500) | |
G.add_nodes_from([2, 3]) | |
nx.draw(G, with_labels=True, font_weight='bold', font_color='white', node_color='black', node_size=500) | |
H = nx.path_graph(10) | |
G.add_nodes_from(H) | |
nx.draw(G, with_labels=True, font_weight='bold', font_color='white', node_color='black', node_size=500) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment