function findMinSlack() {
    var result,
        eSlack = Number.POSITIVE_INFINITY;
    minLen.forEach(function(mle /* minLen entry */) {
      if (remaining.has(mle.u) !== remaining.has(mle.v)) {
        var mleSlack = rankUtil.slack(g, mle.u, mle.v, mle.len);
        if (mleSlack < eSlack) {
          if (!remaining.has(mle.u)) {
            result = {
              treeNode: mle.u,
              graphNode: mle.v,
              len: mle.len,
              reversed: false,
              weight: mle.weight
            };
          } else {
            result = {
              treeNode: mle.v,
              graphNode: mle.u,
              len: -mle.len,
              reversed: true,
              weight: mle.weight
            };
          }
          eSlack = mleSlack;
        }
      }
    });

    return result;
  }
function findMinSlack() {
    var result,
        eSlack = Number.POSITIVE_INFINITY;
    minLen.forEach(function(mle ) {
      if (remaining.has(mle.u) !== remaining.has(mle.v)) {
        var mleSlack = rankUtil.slack(g, mle.u, mle.v, mle.len);
        if (mleSlack < eSlack) {
          if (!remaining.has(mle.u)) {
            result = {
              treeNode: mle.u,
              graphNode: mle.v,
              len: mle.len,
              reversed: false,
              weight: mle.weight
            };
          } else {
            result = {
              treeNode: mle.v,
              graphNode: mle.u,
              len: -mle.len,
              reversed: true,
              weight: mle.weight
            };
          }
          eSlack = mleSlack;
        }
      }
    });

    return result;
  }
function findMinSlack ( ) { var result , eSlack = Number . POSITIVE_INFINITY ; minLen . forEach ( function ( mle /* minLen entry */ ) { if ( remaining . has ( mle . u ) !== remaining . has ( mle . v ) ) { var mleSlack = rankUtil . slack ( g , mle . u , mle . v , mle . len ) ; if ( mleSlack < eSlack ) { if ( ! remaining . has ( mle . u ) ) { result = { treeNode : mle . u , graphNode : mle . v , len : mle . len , reversed : false , weight : mle . weight } ; } else { result = { treeNode : mle . v , graphNode : mle . u , len : - mle . len , reversed : true , weight : mle . weight } ; } eSlack = mleSlack ; } } } ) ; return result ; }
Finds the next edge with the minimum slack.
Finds the next edge with the minimum slack .