Generating a Random Connected Graph

1.3k Views Asked by At

Given a graph G(V, E), with |V | = n and |E| = 0 (that is, the graph is empty), and a static set F containing all the possible edges. Consider the following algorithm for generating a random graph.

Input : Empty Graph G(V, E), set of all possible edges F

Output: A connected random graph G

While G is not connected do

    Sample an edge e from F uniformly at random
    E ← E ∪ e

end

What is the best bound on the expected number of samplings performed by the algorithm?