|
From: | suvirbhargav |
Subject: | Re: [igraph] rewire till assortivity.degree reaches certain value. |
Date: | Tue, 23 Apr 2013 16:29:05 +0200 |
> How to i make it to move in one direction(either towards more positive orWell, you write your own rewiring function that strives to increase or decrease assortativity explicitly ;) The degree-preserving rewiring implemented in igraph does not care about assortativity at all.
> more negative) of values?
A (probably) slow way of doing what you want would be as follows:
1. Calculate the assortativity of your current graph.
2. Rewire your original graph using a small value for the "niter" parameter of rewire(); maybe try with niter=10 first.
3. Calculate the assortativity of the rewired graph. If it went in the desired direction, keep the rewired graph and go back to the previous step to keep on rewiring. Otherwise, keep the original graph before the last rewiring step and try again from step 2.
The reason why I'm saying that it's probably slow is because there is a constant overhead associated with the rewire() call since it makes a copy of your graph (this is the standard way of doing things in R). If your graph is large, the cost of copying will dominate the cost of making a single rewiring step.
--
T.
_______________________________________________
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help
[Prev in Thread] | Current Thread | [Next in Thread] |