randesu algorithm speedup
Bug #1011472 reported by
Eric Weese
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
igraph |
Fix Released
|
High
|
Gábor Csárdi |
Bug Description
In igraph_
*no /= size;
It seems like it would be faster to only count each subgraph once, which would also match the original specification of the RANDESU algorithm. It looks to me like this could be done by removing the
added[father] -= 1;
and
*no /= size;
lines. No changes other than deleting these two lines are necessary. It seems like the time required should be 1/N of the old time required.
Related branches
To post a comment you must log in.
Thanks for your report!
I'll need to look at this more carefully, because I already forgot the details of the algorithm and the implementation. Your fix seems to work when the cut probabilities are zero. If they are not zero, then some more changes are needed....
Will fix it asap. Thanks again!