I have used the Barabasi-Albert model in networkx to generate a graph with n=200 and m=2. This gives me an undirected graph but I want a directed graph so that I can plot the in and out degree distributions. Would plotting the in and out degrees be possible?
This is my code:
N=200
m=2
G_barabasi=nx.barabasi_albert_graph(n=N,m=m)
An easy way is to use the
.to_directed
method on the existing graph: