예제 #1
0
  void
  BonCbcFullNodeInfo::registerOptions(Ipopt::SmartPtr<Bonmin::RegisteredOptions> roptions)
  {


    roptions->SetRegisteringCategory("Nonconvex problems", RegisteredOptions::BonminCategory);
    roptions->AddLowerBoundedIntegerOption("max_consecutive_infeasible",
        "Number of consecutive infeasible subproblems before aborting a"
        " branch.",
        0,0,
        "Will continue exploring a branch of the tree until \"max_consecutive_infeasible\""
        "consecutive problems are locally infeasible by the NLP sub-solver.");
    roptions->setOptionExtraInfo("max_consecutive_infeasible",8);

    roptions->SetRegisteringCategory("NLP solution robustness", RegisteredOptions::BonminCategory);
    roptions->AddLowerBoundedIntegerOption
    ("max_consecutive_failures",
     "(temporarily removed) Number $n$ of consecutive unsolved problems before aborting a branch of the tree.",
     0,10,
     "When $n > 0$, continue exploring a branch of the tree until $n$ "
     "consecutive problems in the branch are unsolved (we call unsolved a problem for which Ipopt can not "
     "guarantee optimality within the specified tolerances).");
    roptions->setOptionExtraInfo("max_consecutive_failures",8);

  }
예제 #2
0
 void
 LpBranchingSolver::registerOptions(Ipopt::SmartPtr<Bonmin::RegisteredOptions> roptions)
 {
   roptions->SetRegisteringCategory("ECP based strong branching",RegisteredOptions::UndocumentedCategory);
   roptions->AddLowerBoundedIntegerOption
   ("ecp_max_rounds_strong",
    "Set the maximal number of rounds of ECP cuts in strong branching.",
    0,0,
    "");
   roptions->setOptionExtraInfo("ecp_max_rounds_strong",63);
   roptions->AddLowerBoundedNumberOption
   ("ecp_abs_tol_strong",
    "Set the absolute termination tolerance for ECP rounds in strong branching.",
    0,false,1e-6,
    "");
   roptions->setOptionExtraInfo("ecp_abs_tol_strong",63);
   roptions->AddLowerBoundedNumberOption
   ("ecp_rel_tol_strong",
    "Set the relative termination tolerance for ECP rounds in strong branching.",
    0,false,1e-1,
    "");
   roptions->setOptionExtraInfo("ecp_rel_tol_strong",63);
   roptions->AddStringOption2
   ("lp_strong_warmstart_method",
    "Choose method to use for warm starting lp in strong branching",
    "Basis",
    "Basis", "Use optimal basis of node",
    "Clone", "Clone optimal problem of node",
    "(Advanced stuff)");
   roptions->setOptionExtraInfo("lp_strong_warmstart_method",63);
 }
예제 #3
0
  /** Register OA feasibility checker  options.*/
  void
  OaFeasibilityChecker::registerOptions(Ipopt::SmartPtr<Bonmin::RegisteredOptions> roptions)
  {
    roptions->SetRegisteringCategory("Feasibility checker using OA cuts", RegisteredOptions::BonminCategory);
    roptions->AddStringOption2("feas_check_cut_types", "Choose the type of cuts generated when an integer feasible solution is found",
                               "outer-approx",
                               "outer-approx", "Generate a set of Outer Approximations cuts.",
                               "Benders", "Generate a single Benders cut.",
                               "If it seems too much memory is used should try Benders to use less");
    roptions->setOptionExtraInfo("feas_check_cut_types", 19);
    

    roptions->AddStringOption3("feas_check_discard_policy", "How cuts from feasibility checker are discarded",
                               "detect-cycles",
                               "detect-cycles", "Detect if a cycle occurs and only in this case force not to discard.",
                               "keep-all", "Force cuts from feasibility checker not to be discarded (memory hungry but sometimes better).",
                               "treated-as-normal", "Cuts from memory checker can be discarded as any other cuts (code may cycle then)",
                               "Normally to avoid cycle cuts from feasibility checker should not be discarded in the node where they are generated. "
                               "However Cbc sometimes does it if no care is taken which can lead to an infinite loop in Bonmin (usually on simple problems). "
                               "To avoid this one can instruct Cbc to never discard a cut but if we do that for all cuts it can lead to memory problems. "
                               "The default policy here is to detect cycles and only then impose to Cbc to keep the cut. "
                               "The two other alternative are to instruct Cbc to keep all cuts or to just ignore the problem and hope for the best");
    roptions->setOptionExtraInfo("feas_check_discard_policy", 19);

    roptions->AddLowerBoundedIntegerOption("generate_benders_after_so_many_oa", "Specify that after so many oa cuts have been generated Benders cuts should be generated instead.",
                                           0, 5000,
                                           "It seems that sometimes generating too many oa cuts slows down the optimization compared to Benders due to the size of the LP. "
                                           "With this option we specify that after so many OA cuts have been generated we should switch to Benders cuts.");
    roptions->setOptionExtraInfo("generate_benders_after_so_many_oa", 19);
  }
void HeuristicInnerApproximation::registerOptions(Ipopt::SmartPtr<
    Bonmin::RegisteredOptions> roptions) {
  roptions->SetRegisteringCategory("Initial Approximations descriptions",
      RegisteredOptions::UndocumentedCategory);
  roptions->AddStringOption2("heuristic_inner_approximation",
      "if yes runs the InnerApproximation heuristic", "yes", "no",
      "don't run it", "yes", "runs the heuristic", "");

        roptions->setOptionExtraInfo("heuristic_inner_approximation", 63);
}
void HeuristicInnerApproximation::registerOptions(Ipopt::SmartPtr<
    Bonmin::RegisteredOptions> roptions) {
  roptions->SetRegisteringCategory("Initial Approximations descriptions",
      Bonmin::RegisteredOptions::UndocumentedCategory);
  roptions->AddStringOption2("heuristic_inner_approximation",
      "if yes runs the InnerApproximation heuristic", "yes", "no",
      "don't run it", "yes", "runs the heuristic", "");

 roptions->setOptionExtraInfo("heuristic_inner_approximation", 63);

 roptions->AddLowerBoundedIntegerOption("number_inner_approximation_points",
       "Set the number of points to use for linear inner approximation of nonlinear functions in heuristic",
       1, 20);
 roptions->setOptionExtraInfo("number_inner_approximation_points", 63);

 roptions->AddLowerBoundedNumberOption("inner_time_limit",
       "Time limit for inner approximation",
       0, true, 10, "");
 roptions->setOptionExtraInfo("number_inner_approximation_points", 63);
}
 void
 HeuristicDiveVectorLength::registerOptions(Ipopt::SmartPtr<Bonmin::RegisteredOptions> roptions){
   roptions->SetRegisteringCategory("Primal Heuristics", RegisteredOptions::BonminCategory);
  roptions->AddStringOption2(
    "heuristic_dive_vectorLength",
    "if yes runs the Dive VectorLength heuristic",
    "no",
    "no", "",
    "yes", "",
    "");
  roptions->setOptionExtraInfo("heuristic_dive_vectorLength", 63);
 }
예제 #7
0
 void
 FixAndSolveHeuristic::registerOptions(Ipopt::SmartPtr<Bonmin::RegisteredOptions> roptions){
  roptions->SetRegisteringCategory("Test Heuristics", RegisteredOptions::UndocumentedCategory);
  roptions->AddStringOption2(
    "fix_and_solve_heuristic",
    "if yes runs a heuristic at root where fixes all variables integer in the continuous solution",
    "no",
    "no", "don't run it",
    "yes", "runs the heuristic",
    "");
  roptions->setOptionExtraInfo("fix_and_solve_heuristic", 63);
 }
예제 #8
0
void CouenneSetup::registerAllOptions (Ipopt::SmartPtr <Bonmin::RegisteredOptions> roptions) {

  roptions -> SetRegisteringCategory ("Couenne options", Bonmin::RegisteredOptions::CouenneCategory);

  BabSetupBase        ::registerAllOptions (roptions);
  Bonmin::BonCbcFullNodeInfo  ::registerOptions (roptions);

  /// Heuristics
  Bonmin::LocalSolverBasedHeuristic    ::registerOptions (roptions);
  Bonmin::FixAndSolveHeuristic         ::registerOptions (roptions);
  Bonmin::DummyPump                    ::registerOptions (roptions);
  Bonmin::MilpRounding                 ::registerOptions (roptions);
  Bonmin::PumpForMinlp                 ::registerOptions (roptions);
  Bonmin::HeuristicRINS                ::registerOptions (roptions);
  Bonmin::HeuristicLocalBranching      ::registerOptions (roptions);
  Bonmin::HeuristicFPump               ::registerOptions (roptions);
  Bonmin::HeuristicDiveFractional      ::registerOptions (roptions);
  Bonmin::HeuristicDiveVectorLength    ::registerOptions (roptions);
  Bonmin::HeuristicDiveMIPFractional   ::registerOptions (roptions);
  Bonmin::HeuristicDiveMIPVectorLength ::registerOptions (roptions);  

  roptions -> AddStringOption3 ("milp_solver",
				"Choose the subsolver to solve MILP sub-problems in OA decompositions.",
				"Cbc_D",
				"Cbc_D","Coin Branch and Cut with its default",
				"Cbc_Par", "Coin Branch and Cut with passed parameters",
				"Cplex","Cplex",
				" To use Cplex, a valid license is required and you should have compiled OsiCpx in COIN-OR  (see Osi documentation).");

  roptions -> setOptionExtraInfo ("milp_solver",64);

  roptions -> AddStringOption2 ("milp_strategy",
				"Choose a strategy for MILPs.",
				"find_good_sol",
				"find_good_sol","Stop sub milps when a solution improving the incumbent is found",
				"solve_to_optimality", "Solve MILPs to optimality",
				"");

  roptions -> AddStringOption6 ("algorithm",
				"Choice of the algorithm.",
				"B-BB",
				"B-BB","simple branch-and-bound algorithm,",
				"B-OA","OA Decomposition algorithm,",
				"B-QG","Quesada and Grossmann branch-and-cut algorithm,",
				"B-Hyb","hybrid outer approximation based branch-and-cut,",
				"B-Ecp","ecp cuts based branch-and-cut a la FilMINT.",
				"B-iFP","Iterated Feasibility Pump for MINLP.",
				"This will preset some of the options of bonmin depending on the algorithm choice."
				);

  CouenneProblem          ::registerOptions (roptions);
  CouenneCutGenerator     ::registerOptions (roptions);
  CouenneChooseStrong     ::registerOptions (roptions);
  CouenneChooseVariable   ::registerOptions (roptions);
  CouenneFixPoint         ::registerOptions (roptions);
  CouenneDisjCuts         ::registerOptions (roptions);
  CouenneCrossConv        ::registerOptions (roptions);
  CouenneSdpCuts          ::registerOptions (roptions);
  CouenneTwoImplied       ::registerOptions (roptions);
  NlpSolveHeuristic       ::registerOptions (roptions);
  CouenneFeasPump         ::registerOptions (roptions);
  CouenneIterativeRounding::registerOptions (roptions);

  /// TODO: move later!
  roptions -> AddStringOption2
    ("local_branching_heuristic",
     "Apply local branching heuristic",
     "no",
     "no","",
     "yes","",
     "A local-branching heuristic based is used to find feasible solutions.");


  roptions -> AddNumberOption  ("couenne_check",
				"known value of a global optimum (for debug purposes only)",
				COIN_DBL_MAX,
				"Default value is +infinity.");

  roptions -> AddStringOption2 ("display_stats",
				"display statistics at the end of the run",
				"no",
				"yes", "",
				"no", "");

  roptions -> AddStringOption2 ("save_soltext",
				"save pairs (index, value) of the solution at the end of the solve",
				"no",
				"yes", "",
				"no", "");

  roptions -> AddStringOption2 ("test_mode",
				"set to true if this is Couenne unit test",
				"no",
				"yes", "",
				"no", "");

  roptions -> AddStringOption5 ("lp_solver",
				"Linear Programming solver for the linearization",
				"clp",
				"clp",    "Use the COIN-OR Open Source solver CLP (default)",
				"cplex",  "Use the commercial solver Cplex (license is needed)",
				"gurobi", "Use the commercial solver Gurobi (license is needed)",
				"soplex", "Use the freely available Soplex",
                                "xpress-mp", "Use the commercial solver Xpress MP (license is needed)"
				);

#define addLevOption(optname,comment,default) roptions -> AddBoundedIntegerOption (optname, comment, -2, J_LAST_LEVEL-1, default, "")

  addLevOption ("output_level",                "Output level",                                          J_WARNING);
  addLevOption ("branching_print_level",       "Output level for braching code in Couenne",             J_NONE);
  addLevOption ("boundtightening_print_level", "Output level for bound tightening code in Couenne",     J_NONE);
  addLevOption ("convexifying_print_level",    "Output level for convexifying code in Couenne",         J_NONE);
  addLevOption ("problem_print_level",         "Output level for problem manipulation code in Couenne", J_NONE);
  addLevOption ("nlpheur_print_level",         "Output level for NLP heuristic in Couenne",             J_NONE);
  addLevOption ("disjcuts_print_level",        "Output level for disjunctive cuts in Couenne",          J_NONE);
  addLevOption ("reformulate_print_level",     "Output level for reformulating problems in Couenne",    J_NONE);

  roptions -> AddNumberOption
    ("feas_tolerance",
     "Tolerance for constraints/auxiliary variables",
     feas_tolerance_default,
     "Default value is 1e-5.");

  roptions -> AddStringOption2 
    ("feasibility_bt",
     "Feasibility-based (cheap) bound tightening (FBBT)",
     "yes",
     "no","",
     "yes","",
     "A pre-processing technique to reduce the bounding box, before the generation of linearization cuts. "
     "This is a quick and effective way to reduce the solution set, and it is highly recommended to keep it active."
    );

  // copied from BonminSetup::registerMilpCutGenerators(), in
  // BonBonminSetup.cpp

  struct cutOption_ {

    const char *cgname;
    int         defaultFreq;

  } cutOption [] = {
    {(const char *) "Gomory_cuts",             0},
    {(const char *) "probing_cuts",            0},
    {(const char *) "cover_cuts",              0},
    {(const char *) "mir_cuts",                0},
    {(const char *) "2mir_cuts",               0},
    {(const char *) "flow_covers_cuts",        0},
    {(const char *) "lift_and_project_cuts",   0},
    {(const char *) "reduce_split_cuts",       0},
    {(const char *) "clique_cuts",             0},
    {NULL, 0}};

  for (int i=0; cutOption [i].cgname; i++) {

    char descr [150];

    sprintf (descr, "Frequency k (in terms of nodes) for generating %s cuts in branch-and-cut.",
	     cutOption [i].cgname);

    roptions -> AddLowerBoundedIntegerOption 
      (cutOption [i].cgname,
       descr,
       -100, cutOption [i].defaultFreq,
       "If k > 0, cuts are generated every k nodes, "
       "if -99 < k < 0 cuts are generated every -k nodes but "
       "Cbc may decide to stop generating cuts, if not enough are generated at the root node, "
       "if k=-99 generate cuts only at the root node, if k=0 or 100 do not generate cuts.");

    roptions->setOptionExtraInfo (cutOption [i].cgname, 5);
  }
}