Suppose we have a large directed graph, containing about 2000 nodes and about 10 edges per node. Now we need to achieve these goals as quickly as possible:
Find a random ring in this graph. The 'Random' means no matter how big the ring is, all the possible rings should be picked with the same probabilities.
After finding the random ring, we reverse this ring, which means this ring will be changed to another direction. Now how should we find a random ring on this new graph.
The step 1 and step 2 can be invoked for many times, please find a proper way to store the graph and find a random ring easily.