public PogNode chooseNeighborWeighted_Fast(TreeQualifier qualifier, Random generator) {
        Node editedNode = null;
        boolean isAdded = false;
        if (addableList.isEmpty() && removableList.isEmpty()) { // this is a null node; choose a node to add from the whole dataset
            isAdded = true;
            Set<Node> entireNodeList = qualifier.entireNodeList();
            int chosenIndex = generator.nextInt(entireNodeList.size());
            int i = 0;
            for (Node n : entireNodeList) {
                if (i++ == chosenIndex) {
                    editedNode = n;
                    break;
                }
            }
        } else {
            double[] w = new double[addWeight.length + removeWeight.length];
            int j = 0;
            for (int i = 0; i < addWeight.length; i++){
                w[j++] = addWeight[i];
            }
            for (int i = 0; i < removeWeight.length; i++){
                w[j++] = removeWeight[i];
            }
            int chosenIndex = randomIndex(generator, w);
            if (chosenIndex < addWeight.length){ // add a vertex
                isAdded = true;
                editedNode = candidateArrayAdd[chosenIndex];
            } else { // remove a vertex
                editedNode = candidateArrayRemove[chosenIndex - addWeight.length];
            }
        }

        // create a node with the new infomation
        PogNode q = null;
        if (isAdded) {
            q = recalcInfoAdded(editedNode, qualifier);
        } else {
            q = recalcInfoRemoved(editedNode, qualifier);
        }

        if (q != null) {
            candidateEditedNode = editedNode;
        }
        return q;
    }