Changeset 1020


Ignore:
Timestamp:
Jul 22, 2008 12:35:52 PM (11 years ago)
Author:
forrest
Message:

tweaks to heuristics

Location:
trunk/Cbc/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/src/CbcHeuristic.cpp

    r1013 r1020  
    489489{
    490490  // size before
    491   double before = 4*solver->getNumRows()+solver->getNumCols();
     491  double before = 2*solver->getNumRows()+solver->getNumCols();
     492#ifdef CLP_INVESTIGATE
     493  printf("%s has %d rows, %d columns\n",
     494         name.c_str(),solver->getNumRows(),solver->getNumCols());
     495#endif
    492496  // Use this fraction
    493497  double fractionSmall = fractionSmall_;
    494   if (before>80000.0) {
     498  if (before>20000.0) {
    495499    // fairly large - be more conservative
    496     double multiplier = (0.7*200000.0)/CoinMin(before,200000.0);
    497     if (multiplier<1.0)
     500    double multiplier = 1.0 - 0.3*CoinMin(100000.0,before-20000.0)/100000.0;
     501    if (multiplier<1.0) {
    498502      fractionSmall *= multiplier;
    499 #ifdef COIN_DEVELOP
    500     printf("changing fractionSmall from %g to %g for %s\n",
    501            fractionSmall_,fractionSmall,name.c_str());
    502 #endif
     503#ifdef CLP_INVESTIGATE
     504      printf("changing fractionSmall from %g to %g for %s\n",
     505             fractionSmall_,fractionSmall,name.c_str());
     506#endif
     507    }
    503508  }
    504509#ifdef COIN_HAS_CLP
     
    552557      int afterCols = presolvedModel->getNumCols();
    553558      delete presolvedModel;
    554       double after = 4*afterRows+afterCols;
     559      double after = 2*afterRows+afterCols;
    555560      if (after>fractionSmall*before&&after>300&&numberNodes>=0) {
    556561        // Need code to try again to compress further using used
     
    669674    } else {
    670675      // see if too big
    671       //double before = 2*solver->getNumRows()+solver->getNumCols();
    672676      double after = 2*solver2->getNumRows()+solver2->getNumCols();
    673677      if (after>fractionSmall*before&&(after>300||numberNodes<0)) {
  • trunk/Cbc/src/CbcHeuristicFPump.cpp

    r1014 r1020  
    14011401        cutoff -= weights[CoinMin(numberTries-1,9)]*(cutoff-continuousObjectiveValue);
    14021402      }
     1403      // But round down
     1404      if (model_->getCutoffIncrement()==0.999||
     1405          model_->getCutoffIncrement()==1.0)
     1406        cutoff = floor(cutoff);
    14031407      if (cutoff<continuousObjectiveValue)
    14041408        break;
  • trunk/Cbc/src/CbcModel.cpp

    r1019 r1020  
    33003300        continue;
    33013301#endif
     3302      // Do main work of solving node here
    33023303      doOneNode(this,node,createdNode);
    33033304#ifdef CBC_DETERMINISTIC_THREAD
     
    34313432          }
    34323433          assert (iThread<numberThreads_);
     3434          // move information to model
    34333435          threadModel[iThread]->moveToModel(this,1);
    34343436          node = threadInfo[iThread].node;
     
    1206812070    clpSimplex->setSpecialOptions(save|0x11000000); // say is Cbc (and in branch and bound)
    1206912071    clpSolver->resolve();
     12072#ifdef CLP_INVESTIGATE
     12073    if (clpSimplex->numberIterations()>1000)
     12074      printf("node %d took %d iterations\n",numberNodes_,clpSimplex->numberIterations());
     12075#endif
    1207012076    clpSimplex->setSpecialOptions(save);
    1207112077  } else {
     
    1456714573          printf("xxxx %d\n",nXXXXXX);
    1456814574#endif
     14575        // Do real work of node
    1456914576        thisModel->doOneNode(NULL,node,createdNode);
    1457014577#if CBC_THREAD_DEBUG
     
    1460814615        }
    1460914616      }
     14617      // end of this sub-tree
    1461014618      int * usedA = thisModel->usedInSolution();
    1461114619      for (int i=0;i<numberColumns;i++) {
  • trunk/Cbc/src/CbcSolver.cpp

    r1015 r1020  
    33483348    CbcHeuristicLocal heuristic2(*model);
    33493349    heuristic2.setHeuristicName("combine solutions");
    3350     heuristic2.setFractionSmall(0.6);
     3350    heuristic2.setFractionSmall(0.5);
    33513351    heuristic2.setSearchType(1);
    33523352    model->addHeuristic(&heuristic2);
     
    33653365    CbcHeuristicRENS heuristic6(*model);
    33663366    heuristic6.setHeuristicName("RENS");
    3367     heuristic6.setFractionSmall(0.5);
     3367    heuristic6.setFractionSmall(0.4);
    33683368    heuristic6.setFeasibilityPumpOptions(1008003);
    33693369    int nodes []={-2,0,200,1000,10000};
     
    33753375    CbcHeuristicRINS heuristic5(*model);
    33763376    heuristic5.setHeuristicName("RINS");
    3377     heuristic5.setFractionSmall(0.6);
     3377    heuristic5.setFractionSmall(0.5);
    33783378    if (useRINS==1)
    33793379      heuristic5.setDecayFactor(5.0);
Note: See TracChangeset for help on using the changeset viewer.