 var thresh = neighbor.distance;
                var delta = i - which;
                if (delta > 0 && thresh < maxThreshold) {
                    var percent = delta * 100 / quanta.length;
                    var edge = [percent, i, which, q, neighbor]
                    branches.push(edge);
                }
            }
        }

        if (branches.length === 0) {
            return;
        }

        branches.sort(
            function (a, b) {
                return a[0] - b[0];
            }
