8 Dec
2004
8 Dec
'04
12:35 p.m.
Rui Carvalho wrote:
Hi,
I must be missing something basic as my use of random_vertex returns always the same vertex each time I run the code (which is listed below).
Sure, because the random number generator is initialized with the same seed on each invocation. You can seed it with current time or something like that. Note however, that you'll need to output the seed and have an option to specify it manually, if you want to be able to debug anything. If you're using random_vertex for some testing, I'd recommend not using seed and just running the tests several times. The sequence of vertices will be always the the same, but still sufficiently "random". - Volodya