How to create real random matrices representing real social network

1 visualización (últimos 30 días)
EllaD
EllaD el 1 de Abr. de 2020
Respondida: Ameer Hamza el 1 de Abr. de 2020
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!

Respuestas (1)

Ameer Hamza
Ameer Hamza el 1 de Abr. de 2020
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;

Categorías

Más información sobre Graph and Network Algorithms en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by