index.js
function addEdge(u, v, weight){
    addNode(u);
    addNode(v);
    adjacent(u).push(v);

    if (weight !== undefined) {
      setEdgeWeight(u, v, weight);
    }

    return graph;
  }
function addEdge(u, v, weight){
    addNode(u);
    addNode(v);
    adjacent(u).push(v);

    if (weight !== undefined) {
      setEdgeWeight(u, v, weight);
    }

    return graph;
  }
function addEdge ( u , v , weight ) { addNode ( u ) ; addNode ( v ) ; adjacent ( u ) . push ( v ) ; if ( weight !== undefined ) { setEdgeWeight ( u , v , weight ) ; } return graph ; }
Adds an edge from node u to node v. Implicitly adds the nodes if they were not already added.
Adds an edge from node u to node v . Implicitly adds the nodes if they were not already added .