Last active
December 14, 2015 00:39
-
-
Save brainstorm/5000205 to your computer and use it in GitHub Desktop.
NetworkX rich gets richer algorithm
This file contains 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
#!/usr/bin/env python | |
# http://rt.com/news/oxfam-report-global-inequality-357/ | |
# http://networkx.github.com/documentation/latest/reference/generated/networkx.generators.random_graphs.barabasi_albert_graph.html | |
import networkx as nx | |
import matplotlib.pyplot as plt | |
g = nx.Graph() | |
ba = nx.barabasi_albert_graph(15, 5) | |
er = nx.erdos_renyi_graph(15, 0.15) | |
nx.draw(ba) | |
plt.savefig("barabasi.png") | |
nx.draw(er) | |
plt.savefig("erdos.png") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment