Question: I'm trying to find an efficient algorithm to generate a simple connected graph with given the number of nodes. Something like:

```
Input:
    N - size of generated graph
Output:
    simple connected graph G(v,e) with N vertices and S edges, The number of edges should be uniform distribution.

```

Answer: 
You might want to create a minimal spanning tree first to ensure connectivity. Later, randomly generate two nodes (which are not yet connected) and connect them. Repeat until you have S edges.

For minimal spanning tree, the easiest thing to do is start with a random node as tree. For every remaining node (ordered randomly), connect it to any node in the tree. The way you select the node within the tree (to connect to) defines the distribution of edges/node.
A very common random graph generation algorithm (used in many academic works) is based on RMat method, or a generalization in the form of Kronecker graphs. It's a simple, iterative process, that uses very few parameters and is easily scalable.

There's a really good explanation here (including why it's better than other methods) - 
<http://www.graphanalysis.org/SIAM-PP08/Leskovic.pdf>

There are versions of both implemented in many graph benchmark suites, for e.g. 

* BFS benchmark with a subdir with rMat generator - <http://www.cs.cmu.edu/~pbbs/benchmarks/breadthFirstSearch.tar>
* Kronecker graph generator (both c and matlab codes included) - <http://www.graph500.org/sites/default/files/files/graph500-2.1.4.tar.bz2>