code: function(digraph, start) {
                  var _this = this;
                  this.edgeTo = [];
                  this.distTo = [];
                  this.distTo[start] = 0.0;
                  this.start = start;
                  this.top = new topological(digraph);
                  this.top.order().forEach(function(vertex){
                      _this.relaxVertex(digraph, vertex, _this);
                  });
              }
docs: 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.