Stay organized with collections
Save and categorize content based on your preferences.
C++ Reference: sat_proto_solver
Note: This documentation is automatically generated.
Solve the input MIP model with the SAT solver.
If possible, std::move the request into this function call to avoid a copy.
If you need to change the solver parameters, please use the EncodeSatParametersAsString() function below to set the request's solver_specific_parameters field.
The optional interrupt_solve can be used to interrupt the solve early. It must only be set to true, never reset to false. It is also used internally by the solver that will set it to true for its own internal logic. As a consequence the caller should ignore the stored value and should not use the same atomic for different concurrent calls.
The optional logging_callback will be called when the SAT parameter log_search_progress is set to true. Passing a callback will disable the default logging to INFO. Note though that by default the SAT parameter log_to_stdout is true so even with a callback, the logs will appear on stdout too unless log_to_stdout is set to false. The enable_internal_solver_output in the request will act as the SAT parameter log_search_progress.
The optional solution_callback will be called on each intermediate solution found by the solver. The solver may call solution_callback from multiple threads, but it will ensure that at most one thread executes solution_callback at a time.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-06 UTC."],[[["The primary function, `SatSolveProto`, is used to solve Mixed Integer Programming (MIP) models using the SAT solver within OR-Tools."],["Users can customize solver behavior by encoding parameters as a string using `EncodeSatParametersAsString` and setting the `solver_specific_parameters` field in the request."],["Optional features include early solve interruption using `interrupt_solve`, custom logging through `logging_callback`, and processing intermediate solutions via `solution_callback`."],["The `SatSolveProto` function accepts an `MPModelRequest` and returns an `absl::StatusOr\u003cMPSolutionResponse\u003e`, indicating either the solution or an error status."],["To avoid unnecessary copying, consider using `std::move` when passing the request to the `SatSolveProto` function."]]],["The `SatSolveProto` function solves a MIP model using a SAT solver, optionally moving the request to avoid copying. Solver parameters are set via `EncodeSatParametersAsString`. An `interrupt_solve` flag can prematurely halt solving; its value should only be set to true. A `logging_callback` function allows custom logging, while `solution_callback` processes intermediate solutions, ensuring single-threaded execution at a time. The enable_internal_solver_output acts as SAT parameter `log_search_progress`.\n"]]