开发者

Python :How to generate a power law graph

I have installed networkx and matplotlib packages. How can I generate a power law graph based on degree correlation i.e. graphs with high or low deg开发者_如何学Pythonree of homophily


Have you looked at the examples on the Networkx site? This example might help you get started with this.

There are also a number of functions within Networkx which generate random graphs which will probably be helpful. Have a look for the random_powerlaw_tree(....) function detailed in the graph generators section of the documentation.


networkx.generators.barabasi_albert_graph will generate a graph according to the Barabasi-Albert model, which will have a power-law degree distribution.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜