Im trying to generate a social network in networkx. To do this I want to use the barabasi_albert_graph network generator. I want to be able to generate the nodes separately in pandas so I can give them specific attributes, but then have the generator create the edges based on preferential attachment. Is this possible?
The documentation for the generator just explains how to generate based on numbers of nodes and edges like so
G = nx.barabasi_albert_graph(600, 2, seed=None)
The documentation for from_pandas_dataframe just shows how to create a graph from a dataframe with edges already like so
G =nx.from_pandas_dataframe(df2, 'nodes', 'edges', ['attributes'])
In more an exploratory way rather than "this code doesnt work", I need something like
G = nx.barabasi_albert_graph.from_pandas_dataframe()
The purpose of this is to generate a model of an organisational communication network. I need the nodes to have attributes of a hierarchy (department, job title, salary) but the edges to be created using preferential attachment.