d);
            if (count >= targetBranchCount) {
                break;
            }
        }
        jukeboxData.currentThreshold = jukeboxData.computedThreshold = threshold;
        postProcessNearestNeighbors(type);
        return count;
    }

    function postProcessNearestNeighbors(type) {
        removeDeletedEdges();

        if (jukeboxData.addLastEdge) {
            if (longestBackwardBranch(type) < 50) {
                insertBestBackwardBranch(type, jukeboxData.currentThreshold, 65);
        