A branch-cut-and-price algorithm for solving a nonconvex MINLP problem. More...
#include <bcp.h>
Classes | |
struct | LagSolveStatus_s |
Public Member Functions | |
MinlpBCP (Pointer< MinlpProblem > orig_prob_, Pointer< MinlpProblem > split_prob_, Pointer< LinearRelax > linear_relax_, bool is_gams_prob=false, double closeval_tol_=0., Pointer< dvector > diam_=NULL, Pointer< Param > param_=NULL, Pointer< ostream > out_solver_p_=out_out_p, Pointer< ostream > out_solver_log_p_=out_log_p) | |
virtual | ~MinlpBCP () |
void | set_quad_relax (Pointer< MinlpProblem > quad_prob_) |
void | set_convex_prob (Pointer< MinlpProblem > convex_prob_, const Pointer< dvector > &sol_C_=NULL, bool sol_C_is_solution_=false) |
void | set_reform (Pointer< Reformulation > reform_, Pointer< dvector > sol_C_, bool sol_C_is_solution_) |
void | set_reform (Pointer< Reformulation > reform_) |
void | set_linear_relax (Pointer< LinearRelax > linrelax_) |
void | set_problem_is_convex (bool prob_is_convex_) |
void | set_MINLPData (Pointer< MINLPData > minlpdata_) |
void | set_timer (Pointer< Timer > timer_) |
int | solve () |
Calls the branch-cut-and-price algorithm. | |
int | solve (dvector &start) |
Solves the problem for a starting point. | |
Private Types | |
enum | t_bound_type { RMP_bound, NLP_bound, LP_bound, LP_RMP_bound, stop_bound } |
enum | { BranchCut } |
enum | { BinSubdiv, CostSubdivLag, CostSubdivNewton, BisectSubdiv, RMPSubdiv, ViolSubdiv } |
enum | { BestBound, UnfixedDiscrete } |
typedef struct MinlpBCP::LagSolveStatus_s | LagSolveStatus |
Private Member Functions | |
double | start_bb () |
starts the BB-algorithm | |
bool | add_sol_candidate (const dvector &x) |
int | find_sol_candidates (Pointer< MinlpNode > node) |
Finds solution candidates using a heuristic defined by heu_type. | |
int | preswitching (Pointer< MinlpNode > node) |
void | init () |
Initializes the BCP-algorithm. | |
void | init_block_problems () |
Initializes the block problems. | |
void | clean_sub_problems () |
pair< list< ExtremePoint > ::iterator, bool > | add_ExtremePoint (const dvector &w, int k, Pointer< MinlpNode >=NULL) |
Adds a point to the RMP point pool. | |
int | init_ExtremePoints (Pointer< MinlpNode > node) |
Initializes the RMP of the root node. | |
int | primal_init_ExtremePoints (const dvector &x, Pointer< MinlpNode > node) |
int | dual_init_ExtremePoints (Pointer< MinlpNode > node) |
void | prune_ExtremePoints (multimap< double, Pointer< MinlpNode > > &bb_tree) |
Removes RMP points, which are not used by any node anymore. | |
void | project_ExtremePoints (dvector &x, Pointer< MinlpNode > node) |
bool | boxreduce (Pointer< MinlpNode > node, int index, IntervalReduction::which_bound_type which_bound) |
Reducing the box and updating the relaxation after subdivision. | |
bool | feasibility_check (Pointer< MinlpNode > node) |
Checks by interval arithmetic whether the box in node is feasible by evaluation the constraints over the box. | |
multimap< double, Pointer < MinlpNode > >::iterator | select_node () |
int | set_low_bound (Pointer< MinlpNode > node) |
Computes a lower bound of the objective value according to the bound_type: RMP_bound, NLP_bound, LP_bound. | |
pair< bool, double > | improve_bound (Pointer< MinlpNode > node) |
Improves a lower bound without subdivision. | |
int | set_NLP_bound (Pointer< MinlpNode > node, bool improve=false) |
int | set_RMP_bound (Pointer< MinlpNode > node) |
int | set_LP_bound (Pointer< MinlpNode > node) |
int | set_LP_RMP_bound (Pointer< MinlpNode > node) |
int | improve_LP_bound (Pointer< MinlpNode > node) |
int | update_subdiv_bound (int k, int i, Pointer< MinlpNode > node) |
Improves a lower bound after subdivision. | |
int | subdivide (list< Pointer< MinlpNode > > &nodes, Pointer< MinlpNode > node) |
Subdivides the feasible set into several sets according to the subdiv_type: BinSubdiv, CostSubdiv. | |
int | bin_subdiv (list< Pointer< MinlpNode > > &nodes, int &subdiv_var, Pointer< MinlpNode > node) |
subdivision according to violated binary constraints | |
void | cost_subdiv (list< Pointer< MinlpNode > > &nodes, int &subdiv_var, Pointer< MinlpNode > node) |
subdivision according to pseudo costs I | |
void | bisect_subdiv (list< Pointer< MinlpNode > > &nodes, int &subdiv_var, Pointer< MinlpNode > node) |
subdivision according to pseudo costs II | |
void | viol_subdiv (list< Pointer< MinlpNode > > &nodes, int &subdiv_var, Pointer< MinlpNode > node) |
subdivision according to constraint violation | |
void | rect_subdiv (list< Pointer< MinlpNode > > &nodes, Pointer< MinlpNode > node, int k, int i, double cut) |
branching at variable i of block k w.r.t the cut-value | |
void | init_lag_problems (Pointer< MinlpNode > node) |
Builds the Lagrangian sub-problems with empty objective function. | |
void | update_lag_problems (const dvector &dual_point) |
Updates the objective functions of the lagrangian subproblems. | |
void | update_lag_problem (int k, const dvector &a) |
void | solve_lag_problem (LagSolveStatus &status, int k, Pointer< MinlpNode > node, Pointer< SepQcFunc > temp_cut=NULL) |
Solves the k-th Lagrangian sub-problem and adds Lagrangian cuts. | |
int | conv_rate_check (double val) |
Checks the actual iteration. | |
void | mem_check () |
Private Attributes | |
Pointer< dvector > | sol_C |
bool | sol_C_is_solution |
bool | prob_is_convex |
Indicated whether original problem is convex. | |
Pointer< MinlpProblem > | quad_prob |
The quadratic relaxation of the problem. | |
vector< Pointer< MinlpProblem > > | block_prob |
The original problem for each block (P_k), without objective function. | |
vector< Pointer< MinlpProblem > > | block_convex_prob |
The convexification for each block (C_k), without objective function. | |
vector< list< ExtremePoint > > | ExtremePoints |
A pool of extreme points and columns for each block. | |
vector< Pointer< MinlpProblem > > | block_sub_convex_prob |
Pointer< MinlpProblem > | sub_convex_prob |
vector< Pointer< MinlpProblem > > | lag_problem |
The Lagrangian Subproblems for each block. | |
Pointer< ColumnGenerator > | colgen |
multimap< double, Pointer < MinlpNode > > | bb_tree |
A second Branch-and-Bound tree. | |
Pointer< MinlpNode > | current_node |
The current node. | |
double | gap_tol |
gap tolerance | |
double | bound_impr_tol |
bound improvement tolerance | |
bool | intgrad_cuts |
Indicates, whether we use IntervalGradientCuts. | |
IntervalGradientCutGenerator | intgrad_cutgen |
LinearizedConCutGenerator | linconcutgen |
bool | mip_cuts |
Indicates, whether we want to derive cuts from the LP relaxation. | |
Pointer< LagHeu > | lagheu |
t_bound_type | pre_bound_type |
t_bound_type | maj_bound_type |
t_bound_type | bound_type |
The current bound type. | |
enum MinlpBCP:: { ... } | lagsolve_type |
enum MinlpBCP:: { ... } | subdiv_type |
int | subdiv_discrete_emphasis |
enum MinlpBCP:: { ... } | nodeselect_type |
int | upper_bound_effort_level |
int | pre_bb_max_iter |
Do a preprocessing Branch & Bound. | |
bool | lag_cuts |
Indicates, whether we should add Lagrangian cuts. | |
int | bound_failed |
The number of computations of NLP-bounds or RMP-bounds, which failed, while (R[U]) was solved. | |
int | bound_computed |
double | bound_time |
double | init_RMP_time |
int | lagprob_solves |
The number of lagrangian subproblems, we (tried to) solved. | |
double | find_solcand_time |
int | nr_solcand_found |
double | subdiv_time |
int | update_ExtremePoints_count |
Pointer< Timer > | timer |
double | max_time |
bool | is_maxcut |
Pointer< IntervalReduction > | intervalreduction |
int | nr_subdiv_contvar |
number of branchings on continuous variables. | |
int | nr_subdiv_bisect |
number of subdivision by bisection. | |
double | conv_rate_cntrl_stopping_rho |
If conv_rate_cntrl is set and improvement in last minor_iter iterations is less than stopping_rho * rel_imp1, check() breakes the solving process. | |
int | conv_rate_cntrl_minor_iter |
The number of minor iterations for the convergence rate control. | |
double | conv_rate_cntrl_last_major_val |
The value in the last major iteration. | |
double | conv_rate_cntrl_last_val |
The value in the last iteration. | |
double | conv_rate_cntrl_first_major_val |
The value in the first iteration. | |
double | conv_rate_cntrl_max_rel_improvement |
First relative improvement. | |
int | conv_rate_cntrl_improve_iter |
Counter for the number of iterations with improvements (serious steps). | |
int | mem_limit |
Friends | |
class | ColumnGenerator |
class | MinlpNode |
A branch-cut-and-price algorithm for solving a nonconvex MINLP problem.
MinlpBCP | max iter options integer $ 0$ default 10000 level 2 The maximum number of Branch and Bound iterations. | |
MinlpBCP | max time options double $ 0$ default 3600 level 2 The maximum amount of seconds, which can be used by the preprocessing and MinlpBCP. | |
MinlpBCP | gap tol options double $ 0$ default 0.01 level 2 Gap tolerance. Stops, if gap between upper and lower bound is smaller than gap tol. | |
Lagrangian | cuts options 0, 1 default 1 level 0 Indicates, whether to use Lagrangian cuts. If you use RMP bounds, you would be well advised to let them switched on. | |
BCP | bound type options NLP,RMP,LP,LP-RMP,stop default LP level 1 Determines, which bounding method to use. Options other then LP or NLP are likely to fail. {itemize} NLP: Using the convex relaxation (Cext). LP: Using the linear relaxation (R). RMP: Does Lagrangian decomposition based on a $$, computed by an inner approximation. LP-RMP: Using LP bounds but constructs and solves also the inner approximation. stop: After the first BCP phase (preprocessing, RMP bounds), subdivision and bound computation is stopped, only upper bounds for the remaining nodes are computed. {itemize} | |
BCP | preprocess max iter options integer $ 0$ default 0 level 0 The maximum number of BCP preprocessing iterations. | |
BCP | subdiv type options Binary, Cost, Bisection, Violation default Violation level 2 The branching method. First, binary (integer) subdivision is tried. If all integers are fixed, further actions depend on the value of this parameter. {itemize} Binary: When all integer variables are fixed, no further subdivision is performed. Cost: Tries to subdivide w.r.t. a variable, for which a maximum improvement of the Lagrangian can be achieved. (not tested) Bisection: Subdivides w.r.t. a variables, which boxdiameter is maximal. Violation: Tries to subdivide w.r.t. a variable, which can minimize the violation of the reference point. If it fails to find a variable, bisection is used. {itemize} | |
Subdivision | on discrete emphasis options 1, 2 default 1 level 2 If set to 1, discrete variables are only chosen for subdivision, if integer-infeasible or the subdiv type is Binary. If set to 2, discrete variables are also chosen for subdivision, if they are already integer-feasible. | |
BCP | node selection typ options best bound, unfixed discrete default unfixed discrete level 2 The method that selects the next node from the branch-and-bound tree. {itemize} best bound: Selects node with lowest lower bound. unfixed discrete: Selects node which does not have all discrete variables fixed yet (and among them one with the lowest lower bound). {itemize} | |
IntervalGradient | cuts options 0, 1 default 0 level 1 Enables (relaxed) IntervalGradientCuts. | |
MIP | cuts options 0, 1 default 1 level 1 Indicates, whether to derive cuts from the LP relaxation by considering the binary restrictions in the original problem. Currently, MixedIntegerRoundingCuts from the Cgl are used. | |
maxcut | options 0, 1 default 0 Indicates, whether the problem is a MaxCut problem. | |
BCP | upper bound effort options $0, 1, 2, 3$ default 0 (2 for MaxCut) level 0 How much effort to spend in computation of upper bounds. {itemize} [$ 0$] performs just local optimization, starting from the reference point. [$ 1$] applies preswitching as well. {itemize} | |
LagHeu | options first, second, second b, Simulated Annealing default none level 0 Which Lagrangian Heuristic to use to compute upper bounds. Only available, when RMP bounds are used. "first" means the first one, we implemented, "second" is the third one, also called LagHeu2, "second b" is a modification of LagHeu2. | |
stopping | rho options $ 0$ default 0.1 For the convergence rate control. If the relative improvement over the last iterations falls under $$ times the first relative improvement, the convergence rate is considered as too small. | |
minor | iterations options integer default 5 How many iterations to consider for the computation of one relative improvement. | |
BCP | IntervalReduction level 1 options 0, 1 default 1 If we should apply boxreduction based on interval arithmetic after branching. | |
Memory | limit level 2 options $ 0$ default 0 The amount of totally allocated memory (swaped and non-swaped) in Megabytes, LaGO is allowed to use. If set to 0, no limit is used. When the limit is exceeded in the Branch and Cut, nodes from the branching tree are pruned until LaGO consumes less than 95% of the limit on memory or only one node is left in the tree. |
Definition at line 158 of file bcp.h.
typedef struct MinlpBCP::LagSolveStatus_s MinlpBCP::LagSolveStatus [private] |
enum MinlpBCP::t_bound_type [private] |
anonymous enum [private] |
anonymous enum [private] |
MinlpBCP::MinlpBCP | ( | Pointer< MinlpProblem > | orig_prob_, | |
Pointer< MinlpProblem > | split_prob_, | |||
Pointer< LinearRelax > | linear_relax_, | |||
bool | is_gams_prob = false , |
|||
double | closeval_tol_ = 0. , |
|||
Pointer< dvector > | diam_ = NULL , |
|||
Pointer< Param > | param_ = NULL , |
|||
Pointer< ostream > | out_solver_p_ = out_out_p , |
|||
Pointer< ostream > | out_solver_log_p_ = out_log_p | |||
) |
virtual MinlpBCP::~MinlpBCP | ( | ) | [virtual] |
double MinlpBCP::start_bb | ( | ) | [private] |
starts the BB-algorithm
bb_tree | A Branch-and-Bound tree |
bool MinlpBCP::add_sol_candidate | ( | const dvector & | x | ) | [private, virtual] |
Reimplemented from RelaxationSolver.
Finds solution candidates using a heuristic defined by heu_type.
node | The MINLP node. | |
sol_point | The solution point. |
void MinlpBCP::init | ( | ) | [private] |
Initializes the BCP-algorithm.
void MinlpBCP::init_block_problems | ( | ) | [private] |
Initializes the block problems.
void MinlpBCP::clean_sub_problems | ( | ) | [private] |
Reimplemented from RelaxationSolver.
pair<list<ExtremePoint>::iterator, bool> MinlpBCP::add_ExtremePoint | ( | const dvector & | w, | |
int | k, | |||
Pointer< MinlpNode > | = NULL | |||
) | [private] |
Adds a point to the RMP point pool.
w | The RMP point. | |
k | The index of the block. |
Initializes the RMP of the root node.
Removes RMP points, which are not used by any node anymore.
bool MinlpBCP::boxreduce | ( | Pointer< MinlpNode > | node, | |
int | index, | |||
IntervalReduction::which_bound_type | which_bound | |||
) | [private] |
Reducing the box and updating the relaxation after subdivision.
Checks by interval arithmetic whether the box in node is feasible by evaluation the constraints over the box.
Computes a lower bound of the objective value according to the bound_type: RMP_bound, NLP_bound, LP_bound.
If a lower bound can be computed , low_bound is updated and ref_point is set to the appropiate point. And dual_point is set.
Improves a lower bound without subdivision.
Improves a lower bound after subdivision.
k | The block number of the branching variable. | |
i | The block index of the branching variable. | |
node | The new node. | |
1,if | Node is infeasible, 0 else. |
int MinlpBCP::subdivide | ( | list< Pointer< MinlpNode > > & | nodes, | |
Pointer< MinlpNode > | node | |||
) | [private] |
Subdivides the feasible set into several sets according to the subdiv_type: BinSubdiv, CostSubdiv.
nodes | A list, where we can add the new nodes to. | |
node | The node to subdivide. |
int MinlpBCP::bin_subdiv | ( | list< Pointer< MinlpNode > > & | nodes, | |
int & | subdiv_var, | |||
Pointer< MinlpNode > | node | |||
) | [private] |
subdivision according to violated binary constraints
void MinlpBCP::cost_subdiv | ( | list< Pointer< MinlpNode > > & | nodes, | |
int & | subdiv_var, | |||
Pointer< MinlpNode > | node | |||
) | [private] |
subdivision according to pseudo costs I
void MinlpBCP::bisect_subdiv | ( | list< Pointer< MinlpNode > > & | nodes, | |
int & | subdiv_var, | |||
Pointer< MinlpNode > | node | |||
) | [private] |
subdivision according to pseudo costs II
subdivision at the midpoint of the largest edge
void MinlpBCP::viol_subdiv | ( | list< Pointer< MinlpNode > > & | nodes, | |
int & | subdiv_var, | |||
Pointer< MinlpNode > | node | |||
) | [private] |
subdivision according to constraint violation
void MinlpBCP::rect_subdiv | ( | list< Pointer< MinlpNode > > & | nodes, | |
Pointer< MinlpNode > | node, | |||
int | k, | |||
int | i, | |||
double | cut | |||
) | [private] |
branching at variable i of block k w.r.t the cut-value
Builds the Lagrangian sub-problems with empty objective function.
void MinlpBCP::update_lag_problems | ( | const dvector & | dual_point | ) | [private] |
Updates the objective functions of the lagrangian subproblems.
dual_point | The new dual point to use. |
void MinlpBCP::update_lag_problem | ( | int | k, | |
const dvector & | a | |||
) | [private] |
void MinlpBCP::solve_lag_problem | ( | LagSolveStatus & | status, | |
int | k, | |||
Pointer< MinlpNode > | node, | |||
Pointer< SepQcFunc > | temp_cut = NULL | |||
) | [private] |
Solves the k-th Lagrangian sub-problem and adds Lagrangian cuts.
solset | A set, where we can store the solutions, we found, in. | |
k | The block number. | |
node | An optional node to store the new cuts in. | |
temp_cut | Temporary cut. |
int MinlpBCP::conv_rate_check | ( | double | val | ) | [private] |
Checks the actual iteration.
val | The last value of the dual function. |
void MinlpBCP::mem_check | ( | ) | [private] |
void MinlpBCP::set_quad_relax | ( | Pointer< MinlpProblem > | quad_prob_ | ) |
void MinlpBCP::set_convex_prob | ( | Pointer< MinlpProblem > | convex_prob_, | |
const Pointer< dvector > & | sol_C_ = NULL , |
|||
bool | sol_C_is_solution_ = false | |||
) |
void MinlpBCP::set_reform | ( | Pointer< Reformulation > | reform_, | |
Pointer< dvector > | sol_C_, | |||
bool | sol_C_is_solution_ | |||
) |
void MinlpBCP::set_reform | ( | Pointer< Reformulation > | reform_ | ) | [virtual] |
Reimplemented from RelaxationSolver.
void MinlpBCP::set_linear_relax | ( | Pointer< LinearRelax > | linrelax_ | ) |
Reimplemented from RelaxationSolver.
void MinlpBCP::set_problem_is_convex | ( | bool | prob_is_convex_ | ) | [inline] |
Reimplemented from RelaxationSolver.
int MinlpBCP::solve | ( | ) | [virtual] |
Calls the branch-cut-and-price algorithm.
Implements Solver.
int MinlpBCP::solve | ( | dvector & | x | ) | [virtual] |
friend class ColumnGenerator [friend] |
friend class MinlpNode [friend] |
Reimplemented from RelaxationSolver.
Pointer<dvector> MinlpBCP::sol_C [private] |
bool MinlpBCP::sol_C_is_solution [private] |
bool MinlpBCP::prob_is_convex [private] |
Pointer<MinlpProblem> MinlpBCP::quad_prob [private] |
vector<Pointer<MinlpProblem> > MinlpBCP::block_prob [private] |
vector<Pointer<MinlpProblem> > MinlpBCP::block_convex_prob [private] |
vector<list<ExtremePoint> > MinlpBCP::ExtremePoints [private] |
vector<Pointer<MinlpProblem> > MinlpBCP::block_sub_convex_prob [private] |
Pointer<MinlpProblem> MinlpBCP::sub_convex_prob [private] |
vector<Pointer<MinlpProblem> > MinlpBCP::lag_problem [private] |
Pointer<ColumnGenerator> MinlpBCP::colgen [private] |
multimap<double, Pointer<MinlpNode> > MinlpBCP::bb_tree [private] |
Pointer<MinlpNode> MinlpBCP::current_node [private] |
double MinlpBCP::gap_tol [private] |
double MinlpBCP::bound_impr_tol [private] |
bool MinlpBCP::intgrad_cuts [private] |
bool MinlpBCP::mip_cuts [private] |
Pointer<LagHeu> MinlpBCP::lagheu [private] |
t_bound_type MinlpBCP::pre_bound_type [private] |
t_bound_type MinlpBCP::maj_bound_type [private] |
t_bound_type MinlpBCP::bound_type [private] |
enum { ... } MinlpBCP::lagsolve_type [private] |
enum { ... } MinlpBCP::subdiv_type [private] |
int MinlpBCP::subdiv_discrete_emphasis [private] |
enum { ... } MinlpBCP::nodeselect_type [private] |
int MinlpBCP::upper_bound_effort_level [private] |
int MinlpBCP::pre_bb_max_iter [private] |
bool MinlpBCP::lag_cuts [private] |
int MinlpBCP::bound_failed [private] |
int MinlpBCP::bound_computed [private] |
double MinlpBCP::bound_time [private] |
double MinlpBCP::init_RMP_time [private] |
int MinlpBCP::lagprob_solves [private] |
double MinlpBCP::find_solcand_time [private] |
int MinlpBCP::nr_solcand_found [private] |
double MinlpBCP::subdiv_time [private] |
int MinlpBCP::update_ExtremePoints_count [private] |
Pointer<Timer> MinlpBCP::timer [private] |
double MinlpBCP::max_time [private] |
bool MinlpBCP::is_maxcut [private] |
Pointer<IntervalReduction> MinlpBCP::intervalreduction [private] |
int MinlpBCP::nr_subdiv_contvar [private] |
int MinlpBCP::nr_subdiv_bisect [private] |
double MinlpBCP::conv_rate_cntrl_stopping_rho [private] |
int MinlpBCP::conv_rate_cntrl_minor_iter [private] |
double MinlpBCP::conv_rate_cntrl_last_major_val [private] |
double MinlpBCP::conv_rate_cntrl_last_val [private] |
double MinlpBCP::conv_rate_cntrl_first_major_val [private] |
double MinlpBCP::conv_rate_cntrl_max_rel_improvement [private] |
int MinlpBCP::conv_rate_cntrl_improve_iter [private] |
int MinlpBCP::mem_limit [private] |