Skip to content

Commit

Permalink
Bnb tries fixed for examples (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
NeoZ666 authored Oct 23, 2024
1 parent eaad338 commit e7409cb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,16 +186,19 @@ fn bnb(
if acc_eff_value > match_parameters.target_for_match + match_parameters.match_range {
return None;
}

if acc_eff_value >= match_parameters.target_for_match {
return Some(selected_inputs.to_vec());
}

// Decrement of bnb_tries for every iteration
*bnb_tries -= 1;
// Capping the number of iterations on the computation
if *bnb_tries == 0 || depth >= inputs_in_desc_value.len() {
return None;
}

// Decrement of bnb_tries for every iteration
*bnb_tries -= 1;

if rng.gen_bool(0.5) {
// exploring the inclusion branch
// first include then omit
Expand Down

0 comments on commit e7409cb

Please sign in to comment.