A random large connected undirected graph in JAVA with 5K vertices and D density is to be generated. But generating an edge between random V1 and a random V2 is taking a lot of time. I tried eliminating a created edge from the list of all possible edges and then selecting a random one from the remaining edges, but again it is taking a lot of time.
What do you think will be a fast way to generate the edges for the huge connected graph in a random fashion?