|
From: | anupam sinha |
Subject: | Re: [igraph] Randomizing weighted newtorks |
Date: | Sat, 1 Jun 2013 20:49:28 +0530 |
> I have a rather naive question to ask. How do you randomize a weighted network(edges are weighted)?Well, what do you want to achieve with randomization? Do you have any specific properties of the network that you wish to preserve during randomization? When you randomize an unweighted network, you typically wish to preserve the degree distribution -- is this the case here as well? Or do you want to preserve the *strength* of each node (i.e. the sum of weights of edges incident on each node)? Either way, igraph has no built-in support for weighted network randomization whatsoever, so you first have to decide what exactly you want to achieve and then code it yourself.
Two dead simple cases of randomization come to my mind that can be implemented relatively easily using the existing tools in igraph:
1. Keep the edges exactly as they are, but shuffle the weights around. This can be achieved by retrieving the weight vector of the edges, shuffling the weight vector, and re-assigning the shuffled copy to the edges. T
2. Shuffle the edges while preserving the degree distribution, and shuffle the weights as well. This is almost the same as case 1, but before re-assigning the shuffled copy, you also call the rewire() method of the graph (or call igraph_rewire if you are using the C core directly).
--
T.
_______________________________________________
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help
[Prev in Thread] | Current Thread | [Next in Thread] |