Debian Codegraph @

Bonmin/doc/options_set.tex

raw
1
2 \begin{PageSummary}
3 \PageName{Setting Options}
4 \PageSection{Passing options to \Bonmin }{sec:opt_opt}
5 \PageSection{List of options}{sec:options_list}
6 \PageSection{Getting good solutions to nonconvex problems}{sec:opt_nonconv}
7 \PageSection{Notes on \Ipopt\ options}{sec:opt_ipopt}
8 \end{PageSummary}
9
10
11 \PageTitle{Options}{sec:opt}
12 \subsectionH{Passing options to \Bonmin}{sec:opt_opt}
13 Options in \Bonmin\ can be set in several different ways.
14
15 First, you can set options by putting them in a file called {\tt
16 bonmin.opt} in the directory where {\tt bonmin} is executing. If you
17 are familiar with the file
18 \href{\IpoptDoc{34}}{\tt
19 ipopt.opt} (formerly named {\tt PARAMS.DAT}) in {\tt Ipopt}, the
20 syntax of the {\tt bonmin.opt} is similar. For those not familiar
21 with {\tt ipopt.opt}, the syntax is simply to put the name of the
22 option followed by its value, with no more than two options on a
23 single line. Anything on a line after a \# symbol is ignored (i.e.,
24 treated as a comment).
25
26 Note that \Bonmin\ sets options for {\tt
27 Ipopt}. If you want to set options for {\tt Ipopt} (when used inside \Bonmin) you have to set them
28 in the file {\tt bonmin.opt} (the standard {\tt Ipopt} option file {\tt ipopt.opt}
29 is not read by \Bonmin.)
30 For a list and a description of all the {\tt Ipopt} options, the
31 reader may refer to the
32 \footlink{\IpoptDoc{39}}{documentation
33 of {\tt
34 Ipopt}}.
35
36 Since {\tt bonmin.opt} contains both {\tt Ipopt} and \Bonmin\ options, for clarity
37 all \Bonmin\ options should be preceded with the prefix ``{\tt bonmin.}'' in {\tt bonmin.opt}~.
38 Note that some options can also be passed to the MILP subsolver used by \Bonmin\
39 in the outer approximation decomposition
40 and the hybrid (see Subsection \ref{sec:sub_solvers}).
41
42 The most important option in \Bonmin\ is the choice of the solution
43 algorithm. This can be set by using the option named {\tt
44 bonmin.algorithm} which can be set to {\tt B-BB}, {\tt B-OA}, {\tt
45 B-QG}, or {\tt B-Hyb} (it's default value is {\tt B-BB}). Depending
46 on the value of this option, certain other options may be available
47 or not. \latexhtml{Table \ref{tab:options} gives t}{T}he list of options together
48 with their types, default values and availability in each of the
49 four algorithms\latexhtml{}{ can be found \href{\OptListPage \#sec:options_list}{here}}. The column labeled `type' indicates the type of the
50 parameter (`F' stands for float, `I' for integer, and `S' for
51 string). The column labeled `default' indicates the global default
52 value. Then for each of the algorithms {\tt B-BB}, {\tt B-OA},
53 {\tt B-QG}, {\tt B-Hyb}, {\tt B-Ecp}, and {\tt B-iFP} `$\surd$' indicates that the option is
54 available for that particular algorithm
55 while `$-$' indicates that it is not.
56
57 An example of a {\tt bonmin.opt} file including all the options
58 with their default values is located in the {\tt Test}
59 sub-directory.
60
61 A small example is as follows:
62 \begin{verbatim}
63 bonmin.bb_log_level 4
64 bonmin.algorithm B-BB
65 print_level 6
66 \end{verbatim}
67 This sets the level of output of the branch-and-bound in \Bonmin\ to $4$, the algorithm to branch-and-bound
68 and the output level for {\tt Ipopt} to $6$.
69
70 When \Bonmin\ is run from within {\tt AMPL}, another way to set
71 an option is via the
72 internal {\tt AMPL} command {\tt options}.
73 For example
74 \begin{verbatim}
75 options bonmin_options "bonmin.bb_log-level 4 \
76 bonmin.algorithm B-BB print_level 6";
77 \end{verbatim}
78 has the same affect as the {\tt bonmin.opt} example above.
79 Note that any \Bonmin\ option specified in the file {\tt bonmin.opt}
80 overrides any setting of that option from within {\tt AMPL}.
81
82 A third way is to set options directly in the C/C++ code when
83 running \Bonmin\ from inside a C/C++ program as is explained in the reference manual.
84
85 A detailed description of all of the \Bonmin\ options is given \latexhtml{in Appendix \ref{sec:optList}}{\href{\OptListPage \#sec:options_list}{here}}.
86 In the following, we give some more details on options for the MILP subsolver and
87 on the options specifically designed
88 for nonconvex problems.
89
90 \latexhtml{
91 \include{options_table}
92 }{
93 }
94
95 \subsectionH{Passing options to local search based heuristics and oa generators}{sec:sub_solvers}
96 %\label{sec:sub_solvers}
97 Several parts of the algorithms in \Bonmin\ are based on solving a simplified version of the problem with another instance of \Bonmin:
98 Outer Approximation Decomposition (called in {\tt B-Hyb} at the root node)
99 and Feasibility Pump for MINLP (called in B-Hyb or B-BB at the root node), RINS, RENS, Local Branching.
100
101 In all these cases, one can pass options to the sub-algorithm used through the bonmin.opt file. The basic principle is
102 that the {\tt bonmin.} prefix is replaced with a prefix that identifies the sub-algorithm used:
103 \begin{itemize}
104 \item {\tt oa\_decomposition.} to pass options to Outer Approximation Decomposition,
105 \item {\tt pump\_for\_minlp.} to pass options to Feasibility Pump for MINLP
106 \item {\tt rins.} to pass options to RINS,
107 \item {\tt rens.} to pass options to RENS,
108 \item {\tt local\_branch.} to pass options to Local Branching.
109 \end{itemize}
110
111
112 For example, we may want to run a maximum of 60 seconds of the feasibility pump for MINLP until 6 solutions are found at the beginning of the hybrid algorithm. To do so
113 we set the following option in {\tt bonmin.opt}
114 \begin{verbatim}
115 bonmin.algorithm B-Hyb
116
117 bonmin.pump_for_minlp yes # tells to run fp for MINLP
118 pump_for_minlp.time_limit 60 # set a time limit for the pump
119 pump_for_minlp.solution_limit 6 # set a solution limit
120 \end{verbatim}
121
122 Note that the actual solution and time limit will be the minimum of the global limits set for \Bonmin.
123
124 A slightly more complicated set of options may be used when using RINS. Say for example that we want to run RINS inside B-BB. Each time RINS is called we want
125 to solve the small-size MINLP generated using B-QG (we may run any algorithm available in \Bonmin for solving an MINLP) and want to stop as soon as B-QG found 1 solution.
126 We set the following options in bonmin.opt
127
128 \begin{verbatim}
129 bonmin.algorithm B-BB
130
131 bonmin.rins yes
132 rins.algorithm B-QG
133 rins.solution_limit 1
134
135 \end{verbatim}
136 This example shows that it is possible to set any option used in the sub-algorithm to be different than the one used for the main algorithm.
137
138
139 In the context of OA and FP for MINLP, a standard MILP solver is used.
140 Several option are available for configuring this MILP solver.
141 \Bonmin\ allows a choice of different MILP solvers through the option
142 {\tt bonmin.milp\_subsolver}. Values for this option are: {\tt Cbc\_D} which uses {\tt Cbc} with its
143 default settings, {\tt Cplex} which uses {\tt Cplex} with its default settings, and
144 {\tt Cbc\_Par} which uses a version of {\tt Cbc} that can be parametrized by the user.
145 The options that can be set in {\tt Cbc\_Par} are the number of strong-branching candidates,
146 the number of branches before pseudo costs are to be trusted, and the frequency of the various cut generators
147 (these options are signaled in Table \ref{tab:options}).
148
149 \subsectionH{Getting good solutions to nonconvex problems}{sec:opt_nonconv}
150 \label{sec:non_convex}
151 To solve a problem with non-convex constraints, one should only use the branch-and-bound algorithm {\tt B-BB}.
152
153
154 A few options have been designed in \Bonmin\ specifically to treat
155 problems that do not have a convex continuous relaxation.
156 In such problems, the solutions obtained from {\tt Ipopt} are
157 not necessarily globally optimal, but are only locally optimal. Also the outer-approximation
158 constraints are not necessarily valid inequalities for the problem.
159
160 No specific heuristic method for treating nonconvex problems is implemented
161 yet within the OA framework.
162 But for the pure branch-and-bound {\tt B-BB}, we implemented a few options having
163 in mind that lower bounds provided by {\tt Ipopt} should not be trusted, and with the goal of
164 trying to get good solutions. Such options are at a very experimental stage.
165
166 First, in the context of nonconvex problems, {\tt Ipopt} may find different local optima when started
167 from different starting points. The two options {\tt num\_re\-solve\_at\_root} and {\tt num\_resolve\_at\_node}
168 allow for solving the root node or each node of the tree, respectively, with a user-specified
169 number of different randomly-chosen
170 starting points, saving the best solution found. Note that the function to generate a random starting point
171 is very na\"{\i}ve: it chooses a random point (uniformly) between the bounds provided for the variable.
172 In particular if there are some functions
173 that can not be evaluated at some points of the domain, it may pick such points,
174 and so it is not robust in that respect.
175
176 Secondly, since the solution given by {\tt Ipopt} does not truly give a lower bound, we allow for
177 changing the fathoming rule
178 to continue branching even if the solution value to the current node is worse
179 than the best-known
180 solution. This is achieved by setting {\tt allowable\_gap}
181 and {\tt allowable\_fraction\_gap} and {\tt cutoff\_decr} to negative values.
182
183 \subsectionH{Notes on {\tt Ipopt} options}{sec:opt_ipopt}
184 %\label{sec:opt_ipopt}
185 \Ipopt\ has a very large number of options, to get a complete description of them, you
186 should refer to the \Ipopt\ manual.
187 Here we only mention and explain some of the options that have been more important to us, so far,
188 in developing and using \Bonmin.
189 \subsubsection{Default options changed by \Bonmin}
190 \Ipopt\ has been tailored to be more efficient when used in the context of the
191 solution of a MINLP problem. In particular, we have tried to
192 improve \Ipopt's warm-starting capabilities and its ability to prove quickly that a subproblem
193 is infeasible. For ordinary NLP problems, \Ipopt\ does not use these options
194 by default, but \Bonmin\ automatically changes these options from their default values.
195
196 Note that options set by the user in {\tt bonmin.opt} will override these
197 settings.
198
199 \paragraph{{\tt mu\_strategy} and {\tt mu\_oracle}} are set, respectively, to
200 {\tt adaptive} and {\tt probing} by default (these are newly implemented strategies in \Ipopt\
201 for updating the barrier parameter \mycite{NocedalAdaptive}{Nocedal2004} which we have found to be
202 more efficient in the context of MINLP).
203 \paragraph{{\tt gamma\_phi} and {\tt gamma\_theta}} are set to $10^{-8}$ and $10^{-4}$
204 respectively. This has the effect of reducing the size of the filter in the line search performed by \Ipopt.
205
206 \paragraph{\tt required\_infeasibility\_reduction} is set to $0.1$.
207 This increases the required infeasibility reduction when \Ipopt\ enters the
208 restoration phase and should thus help to
209 detect infeasible problems faster.
210
211 \paragraph{\tt expect\_infeasible\_problem} is set to {\tt yes}, which enables some heuristics
212 to detect infeasible problems faster.
213
214 \paragraph{\tt warm\_start\_init\_point} is set to {\tt yes} when a full primal/dual starting
215 point is available (generally all the optimizations after the continuous relaxation has been solved).
216
217 \paragraph{\tt print\_level} is set to $0$ by default to turn off \Ipopt\ output.
218 \subsubsection{Some useful \Ipopt\ options}
219 \paragraph{bound\_relax\_factor} is by default set to $10^{-8}$ in \Ipopt. All of the bounds
220 of the problem are relaxed by this factor. This may cause some trouble
221 when constraint functions can only be evaluated within their bounds.
222 In such cases, this
223 option should be set to 0.