I wanted to open an issue to understand why `bnb_search` as [implemented](https://github.com/bitcoin/bitcoin/pull/10637) @achow101 does not terminate once an optimal search is found.  This behavior is evident I believe when inspecting the [test](https://github.com/bitcoin/bitcoin/blob/master/src/wallet/test/coinselector_tests.cpp#L178) which sets the target to `5` and uses the utxo pool `4,3,2,1`.  since combinations of `4` are evaluated first, the `bnb_search` finds an optimal solution of `4,1`.  However, instead of terminating when the `best_waste = 0` (no better solution can be found), the search continues and instead finds another solution `2,3` which also has a `best_waste = 0`.  Why not terminate once an optimal solution is found instead of continuing to search?
{
    out_set.clear();
    CAmount curr_value = 0;
    std::vector<bool> curr_selection; /
    curr_selection.reserve(utxo_pool.size());
    CAmount actual_target = not_input_fees + target_value;
    /
    CAmount curr_available_value = 0;
    for (const OutputGroup& utxo : utxo_pool) {
        /
        assert(utxo.effective_value > 0);
        curr_available_value += utxo.effective_value;
    }
    if (curr_available_value < actual_target) {
        return false;
    }
    /
    std::sort(utxo_pool.begin(), utxo_pool.end(), descending);
    CAmount curr_waste = 0;
    std::vector<bool> best_selection;
    CAmount best_waste = MAX_MONEY;
    /
    for (size_t i = 0; i < TOTAL_TRIES; ++i) {