code: function random (nodes, edges, prefix) {
    prefix = prefix || '#'
    if(isNaN(+nodes)) throw new Error('nodes must be a number')
    if(isNaN(+edges)) throw new Error('edges must be a number')
  
    var n = 0, g = {}
  
    function rand(n) {
      return prefix+~~(Math.random()*n)
    }
  
    for(var i = 0; i < nodes; i++)
      addNode(g, prefix+i)
  
    for(var i = 0; i < edges; i++) {
      var a = rand(nodes), b = rand(nodes)
      addEdge(g, a, b)
      addEdge(g, b, a)
    }
  
    return g
  }
docs: graph generators