[jgrapht-developers] RandomGraphGenerator behavior
Brought to you by:
barak_naveh,
perfecthash
From: Charles F. <cf...@us...> - 2006-04-28 18:44:25
|
It seems to me that the RandomGraphGenerator specification is incorrect. It currently generates the same graph over and over on subsequent calls to generateGraph(), and I argue that it should rather produce (probably) different graphs on each call to generateGraph(). I don't recall any discussion about the class, but it may have occured before I joined the group. In any case, I need to extend RandomGraphGenerator, and I would very much like to see its specification improved. :-) The closest parallels that I can find in Java itself are Random and SecureRandom, which generate random numbers as opposed to random graphs. Their model is to construct a single instance of Random, and then to generate a (probably) different random number on each subsequent method invocation. It is possible to reseed the random number generator (or to seed the constructor) to obtain duplicible results. I argue that RandomGraphGenerator should do the same. It should be possible to construct an instance either with or without specifying a seed, and then to reseed the instance at will. But between reseedings, succesive calls to generateGraph should create (probably) different graphs. I also propose that RandomGraphGenerator be turned into an interface (following the specification outlined above, which I would be glad to turn into code), which could then be implemented by the current generator, as well as the currently experimental UniformRandomGraphGenerator and PartiteRandomGraphGenerator (shouldn't that be Bipartite?), in addition to some new RandomGraphGenerators that I plan to write (RegularRandomGraphGenerator and MOutRandomGraphGenerator to begin with, though PreferentialAttachmentRandomGraphGenerator would be nice, if not verbosely named). Charles -- My job is Keeping faces clean And nobody knows De stubble I've seen Burma-Shave http://burma-shave.org/jingles/1950/my_job_is |