Git Product home page Git Product logo

Comments (3)

shnarazk avatar shnarazk commented on June 11, 2024

A Simple CDCL solver with CHB as the branching heuristic.

cited from: Liang, J. H., Ganesh, V., Poupart, P., & Czarnecki, K.: (Exponential Recency Weighted Average Branching Heuristic for SAT Solvers, 2016.

71564185-eec23500-2adf-11ea-91aa-690e65273e82

from splr.

shnarazk avatar shnarazk commented on June 11, 2024

Learning Rate Branching (LRB)

/// Called after a learnt clause is generated from conflict analysis
///  and before bracktrack.
fn after_conflict_analysis() {
  LEARNT_COUNT += 1;
  for v in conflict_side_vars + learnt_clause.vars {
    v.participated += 1;
  }
  // Reason Side Rate (RSR) extension
  for v in learnt_clause.vars.map(|v| v.reason).flatten() - learnt_clause.vars {
    v.reasoned += 1;
  }
  // locality extension
  for v in Vars {
    if !v.assign {
      v.Q *= 0.95;
    }
  }
  if 0.06 < 𝑎 {
    𝑎 -= 10E-6;
  }
}

/// Called when v is assigned by branching or propagation.
fn on_assign(v: Var) {
  v.assigned = LEARNT_COUNT;
  v.participated = 0;
  v.reasoned = 0;
}

/// Called when v is unassigned by backtracking or restart.
fn on_unassign(v: Var) {
  let interval = LEARNT_COUNT - v.assigned; // zero is possible due to restarts.
  if 0 < interval {
    let r = v.participated / interval;     // r is the Learning Rate (LR).
    let s = v.reasoned / interval;         // s is the RSL.
    v.Q = (1 - 𝑎) * v.Q + 𝑎 * (r + s);      // EMA style update.
  }
}

from splr.

shnarazk avatar shnarazk commented on June 11, 2024

It works well and landed on dev-0.2.2. Done.

from splr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.