1// Copyright 2010-2024 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.
16package operations_research;
18// Contains both the "SCIP parameters" and gSCIP only configuration. For the
19// SCIP parameters, the order of application is:
21// 2. Meta parameters (heuristics, presolve, separating)
22// 3. Individual SCIP parameters (e.g. an entry in bool_params)
23// Note that 1. and 2. both apply a combination of parameters from 3.
25// For parameters that are marked as optional, the underlying solver default
26// is used if they are not specified.
27message GScipParameters {
28 // See SCIP documentation for details:
29 // https://scip.zib.de/doc/html/type__paramset_8h.php#a2e51a867a8ea3ea16f15e7cc935c3f32
43 // See SCIP documentation for details:
44 // https://scip.zib.de/doc/html/type__paramset_8h.php#a083067d8e425d0d44e834095e82902ed
46 DEFAULT_META_PARAM_VALUE = 0;
52 Emphasis emphasis = 1;
54 // See SCIPsetHeuristics() for details:
55 // https://scip.zib.de/doc/html/group__ParameterMethods.php#gaeccb7859066cadd01d0df7aca98e2c7d
56 optional MetaParamValue heuristics = 2;
58 // See SCIPsetPresolving() for details:
59 // https://scip.zib.de/doc/html/group__ParameterMethods.php#ga8365de8ab5ec5961c005e2d77965b182
60 optional MetaParamValue presolve = 3;
62 // See SCIPsetSeparating() for details:
63 // https://scip.zib.de/doc/html/group__ParameterMethods.php#gad0c64e3e9b8def72fd8a7d3d9dce7729
64 optional MetaParamValue separating = 4;
66 // See https://scip.zib.de/doc/html/PARAMETERS.php for a list of all SCIP
68 map<string, bool> bool_params = 5;
69 map<string, int32> int_params = 6;
70 map<string, int64> long_params = 7;
71 map<string, double> real_params = 8;
72 map<string, string> char_params = 9;
73 map<string, string> string_params = 10;
75 // ///////////////////////////////////////////////////////////////////////////
76 // gSCIP only parameters
77 // ///////////////////////////////////////////////////////////////////////////
79 // Disable all terminal output (override all logging parameters). To control
80 // only the search logs, see also the SCIP parameter display/verblevel and
81 // from gscip_parameters.h, SetLogLevel() and SetOutputEnabled().
82 optional bool silence_output = 11;
84 // Log solver metrics to terminal when finished solving (unless silenced).
85 bool print_detailed_solving_stats = 12;
87 // Write out the model in SCIP's text format before solving to the terminal
89 bool print_scip_model = 13;
91 // If nonempty, search logs are written here INSTEAD OF out to terminal. See
92 // also the SCIP parameter display/verblevel and from gscip_parameters.h, the
93 // functions SetLogLevel() and SetOutputEnabled() for configuring the search
96 // Does not use gfile, can only write to local disk.
97 string search_logs_filename = 14;
99 // If non-empty, write detailed_solving_stats to a file. Can be set
100 // independently from print_detailed_solving_stats.
102 // Does not use gfile, can only write to local disk.
103 string detailed_solving_stats_filename = 15;
105 // If nonempty, out the model in SCIP's text format to a file before solving.
106 // Can be set independently of print_scip_model.
108 // Does not use gfile, can only write to local disk.
109 string scip_model_filename = 16;
111 // How many solutions to retrieve from the solution pool (if this many exist).
112 // At least one solution will always be returned, even if num_solutions < 1.
113 optional int32 num_solutions = 17;
115 // If set, ignore all solutions worse than objective_limit, for details see
116 // SCIPsetObjlimit(). Note that the solution pool will still contain solutions
117 // worse than the limit as SCIP uses these to run improvement heuristics, and
118 // if you query all solutions at the end of the solve they will be present,
119 // even if you found no solution that met the limit and returned infeasible.
120 optional double objective_limit = 18;
123// TODO(user): this should be machine generated by script and contain all of
124// https://scip.zib.de/doc/html/group__PublicSolvingStatsMethods.php
125message GScipSolvingStats {
126 // The objective value of the best solution (or the cutoff). If no solution is
127 // found, returns +inf for minimization and -inf for maximization. Equivalent
128 // to SCIPgetPrimalbound().
129 double best_objective = 1;
130 // The best proven bound on the object (e.g. through the LP relaxation).
131 // Returns +inf for maximization and -inf for minimization if no bound was
132 // found. Equivalent to SCIPgetDualBound().
133 double best_bound = 2;
134 // nprimallpiterations in SCIP. The number of primal simplex LP iterations.
135 int64 primal_simplex_iterations = 3;
136 // nduallpiterations in SCIP. The number of dual simplex LP iterations.
137 int64 dual_simplex_iterations = 4;
138 // nbarrierlpiterations. The number of barrier LP iterations.
139 int64 barrier_iterations = 10;
140 // nlp_iterations in SCIP. The total number of LP steps taken. Note that this
141 // number be at least (and often strictly greater than)
142 // primal_simplex_iterations + dual simplex iterations + barrier iterations,
143 // as it includes other types of iterations (e.g. see ndivinglpiterations).
144 int64 total_lp_iterations = 5;
145 // NTotalNodes in SCIP.
146 // This is the total number of nodes used in the solve, potentially across
147 // multiple branch-and-bound trees. Use limits/totalnodes (rather than
148 // limits/nodes) to control this value.
149 int64 node_count = 6;
150 // FirstLPDualboundRoot in SCIP. The bound obtained from the first LP solve
152 double first_lp_relaxation_bound = 7;
153 // DualboundRoot in SCIP. The bound obtained at the root node, possibly after
154 // multiple rounds of cuts.
155 double root_node_bound = 8;
156 // A deterministic measure of work done during the solve. The units of this
157 // field are specific to SCIP.
158 double deterministic_time = 9;
162 // See https://scip.zib.de/doc/html/type__stat_8h.php
167 TOTAL_NODE_LIMIT = 3;
168 STALL_NODE_LIMIT = 4;
180 // WARNING(rander): we add some extra status values beyond SCIP here
181 INVALID_SOLVER_PARAMETERS = 16;
184 string status_detail = 2;
185 GScipSolvingStats stats = 3;