code: public void setWeight(int s, int t, double w) {
          DiEdge e = edge(s, t);
          assertEdge(e);
          weights.put(e, w);
      }
docs: Sets the weight of the edge s->t to be w if the edge is present,
  otherwise, an IndexOutOfBoundsException is thrown