= quanta.length - q.which;
        }

        for (var iter = 0; iter < maxIter; iter++) {
            var changeCount = 0;
            for (qi = 0; qi < quanta.length; qi++) {
                var q = quanta[qi];
                var changed = false;

                for (var i = 0; i < q.neighbors.length; i++) {
                    var q2 = q.neighbors[i].dest;
                    if (q2.reach > q.reach) {
                        q.reach = q2.reach;
                        changed = true;
                  