フィルターのクリア

How to create real random matrices representing real social network

1 回表示 (過去 30 日間)
EllaD
EllaD 2020 年 4 月 1 日
回答済み: Ameer Hamza 2020 年 4 月 1 日
Greetings and Salutations!
I'm looking to create a 1000 by 1000 matrix where it is somehow close to a real random social network. In this graph manyare somewhat have low degrees, there are a portion of nodes with very high degree (hubs). Now I'm not looking for exact results but rather some approximation.
I tried the simple code Ge=round(rand(n)) which is not helpful at all. Two main problems:
1)The avg degree it gives is around 700 and the min degree usually varies from 500 to 700, which is very high! (I'm looking to tone it down a bit)
2) Also the random matrices it gives seems like not that much different in different runs (in terms of avg degree, max degree and min degree.)
Any help is greatly appreciated.
Thank you and stay safe!

回答 (1 件)

Ameer Hamza
Ameer Hamza 2020 年 4 月 1 日
How do you define the degree of matrix in this context? You can control the average number of 1s in the matrix like this
M = rand(1000) < 0.1;
will have an average of 0.1.
Also see sprand which generate sparse matrix to save space since most of the numbers are zero
q = sprand(1000, 1000, 0.1) > 0;

カテゴリ

Help Center および File ExchangeGraph and Network Algorithms についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by