Implement random graph generation