1// Copyright 2010-2025 Google LLC
2// Licensed under the Apache License, Version 2.0 (the "License");
3// you may not use this file except in compliance with the License.
4// You may obtain a copy of the License at
6// http://www.apache.org/licenses/LICENSE-2.0
8// Unless required by applicable law or agreed to in writing, software
9// distributed under the License is distributed on an "AS IS" BASIS,
10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11// See the License for the specific language governing permissions and
12// limitations under the License.
17package operations_research.sat;
19option csharp_namespace = "Google.OrTools.Sat";
20option go_package = "github.com/google/or-tools/ortools/sat/proto/satparameters";
21option java_package = "com.google.ortools.sat";
22option java_multiple_files = true;
24// Contains the definitions for all the sat algorithm parameters and their
28message SatParameters {
29 // In some context, like in a portfolio of search, it makes sense to name a
30 // given parameters set for logging purpose.
31 optional string name = 171 [default = ""];
33 // ==========================================================================
34 // Branching and polarity
35 // ==========================================================================
37 // Variables without activity (i.e. at the beginning of the search) will be
38 // tried in this preferred order.
40 IN_ORDER = 0; // As specified by the problem.
44 optional VariableOrder preferred_variable_order = 1 [default = IN_ORDER];
46 // Specifies the initial polarity (true/false) when the solver branches on a
47 // variable. This can be modified later by the user, or the phase saving
50 // Note(user): POLARITY_FALSE is usually a good choice because of the
51 // "natural" way to express a linear boolean problem.
57 optional Polarity initial_polarity = 2 [default = POLARITY_FALSE];
59 // If this is true, then the polarity of a variable will be the last value it
60 // was assigned to, or its default polarity if it was never assigned since the
61 // call to ResetDecisionHeuristic().
63 // Actually, we use a newer version where we follow the last value in the
64 // longest non-conflicting partial assignment in the current phase.
66 // This is called 'literal phase saving'. For details see 'A Lightweight
67 // Component Caching Scheme for Satisfiability Solvers' K. Pipatsrisawat and
68 // A.Darwiche, In 10th International Conference on Theory and Applications of
69 // Satisfiability Testing, 2007.
70 optional bool use_phase_saving = 44 [default = true];
72 // If non-zero, then we change the polarity heuristic after that many number
73 // of conflicts in an arithmetically increasing fashion. So x the first time,
74 // 2 * x the second time, etc...
75 optional int32 polarity_rephase_increment = 168 [default = 1000];
77 // If true and we have first solution LS workers, tries in some phase to
78 // follow a LS solutions that violates has litle constraints as possible.
79 optional bool polarity_exploit_ls_hints = 309 [default = false];
81 // The proportion of polarity chosen at random. Note that this take
82 // precedence over the phase saving heuristic. This is different from
83 // initial_polarity:POLARITY_RANDOM because it will select a new random
84 // polarity each time the variable is branched upon instead of selecting one
85 // initially and then always taking this choice.
86 optional double random_polarity_ratio = 45 [default = 0.0];
88 // A number between 0 and 1 that indicates the proportion of branching
89 // variables that are selected randomly instead of choosing the first variable
90 // from the given variable_ordering strategy.
91 optional double random_branches_ratio = 32 [default = 0.0];
93 // Whether we use the ERWA (Exponential Recency Weighted Average) heuristic as
94 // described in "Learning Rate Based Branching Heuristic for SAT solvers",
95 // J.H.Liang, V. Ganesh, P. Poupart, K.Czarnecki, SAT 2016.
96 optional bool use_erwa_heuristic = 75 [default = false];
98 // The initial value of the variables activity. A non-zero value only make
99 // sense when use_erwa_heuristic is true. Experiments with a value of 1e-2
100 // together with the ERWA heuristic showed slighthly better result than simply
101 // using zero. The idea is that when the "learning rate" of a variable becomes
102 // lower than this value, then we prefer to branch on never explored before
103 // variables. This is not in the ERWA paper.
104 optional double initial_variables_activity = 76 [default = 0.0];
106 // When this is true, then the variables that appear in any of the reason of
107 // the variables in a conflict have their activity bumped. This is addition to
108 // the variables in the conflict, and the one that were used during conflict
110 optional bool also_bump_variables_in_conflict_reasons = 77 [default = false];
112 // ==========================================================================
114 // ==========================================================================
116 // Do we try to minimize conflicts (greedily) when creating them.
117 enum ConflictMinimizationAlgorithm {
123 optional ConflictMinimizationAlgorithm minimization_algorithm = 4
124 [default = RECURSIVE];
126 // Whether to expoit the binary clause to minimize learned clauses further.
127 enum BinaryMinizationAlgorithm {
129 NO_BINARY_MINIMIZATION = 0;
130 BINARY_MINIMIZATION_FROM_UIP = 1;
131 BINARY_MINIMIZATION_FROM_UIP_AND_DECISIONS = 5;
133 optional BinaryMinizationAlgorithm binary_minimization_algorithm = 34
134 [default = BINARY_MINIMIZATION_FROM_UIP_AND_DECISIONS];
136 // At a really low cost, during the 1-UIP conflict computation, it is easy to
137 // detect if some of the involved reasons are subsumed by the current
138 // conflict. When this is true, such clauses are detached and later removed
140 optional bool subsumption_during_conflict_analysis = 56 [default = true];
142 // It is possible that "intermediate" clauses during conflict resolution
143 // subsumes some of the clauses that propagated. This is quite cheap to detect
144 // and result in more subsumption/strengthening of clauses.
145 optional bool extra_subsumption_during_conflict_analysis = 351
148 // Try even more subsumption options during conflict analysis.
149 optional bool decision_subsumption_during_conflict_analysis = 353
152 // If >=0, each time we have a conflict, we try to subsume the last n learned
154 optional int32 eagerly_subsume_last_n_conflicts = 343 [default = 4];
156 // If we remove clause that we now are "implied" by others. Note that this
157 // might not always be good as we might loose some propagation power.
158 optional bool subsume_during_vivification = 355 [default = true];
160 // If true, try to backtrack as little as possible on conflict and re-imply
161 // the clauses later.
162 // This means we discard less propagation than traditional backjumping, but
163 // requites additional bookkeeping to handle reimplication.
164 // See: https://doi.org/10.1007/978-3-319-94144-8_7
165 optional bool use_chronological_backtracking = 330 [default = false];
167 // If chronological backtracking is enabled, this is the maximum number of
168 // levels we will backjump over, otherwise we will backtrack.
169 optional int32 max_backjump_levels = 331 [default = 50];
171 // If chronological backtracking is enabled, this is the minimum number of
172 // conflicts before we will consider backjumping.
173 optional int32 chronological_backtrack_min_conflicts = 332 [default = 1000];
175 // ==========================================================================
176 // Clause database management
177 // ==========================================================================
179 // Trigger a cleanup when this number of "deletable" clauses is learned.
180 optional int32 clause_cleanup_period = 11 [default = 10000];
182 // Increase clause_cleanup_period by this amount after each cleanup.
183 optional int32 clause_cleanup_period_increment = 337 [default = 0];
185 // During a cleanup, we will always keep that number of "deletable" clauses.
186 // Note that this doesn't include the "protected" clauses.
187 optional int32 clause_cleanup_target = 13 [default = 0];
189 // During a cleanup, if clause_cleanup_target is 0, we will delete the
190 // clause_cleanup_ratio of "deletable" clauses instead of aiming for a fixed
191 // target of clauses to keep.
192 optional double clause_cleanup_ratio = 190 [default = 0.5];
194 // All the clauses with a LBD (literal blocks distance) lower or equal to this
195 // parameters will always be kept.
197 // Note that the LBD of a clause that just propagated is 1 + number of
198 // different decision levels of its literals. So that the "classic" LBD of a
199 // learned conflict is the same as its LBD when we backjump and then propagate
201 optional int32 clause_cleanup_lbd_bound = 59 [default = 5];
203 // All the clause with a LBD lower or equal to this will be kept except if
204 // its activity hasn't been bumped in the last 32 cleanup phase. Note that
205 // this has no effect if it is <= clause_cleanup_lbd_bound.
206 optional int32 clause_cleanup_lbd_tier1 = 349 [default = 0];
208 // All the clause with a LBD lower or equal to this will be kept except if its
209 // activity hasn't been bumped since the previous cleanup phase. Note that
210 // this has no effect if it is <= clause_cleanup_lbd_bound or <=
211 // clause_cleanup_lbd_tier1.
212 optional int32 clause_cleanup_lbd_tier2 = 350 [default = 0];
214 // The clauses that will be kept during a cleanup are the ones that come
215 // first under this order. We always keep or exclude ties together.
216 enum ClauseOrdering {
217 // Order clause by decreasing activity, then by increasing LBD.
219 // Order clause by increasing LBD, then by decreasing activity.
222 optional ClauseOrdering clause_cleanup_ordering = 60
223 [default = CLAUSE_ACTIVITY];
225 // Same as for the clauses, but for the learned pseudo-Boolean constraints.
226 optional int32 pb_cleanup_increment = 46 [default = 200];
227 optional double pb_cleanup_ratio = 47 [default = 0.5];
229 // ==========================================================================
230 // Variable and clause activities
231 // ==========================================================================
233 // Each time a conflict is found, the activities of some variables are
234 // increased by one. Then, the activity of all variables are multiplied by
235 // variable_activity_decay.
237 // To implement this efficiently, the activity of all the variables is not
238 // decayed at each conflict. Instead, the activity increment is multiplied by
239 // 1 / decay. When an activity reach max_variable_activity_value, all the
240 // activity are multiplied by 1 / max_variable_activity_value.
241 optional double variable_activity_decay = 15 [default = 0.8];
242 optional double max_variable_activity_value = 16 [default = 1e100];
244 // The activity starts at 0.8 and increment by 0.01 every 5000 conflicts until
245 // 0.95. This "hack" seems to work well and comes from:
247 // Glucose 2.3 in the SAT 2013 Competition - SAT Competition 2013
248 // http://edacc4.informatik.uni-ulm.de/SC13/solver-description-download/136
249 optional double glucose_max_decay = 22 [default = 0.95];
250 optional double glucose_decay_increment = 23 [default = 0.01];
251 optional int32 glucose_decay_increment_period = 24 [default = 5000];
253 // Clause activity parameters (same effect as the one on the variables).
254 optional double clause_activity_decay = 17 [default = 0.999];
255 optional double max_clause_activity_value = 18 [default = 1e20];
257 // ==========================================================================
259 // ==========================================================================
261 // Restart algorithms.
263 // A reference for the more advanced ones is:
264 // Gilles Audemard, Laurent Simon, "Refining Restarts Strategies for SAT
265 // and UNSAT", Principles and Practice of Constraint Programming Lecture
266 // Notes in Computer Science 2012, pp 118-126
267 enum RestartAlgorithm {
270 // Just follow a Luby sequence times restart_period.
273 // Moving average restart based on the decision level of conflicts.
274 DL_MOVING_AVERAGE_RESTART = 2;
276 // Moving average restart based on the LBD of conflicts.
277 LBD_MOVING_AVERAGE_RESTART = 3;
279 // Fixed period restart every restart period.
283 // The restart strategies will change each time the strategy_counter is
284 // increased. The current strategy will simply be the one at index
285 // strategy_counter modulo the number of strategy. Note that if this list
286 // includes a NO_RESTART, nothing will change when it is reached because the
287 // strategy_counter will only increment after a restart.
289 // The idea of switching of search strategy tailored for SAT/UNSAT comes from
290 // Chanseok Oh with his COMiniSatPS solver, see http://cs.nyu.edu/~chanseok/.
291 // But more generally, it seems REALLY beneficial to try different strategy.
292 repeated RestartAlgorithm restart_algorithms = 61;
293 optional string default_restart_algorithms = 70
295 "LUBY_RESTART,LBD_MOVING_AVERAGE_RESTART,DL_MOVING_AVERAGE_RESTART"];
297 // Restart period for the FIXED_RESTART strategy. This is also the multiplier
298 // used by the LUBY_RESTART strategy.
299 optional int32 restart_period = 30 [default = 50];
301 // Size of the window for the moving average restarts.
302 optional int32 restart_running_window_size = 62 [default = 50];
304 // In the moving average restart algorithms, a restart is triggered if the
305 // window average times this ratio is greater that the global average.
306 optional double restart_dl_average_ratio = 63 [default = 1.0];
307 optional double restart_lbd_average_ratio = 71 [default = 1.0];
309 // Block a moving restart algorithm if the trail size of the current conflict
310 // is greater than the multiplier times the moving average of the trail size
311 // at the previous conflicts.
312 optional bool use_blocking_restart = 64 [default = false];
313 optional int32 blocking_restart_window_size = 65 [default = 5000];
314 optional double blocking_restart_multiplier = 66 [default = 1.4];
316 // After each restart, if the number of conflict since the last strategy
317 // change is greater that this, then we increment a "strategy_counter" that
318 // can be use to change the search strategy used by the following restarts.
319 optional int32 num_conflicts_before_strategy_changes = 68 [default = 0];
321 // The parameter num_conflicts_before_strategy_changes is increased by that
322 // much after each strategy change.
323 optional double strategy_change_increase_ratio = 69 [default = 0.0];
325 // ==========================================================================
327 // ==========================================================================
329 // Maximum time allowed in seconds to solve a problem.
330 // The counter will starts at the beginning of the Solve() call.
331 optional double max_time_in_seconds = 36 [default = inf];
333 // Maximum time allowed in deterministic time to solve a problem.
334 // The deterministic time should be correlated with the real time used by the
335 // solver, the time unit being as close as possible to a second.
336 optional double max_deterministic_time = 67 [default = inf];
338 // Stops after that number of batches has been scheduled. This only make sense
339 // when interleave_search is true.
340 optional int32 max_num_deterministic_batches = 291 [default = 0];
342 // Maximum number of conflicts allowed to solve a problem.
344 // TODO(user): Maybe change the way the conflict limit is enforced?
345 // currently it is enforced on each independent internal SAT solve, rather
346 // than on the overall number of conflicts across all solves. So in the
347 // context of an optimization problem, this is not really usable directly by a
349 optional int64 max_number_of_conflicts = 37
350 [default = 0x7FFFFFFFFFFFFFFF]; // kint64max
352 // Maximum memory allowed for the whole thread containing the solver. The
353 // solver will abort as soon as it detects that this limit is crossed. As a
354 // result, this limit is approximative, but usually the solver will not go too
357 // TODO(user): This is only used by the pure SAT solver, generalize to CP-SAT.
358 optional int64 max_memory_in_mb = 40 [default = 10000];
360 // Stop the search when the gap between the best feasible objective (O) and
361 // our best objective bound (B) is smaller than a limit.
362 // The exact definition is:
363 // - Absolute: abs(O - B)
364 // - Relative: abs(O - B) / max(1, abs(O)).
366 // Important: The relative gap depends on the objective offset! If you
367 // artificially shift the objective, you will get widely different value of
370 // Note that if the gap is reached, the search status will be OPTIMAL. But
371 // one can check the best objective bound to see the actual gap.
373 // If the objective is integer, then any absolute gap < 1 will lead to a true
374 // optimal. If the objective is floating point, a gap of zero make little
375 // sense so is is why we use a non-zero default value. At the end of the
376 // search, we will display a warning if OPTIMAL is reported yet the gap is
377 // greater than this absolute gap.
378 optional double absolute_gap_limit = 159 [default = 1e-4];
379 optional double relative_gap_limit = 160 [default = 0.0];
381 // ==========================================================================
383 // ==========================================================================
385 // At the beginning of each solve, the random number generator used in some
386 // part of the solver is reinitialized to this seed. If you change the random
387 // seed, the solver may make different choices during the solving process.
389 // For some problems, the running time may vary a lot depending on small
390 // change in the solving algorithm. Running the solver with different seeds
391 // enables to have more robust benchmarks when evaluating new features.
392 optional int32 random_seed = 31 [default = 1];
394 // This is mainly here to test the solver variability. Note that in tests, if
395 // not explicitly set to false, all 3 options will be set to true so that
396 // clients do not rely on the solver returning a specific solution if they are
397 // many equivalent optimal solutions.
398 optional bool permute_variable_randomly = 178 [default = false];
399 optional bool permute_presolve_constraint_order = 179 [default = false];
400 optional bool use_absl_random = 180 [default = false];
402 // Whether the solver should log the search progress. This is the maing
403 // logging parameter and if this is false, none of the logging (callbacks,
404 // log_to_stdout, log_to_response, ...) will do anything.
405 optional bool log_search_progress = 41 [default = false];
407 // Whether the solver should display per sub-solver search statistics.
408 // This is only useful is log_search_progress is set to true, and if the
409 // number of search workers is > 1. Note that in all case we display a bit
410 // of stats with one line per subsolver.
411 optional bool log_subsolver_statistics = 189 [default = false];
413 // Add a prefix to all logs.
414 optional string log_prefix = 185 [default = ""];
417 optional bool log_to_stdout = 186 [default = true];
419 // Log to response proto.
420 optional bool log_to_response = 187 [default = false];
424 // This is an old experiment, it might cause crashes in multi-thread and you
425 // should double check the solver result. It can still be used if you only
426 // care about feasible solutions (these are checked) and it gives good result
427 // on your problem. We might revive it at some point.
429 // Whether to use pseudo-Boolean resolution to analyze a conflict. Note that
430 // this option only make sense if your problem is modelized using
431 // pseudo-Boolean constraints. If you only have clauses, this shouldn't change
432 // anything (except slow the solver down).
433 optional bool use_pb_resolution = 43 [default = false];
435 // A different algorithm during PB resolution. It minimizes the number of
436 // calls to ReduceCoefficients() which can be time consuming. However, the
437 // search space will be different and if the coefficients are large, this may
438 // lead to integer overflows that could otherwise be prevented.
439 optional bool minimize_reduction_during_pb_resolution = 48 [default = false];
441 // Whether or not the assumption levels are taken into account during the LBD
442 // computation. According to the reference below, not counting them improves
443 // the solver in some situation. Note that this only impact solves under
446 // Gilles Audemard, Jean-Marie Lagniez, Laurent Simon, "Improving Glucose for
447 // Incremental SAT Solving with Assumptions: Application to MUS Extraction"
448 // Theory and Applications of Satisfiability Testing - SAT 2013, Lecture Notes
449 // in Computer Science Volume 7962, 2013, pp 309-317.
450 optional bool count_assumption_levels_in_lbd = 49 [default = true];
452 // ==========================================================================
454 // ==========================================================================
456 // During presolve, only try to perform the bounded variable elimination (BVE)
457 // of a variable x if the number of occurrences of x times the number of
458 // occurrences of not(x) is not greater than this parameter.
459 optional int32 presolve_bve_threshold = 54 [default = 500];
461 // Internal parameter. During BVE, if we eliminate a variable x, by default we
462 // will push all clauses containing x and all clauses containing not(x) to the
463 // postsolve. However, it is possible to write the postsolve code so that only
464 // one such set is needed. The idea is that, if we push the set containing a
465 // literal l, is to set l to false except if it is needed to satisfy one of
466 // the clause in the set. This is always beneficial, but for historical
467 // reason, not all our postsolve algorithm support this.
468 optional bool filter_sat_postsolve_clauses = 324 [default = false];
470 // During presolve, we apply BVE only if this weight times the number of
471 // clauses plus the number of clause literals is not increased.
472 optional int32 presolve_bve_clause_weight = 55 [default = 3];
474 // The maximum "deterministic" time limit to spend in probing. A value of
475 // zero will disable the probing.
477 // TODO(user): Clean up. The first one is used in CP-SAT, the other in pure
479 optional double probing_deterministic_time_limit = 226 [default = 1.0];
480 optional double presolve_probing_deterministic_time_limit = 57
483 // Whether we use an heuristic to detect some basic case of blocked clause
484 // in the SAT presolve.
485 optional bool presolve_blocked_clause = 88 [default = true];
487 // Whether or not we use Bounded Variable Addition (BVA) in the presolve.
488 optional bool presolve_use_bva = 72 [default = true];
490 // Apply Bounded Variable Addition (BVA) if the number of clauses is reduced
491 // by stricly more than this threshold. The algorithm described in the paper
492 // uses 0, but quick experiments showed that 1 is a good value. It may not be
493 // worth it to add a new variable just to remove one clause.
494 optional int32 presolve_bva_threshold = 73 [default = 1];
496 // In case of large reduction in a presolve iteration, we perform multiple
497 // presolve iterations. This parameter controls the maximum number of such
498 // presolve iterations.
499 optional int32 max_presolve_iterations = 138 [default = 3];
501 // Whether we presolve the cp_model before solving it.
502 optional bool cp_model_presolve = 86 [default = true];
504 // How much effort do we spend on probing. 0 disables it completely.
505 optional int32 cp_model_probing_level = 110 [default = 2];
507 // Whether we also use the sat presolve when cp_model_presolve is true.
508 optional bool cp_model_use_sat_presolve = 93 [default = true];
510 // If we try to load at most ones and exactly ones constraints when running
511 // the pure SAT presolve. Or if we just ignore them.
513 // If one detects at_most_one via merge_at_most_one_work_limit or exactly one
514 // with find_clauses_that_are_exactly_one, it might be good to also set this
516 optional bool load_at_most_ones_in_sat_presolve = 335 [default = false];
518 // If cp_model_presolve is true and there is a large proportion of fixed
519 // variable after the first model copy, remap all the model to a dense set of
520 // variable before the full presolve even starts. This should help for LNS on
522 optional bool remove_fixed_variables_early = 310 [default = true];
524 // If true, we detect variable that are unique to a table constraint and only
525 // there to encode a cost on each tuple. This is usually the case when a WCSP
526 // (weighted constraint program) is encoded into CP-SAT format.
528 // This can lead to a dramatic speed-up for such problems but is still
529 // experimental at this point.
530 optional bool detect_table_with_cost = 216 [default = false];
532 // How much we try to "compress" a table constraint. Compressing more leads to
533 // less Booleans and faster propagation but can reduced the quality of the lp
534 // relaxation. Values goes from 0 to 3 where we always try to fully compress a
535 // table. At 2, we try to automatically decide if it is worth it.
536 optional int32 table_compression_level = 217 [default = 2];
538 // If true, expand all_different constraints that are not permutations.
539 // Permutations (#Variables = #Values) are always expanded.
540 optional bool expand_alldiff_constraints = 170 [default = false];
542 // Max domain size for all_different constraints to be expanded.
543 optional int32 max_alldiff_domain_size = 320 [default = 256];
545 // If true, expand the reservoir constraints by creating booleans for all
546 // possible precedences between event and encoding the constraint.
547 optional bool expand_reservoir_constraints = 182 [default = true];
549 // Max domain size for expanding linear2 constraints (ax + by ==/!= c).
550 optional int32 max_domain_size_for_linear2_expansion = 340 [default = 8];
552 // Mainly useful for testing.
554 // If this and expand_reservoir_constraints is true, we use a different
555 // encoding of the reservoir constraint using circuit instead of precedences.
556 // Note that this is usually slower, but can exercise different part of the
557 // solver. Note that contrary to the precedence encoding, this easily support
560 // WARNING: with this encoding, the constraint takes a slightly different
561 // meaning. There must exist a permutation of the events occurring at the same
562 // time such that the level is within the reservoir after each of these events
563 // (in this permuted order). So we cannot have +100 and -100 at the same time
564 // if the level must be between 0 and 10 (as authorized by the reservoir
566 optional bool expand_reservoir_using_circuit = 288 [default = false];
568 // Encore cumulative with fixed demands and capacity as a reservoir
569 // constraint. The only reason you might want to do that is to test the
570 // reservoir propagation code!
571 optional bool encode_cumulative_as_reservoir = 287 [default = false];
573 // If the number of expressions in the lin_max is less that the max size
574 // parameter, model expansion replaces target = max(xi) by linear constraint
575 // with the introduction of new booleans bi such that bi => target == xi.
577 // This is mainly for experimenting compared to a custom lin_max propagator.
578 optional int32 max_lin_max_size_for_expansion = 280 [default = 0];
580 // If true, it disable all constraint expansion.
581 // This should only be used to test the presolve of expanded constraints.
582 optional bool disable_constraint_expansion = 181 [default = false];
584 // Linear constraint with a complex right hand side (more than a single
585 // interval) need to be expanded, there is a couple of way to do that.
586 optional bool encode_complex_linear_constraint_with_integer = 223
589 // During presolve, we use a maximum clique heuristic to merge together
590 // no-overlap constraints or at most one constraints. This code can be slow,
591 // so we have a limit in place on the number of explored nodes in the
592 // underlying graph. The internal limit is an int64, but we use double here to
593 // simplify manual input.
594 optional double merge_no_overlap_work_limit = 145 [default = 1e12];
595 optional double merge_at_most_one_work_limit = 146 [default = 1e8];
597 // How much substitution (also called free variable aggregation in MIP
598 // litterature) should we perform at presolve. This currently only concerns
599 // variable appearing only in linear constraints. For now the value 0 turns it
600 // off and any positive value performs substitution.
601 optional int32 presolve_substitution_level = 147 [default = 1];
603 // If true, we will extract from linear constraints, enforcement literals of
604 // the form "integer variable at bound => simplified constraint". This should
605 // always be beneficial except that we don't always handle them as efficiently
606 // as we could for now. This causes problem on manna81.mps (LP relaxation not
607 // as tight it seems) and on neos-3354841-apure.mps.gz (too many literals
608 // created this way).
609 optional bool presolve_extract_integer_enforcement = 174 [default = false];
611 // A few presolve operations involve detecting constraints included in other
612 // constraint. Since there can be a quadratic number of such pairs, and
613 // processing them usually involve scanning them, the complexity of these
614 // operations can be big. This enforce a local deterministic limit on the
615 // number of entries scanned. Default is 1e8.
617 // A value of zero will disable these presolve rules completely.
618 optional int64 presolve_inclusion_work_limit = 201 [default = 100000000];
620 // If true, we don't keep names in our internal copy of the user given model.
621 optional bool ignore_names = 202 [default = true];
623 // Run a max-clique code amongst all the x != y we can find and try to infer
624 // set of variables that are all different. This allows to close neos16.mps
625 // for instance. Note that we only run this code if there is no all_diff
626 // already in the model so that if a user want to add some all_diff, we assume
627 // it is well done and do not try to add more.
629 // This will also detect and add no_overlap constraints, if all the relations
630 // x != y have "offsets" between them. I.e. x > y + offset.
631 optional bool infer_all_diffs = 233 [default = true];
633 // Try to find large "rectangle" in the linear constraint matrix with
634 // identical lines. If such rectangle is big enough, we can introduce a new
635 // integer variable corresponding to the common expression and greatly reduce
636 // the number of non-zero.
637 optional bool find_big_linear_overlap = 234 [default = true];
639 // By propagating (or just using binary clauses), one can detect that all
640 // literal of a clause are actually in at most one relationship. Thus this
641 // constraint can be promoted to an exactly one constraints. This should help
642 // as it convey more structure. Note that this is expensive, so we have a
643 // deterministic limit in place.
644 optional bool find_clauses_that_are_exactly_one = 333 [default = true];
646 // ==========================================================================
648 // ==========================================================================
650 // Enable or disable "inprocessing" which is some SAT presolving done at
651 // each restart to the root level.
652 optional bool use_sat_inprocessing = 163 [default = true];
654 // Proportion of deterministic time we should spend on inprocessing.
655 // At each "restart", if the proportion is below this ratio, we will do some
656 // inprocessing, otherwise, we skip it for this restart.
657 optional double inprocessing_dtime_ratio = 273 [default = 0.2];
659 // The amount of dtime we should spend on probing for each inprocessing round.
660 optional double inprocessing_probing_dtime = 274 [default = 1.0];
662 // Parameters for an heuristic similar to the one described in "An effective
663 // learnt clause minimization approach for CDCL Sat Solvers",
664 // https://www.ijcai.org/proceedings/2017/0098.pdf
666 // This is the amount of dtime we should spend on this technique during each
667 // inprocessing phase.
669 // The minimization technique is the same as the one used to minimize core in
670 // max-sat. We also minimize problem clauses and not just the learned clause
671 // that we keep forever like in the paper.
672 optional double inprocessing_minimization_dtime = 275 [default = 1.0];
673 optional bool inprocessing_minimization_use_conflict_analysis = 297
675 optional bool inprocessing_minimization_use_all_orderings = 298
678 // Whether we use the algorithm described in "Clausal Congruence closure",
679 // Armin Biere, Katalin Fazekas, Mathias Fleury, Nils Froleyks, 2024.
681 // Note that we only have a basic version currently.
682 optional bool inprocessing_use_congruence_closure = 342 [default = true];
684 // Whether we use the SAT sweeping algorithm described in "Clausal Equivalence
685 // Sweeping", Armin Biere, Katalin Fazekas, Mathias Fleury, Nils Froleyks,
687 optional bool inprocessing_use_sat_sweeping = 354 [default = false];
689 // ==========================================================================
691 // ==========================================================================
693 // Specify the number of parallel workers (i.e. threads) to use during search.
694 // This should usually be lower than your number of available cpus +
695 // hyperthread in your machine.
697 // A value of 0 means the solver will try to use all cores on the machine.
698 // A number of 1 means no parallelism.
700 // Note that 'num_workers' is the preferred name, but if it is set to zero,
701 // we will still read the deprecated 'num_search_workers'.
703 // As of 2020-04-10, if you're using SAT via MPSolver (to solve integer
704 // programs) this field is overridden with a value of 8, if the field is not
705 // set *explicitly*. Thus, always set this field explicitly or via
706 // MPSolver::SetNumThreads().
707 optional int32 num_workers = 206 [default = 0];
708 optional int32 num_search_workers = 100 [default = 0];
710 // We distinguish subsolvers that consume a full thread, and the ones that are
711 // always interleaved. If left at zero, we will fix this with a default
712 // formula that depends on num_workers. But if you start modifying what runs,
713 // you might want to fix that to a given value depending on the num_workers
715 optional int32 num_full_subsolvers = 294 [default = 0];
717 // In multi-thread, the solver can be mainly seen as a portfolio of solvers
718 // with different parameters. This field indicates the names of the parameters
719 // that are used in multithread. This only applies to "full" subsolvers.
721 // See cp_model_search.cc to see a list of the names and the default value (if
722 // left empty) that looks like:
723 // - default_lp (linearization_level:1)
724 // - fixed (only if fixed search specified or scheduling)
725 // - no_lp (linearization_level:0)
726 // - max_lp (linearization_level:2)
727 // - pseudo_costs (only if objective, change search heuristic)
728 // - reduced_costs (only if objective, change search heuristic)
729 // - quick_restart (kind of probing)
730 // - quick_restart_no_lp (kind of probing with linearization_level:0)
731 // - lb_tree_search (to improve lower bound, MIP like tree search)
732 // - probing (continuous probing and shaving)
734 // Also, note that some set of parameters will be ignored if they do not make
735 // sense. For instance if there is no objective, pseudo_cost or reduced_cost
736 // search will be ignored. Core based search will only work if the objective
737 // has many terms. If there is no fixed strategy fixed will be ignored. And so
740 // The order is important, as only the first num_full_subsolvers will be
741 // scheduled. You can see in the log which one are selected for a given run.
742 repeated string subsolvers = 207;
744 // A convenient way to add more workers types.
745 // These will be added at the beginning of the list.
746 repeated string extra_subsolvers = 219;
748 // Rather than fully specifying subsolvers, it is often convenient to just
749 // remove the ones that are not useful on a given problem or only keep
750 // specific ones for testing. Each string is interpreted as a "glob", so we
751 // support '*' and '?'.
753 // The way this work is that we will only accept a name that match a filter
754 // pattern (if non-empty) and do not match an ignore pattern. Note also that
755 // these fields work on LNS or LS names even if these are currently not
756 // specified via the subsolvers field.
757 repeated string ignore_subsolvers = 209;
758 repeated string filter_subsolvers = 293;
760 // It is possible to specify additional subsolver configuration. These can be
761 // referred by their params.name() in the fields above. Note that only the
762 // specified field will "overwrite" the ones of the base parameter. If a
763 // subsolver_params has the name of an existing subsolver configuration, the
764 // named parameters will be merged into the subsolver configuration.
765 repeated SatParameters subsolver_params = 210;
767 // Experimental. If this is true, then we interleave all our major search
768 // strategy and distribute the work amongst num_workers.
770 // The search is deterministic (independently of num_workers!), and we
771 // schedule and wait for interleave_batch_size task to be completed before
772 // synchronizing and scheduling the next batch of tasks.
773 optional bool interleave_search = 136 [default = false];
774 optional int32 interleave_batch_size = 134 [default = 0];
776 // Allows objective sharing between workers.
777 optional bool share_objective_bounds = 113 [default = true];
779 // Allows sharing of the bounds of modified variables at level 0.
780 optional bool share_level_zero_bounds = 114 [default = true];
782 // Allows sharing of the bounds on linear2 discovered at level 0. This is
783 // mainly interesting on scheduling type of problems when we branch on
786 // Warning: This currently non-deterministic.
787 optional bool share_linear2_bounds = 326 [default = false];
789 // Allows sharing of new learned binary clause between workers.
790 optional bool share_binary_clauses = 203 [default = true];
792 // Allows sharing of short glue clauses between workers.
793 // Implicitly disabled if share_binary_clauses is false.
794 optional bool share_glue_clauses = 285 [default = true];
796 // Minimize and detect subsumption of shared clauses immediately after they
798 optional bool minimize_shared_clauses = 300 [default = true];
800 // The amount of dtime between each export of shared glue clauses.
801 optional double share_glue_clauses_dtime = 322 [default = 1.0];
803 // ==========================================================================
805 // ==========================================================================
807 // If true, inferred clauses are checked with an LRAT checker as they are
808 // learned, in presolve (reduced to trivial simplifications if
809 // cp_model_presolve is false), and in each worker. As of December 2025, this
810 // only works with pure SAT problems, with
811 // - cp_model_presolve = false,
812 // - linearization_level <= 1,
813 // - symmetry_level <= 1.
814 optional bool check_lrat_proof = 344 [default = false];
816 // If true, and if output_lrat_proof is true and the problem is UNSAT, check
817 // that the merged proof file is valid, i.e., that clause sharing between
818 // workers is correct. This checks each inferred clause, so you might want to
819 // disable check_lrat_proof to avoid redundant work. As of November 2025, this
820 // only works for pure SAT problems, with num_workers = 1.
821 optional bool check_merged_lrat_proof = 352 [default = false];
823 // If true, an LRAT proof that all the clauses inferred by the solver are
824 // valid is output to several files (one for presolve -- reduced to trivial
825 // simplifications if cp_model_presolve is false, one per worker, and one for
826 // the merged proof). As of December 2025, this only works for pure SAT
828 // - cp_model_presolve = false,
829 // - linearization_level <= 1,
830 // - symmetry_level <= 1.
831 optional bool output_lrat_proof = 345 [default = false];
833 // If true, and if the problem is UNSAT, a DRAT proof of this UNSAT property
834 // is checked after the solver has finished. As of November 2025, this only
835 // works for pure SAT problems, with
836 // - num_workers = 1,
837 // - cp_model_presolve = false,
838 // - linearization_level <= 1,
839 // - symmetry_level <= 1.
840 optional bool check_drat_proof = 346 [default = false];
842 // If true, a DRAT proof that all the clauses inferred by the solver are valid
843 // is output to a file. As of December 2025, this only works for pure SAT
845 // - num_workers = 1,
846 // - cp_model_presolve = false,
847 // - linearization_level <= 1,
848 // - symmetry_level <= 1.
849 optional bool output_drat_proof = 347 [default = false];
851 // The maximum time allowed to check the DRAT proof (this can take more time
852 // than the solve itself). Only used if check_drat_proof is true.
853 optional double max_drat_time_in_seconds = 348 [default = inf];
855 // ==========================================================================
856 // Debugging parameters
857 // ==========================================================================
859 // We have two different postsolve code. The default one should be better and
860 // it allows for a more powerful presolve, but it can be useful to postsolve
861 // using the full solver instead.
862 optional bool debug_postsolve_with_full_solver = 162 [default = false];
864 // If positive, try to stop just after that many presolve rules have been
865 // applied. This is mainly useful for debugging presolve.
866 optional int32 debug_max_num_presolve_operations = 151 [default = 0];
868 // Crash if we do not manage to complete the hint into a full solution.
869 optional bool debug_crash_on_bad_hint = 195 [default = false];
871 // Crash if presolve breaks a feasible hint.
872 optional bool debug_crash_if_presolve_breaks_hint = 306 [default = false];
874 // Crash if the LRAT UNSAT proof is invalid.
875 optional bool debug_crash_if_lrat_check_fails = 339 [default = false];
877 // ==========================================================================
878 // Max-sat parameters
879 // ==========================================================================
881 // For an optimization problem, whether we follow some hints in order to find
882 // a better first solution. For a variable with hint, the solver will always
883 // try to follow the hint. It will revert to the variable_branching default
885 optional bool use_optimization_hints = 35 [default = true];
887 // If positive, we spend some effort on each core:
888 // - At level 1, we use a simple heuristic to try to minimize an UNSAT core.
889 // - At level 2, we use propagation to minimize the core but also identify
890 // literal in at most one relationship in this core.
891 optional int32 core_minimization_level = 50 [default = 2];
893 // Whether we try to find more independent cores for a given set of
894 // assumptions in the core based max-SAT algorithms.
895 optional bool find_multiple_cores = 84 [default = true];
897 // If true, when the max-sat algo find a core, we compute the minimal number
898 // of literals in the core that needs to be true to have a feasible solution.
899 // This is also called core exhaustion in more recent max-SAT papers.
900 optional bool cover_optimization = 89 [default = true];
902 // In what order do we add the assumptions in a core-based max-sat algorithm
903 enum MaxSatAssumptionOrder {
904 DEFAULT_ASSUMPTION_ORDER = 0;
905 ORDER_ASSUMPTION_BY_DEPTH = 1;
906 ORDER_ASSUMPTION_BY_WEIGHT = 2;
908 optional MaxSatAssumptionOrder max_sat_assumption_order = 51
909 [default = DEFAULT_ASSUMPTION_ORDER];
911 // If true, adds the assumption in the reverse order of the one defined by
912 // max_sat_assumption_order.
913 optional bool max_sat_reverse_assumption_order = 52 [default = false];
915 // What stratification algorithm we use in the presence of weight.
916 enum MaxSatStratificationAlgorithm {
917 // No stratification of the problem.
918 STRATIFICATION_NONE = 0;
920 // Start with literals with the highest weight, and when SAT, add the
921 // literals with the next highest weight and so on.
922 STRATIFICATION_DESCENT = 1;
924 // Start with all literals. Each time a core is found with a given minimum
925 // weight, do not consider literals with a lower weight for the next core
926 // computation. If the subproblem is SAT, do like in STRATIFICATION_DESCENT
927 // and just add the literals with the next highest weight.
928 STRATIFICATION_ASCENT = 2;
930 optional MaxSatStratificationAlgorithm max_sat_stratification = 53
931 [default = STRATIFICATION_DESCENT];
933 // ==========================================================================
934 // Constraint programming parameters
935 // ==========================================================================
937 // Some search decisions might cause a really large number of propagations to
938 // happen when integer variables with large domains are only reduced by 1 at
939 // each step. If we propagate more than the number of variable times this
940 // parameters we try to take counter-measure. Setting this to 0.0 disable this
943 // TODO(user): Setting this to something like 10 helps in most cases, but the
944 // code is currently buggy and can cause the solve to enter a bad state where
945 // no progress is made.
946 optional double propagation_loop_detection_factor = 221 [default = 10.0];
948 // When this is true, then a disjunctive constraint will try to use the
949 // precedence relations between time intervals to propagate their bounds
950 // further. For instance if task A and B are both before C and task A and B
951 // are in disjunction, then we can deduce that task C must start after
952 // duration(A) + duration(B) instead of simply max(duration(A), duration(B)),
953 // provided that the start time for all task was currently zero.
955 // This always result in better propagation, but it is usually slow, so
956 // depending on the problem, turning this off may lead to a faster solution.
957 optional bool use_precedences_in_disjunctive_constraint = 74 [default = true];
959 // At root level, we might compute the transitive closure of "precedences"
960 // relations so that we can exploit that in scheduling problems. Setting this
961 // to zero disable the feature.
962 optional int32 transitive_precedences_work_limit = 327 [default = 1000000];
964 // Create one literal for each disjunction of two pairs of tasks. This slows
965 // down the solve time, but improves the lower bound of the objective in the
966 // makespan case. This will be triggered if the number of intervals is less or
967 // equal than the parameter and if use_strong_propagation_in_disjunctive is
969 optional int32 max_size_to_create_precedence_literals_in_disjunctive = 229
972 // Enable stronger and more expensive propagation on no_overlap constraint.
973 optional bool use_strong_propagation_in_disjunctive = 230 [default = false];
975 // Whether we try to branch on decision "interval A before interval B" rather
976 // than on intervals bounds. This usually works better, but slow down a bit
977 // the time to find the first solution.
979 // These parameters are still EXPERIMENTAL, the result should be correct, but
980 // it some corner cases, they can cause some failing CHECK in the solver.
981 optional bool use_dynamic_precedence_in_disjunctive = 263 [default = false];
982 optional bool use_dynamic_precedence_in_cumulative = 268 [default = false];
984 // When this is true, the cumulative constraint is reinforced with overload
985 // checking, i.e., an additional level of reasoning based on energy. This
986 // additional level supplements the default level of reasoning as well as
987 // timetable edge finding.
989 // This always result in better propagation, but it is usually slow, so
990 // depending on the problem, turning this off may lead to a faster solution.
991 optional bool use_overload_checker_in_cumulative = 78 [default = false];
993 // Enable a heuristic to solve cumulative constraints using a modified energy
994 // constraint. We modify the usual energy definition by applying a
995 // super-additive function (also called "conservative scale" or "dual-feasible
996 // function") to the demand and the durations of the tasks.
998 // This heuristic is fast but for most problems it does not help much to find
1000 optional bool use_conservative_scale_overload_checker = 286 [default = false];
1002 // When this is true, the cumulative constraint is reinforced with timetable
1003 // edge finding, i.e., an additional level of reasoning based on the
1004 // conjunction of energy and mandatory parts. This additional level
1005 // supplements the default level of reasoning as well as overload_checker.
1007 // This always result in better propagation, but it is usually slow, so
1008 // depending on the problem, turning this off may lead to a faster solution.
1009 optional bool use_timetable_edge_finding_in_cumulative = 79 [default = false];
1011 // Max number of intervals for the timetable_edge_finding algorithm to
1012 // propagate. A value of 0 disables the constraint.
1013 optional int32 max_num_intervals_for_timetable_edge_finding = 260
1016 // If true, detect and create constraint for integer variable that are "after"
1017 // a set of intervals in the same cumulative constraint.
1019 // Experimental: by default we just use "direct" precedences. If
1020 // exploit_all_precedences is true, we explore the full precedence graph. This
1021 // assumes we have a DAG otherwise it fails.
1022 optional bool use_hard_precedences_in_cumulative = 215 [default = false];
1023 optional bool exploit_all_precedences = 220 [default = false];
1025 // When this is true, the cumulative constraint is reinforced with propagators
1026 // from the disjunctive constraint to improve the inference on a set of tasks
1027 // that are disjunctive at the root of the problem. This additional level
1028 // supplements the default level of reasoning.
1030 // Propagators of the cumulative constraint will not be used at all if all the
1031 // tasks are disjunctive at root node.
1033 // This always result in better propagation, but it is usually slow, so
1034 // depending on the problem, turning this off may lead to a faster solution.
1035 optional bool use_disjunctive_constraint_in_cumulative = 80 [default = true];
1037 // If less than this number of boxes are present in a no-overlap 2d, we
1038 // create 4 Booleans per pair of boxes:
1039 // - Box 2 is after Box 1 on x.
1040 // - Box 1 is after Box 2 on x.
1041 // - Box 2 is after Box 1 on y.
1042 // - Box 1 is after Box 2 on y.
1044 // Note that at least one of them must be true, and at most one on x and one
1045 // on y can be true.
1047 // This can significantly help in closing small problem. The SAT reasoning
1048 // can be a lot more powerful when we take decision on such positional
1050 optional int32 no_overlap_2d_boolean_relations_limit = 321 [default = 10];
1052 // When this is true, the no_overlap_2d constraint is reinforced with
1053 // propagators from the cumulative constraints. It consists of ignoring the
1054 // position of rectangles in one position and projecting the no_overlap_2d on
1055 // the other dimension to create a cumulative constraint. This is done on both
1056 // axis. This additional level supplements the default level of reasoning.
1057 optional bool use_timetabling_in_no_overlap_2d = 200 [default = false];
1059 // When this is true, the no_overlap_2d constraint is reinforced with
1060 // energetic reasoning. This additional level supplements the default level of
1062 optional bool use_energetic_reasoning_in_no_overlap_2d = 213
1065 // When this is true, the no_overlap_2d constraint is reinforced with
1066 // an energetic reasoning that uses an area-based energy. This can be combined
1067 // with the two other overlap heuristics above.
1068 optional bool use_area_energetic_reasoning_in_no_overlap_2d = 271
1071 optional bool use_try_edge_reasoning_in_no_overlap_2d = 299 [default = false];
1073 // If the number of pairs to look is below this threshold, do an extra step of
1074 // propagation in the no_overlap_2d constraint by looking at all pairs of
1076 optional int32 max_pairs_pairwise_reasoning_in_no_overlap_2d = 276
1079 // Detects when the space where items of a no_overlap_2d constraint can placed
1080 // is disjoint (ie., fixed boxes split the domain). When it is the case, we
1081 // can introduce a boolean for each pair <item, component> encoding whether
1082 // the item is in the component or not. Then we replace the original
1083 // no_overlap_2d constraint by one no_overlap_2d constraint for each
1084 // component, with the new booleans as the enforcement_literal of the
1085 // intervals. This is equivalent to expanding the original no_overlap_2d
1086 // constraint into a bin packing problem with each connected component being a
1087 // bin. This heuristic is only done when the number of regions to split
1088 // is less than this parameter and <= 1 disables it.
1089 optional int32 maximum_regions_to_split_in_disconnected_no_overlap_2d = 315
1092 // When set, this activates a propagator for the no_overlap_2d constraint that
1093 // uses any eventual linear constraints of the model in the form
1094 // `{start interval 1} - {end interval 2} + c*w <= ub` to detect that two
1095 // intervals must overlap in one dimension for some values of `w`. This is
1096 // particularly useful for problems where the distance between two boxes is
1097 // part of the model.
1098 optional bool use_linear3_for_no_overlap_2d_precedences = 323
1101 // When set, it activates a few scheduling parameters to improve the lower
1102 // bound of scheduling problems. This is only effective with multiple workers
1103 // as it modifies the reduced_cost, lb_tree_search, and probing workers.
1104 optional bool use_dual_scheduling_heuristics = 214 [default = true];
1106 // Turn on extra propagation for the circuit constraint.
1107 // This can be quite slow.
1108 optional bool use_all_different_for_circuit = 311 [default = false];
1110 // If the size of a subset of nodes of a RoutesConstraint is less than this
1111 // value, use linear constraints of size 1 and 2 (such as capacity and time
1112 // window constraints) enforced by the arc literals to compute cuts for this
1113 // subset (unless the subset size is less than
1114 // routing_cut_subset_size_for_tight_binary_relation_bound, in which case the
1115 // corresponding algorithm is used instead). The algorithm for these cuts has
1116 // a O(n^3) complexity, where n is the subset size. Hence the value of this
1117 // parameter should not be too large (e.g. 10 or 20).
1118 optional int32 routing_cut_subset_size_for_binary_relation_bound = 312
1121 // Similar to above, but with a different algorithm producing better cuts, at
1122 // the price of a higher O(2^n) complexity, where n is the subset size. Hence
1123 // the value of this parameter should be small (e.g. less than 10).
1124 optional int32 routing_cut_subset_size_for_tight_binary_relation_bound = 313
1127 // Similar to above, but with an even stronger algorithm in O(n!). We try to
1128 // be defensive and abort early or not run that often. Still the value of
1129 // that parameter shouldn't really be much more than 10.
1130 optional int32 routing_cut_subset_size_for_exact_binary_relation_bound = 316
1133 // Similar to routing_cut_subset_size_for_exact_binary_relation_bound but
1134 // use a bound based on shortest path distances (which respect triangular
1135 // inequality). This allows to derive bounds that are valid for any superset
1136 // of a given subset. This is slow, so it shouldn't really be larger than 10.
1137 optional int32 routing_cut_subset_size_for_shortest_paths_bound = 318
1140 // The amount of "effort" to spend in dynamic programming for computing
1141 // routing cuts. This is in term of basic operations needed by the algorithm
1142 // in the worst case, so a value like 1e8 should take less than a second to
1144 optional double routing_cut_dp_effort = 314 [default = 1e7];
1146 // If the length of an infeasible path is less than this value, a cut will be
1147 // added to exclude it.
1148 optional int32 routing_cut_max_infeasible_path_length = 317 [default = 6];
1150 // The search branching will be used to decide how to branch on unfixed nodes.
1151 enum SearchBranching {
1152 // Try to fix all literals using the underlying SAT solver's heuristics,
1153 // then generate and fix literals until integer variables are fixed. New
1154 // literals on integer variables are generated using the fixed search
1155 // specified by the user or our default one.
1156 AUTOMATIC_SEARCH = 0;
1158 // If used then all decisions taken by the solver are made using a fixed
1159 // order as specified in the API or in the CpModelProto search_strategy
1163 // Simple portfolio search used by LNS workers.
1164 PORTFOLIO_SEARCH = 2;
1166 // If used, the solver will use heuristics from the LP relaxation. This
1167 // exploit the reduced costs of the variables in the relaxation.
1170 // If used, the solver uses the pseudo costs for branching. Pseudo costs
1171 // are computed using the historical change in objective bounds when some
1172 // decision are taken. Note that this works whether we use an LP or not.
1173 PSEUDO_COST_SEARCH = 4;
1175 // Mainly exposed here for testing. This quickly tries a lot of randomized
1176 // heuristics with a low conflict limit. It usually provides a good first
1178 PORTFOLIO_WITH_QUICK_RESTART_SEARCH = 5;
1180 // Mainly used internally. This is like FIXED_SEARCH, except we follow the
1181 // solution_hint field of the CpModelProto rather than using the information
1182 // provided in the search_strategy.
1185 // Similar to FIXED_SEARCH, but differ in how the variable not listed into
1186 // the fixed search heuristics are branched on. This will always start the
1187 // search tree according to the specified fixed search strategy, but will
1188 // complete it using the default automatic search.
1189 PARTIAL_FIXED_SEARCH = 7;
1191 // Randomized search. Used to increase entropy in the search.
1192 RANDOMIZED_SEARCH = 8;
1194 optional SearchBranching search_branching = 82 [default = AUTOMATIC_SEARCH];
1196 // Conflict limit used in the phase that exploit the solution hint.
1197 optional int32 hint_conflict_limit = 153 [default = 10];
1199 // If true, the solver tries to repair the solution given in the hint. This
1200 // search terminates after the 'hint_conflict_limit' is reached and the solver
1201 // switches to regular search. If false, then we do a FIXED_SEARCH using the
1202 // hint until the hint_conflict_limit is reached.
1203 optional bool repair_hint = 167 [default = false];
1205 // If true, variables appearing in the solution hints will be fixed to their
1207 optional bool fix_variables_to_their_hinted_value = 192 [default = false];
1209 // If true, search will continuously probe Boolean variables, and integer
1210 // variable bounds. This parameter is set to true in parallel on the probing
1212 optional bool use_probing_search = 176 [default = false];
1214 // Use extended probing (probe bool_or, at_most_one, exactly_one).
1215 optional bool use_extended_probing = 269 [default = true];
1217 // How many combinations of pairs or triplets of variables we want to scan.
1218 optional int32 probing_num_combinations_limit = 272 [default = 20000];
1220 // Add a shaving phase (where the solver tries to prove that the lower or
1221 // upper bound of a variable are infeasible) to the probing search. (<= 0
1223 optional double shaving_deterministic_time_in_probing_search = 204
1226 // Specifies the amount of deterministic time spent of each try at shaving a
1227 // bound in the shaving search.
1228 optional double shaving_search_deterministic_time = 205 [default = 0.1];
1230 // Specifies the threshold between two modes in the shaving procedure.
1231 // If the range of the variable/objective is less than this threshold, then
1232 // the shaving procedure will try to remove values one by one. Otherwise, it
1233 // will try to remove one range at a time.
1234 optional int64 shaving_search_threshold = 290 [default = 64];
1236 // If true, search will search in ascending max objective value (when
1237 // minimizing) starting from the lower bound of the objective.
1238 optional bool use_objective_lb_search = 228 [default = false];
1240 // This search differs from the previous search as it will not use assumptions
1241 // to bound the objective, and it will recreate a full model with the
1242 // hardcoded objective value.
1243 optional bool use_objective_shaving_search = 253 [default = false];
1245 // This search takes all Boolean or integer variables, and maximize or
1246 // minimize them in order to reduce their domain. -1 is automatic, otherwise
1247 // value 0 disables it, and 1, 2, or 3 changes something.
1248 optional int32 variables_shaving_level = 289 [default = -1];
1250 // The solver ignores the pseudo costs of variables with number of recordings
1251 // less than this threshold.
1252 optional int64 pseudo_cost_reliability_threshold = 123 [default = 100];
1254 // The default optimization method is a simple "linear scan", each time trying
1255 // to find a better solution than the previous one. If this is true, then we
1256 // use a core-based approach (like in max-SAT) when we try to increase the
1257 // lower bound instead.
1258 optional bool optimize_with_core = 83 [default = false];
1260 // Do a more conventional tree search (by opposition to SAT based one) where
1261 // we keep all the explored node in a tree. This is meant to be used in a
1262 // portfolio and focus on improving the objective lower bound. Keeping the
1263 // whole tree allow us to report a better objective lower bound coming from
1264 // the worst open node in the tree.
1265 optional bool optimize_with_lb_tree_search = 188 [default = false];
1267 // Experimental. Save the current LP basis at each node of the search tree so
1268 // that when we jump around, we can load it and reduce the number of LP
1269 // iterations needed.
1271 // It currently works okay if we do not change the lp with cuts or
1272 // simplification... More work is needed to make it robust in all cases.
1273 optional bool save_lp_basis_in_lb_tree_search = 284 [default = false];
1275 // If non-negative, perform a binary search on the objective variable in order
1276 // to find an [min, max] interval outside of which the solver proved unsat/sat
1277 // under this amount of conflict. This can quickly reduce the objective domain
1278 // on some problems.
1279 optional int32 binary_search_num_conflicts = 99 [default = -1];
1281 // This has no effect if optimize_with_core is false. If true, use a different
1282 // core-based algorithm similar to the max-HS algo for max-SAT. This is a
1283 // hybrid MIP/CP approach and it uses a MIP solver in addition to the CP/SAT
1284 // one. This is also related to the PhD work of tobyodavies@
1285 // "Automatic Logic-Based Benders Decomposition with MiniZinc"
1286 // http://aaai.org/ocs/index.php/AAAI/AAAI17/paper/view/14489
1287 optional bool optimize_with_max_hs = 85 [default = false];
1289 // Parameters for an heuristic similar to the one described in the paper:
1290 // "Feasibility Jump: an LP-free Lagrangian MIP heuristic", Bjørnar
1291 // Luteberget, Giorgio Sartor, 2023, Mathematical Programming Computation.
1292 optional bool use_feasibility_jump = 265 [default = true];
1294 // Disable every other type of subsolver, setting this turns CP-SAT into a
1295 // pure local-search solver.
1296 optional bool use_ls_only = 240 [default = false];
1298 // On each restart, we randomly choose if we use decay (with this parameter)
1300 optional double feasibility_jump_decay = 242 [default = 0.95];
1302 // How much do we linearize the problem in the local search code.
1303 optional int32 feasibility_jump_linearization_level = 257 [default = 2];
1305 // This is a factor that directly influence the work before each restart.
1306 // Increasing it leads to longer restart.
1307 optional int32 feasibility_jump_restart_factor = 258 [default = 1];
1309 // How much dtime for each LS batch.
1310 optional double feasibility_jump_batch_dtime = 292 [default = 0.1];
1312 // Probability for a variable to have a non default value upon restarts or
1314 optional double feasibility_jump_var_randomization_probability = 247
1317 // Max distance between the default value and the pertubated value relative to
1318 // the range of the domain of the variable.
1319 optional double feasibility_jump_var_perburbation_range_ratio = 248
1322 // When stagnating, feasibility jump will either restart from a default
1323 // solution (with some possible randomization), or randomly pertubate the
1324 // current solution. This parameter selects the first option.
1325 optional bool feasibility_jump_enable_restarts = 250 [default = true];
1327 // Maximum size of no_overlap or no_overlap_2d constraint for a quadratic
1328 // expansion. This might look a lot, but by expanding such constraint, we get
1329 // a linear time evaluation per single variable moves instead of a slow O(n
1331 optional int32 feasibility_jump_max_expanded_constraint_size = 264
1334 // This will create incomplete subsolvers (that are not LNS subsolvers)
1335 // that use the feasibility jump code to find improving solution, treating
1336 // the objective improvement as a hard constraint.
1337 optional int32 num_violation_ls = 244 [default = 0];
1339 // How long violation_ls should wait before perturbating a solution.
1340 optional int32 violation_ls_perturbation_period = 249 [default = 100];
1342 // Probability of using compound move search each restart.
1343 // TODO(user): Add reference to paper when published.
1344 optional double violation_ls_compound_move_probability = 259 [default = 0.5];
1346 // Enables shared tree search.
1347 // If positive, start this many complete worker threads to explore a shared
1348 // search tree. These workers communicate objective bounds and simple decision
1349 // nogoods relating to the shared prefix of the tree, and will avoid exploring
1350 // the same subtrees as one another.
1351 // Specifying a negative number uses a heuristic to select an appropriate
1352 // number of shared tree workeres based on the total number of workers.
1353 optional int32 shared_tree_num_workers = 235 [default = -1];
1355 // Set on shared subtree workers. Users should not set this directly.
1356 optional bool use_shared_tree_search = 236 [default = false];
1358 // Minimum restarts before a worker will replace a subtree
1359 // that looks "bad" based on the average LBD of learned clauses.
1360 optional int32 shared_tree_worker_min_restarts_per_subtree = 282
1363 // If true, workers share more of the information from their local trail.
1364 // Specifically, literals implied by the shared tree decisions.
1365 optional bool shared_tree_worker_enable_trail_sharing = 295 [default = true];
1367 // If true, shared tree workers share their target phase when returning an
1368 // assigned subtree for the next worker to use.
1369 optional bool shared_tree_worker_enable_phase_sharing = 304 [default = true];
1371 // How many open leaf nodes should the shared tree maintain per worker.
1372 optional double shared_tree_open_leaves_per_worker = 281 [default = 2.0];
1374 // In order to limit total shared memory and communication overhead, limit the
1375 // total number of nodes that may be generated in the shared tree. If the
1376 // shared tree runs out of unassigned leaves, workers act as portfolio
1377 // workers. Note: this limit includes interior nodes, not just leaves.
1378 optional int32 shared_tree_max_nodes_per_worker = 238 [default = 10000];
1380 enum SharedTreeSplitStrategy {
1381 // Uses the default strategy, currently equivalent to
1382 // SPLIT_STRATEGY_DISCREPANCY.
1383 SPLIT_STRATEGY_AUTO = 0;
1384 // Only accept splits if the node to be split's depth+discrepancy is minimal
1385 // for the desired number of leaves.
1386 // The preferred child for discrepancy calculation is the one with the
1387 // lowest objective lower bound or the original branch direction if the
1388 // bounds are equal. This rule allows twice as many workers to work in the
1389 // preferred subtree as non-preferred.
1390 SPLIT_STRATEGY_DISCREPANCY = 1;
1391 // Only split nodes with an objective lb equal to the global lb. If there is
1392 // no objective, this is equivalent to SPLIT_STRATEGY_FIRST_PROPOSAL.
1393 SPLIT_STRATEGY_OBJECTIVE_LB = 2;
1394 // Attempt to keep the shared tree balanced.
1395 SPLIT_STRATEGY_BALANCED_TREE = 3;
1396 // Workers race to split their subtree, the winner's proposal is accepted.
1397 SPLIT_STRATEGY_FIRST_PROPOSAL = 4;
1399 optional SharedTreeSplitStrategy shared_tree_split_strategy = 239
1400 [default = SPLIT_STRATEGY_AUTO];
1402 // How much deeper compared to the ideal max depth of the tree is considered
1403 // "balanced" enough to still accept a split. Without such a tolerance,
1404 // sometimes the tree can only be split by a single worker, and they may not
1405 // generate a split for some time. In contrast, with a tolerance of 1, at
1406 // least half of all workers should be able to split the tree as soon as a
1407 // split becomes required. This only has an effect on
1408 // SPLIT_STRATEGY_BALANCED_TREE and SPLIT_STRATEGY_DISCREPANCY.
1409 optional int32 shared_tree_balance_tolerance = 305 [default = 1];
1411 // How much dtime a worker will wait between proposing splits.
1412 // This limits the contention in splitting the shared tree, and also reduces
1413 // the number of too-easy subtrees that are generates.
1414 optional double shared_tree_split_min_dtime = 328 [default = 0.1];
1416 // Whether we enumerate all solutions of a problem without objective.
1419 // - This can be used with num_workers > 1 but then each solutions can be
1420 // found more than once, so it is up to the client to deduplicate them.
1421 // - If keep_all_feasible_solutions_in_presolve is unset, we will set it to
1422 // true as otherwise, many feasible solution can just be removed by the
1423 // presolve. It is still possible to manually set this to false if one only
1424 // wants to enumerate all solutions of the presolved model.
1425 optional bool enumerate_all_solutions = 87 [default = false];
1427 // If true, we disable the presolve reductions that remove feasible solutions
1428 // from the search space. Such solution are usually dominated by a "better"
1429 // solution that is kept, but depending on the situation, we might want to
1430 // keep all solutions.
1432 // A trivial example is when a variable is unused. If this is true, then the
1433 // presolve will not fix it to an arbitrary value and it will stay in the
1435 optional bool keep_all_feasible_solutions_in_presolve = 173 [default = false];
1437 // If true, add information about the derived variable domains to the
1438 // CpSolverResponse. It is an option because it makes the response slighly
1439 // bigger and there is a bit more work involved during the postsolve to
1440 // construct it, but it should still have a low overhead. See the
1441 // tightened_variables field in CpSolverResponse for more details.
1442 optional bool fill_tightened_domains_in_response = 132 [default = false];
1444 // If true, the final response addition_solutions field will be filled with
1445 // all solutions from our solutions pool.
1447 // Note that if both this field and enumerate_all_solutions is true, we will
1448 // copy to the pool all of the solution found. So if solution_pool_size is big
1449 // enough, you can get all solutions this way instead of using the solution
1452 // Note that this only affect the "final" solution, not the one passed to the
1453 // solution callbacks.
1454 optional bool fill_additional_solutions_in_response = 194 [default = false];
1456 // If true, the solver will add a default integer branching strategy to the
1457 // already defined search strategy. If not, some variable might still not be
1458 // fixed at the end of the search. For now we assume these variable can just
1459 // be set to their lower bound.
1460 optional bool instantiate_all_variables = 106 [default = true];
1462 // If true, then the precedences propagator try to detect for each variable if
1463 // it has a set of "optional incoming arc" for which at least one of them is
1464 // present. This is usually useful to have but can be slow on model with a lot
1466 optional bool auto_detect_greater_than_at_least_one_of = 95 [default = true];
1468 // For an optimization problem, stop the solver as soon as we have a solution.
1469 optional bool stop_after_first_solution = 98 [default = false];
1471 // Mainly used when improving the presolver. When true, stops the solver after
1472 // the presolve is complete (or after loading and root level propagation).
1473 optional bool stop_after_presolve = 149 [default = false];
1474 optional bool stop_after_root_propagation = 252 [default = false];
1478 // Initial parameters for neighborhood generation.
1479 optional double lns_initial_difficulty = 307 [default = 0.5];
1480 optional double lns_initial_deterministic_limit = 308 [default = 0.1];
1482 // Testing parameters used to disable all lns workers.
1483 optional bool use_lns = 283 [default = true];
1485 // Experimental parameters to disable everything but lns.
1486 optional bool use_lns_only = 101 [default = false];
1488 // Size of the top-n different solutions kept by the solver.
1489 // This parameter must be > 0. Currently, having this larger than one mainly
1490 // impact the "base" solution chosen for a LNS/LS fragment.
1491 optional int32 solution_pool_size = 193 [default = 3];
1493 // If solution_pool_size is <= this, we will use DP to keep a "diverse" set
1494 // of solutions (the one further apart via hamming distance) in the pool.
1495 // Setting this to large value might be slow, especially if your solution are
1497 optional int32 solution_pool_diversity_limit = 329 [default = 10];
1499 // In order to not get stuck in local optima, when this is non-zero, we try to
1500 // also work on "older" solutions with a worse objective value so we get a
1501 // chance to follow a different LS/LNS trajectory.
1502 optional int32 alternative_pool_size = 325 [default = 1];
1504 // Turns on relaxation induced neighborhood generator.
1505 optional bool use_rins_lns = 129 [default = true];
1507 // Adds a feasibility pump subsolver along with lns subsolvers.
1508 optional bool use_feasibility_pump = 164 [default = true];
1510 // Turns on neighborhood generator based on local branching LP. Based on Huang
1511 // et al., "Local Branching Relaxation Heuristics for Integer Linear
1513 optional bool use_lb_relax_lns = 255 [default = true];
1515 // Only use lb-relax if we have at least that many workers.
1516 optional int32 lb_relax_num_workers_threshold = 296 [default = 16];
1518 // Rounding method to use for feasibility pump.
1519 enum FPRoundingMethod {
1520 // Rounds to the nearest integer value.
1521 NEAREST_INTEGER = 0;
1523 // Counts the number of linear constraints restricting the variable in the
1524 // increasing values (up locks) and decreasing values (down locks). Rounds
1525 // the variable in the direction of lesser locks.
1528 // Similar to lock based rounding except this only considers locks of active
1529 // constraints from the last lp solve.
1530 ACTIVE_LOCK_BASED = 3;
1532 // This is expensive rounding algorithm. We round variables one by one and
1533 // propagate the bounds in between. If none of the rounded values fall in
1534 // the continuous domain specified by lower and upper bound, we use the
1535 // current lower/upper bound (whichever one is closest) instead of rounding
1536 // the fractional lp solution value. If both the rounded values are in the
1537 // domain, we round to nearest integer.
1538 PROPAGATION_ASSISTED = 2;
1540 optional FPRoundingMethod fp_rounding = 165 [default = PROPAGATION_ASSISTED];
1542 // If true, registers more lns subsolvers with different parameters.
1543 optional bool diversify_lns_params = 137 [default = false];
1545 // Randomize fixed search.
1546 optional bool randomize_search = 103 [default = false];
1548 // Search randomization will collect the top
1549 // 'search_random_variable_pool_size' valued variables, and pick one randomly.
1550 // The value of the variable is specific to each strategy.
1551 optional int64 search_random_variable_pool_size = 104 [default = 0];
1553 // Experimental code: specify if the objective pushes all tasks toward the
1554 // start of the schedule.
1555 optional bool push_all_tasks_toward_start = 262 [default = false];
1557 // If true, we automatically detect variables whose constraint are always
1558 // enforced by the same literal and we mark them as optional. This allows
1559 // to propagate them as if they were present in some situation.
1561 // TODO(user): This is experimental and seems to lead to wrong optimal in
1562 // some situation. It should however gives correct solutions. Fix.
1563 optional bool use_optional_variables = 108 [default = false];
1565 // The solver usually exploit the LP relaxation of a model. If this option is
1566 // true, then whatever is infered by the LP will be used like an heuristic to
1567 // compute EXACT propagation on the IP. So with this option, there is no
1568 // numerical imprecision issues.
1569 optional bool use_exact_lp_reason = 109 [default = true];
1571 // This can be beneficial if there is a lot of no-overlap constraints but a
1572 // relatively low number of different intervals in the problem. Like 1000
1573 // intervals, but 1M intervals in the no-overlap constraints covering them.
1574 optional bool use_combined_no_overlap = 133 [default = false];
1576 // All at_most_one constraints with a size <= param will be replaced by a
1577 // quadratic number of binary implications.
1578 optional int32 at_most_one_max_expansion_size = 270 [default = 3];
1580 // Indicates if the CP-SAT layer should catch Control-C (SIGINT) signals
1581 // when calling solve. If set, catching the SIGINT signal will terminate the
1582 // search gracefully, as if a time limit was reached.
1583 optional bool catch_sigint_signal = 135 [default = true];
1585 // Stores and exploits "implied-bounds" in the solver. That is, relations of
1586 // the form literal => (var >= bound). This is currently used to derive
1588 optional bool use_implied_bounds = 144 [default = true];
1590 // Whether we try to do a few degenerate iteration at the end of an LP solve
1591 // to minimize the fractionality of the integer variable in the basis. This
1592 // helps on some problems, but not so much on others. It also cost of bit of
1593 // time to do such polish step.
1594 optional bool polish_lp_solution = 175 [default = false];
1596 // The internal LP tolerances used by CP-SAT. These applies to the internal
1597 // and scaled problem. If the domains of your variables are large it might be
1598 // good to use lower tolerances. If your problem is binary with low
1599 // coefficients, it might be good to use higher ones to speed-up the lp
1601 optional double lp_primal_tolerance = 266 [default = 1e-7];
1602 optional double lp_dual_tolerance = 267 [default = 1e-7];
1604 // Temporary flag util the feature is more mature. This convert intervals to
1605 // the newer proto format that support affine start/var/end instead of just
1607 optional bool convert_intervals = 177 [default = true];
1609 // Whether we try to automatically detect the symmetries in a model and
1610 // exploit them. Currently, at level 1 we detect them in presolve and try
1611 // to fix Booleans. At level 2, we also do some form of dynamic symmetry
1612 // breaking during search. At level 3, we also detect symmetries for very
1613 // large models, which can be slow. At level 4, we try to break as much
1614 // symmetry as possible in presolve.
1615 optional int32 symmetry_level = 183 [default = 2];
1617 // When we have symmetry, it is possible to "fold" all variables from the same
1618 // orbit into a single variable, while having the same power of LP relaxation.
1619 // This can help significantly on symmetric problem. However there is
1620 // currently a bit of overhead as the rest of the solver need to do some
1621 // translation between the folded LP and the rest of the problem.
1622 optional bool use_symmetry_in_lp = 301 [default = false];
1624 // Experimental. This will compute the symmetry of the problem once and for
1625 // all. All presolve operations we do should keep the symmetry group intact
1626 // or modify it properly. For now we have really little support for this. We
1627 // will disable a bunch of presolve operations that could be supported.
1628 optional bool keep_symmetry_in_presolve = 303 [default = false];
1630 // Deterministic time limit for symmetry detection.
1631 optional double symmetry_detection_deterministic_time_limit = 302
1634 // The new linear propagation code treat all constraints at once and use
1635 // an adaptation of Bellman-Ford-Tarjan to propagate constraint in a smarter
1636 // order and potentially detect propagation cycle earlier.
1637 optional bool new_linear_propagation = 224 [default = true];
1639 // Linear constraints that are not pseudo-Boolean and that are longer than
1640 // this size will be split into sqrt(size) intermediate sums in order to have
1641 // faster propation in the CP engine.
1642 optional int32 linear_split_size = 256 [default = 100];
1644 // ==========================================================================
1645 // Linear programming relaxation
1646 // ==========================================================================
1648 // A non-negative level indicating the type of constraints we consider in the
1649 // LP relaxation. At level zero, no LP relaxation is used. At level 1, only
1650 // the linear constraint and full encoding are added. At level 2, we also add
1651 // all the Boolean constraints.
1652 optional int32 linearization_level = 90 [default = 1];
1654 // A non-negative level indicating how much we should try to fully encode
1655 // Integer variables as Boolean.
1656 optional int32 boolean_encoding_level = 107 [default = 1];
1658 // When loading a*x + b*y ==/!= c when x and y are both fully encoded.
1659 // The solver may decide to replace the linear equation by a set of clauses.
1660 // This is triggered if the sizes of the domains of x and y are below the
1662 optional int32 max_domain_size_when_encoding_eq_neq_constraints = 191
1665 // The limit on the number of cuts in our cut pool. When this is reached we do
1666 // not generate cuts anymore.
1668 // TODO(user): We should probably remove this parameters, and just always
1669 // generate cuts but only keep the best n or something.
1670 optional int32 max_num_cuts = 91 [default = 10000];
1672 // Control the global cut effort. Zero will turn off all cut. For now we just
1673 // have one level. Note also that most cuts are only used at linearization
1675 optional int32 cut_level = 196 [default = 1];
1677 // For the cut that can be generated at any level, this control if we only
1678 // try to generate them at the root node.
1679 optional bool only_add_cuts_at_level_zero = 92 [default = false];
1681 // When the LP objective is fractional, do we add the cut that forces the
1682 // linear objective expression to be greater or equal to this fractional value
1683 // rounded up? We can always do that since our objective is integer, and
1684 // combined with MIR heuristic to reduce the coefficient of such cut, it can
1686 optional bool add_objective_cut = 197 [default = false];
1688 // Whether we generate and add Chvatal-Gomory cuts to the LP at root node.
1689 // Note that for now, this is not heavily tuned.
1690 optional bool add_cg_cuts = 117 [default = true];
1692 // Whether we generate MIR cuts at root node.
1693 // Note that for now, this is not heavily tuned.
1694 optional bool add_mir_cuts = 120 [default = true];
1696 // Whether we generate Zero-Half cuts at root node.
1697 // Note that for now, this is not heavily tuned.
1698 optional bool add_zero_half_cuts = 169 [default = true];
1700 // Whether we generate clique cuts from the binary implication graph. Note
1701 // that as the search goes on, this graph will contains new binary clauses
1702 // learned by the SAT engine.
1703 optional bool add_clique_cuts = 172 [default = true];
1705 // Whether we generate RLT cuts. This is still experimental but can help on
1706 // binary problem with a lot of clauses of size 3.
1707 optional bool add_rlt_cuts = 279 [default = true];
1709 // Cut generator for all diffs can add too many cuts for large all_diff
1710 // constraints. This parameter restricts the large all_diff constraints to
1711 // have a cut generator.
1712 optional int32 max_all_diff_cut_size = 148 [default = 64];
1714 // For the lin max constraints, generates the cuts described in "Strong
1715 // mixed-integer programming formulations for trained neural networks" by Ross
1716 // Anderson et. (https://arxiv.org/pdf/1811.01988.pdf)
1717 optional bool add_lin_max_cuts = 152 [default = true];
1719 // In the integer rounding procedure used for MIR and Gomory cut, the maximum
1720 // "scaling" we use (must be positive). The lower this is, the lower the
1721 // integer coefficients of the cut will be. Note that cut generated by lower
1722 // values are not necessarily worse than cut generated by larger value. There
1723 // is no strict dominance relationship.
1725 // Setting this to 2 result in the "strong fractional rouding" of Letchford
1727 optional int32 max_integer_rounding_scaling = 119 [default = 600];
1729 // If true, we start by an empty LP, and only add constraints not satisfied
1730 // by the current LP solution batch by batch. A constraint that is only added
1731 // like this is known as a "lazy" constraint in the literature, except that we
1732 // currently consider all constraints as lazy here.
1733 optional bool add_lp_constraints_lazily = 112 [default = true];
1735 // Even at the root node, we do not want to spend too much time on the LP if
1736 // it is "difficult". So we solve it in "chunks" of that many iterations. The
1737 // solve will be continued down in the tree or the next time we go back to the
1739 optional int32 root_lp_iterations = 227 [default = 2000];
1741 // While adding constraints, skip the constraints which have orthogonality
1742 // less than 'min_orthogonality_for_lp_constraints' with already added
1743 // constraints during current call. Orthogonality is defined as 1 -
1744 // cosine(vector angle between constraints). A value of zero disable this
1746 optional double min_orthogonality_for_lp_constraints = 115 [default = 0.05];
1748 // Max number of time we perform cut generation and resolve the LP at level 0.
1749 optional int32 max_cut_rounds_at_level_zero = 154 [default = 1];
1751 // If a constraint/cut in LP is not active for that many consecutive OPTIMAL
1752 // solves, remove it from the LP. Note that it might be added again later if
1753 // it become violated by the current LP solution.
1754 optional int32 max_consecutive_inactive_count = 121 [default = 100];
1756 // These parameters are similar to sat clause management activity parameters.
1757 // They are effective only if the number of generated cuts exceed the storage
1758 // limit. Default values are based on a few experiments on miplib instances.
1759 optional double cut_max_active_count_value = 155 [default = 1e10];
1760 optional double cut_active_count_decay = 156 [default = 0.8];
1762 // Target number of constraints to remove during cleanup.
1763 optional int32 cut_cleanup_target = 157 [default = 1000];
1765 // Add that many lazy constraints (or cuts) at once in the LP. Note that at
1766 // the beginning of the solve, we do add more than this.
1767 optional int32 new_constraints_batch_size = 122 [default = 50];
1769 // All the "exploit_*" parameters below work in the same way: when branching
1770 // on an IntegerVariable, these parameters affect the value the variable is
1771 // branched on. Currently the first heuristic that triggers win in the order
1772 // in which they appear below.
1774 // TODO(user): Maybe do like for the restart algorithm, introduce an enum
1775 // and a repeated field that control the order on which these are applied?
1777 // If true and the Lp relaxation of the problem has an integer optimal
1778 // solution, try to exploit it. Note that since the LP relaxation may not
1779 // contain all the constraints, such a solution is not necessarily a solution
1780 // of the full problem.
1781 optional bool exploit_integer_lp_solution = 94 [default = true];
1783 // If true and the Lp relaxation of the problem has a solution, try to exploit
1784 // it. This is same as above except in this case the lp solution might not be
1785 // an integer solution.
1786 optional bool exploit_all_lp_solution = 116 [default = true];
1788 // When branching on a variable, follow the last best solution value.
1789 optional bool exploit_best_solution = 130 [default = false];
1791 // When branching on a variable, follow the last best relaxation solution
1792 // value. We use the relaxation with the tightest bound on the objective as
1793 // the best relaxation solution.
1794 optional bool exploit_relaxation_solution = 161 [default = false];
1796 // When branching an a variable that directly affect the objective,
1797 // branch on the value that lead to the best objective first.
1798 optional bool exploit_objective = 131 [default = true];
1800 // Infer products of Boolean or of Boolean time IntegerVariable from the
1801 // linear constrainst in the problem. This can be used in some cuts, altough
1802 // for now we don't really exploit it.
1803 optional bool detect_linearized_product = 277 [default = false];
1805 // This should be better on integer problems.
1806 // But it is still work in progress.
1807 optional bool use_new_integer_conflict_resolution = 336 [default = false];
1809 // If true, and during integer conflict resolution (icr) the 1-UIP is an
1810 // integer literal for which we do not have an associated Boolean. Create one.
1811 optional bool create_1uip_boolean_during_icr = 341 [default = true];
1813 // ==========================================================================
1814 // MIP -> CP-SAT (i.e. IP with integer coeff) conversion parameters that are
1815 // used by our automatic "scaling" algorithm.
1817 // Note that it is hard to do a meaningful conversion automatically and if
1818 // you have a model with continuous variables, it is best if you scale the
1819 // domain of the variable yourself so that you have a relevant precision for
1820 // the application at hand. Same for the coefficients and constraint bounds.
1821 // ==========================================================================
1823 // We need to bound the maximum magnitude of the variables for CP-SAT, and
1824 // that is the bound we use. If the MIP model expect larger variable value in
1825 // the solution, then the converted model will likely not be relevant.
1826 optional double mip_max_bound = 124 [default = 1e7];
1828 // All continuous variable of the problem will be multiplied by this factor.
1829 // By default, we don't do any variable scaling and rely on the MIP model to
1830 // specify continuous variable domain with the wanted precision.
1831 optional double mip_var_scaling = 125 [default = 1.0];
1833 // If this is false, then mip_var_scaling is only applied to variables with
1834 // "small" domain. If it is true, we scale all floating point variable
1835 // independenlty of their domain.
1836 optional bool mip_scale_large_domain = 225 [default = false];
1838 // If true, some continuous variable might be automatically scaled. For now,
1839 // this is only the case where we detect that a variable is actually an
1840 // integer multiple of a constant. For instance, variables of the form k * 0.5
1841 // are quite frequent, and if we detect this, we will scale such variable
1842 // domain by 2 to make it implied integer.
1843 optional bool mip_automatically_scale_variables = 166 [default = true];
1845 // If one try to solve a MIP model with CP-SAT, because we assume all variable
1846 // to be integer after scaling, we will not necessarily have the correct
1847 // optimal. Note however that all feasible solutions are valid since we will
1848 // just solve a more restricted version of the original problem.
1850 // This parameters is here to prevent user to think the solution is optimal
1851 // when it might not be. One will need to manually set this to false to solve
1852 // a MIP model where the optimal might be different.
1854 // Note that this is tested after some MIP presolve steps, so even if not
1855 // all original variable are integer, we might end up with a pure IP after
1856 // presolve and after implied integer detection.
1857 optional bool only_solve_ip = 222 [default = false];
1859 // When scaling constraint with double coefficients to integer coefficients,
1860 // we will multiply by a power of 2 and round the coefficients. We will choose
1861 // the lowest power such that we have no potential overflow (see
1862 // mip_max_activity_exponent) and the worst case constraint activity error
1863 // does not exceed this threshold.
1865 // Note that we also detect constraint with rational coefficients and scale
1866 // them accordingly when it seems better instead of using a power of 2.
1868 // We also relax all constraint bounds by this absolute value. For pure
1869 // integer constraint, if this value if lower than one, this will not change
1870 // anything. However it is needed when scaling MIP problems.
1872 // If we manage to scale a constraint correctly, the maximum error we can make
1873 // will be twice this value (once for the scaling error and once for the
1874 // relaxed bounds). If we are not able to scale that well, we will display
1875 // that fact but still scale as best as we can.
1876 optional double mip_wanted_precision = 126 [default = 1e-6];
1878 // To avoid integer overflow, we always force the maximum possible constraint
1879 // activity (and objective value) according to the initial variable domain to
1880 // be smaller than 2 to this given power. Because of this, we cannot always
1881 // reach the "mip_wanted_precision" parameter above.
1883 // This can go as high as 62, but some internal algo currently abort early if
1884 // they might run into integer overflow, so it is better to keep it a bit
1886 optional int32 mip_max_activity_exponent = 127 [default = 53];
1888 // As explained in mip_precision and mip_max_activity_exponent, we cannot
1889 // always reach the wanted precision during scaling. We use this threshold to
1890 // enphasize in the logs when the precision seems bad.
1891 optional double mip_check_precision = 128 [default = 1e-4];
1893 // Even if we make big error when scaling the objective, we can always derive
1894 // a correct lower bound on the original objective by using the exact lower
1895 // bound on the scaled integer version of the objective. This should be fast,
1896 // but if you don't care about having a precise lower bound, you can turn it
1898 optional bool mip_compute_true_objective_bound = 198 [default = true];
1900 // Any finite values in the input MIP must be below this threshold, otherwise
1901 // the model will be reported invalid. This is needed to avoid floating point
1902 // overflow when evaluating bounds * coeff for instance. We are a bit more
1903 // defensive, but in practice, users shouldn't use super large values in a
1905 optional double mip_max_valid_magnitude = 199 [default = 1e20];
1907 // By default, any variable/constraint bound with a finite value and a
1908 // magnitude greater than the mip_max_valid_magnitude will result with a
1909 // invalid model. This flags change the behavior such that such bounds are
1910 // silently transformed to +∞ or -∞.
1912 // It is recommended to keep it at false, and create valid bounds.
1913 optional bool mip_treat_high_magnitude_bounds_as_infinity = 278
1916 // Any value in the input mip with a magnitude lower than this will be set to
1917 // zero. This is to avoid some issue in LP presolving.
1918 optional double mip_drop_tolerance = 232 [default = 1e-16];
1920 // When solving a MIP, we do some basic floating point presolving before
1921 // scaling the problem to integer to be handled by CP-SAT. This control how
1922 // much of that presolve we do. It can help to better scale floating point
1923 // model, but it is not always behaving nicely.
1924 optional int32 mip_presolve_level = 261 [default = 2];