Changeset 1980


Ignore:
Timestamp:
May 27, 2012 6:43:53 AM (7 years ago)
Author:
pbonami
Message:

Enable Osi's strong branching in LP branch-and-cut

Location:
trunk/Bonmin/src/Algorithms
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Bonmin/src/Algorithms/BonBonminSetup.cpp

    r1946 r1980  
    712712    options_->GetEnumValue("variable_selection",varSelection,prefix_.c_str());
    713713    if (varSelection > RELIABILITY_BRANCHING) {
    714       std::cout<<"Variable selection stragey not available with oa branch-and-cut."<<std::endl;
     714      switch (varSelection){
     715        case OSI_SIMPLE:
     716          continuousSolver_->findIntegersAndSOS(false);
     717          setPriorities();
     718          addSos();
     719          branchingMethod_ = new OsiChooseVariable(nonlinearSolver_);
     720   
     721          break;
     722        case OSI_STRONG:
     723          {
     724          continuousSolver_->findIntegersAndSOS(false);
     725          setPriorities();
     726          addSos();
     727          OsiChooseStrong * chooser = new OsiChooseStrong(nonlinearSolver_);
     728          branchingMethod_ = chooser;
     729          chooser->setNumberStrong(intParam_[NumberStrong]);
     730          chooser->setTrustStrongForSolution(false);
     731          chooser->setNumberBeforeTrusted(intParam_[MinReliability]);
     732          }
     733          break;
     734        default:
     735          std::cout<<"Variable selection stragey not available with oa branch-and-cut."<<std::endl;
     736          break;
     737     }
    715738    }
    716739    /* Populate cut generation and heuristic procedures.*/
  • trunk/Bonmin/src/Algorithms/Branching/BonLpBranchingSolver.cpp

    r1858 r1980  
    118118    std::vector<double> diff_up_bnd_value;
    119119
    120 #if 0
    121     // deleteme
    122     for (int i=0; i<tminlp_interface->getNumCols(); i++) {
    123       printf("%3d ol = %e nl = %e   ou = %e nu = %e\n",i,tminlp_interface->getColLower()[i],lin_->getColLower()[i],tminlp_interface->getColUpper()[i],lin_->getColUpper()[i]);
    124     }
    125 #endif
    126120    // Get the bounds.  We assume that the bounds in the linear solver
    127121    // are always the original ones
     
    159153    }
    160154
    161 #if 0
    162     // deleteme
    163     for (int i=0; i<numCols; i++) {
    164       printf("%3d ol = %e nl = %e   ou = %e nu = %e\n",i,tminlp_interface->getColLower()[i],lin_->getColLower()[i],tminlp_interface->getColUpper()[i],lin_->getColUpper()[i]);
    165     }
    166 #endif
    167155    if(warm_start_mode_ == Basis){
    168156      lin->setWarmStart(warm_);
Note: See TracChangeset for help on using the changeset viewer.