generating a random graph