vertices , we generate a graph as follows:
GivenGo through each pair of vertices
Flip a coin
If the coin is heads , create an edge between
Now, suppose we have two of these random graphs and . We want to determine if they are the same. Your task is to find the best case expected time of the most efficient algorithm we could come up with to do this.
The best case expected time can be said to satisfy
for some integer . Find .
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
We need to check the (un-ordered) pair of vertices ( v 1 , v 2 ) to find out whether they are consistent or not (i.e., an edge is present in both G 1 and G 2 or in none of them). We continue the search as long as they are consistent so far. The first time we find an inconsistency, we terminate the search and declare the graphs to be different.
Since at every checking, with probability 2 1 the search terminates, the expected running time of the algorithm is at most 1 × 2 1 + 2 × 2 2 1 + 3 × 2 3 1 + … = 2 , which is independent of n . Thus the expected running time is simply Θ ( 1 ) (note that any constant within the Θ ( ⋅ ) notation is absorbed). Hence a = 0 .