added a solution to randomly choose an edge. but it seems in poor performance, but may be in theory is correct (probability in choosing any edges is equal)