modify random graph generator