code: function getEdgeWeight(u, v){
      var weight = edgeWeights[encodeEdge(u, v)];
      return weight === undefined ? 1 : weight;
    }
docs: Gets the weight of the given edge. Returns 1 if no weight was previously set.