Changeset 131


Ignore:
Timestamp:
May 9, 2009 4:56:54 PM (13 years ago)
Author:
pbelotti
Message:

looser checks on bound tightening -- should prevent good upper/lower bound on objective from fathoming a node

Location:
trunk/Couenne/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Couenne/src/bound_tightening/aggressiveBT.cpp

    r39 r131  
    237237                                 "Couenne infeasible node from aggressive BT\n");
    238238
    239     int       objind = Obj (0) -> Body  () -> Index ();
     239    int objind = Obj (0) -> Body  () -> Index ();
    240240
    241241    Jnlst()->Printf(J_ITERSUMMARY, J_BOUNDTIGHTENING,
     
    243243                    Lb (objind), getCutOff (), ncols);
    244244
    245     for (int i=0; i<nOrigVars_; i++)
    246       Jnlst()->Printf(J_DETAILED, J_BOUNDTIGHTENING,
    247                       "   x%02d [%+20g %+20g]  | %+20g\n",
    248                       i, Lb (i), Ub (i), X [i]);
    249 
    250     for (int i=nOrigVars_; i<ncols; i++)
    251       Jnlst()->Printf(J_MOREDETAILED, J_BOUNDTIGHTENING,
    252                       "   w%02d [%+20g %+20g]  | %+20g\n", i, Lb (i), Ub (i), X [i]);
     245    if (Jnlst()->ProduceOutput(J_DETAILED, J_BOUNDTIGHTENING))
     246      for (int i=0; i<nOrigVars_; i++)
     247        printf("   x%02d [%+20g %+20g]  | %+20g\n",
     248               i, Lb (i), Ub (i), X [i]);
     249
     250    if (Jnlst()->ProduceOutput(J_MOREDETAILED, J_BOUNDTIGHTENING))
     251      for (int i=nOrigVars_; i<ncols; i++)
     252        printf ("   w%02d [%+20g %+20g]  | %+20g\n", i, Lb (i), Ub (i), X [i]);
    253253  }
    254254
  • trunk/Couenne/src/bound_tightening/boundTightening.cpp

    r112 r131  
    3737  if (optimum_ != NULL) {
    3838    contains_optimum = true;
    39     for (int i=0; i<nOrigVars_; i++)
     39    for (int i=0; i < nVars (); i++)
    4040      if ((optimum_ [i] < Lb (i) * (1 - COUENNE_EPS) - COUENNE_EPS) ||
    4141          (optimum_ [i] > Ub (i) * (1 + COUENNE_EPS) + COUENNE_EPS)) {
     
    7070
    7171    if ((ntightened < 0) || (nbwtightened < 0)) {
    72       Jnlst()->Printf(J_DETAILED, J_BOUNDTIGHTENING, "infeasible BT\n");
     72      Jnlst()->Printf(J_ITERSUMMARY, J_BOUNDTIGHTENING, "infeasible BT\n");
    7373      return false;
    7474    }
     
    7878
    7979    if (contains_optimum) {
    80       for (int i=0; i<nOrigVars_; i++)
    81         if ((optimum_ [i] < Lb (i) * (1 - COUENNE_EPS) - COUENNE_EPS) ||
    82             (optimum_ [i] > Ub (i) * (1 + COUENNE_EPS) + COUENNE_EPS)) {
     80      for (int i=0; i<nVars (); i++)
     81        if ((optimum_[i] < Lb(i) - COUENNE_EPS * (1. + CoinMin (fabs(optimum_ [i]), fabs (Lb(i))))) ||
     82            (optimum_[i] > Ub(i) + COUENNE_EPS * (1. + CoinMin (fabs(optimum_ [i]), fabs (Ub(i)))))) {
    8383          printf ("bound tightening FAIL: %d [%e,%e] (%e) -- %e\n",
    8484                  i, Lb (i), Ub (i), optimum_ [i],
     
    108108
    109109      // final test
    110       if ((Lb (i) > Ub (i) + COUENNE_EPS) ||
     110      if ((Lb (i) > Ub (i) + COUENNE_EPS * (1 + CoinMin (fabs (Lb (i)), fabs (Ub (i))))) ||
    111111          (Ub (i) < - MAX_BOUND) ||
    112112          (Lb (i) >   MAX_BOUND)) {
    113113
    114         Jnlst()->Printf(J_DETAILED, J_BOUNDTIGHTENING, "final test: infeasible BT\n");
     114        Jnlst()->Printf(J_ITERSUMMARY, J_BOUNDTIGHTENING, "final test: infeasible BT\n");
    115115        return false;
    116116      }
  • trunk/Couenne/src/bound_tightening/fake_tightening.cpp

    r39 r131  
    137137      feasible  = btCore (f_chg),             // true if feasible with fake bound
    138138      betterbds = Lb (objind) > getCutOff (); // true if over cutoff
    139      
    140139
    141140#ifdef DEBUG
     
    243242  }
    244243
    245 
    246244  Jnlst()->Printf(Ipopt::J_MOREVECTOR, J_BOUNDTIGHTENING, "\n");
    247245  if (tightened)
  • trunk/Couenne/src/bound_tightening/impliedBounds.cpp

    r112 r131  
    3737        (variables_ [i] -> Multiplicity () > 0)) {
    3838
    39       if (Lb (i) > Ub (i) + COUENNE_EPS) {
    40         Jnlst()->Printf(Ipopt::J_DETAILED, J_BOUNDTIGHTENING,
    41                         "  implied bounds: w_%d has infeasible bounds [%g,%g]\n",
    42                         i, Lb (i), Ub (i));
     39      if (Lb (i) > Ub (i) + COUENNE_EPS * (1 + CoinMin (fabs (Lb (i)), fabs (Ub (i))))) {
     40        Jnlst () -> Printf (Ipopt::J_DETAILED, J_BOUNDTIGHTENING,
     41                            "  implied bounds: w_%d has infeasible bounds [%g,%g]\n",
     42                            i, Lb (i), Ub (i));
    4343        return -1;
    4444      }
     
    8686                          i, l0, u0, Lb (i), Ub (i));
    8787
    88           variables_ [i]             -> print (std::cout);
     88          variables_ [i] -> print (std::cout);
    8989
    9090          if (Jnlst()->ProduceOutput(Ipopt::J_MOREVECTOR, J_BOUNDTIGHTENING)) {
  • trunk/Couenne/src/bound_tightening/obbt.cpp

    r39 r131  
    172172    while (!notImproved &&
    173173           (nIter++ < MAX_OBBT_ITER) &&
    174            ((nImprov = obbtInner (csi, cs, chg_bds, babInfo)) > 0)) {
    175 
    176       if (CoinCpuTime () > maxCpuTime_)
    177         break;
     174           ((nImprov = obbtInner (csi, cs, chg_bds, babInfo)) > 0) &&
     175           (CoinCpuTime () < maxCpuTime_)) {
    178176
    179177      int nchanged, *changed = NULL;
  • trunk/Couenne/src/bound_tightening/tightenBounds.cpp

    r112 r131  
    5252    // early test to avoid a loop
    5353
    54     if ((Lb (i) > Ub (i) + COUENNE_EPS) ||
     54    if ((Lb (i) > Ub (i) + COUENNE_EPS * (1 + CoinMin (fabs (Lb (i)), fabs (Ub (i))))) ||
    5555        (Ub (i) < - MAX_BOUND) ||
    5656        (Lb (i) >   MAX_BOUND)) {
    5757
    58       //if (Jnlst()->ProduceOutput(J_ITERSUMMARY, J_BOUNDTIGHTENING)) {
    59 
    60       Jnlst()->Printf(J_ITERSUMMARY, J_BOUNDTIGHTENING,
    61                       "pre-check: w_%d has infeasible bounds [%.10e,%.10e]. ", i, Lb (i), Ub (i));
    62 
    63       if (Jnlst()->ProduceOutput(J_DETAILED, J_BOUNDTIGHTENING)) {
    64         Var (i) -> Lb () -> print (std::cout);
    65         Jnlst()->Printf(J_DETAILED, J_BOUNDTIGHTENING," --- ");
    66         Var (i) -> Ub () -> print (std::cout);
    67       }
    68 
    69       Jnlst()->Printf(J_ITERSUMMARY, J_BOUNDTIGHTENING,"\n");
    70         //}
     58      if (Jnlst()->ProduceOutput(J_ITERSUMMARY, J_BOUNDTIGHTENING)) {
     59
     60        Jnlst()->Printf(J_ITERSUMMARY, J_BOUNDTIGHTENING,
     61                        "pre-check: w_%d has infeasible bounds [%.10e,%.10e]. ", i, Lb (i), Ub (i));
     62
     63        if (Jnlst()->ProduceOutput(J_DETAILED, J_BOUNDTIGHTENING)) {
     64          Var (i) -> Lb () -> print (std::cout);
     65          Jnlst()->Printf(J_DETAILED, J_BOUNDTIGHTENING," --- ");
     66          Var (i) -> Ub () -> print (std::cout);
     67        }
     68
     69        Jnlst()->Printf(J_ITERSUMMARY, J_BOUNDTIGHTENING,"\n");
     70      }
    7171
    7272      return -1; // declare this node infeasible
     
    7979      }*/
    8080
    81     if (Var (i) -> Type         () == AUX) {
     81    if (Var (i) -> Type () == AUX) {
    8282        // TODO: also test if any indep variable of this expression
    8383        // have changed. If not, skip
     
    9494      }
    9595
    96       if (ll > uu + COUENNE_EPS) {
     96      if (ll - uu > COUENNE_EPS * (1 + CoinMin (fabs (ll), fabs (uu)))) {
    9797
    9898        //if (Jnlst()->ProduceOutput(J_ITERSUMMARY, J_BOUNDTIGHTENING)) {
     
    150150        Lb (i) = ll;
    151151
    152         if (ll > Ub (i) + COUENNE_EPS) {
     152        if (ll > Ub (i) + COUENNE_EPS * (1. + CoinMin (fabs (ll), fabs (Ub (i))))) {
    153153          Jnlst () -> Printf (J_ITERSUMMARY, J_BOUNDTIGHTENING,
    154154                              "just-check: w_%d has infeasible bounds [%g,%g]. ", i, Lb (i), Ub (i));
  • trunk/Couenne/src/convex/generateCuts.cpp

    r130 r131  
    463463    if (realOpt && // this is a good time to check if we have messed up with the optimal solution
    464464        isOptimumCut (realOpt, cs, problem_))
    465       printf ("\n\n CUT OPTIMUM!\n\n");
     465      jnlst_->Printf(J_ITERSUMMARY, J_CONVEXIFYING,
     466                     "\n\n CUT OPTIMUM\n\n");
    466467  }
    467468
Note: See TracChangeset for help on using the changeset viewer.