relaxEdge (e) {
    const distTo = this.distTo
    const edgeTo = this.edgeTo
    const v = e.from(); const w = e.to()
    if (distTo[w] > distTo[v] + e.weight) {
      distTo[w] = distTo[v] + e.weight
      edgeTo[w] = e
    }
  }
The ShortestPathTree represents a data type for solving the
 single-source shortest paths problem in edge-weighted directed
 acyclic graphs (DAGs). The edge weights can be positive, negative, or zero.
 This implementation uses a topological-sort based algorithm.
 the distTo() and hasPathTo() methods take
 constant time and the pathTo() method takes time proportional to the
 number of edges in the longest path returned.