[Networkit] Static seeds for RNGs in NetworKit

Michael Hamann michael.hamann at kit.edu
Wed Feb 25 19:19:50 CET 2015


On Wednesday 25 February 2015 17:53:49, Patrick Bisenius wrote:
> last week I talked to Christian Staudt about static seeds for Aux::Random in
> NetworKit. [...]

I was thinking about exactly the same today as I'm currently evaluating a 
randomized algorithm and I want to get reproducible results. As I don't want 
to/cannot restart NetworKit after every experiment your solution doesn't work 
for me. However, I've implemented an alternative solution. You can find and 
review it in a pull request under 

Basically it uses a "seed generation" in order to keep track if the random 
number generator in a certain thread has already been updated after the last 
time the seed has been set. Whenever getURNG is called, this is checked. So 
after calling setSeed, all calls to getURNG will return a correctly 
initialized URNG. The URNG for the current thread is directly updated.

If this pull request (or a similar change) is merged we should also make sure 
that test cases make use of setSeed whenever it is appropriate.


More information about the NetworKit mailing list