Skip to content

Support weighted maxsat#12

Open
AHartNtkn wants to merge 1 commit into
separate-preprocessingfrom
support-maxsat
Open

Support weighted maxsat#12
AHartNtkn wants to merge 1 commit into
separate-preprocessingfrom
support-maxsat

Conversation

@AHartNtkn
Copy link
Copy Markdown
Owner

@AHartNtkn AHartNtkn commented Oct 22, 2024

Add support for weighted maxsat and "must have" clauses.

  • Modify src/cnf.rs to handle weighted CNF files and "must have" clauses.

    • Add weight field to CNFClause struct.
    • Add must_clause_weight field to CNFFormula struct.
    • Update parse_dimacs_format to parse weight lines and assign weights to clauses.
    • Update apply_variable_mapping and normalize_variables to handle weights.
    • Update to_dimacs_format to include weight lines if present.
  • Modify src/main.rs to keep track of the best solution found within a specific amount of time.

    • Add time_limit option to Opts, StochOpts, and InterhOpts structs.
    • Add time limit handling in solve and batch functions.
    • Track the best solution and score during the simulation loop.
    • Return the best solution found within the time limit.

For more details, open the Copilot Workspace session.

Add support for weighted maxsat and "must have" clauses.

* Modify `src/cnf.rs` to handle weighted CNF files and "must have" clauses.
  - Add `weight` field to `CNFClause` struct.
  - Add `must_clause_weight` field to `CNFFormula` struct.
  - Update `parse_dimacs_format` to parse weight lines and assign weights to clauses.
  - Update `apply_variable_mapping` and `normalize_variables` to handle weights.
  - Update `to_dimacs_format` to include weight lines if present.

* Modify `src/main.rs` to keep track of the best solution found within a specific amount of time.
  - Add `time_limit` option to `Opts`, `StochOpts`, and `InterhOpts` structs.
  - Add time limit handling in `solve` and `batch` functions.
  - Track the best solution and score during the simulation loop.
  - Return the best solution found within the time limit.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/AHartNtkn/odesat?shareId=XXXX-XXXX-XXXX-XXXX).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant