Implement random edge selection