#include <CouenneFixPoint.hpp>
Collaboration diagram for Couenne::CouenneFixPoint:
Public Member Functions | |
CouenneFixPoint (CouenneProblem *, const Ipopt::SmartPtr< Ipopt::OptionsList >) | |
constructor | |
CouenneFixPoint (const CouenneFixPoint &) | |
copy constructor | |
~CouenneFixPoint () | |
destructor | |
CouenneFixPoint * | clone () const |
clone method (necessary for the abstract CglCutGenerator class) | |
void | generateCuts (const OsiSolverInterface &, OsiCuts &, const CglTreeInfo=CglTreeInfo()) const |
the main CglCutGenerator | |
Static Public Member Functions | |
static void | registerOptions (Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions) |
Add list of options to be read from file. | |
Protected Member Functions | |
void | createRow (int, int, int, OsiSolverInterface *, const int *, const double *, const double, const int, bool, int, int) const |
Create a single cut. | |
Protected Attributes | |
bool | extendedModel_ |
should we use an extended model or a more compact one? | |
CouenneProblem * | problem_ |
pointer to the CouenneProblem representation | |
bool | firstCall_ |
Is this the first call? | |
double | CPUtime_ |
CPU time. | |
int | nRuns_ |
Number of actual runs. | |
int | nTightened_ |
Number of bounds tightened. |
Definition at line 27 of file CouenneFixPoint.hpp.
CouenneFixPoint::CouenneFixPoint | ( | CouenneProblem * | , | |
const Ipopt::SmartPtr< Ipopt::OptionsList > | ||||
) |
constructor
Definition at line 17 of file FixPointConstructors.cpp.
References extendedModel_, and s.
Referenced by clone().
CouenneFixPoint::CouenneFixPoint | ( | const CouenneFixPoint & | ) |
CouenneFixPoint::~CouenneFixPoint | ( | ) |
destructor
Definition at line 42 of file FixPointConstructors.cpp.
References CPUtime_, firstCall_, nRuns_, and nTightened_.
CouenneFixPoint* Couenne::CouenneFixPoint::clone | ( | ) | const [inline] |
clone method (necessary for the abstract CglCutGenerator class)
Definition at line 42 of file CouenneFixPoint.hpp.
References CouenneFixPoint().
void CouenneFixPoint::generateCuts | ( | const OsiSolverInterface & | , | |
OsiCuts & | , | |||
const | CglTreeInfo = CglTreeInfo() | |||
) | const |
the main CglCutGenerator
Only run this if the latest FBBT terminated on the iteration limit, as this suggest that the FPLP might be of some help. Termination before iteration limit reached implies that a relaxation (on which the FPLP is based) won't generate better bounds.
However, we do run the first time as otherwise it would be nixed for the whole branch-and-bound.
An LP relaxation of a MINLP problem is available in the first parameter passed. Let us suppose that this LP relaxation is of the form
LP = {x in R^n: Ax <= b}
for suitable nxm matrix A, rhs vector b, and variable vector x. Our purpose is that of creating a much larger LP that will help us find the interval [l,u] corresponding to the fixpoint of an FBBT algorithm. To this purpose, consider a single constraint of the above system:
sum {i=1..n} a_ji x_i <= b_j
According to two schools of thought (Leo's and mine), this single constraint can give rise to a number of FBBT constraints. The two schools of thoughts differ in the meaning of b: in mine, it is constant. In Leo's, it is a variable.
We need to perform the following steps:
define variables xL and xU define variables gL and gU for constraints (downward variables)
add objective function sum_j (u_j - l_j)
for each constraint a^j x <= b_j in Ax <= b: for each variable x_i contained: depending on sign of a_ji, add constraint on x_i^L or x_i^U (*) add constraints on g_j as well
solve LP
if new bounds are better than si's old bounds add OsiColCuts
Get the original problem's coefficient matrix and rhs vector, A and b
Now we have an fbbt-fixpoint LP problem. Solve it to get (possibly) better bounds
Definition at line 28 of file FixPointGenCuts.cpp.
References COUENNE_EPS, COUENNE_INFINITY, CPUtime_, createRow(), extendedModel_, firstCall_, isWiped(), Couenne::J_BOUNDTIGHTENING(), Couenne::J_COUENNE(), m, n, nRuns_, nTightened_, and problem_.
void CouenneFixPoint::registerOptions | ( | Ipopt::SmartPtr< Bonmin::RegisteredOptions > | roptions | ) | [static] |
Add list of options to be read from file.
Definition at line 51 of file FixPointConstructors.cpp.
Referenced by Couenne::CouenneSetup::registerAllOptions().
void CouenneFixPoint::createRow | ( | int | , | |
int | , | |||
int | , | |||
OsiSolverInterface * | , | |||
const int * | , | |||
const double * | , | |||
const | double, | |||
const | int, | |||
bool | , | |||
int | , | |||
int | ||||
) | const [protected] |
Create a single cut.
Define
I+ the subset of {1..n} such that a_ji > 0 and i != indexVar; I- the subset of {1..n} such that a_ji < 0 and i != indexVar.
Consider
sum {i=1..n} a_ji x_i = b_j, (=)
equivalent to the two constraints
sum {i=1..n} a_ji x_i >= b_j. (>) -- sign will be -1 (rlb) sum {i=1..n} a_ji x_i <= b_j (<) -- sign will be +1 (rub)
Hence we should consider both (<) and (>) when we have an equality constraint. The resulting set of upward FBBT is as follows:
sum {i in I+} a_ji xU_i + sum {i in I-} a_ji xL_i >= bU_j (only if (<) enforced, i.e., sign == 1) sum {i in I+} a_ji xL_i + sum {i in I-} a_ji xU_i <= bL_j (only if (>) enforced, i.e., sign == -1)
together with the constraints defining the initial bounding interval of the auxiliary variable (already included):
bU_j <= bU0_j (<) bL_j >= bL0_j (>)
The set of downward FBBT constraints is instead:
xL_i >= (bL_j - sum {k in I+} a_jk xU_k - sum {k in I-} a_jk xL_k) / a_ji (if a_ji > 0 and (>)) xU_i <= (bU_j - sum {k in I+} a_jk xL_k - sum {k in I-} a_jk xU_k) / a_ji (if a_ji > 0 and (<))
xU_i <= (bL_j - sum {k in I+} a_jk xU_k - sum {k in I-} a_jk xL_k) / a_ji (if a_ji < 0 and (>)) xL_i >= (bU_j - sum {k in I+} a_jk xL_k - sum {k in I-} a_jk xU_k) / a_ji (if a_ji < 0 and (<))
probably better rewritten, to avoid (further) numerical issues, as
a_ji xL_i >= bL_j - sum {k in I+} a_jk xU_k - sum {k in I-} a_jk xL_k (if a_ji > 0 and (>)) a_ji xU_i <= bU_j - sum {k in I+} a_jk xL_k - sum {k in I-} a_jk xU_k (if a_ji > 0 and (<))
or even better, to keep the old coefficients (but not the indices!), like this:
a_ji xL_i + sum {k in I+} a_jk xU_k + sum {k in I-} a_jk xL_k - bL_j >= 0 (if a_ji > 0 and (>)) a_ji xU_i + sum {k in I+} a_jk xL_k + sum {k in I-} a_jk xU_k - bU_j <= 0 (if a_ji > 0 and (<))
a_ji xU_i + sum {k in I+} a_jk xU_k + sum {k in I-} a_jk xL_k - bL_j >= 0 (if a_ji < 0 and (>)) a_ji xL_i + sum {k in I+} a_jk xL_k + sum {k in I-} a_jk xU_k - bU_j <= 0 (if a_ji < 0 and (<))
and finally we need initial lower/upper bounds:
xL_i >= xL0_i xU_i <= xU0_i
and some consistency constraints
bL_i <= bU_i
(these and the two bound constraints above are already added in the main function above).
According to my school of thought, instead, there is no upward/downward directions to simulate. Hence, considering again
sum {i=1..n} a_ji x_i >= b_j (>) -- sign will be -1 (rlb) sum {i=1..n} a_ji x_i <= b_j (<) -- sign will be +1 (rub)
we'll have similar constraints, where bL and bU are replaced by the original rhs.
xL_i >= (b_j - sum {k in I+} a_jk xU_k - sum {k in I-} a_jk xL_k) / a_ji (if a_ji > 0 and (>)) xU_i <= (b_j - sum {k in I+} a_jk xL_k - sum {k in I-} a_jk xU_k) / a_ji (if a_ji > 0 and (<))
xU_i <= (b_j - sum {k in I+} a_jk xU_k - sum {k in I-} a_jk xL_k) / a_ji (if a_ji < 0 and (>)) xL_i >= (b_j - sum {k in I+} a_jk xL_k - sum {k in I-} a_jk xU_k) / a_ji (if a_ji < 0 and (<))
once again rewritten as
a_ji xL_i >= b_j - sum {k in I+} a_jk xU_k - sum {k in I-} a_jk xL_k (if a_ji > 0 and (>)) a_ji xU_i <= b_j - sum {k in I+} a_jk xL_k - sum {k in I-} a_jk xU_k (if a_ji > 0 and (<))
or even better:
a_ji xL_i + sum {k in I+} a_jk xU_k + sum {k in I-} a_jk xL_k >= b_j (if a_ji > 0 and (>)) a_ji xU_i + sum {k in I+} a_jk xL_k + sum {k in I-} a_jk xU_k <= b_j (if a_ji > 0 and (<))
a_ji xU_i + sum {k in I+} a_jk xU_k + sum {k in I-} a_jk xL_k >= b_j (if a_ji < 0 and (>)) a_ji xL_i + sum {k in I+} a_jk xL_k + sum {k in I-} a_jk xU_k <= b_j (if a_ji < 0 and (<))
No other cuts are needed.
Definition at line 357 of file FixPointGenCuts.cpp.
References Couenne::J_BOUNDTIGHTENING(), k, and problem_.
Referenced by generateCuts().
bool Couenne::CouenneFixPoint::extendedModel_ [protected] |
should we use an extended model or a more compact one?
Definition at line 56 of file CouenneFixPoint.hpp.
Referenced by CouenneFixPoint(), and generateCuts().
CouenneProblem* Couenne::CouenneFixPoint::problem_ [protected] |
pointer to the CouenneProblem representation
Definition at line 59 of file CouenneFixPoint.hpp.
Referenced by createRow(), and generateCuts().
bool Couenne::CouenneFixPoint::firstCall_ [mutable, protected] |
Is this the first call?
Definition at line 62 of file CouenneFixPoint.hpp.
Referenced by generateCuts(), and ~CouenneFixPoint().
double Couenne::CouenneFixPoint::CPUtime_ [mutable, protected] |
CPU time.
Definition at line 65 of file CouenneFixPoint.hpp.
Referenced by generateCuts(), and ~CouenneFixPoint().
int Couenne::CouenneFixPoint::nRuns_ [mutable, protected] |
Number of actual runs.
Definition at line 68 of file CouenneFixPoint.hpp.
Referenced by generateCuts(), and ~CouenneFixPoint().
int Couenne::CouenneFixPoint::nTightened_ [mutable, protected] |
Number of bounds tightened.
Definition at line 71 of file CouenneFixPoint.hpp.
Referenced by generateCuts(), and ~CouenneFixPoint().