Ignore:
Timestamp:
Nov 21, 2012 4:38:56 AM (7 years ago)
Author:
forrest
Message:

add Proximity heuristic (Fischetti and Monaci) - shouldn't break anything

File:
1 edited

Legend:

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

    r1644 r1802  
    11601160    int useGreedy = parameters_[whichParam(CBC_PARAM_STR_GREEDY, numberParameters_, parameters_)].currentOptionAsInteger();
    11611161    int useCombine = parameters_[whichParam(CBC_PARAM_STR_COMBINE, numberParameters_, parameters_)].currentOptionAsInteger();
     1162    int useProximity = parameters_[whichParam(CBC_PARAM_STR_PROXIMITY, numberParameters_, parameters_)].currentOptionAsInteger();
    11621163    int useCrossover = parameters_[whichParam(CBC_PARAM_STR_CROSSOVER2, numberParameters_, parameters_)].currentOptionAsInteger();
    11631164    //int usePivotC = parameters_[whichParam(CBC_PARAM_STR_PIVOTANDCOMPLEMENT, numberParameters_, parameters_)].currentOptionAsInteger();
     
    15611562        anyToDo = true;
    15621563    }
     1564    if ((useProximity >= kType && useProximity <= kType + 1)||
     1565        (kType == 1 && useProximity >= 4)) {
     1566        CbcHeuristicProximity heuristic2a(*model);
     1567        heuristic2a.setHeuristicName("Proximity Search");
     1568        heuristic2a.setFractionSmall(9999999.0);
     1569        heuristic2a.setNumberNodes(30);
     1570        heuristic2a.setFeasibilityPumpOptions(-2);
     1571        if (useProximity>=4) {
     1572          const int nodes[]={10,100,300};
     1573          heuristic2a.setNumberNodes(nodes[useProximity-4]);
     1574          // more print out and stronger feasibility pump
     1575          if (useProximity==6)
     1576            heuristic2a.setFeasibilityPumpOptions(-3);
     1577        }
     1578        model->addHeuristic(&heuristic2a);
     1579        anyToDo = true;
     1580    }
    15631581    if (useCrossover >= kType && useCrossover <= kType + 1) {
    15641582        CbcHeuristicCrossover heuristic2a(*model);
Note: See TracChangeset for help on using the changeset viewer.