[Lemon-user] Selecting a random Node or Edge

Thomas Gorochowski tgorochowski at me.com
Sat Aug 20 19:06:38 CEST 2011


Hi there,

I am attempting to randomly select a Node and Edge in a graph, but cannot find any function to do this. The only work around I have found it is pick a random integer in the range 0 <= x < number of Nodes/Edges and then iterate through until I reach it. I have noticed there is an id() function, but am unsure if these will maintain sequential numbering as I do a lot of inserts and deletes.

Many thanks for the help,

Tom.

-- 
Thomas E. Gorochowski
University of Bristol, Centre for Complexity Sciences (BCCS)
http://www.chofski.co.uk, tgorochowski at me.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lemon.cs.elte.hu/pipermail/lemon-user/attachments/20110820/b9538bff/attachment.html>


More information about the Lemon-user mailing list