How to create real random matrices representing real social network

조회 수: 2 (최근 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 CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by