Skip to content

Commit

Permalink
(stochastic_local_search) shrink a pseudo random number range
Browse files Browse the repository at this point in the history
  • Loading branch information
shnarazk committed Oct 18, 2022
1 parent 8e78975 commit 0a55f1b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/cdb/sls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl StochasticLocalSearchIF for ClauseDB {
) -> (usize, usize) {
let mut returns: (usize, usize) = (0, 0);
let mut last_flip = self.num_clause;
let mut seed = 38_721_103;
let mut seed = 721_109;
for step in 1..=limit {
let mut unsat_clauses = 0;
// let mut level: DecisionLevel = 0;
Expand Down Expand Up @@ -58,9 +58,7 @@ impl StochasticLocalSearchIF for ClauseDB {
if unsat_clauses == 0 || step == limit {
break;
}
seed = (((((!seed % 10_000_000) * 11_304_001) % 22_003_811) ^ (!last_flip * seed))
% 31_754_873)
>> 4;
seed = ((((!seed * 1_304_003) % 2_003_819) ^ (!last_flip * seed)) % 3_754_873) >> 4;
if let Some(c) = target_clause {
let beta: f64 = 3.2 - 2.1 / (1.0 + unsat_clauses as f64).log(2.0);
// let beta: f64 = if unsat_clauses <= 3 { 1.0 } else { 3.0 };
Expand Down

0 comments on commit 0a55f1b

Please sign in to comment.