In [2]:
import networkx as nx
import matplotlib as plt
%matplotlib inline
Exercício 01: Calcule a distância média, o diâmetro e o coeficiente de agrupamento das redes abaixo.
In [39]:
G1 = nx.erdos_renyi_graph(10,0.4)
nx.draw_shell(G1)
In [41]:
G2 = nx.barabasi_albert_graph(10,3)
nx.draw_shell(G2)
In [43]:
G3 = nx.barabasi_albert_graph(10,4)
nx.draw_shell(G3)
Exercício 02: Calcule a centralidade de grau, betweenness e pagerank dos nós das redes abaixo:
In [45]:
G4 = nx.barabasi_albert_graph(10,3)
plt.pyplot.figure(figsize=(10,10))
pos = nx.shell_layout(G4)
nx.draw_networkx_nodes(G4,pos);
nx.draw_networkx_edges(G4,pos);
nx.draw_networkx_labels(G4,pos);
plt.pyplot.axis('off')
Out[45]:
In [ ]:
In [ ]: