Dice algo for random node selection