# Changeset 539

Ignore:
Timestamp:
May 19, 2007 1:06:40 PM (12 years ago)
Message:

updating 3way branching

Location:
branches/Couenne/Couenne
Files:
8 edited

Unmodified
Added
Removed
• ## branches/Couenne/Couenne/TODO

 r537 - Bilinear cuts - trisection - extended formulation - variable lhs/rhs of bounds containing expression defining aux vars - OBBT - cut currValue_ from expressions - documentation
• ## branches/Couenne/Couenne/src/branch/CouenneBranchingObject.cpp

 r537 // TODO: apply bound tightening /*if (0) { if (0) { printf (" --> [%.6e,%.6e]\n", l, u); //    printf (" --> [%.6e,%.6e]\n", l, u); printf ("### Branch: x%d %c= %.12f\n", index_, way ? '>' : '<', value_); for (int i=0; i < solver -> getNumCols(); i++) /*for (int i=0; i < solver -> getNumCols(); i++) printf (" %3d [%.3e,%.3e]\n", i, solver -> getColLower () [i], solver -> getColUpper () [i]); }*/ } branchIndex_++;
• ## branches/Couenne/Couenne/src/branch/CouenneObject.cpp

 r537 //expression::Variable (reference_ -> Index ()); /* if (0) { if (0) { printf ("Inf: = |%.6e - %.6e| = %.6e  ",  ////[%.2f,%.2f] reference_             -> print (std::cout); std::cout << " = "; reference_ -> Image () -> print (std::cout); printf ("\n"); }  */ } CouNumber delta = fabs (var - expr); bool isint = reference_ -> isInteger (); if (0) if (brVarInd_ >= 0) switch (way) { } /*if (0) { if (0) { printf ("CO::createBranch: "); reference_ -> print (std::cout); reference_ -> Image () -> getFixVar () -> print (std::cout); printf ("\n"); }*/ } // constructor uses actual values of variables and bounds, update them || (fabs (ur-xr) < COUENNE_EPS) || (fabs (ur-lr) < COUENNE_EPS)) return new CouenneBranchingObject (index, TWO_RAND, x, depvar -> isInteger ()); } return new CouenneBranchingObject (ref_ind, TWO_RAND, xr, reference_ -> isInteger ()); return new CouenneBranchingObject (index, TWO_LEFT, x, depvar -> isInteger ()); } return new CouenneBranchingObject (ref_ind, TWO_LEFT, xr, reference_ -> isInteger ()); }
• ## branches/Couenne/Couenne/src/convex/CouenneCutGenerator.cpp

 r521 now = CoinCpuTime (); //problem_ -> print (std::cout); //printf ("======================================\n"); problem_ -> print (std::cout); printf ("======================================\n"); problem_ -> standardize (); septime_ = now; //problem_ -> print (std::cout); problem_ -> print (std::cout); //  printf ("======================================\n"); //  problem_ -> writeMod ("extended.mod");
• ## branches/Couenne/Couenne/src/convex/boundTightening.cpp

 r537 int objInd = problem_ -> Obj (0) -> Body () -> Index (); /////////////////////// MIP bound management ///////////////////////////////// if (objInd < 0) objInd = 0; if (babInfo && (babInfo -> babPtr ())) { CouNumber primal  = babInfo  -> babPtr () -> model (). getObjValue(), dual    = babInfo  -> babPtr () -> model (). getBestPossibleObjValue (), primal0 = problem_ -> Ub (objInd), dual0   = problem_ -> Lb (objInd); // Bonmin assumes minimization. Hence, primal (dual) is an UPPER // (LOWER) bound. if ((primal <   COUENNE_INFINITY - 1) && (primal < primal0)) { // update primal bound (MIP) problem_ -> Ub (objInd) = primal; chg_bds [objInd] = 1; } if ((dual   > - COUENNE_INFINITY + 1) && (dual   > dual0)) { // update dual bound problem_ -> Lb (objInd) = dual; chg_bds [objInd] = 1; } } //////////////////////// Reduced cost bound tightening ////////////////////// } } } } /////////////////////// MIP bound management ///////////////////////////////// if (objInd < 0) objInd = 0; if (babInfo && (babInfo -> babPtr ())) { CouNumber primal  = babInfo  -> babPtr () -> model (). getObjValue(), dual    = babInfo  -> babPtr () -> model (). getBestPossibleObjValue (), primal0 = problem_ -> Ub (objInd), dual0   = problem_ -> Lb (objInd); // Bonmin assumes minimization. Hence, primal (dual) is an UPPER // (LOWER) bound. if ((primal <   COUENNE_INFINITY - 1) && (primal < primal0)) { // update primal bound (MIP) problem_ -> Ub (objInd) = primal; chg_bds [objInd] = 1; } if ((dual   > - COUENNE_INFINITY + 1) && (dual   > dual0)) { // update dual bound problem_ -> Lb (objInd) = dual; chg_bds [objInd] = 1; } } return false; } } while (ntightened || nbwtightened && (niter++ < 10)); #define MAX_BT_ITER 10 } while (ntightened || nbwtightened && (niter++ < MAX_BT_ITER)); // need to check if EITHER procedures gave results, as expression // structure is not a tree any longer.
• ## branches/Couenne/Couenne/src/convex/generateCuts.cpp

 r537 /*printf (":::::::::::::::::::::::: level = %d, pass = %d, intree=%d\n Bounds:\n", info.level, info.pass, info.inTree); info.level, info.pass, info.inTree);*/ for (int i=0; i < si. getNumCols(); i++) printf (" %3d [%.3e,%.3e]\n", i, si. getColLower () [i], si. getColUpper () [i]);*/ si. getColUpper () [i]); Bonmin::BabInfo * babInfo = dynamic_cast (si.getAuxiliaryInfo ()); //////////////////////// Bound tightening /////////////////////////////////////////// if (! boundTightening (si, cs, chg_bds, babInfo)) //  for (int i=0; i nAuxs () + problem_ -> nVars (); i++ ) //    printf ("%d: [%.4f %.4f]\n", i, problem_ -> Lb (i), problem_ -> Ub (i)); if (! boundTightening (si, cs, chg_bds, babInfo)) { printf ("INFEASIBLE\n"); //    for (int i=0; i nAuxs () + problem_ -> nVars (); i++ ) //      printf ("%d: [%.4f %.4f]\n", i, problem_ -> Lb (i), problem_ -> Ub (i)); goto end_genCuts; } //  for (int i=0; i nAuxs () + problem_ -> nVars (); i++ ) //    printf ("%d: [%.4f %.4f]\n", i, problem_ -> Lb (i), problem_ -> Ub (i)); //////////////////////// GENERATE CONVEXIFICATION CUTS //////////////////////////////
• ## branches/Couenne/Couenne/src/problem/impliedBounds.cpp

 r525 for (int i=nAuxs (); i--;) { //    for (int j=0; j ub_ [nvar+i] + COUENNE_EPS) { /*printf ("w_%d has infeasible bounds [%g,%g]\n", i+nvar, lb_ [nvar+i], ub_ [nvar+i]);*/ //      printf ("w_%d has infeasible bounds [%g,%g]\n", //        i+nvar, lb_ [nvar+i], ub_ [nvar+i]); return -1; } u0 = ub_ [nvar+i]; if (auxiliaries_ [i] -> Image () -> impliedBound (nvar+i, lb_, ub_, chg_bds) > COUENNE_EPS) { /*printf ("implied: [%g,%g] -> [%g,%g] ", l0, u0, lb_ [nvar+i], ub_ [nvar+i]); auxiliaries_ [i] -> print (std::cout); printf (" := "); auxiliaries_ [i] -> Image () -> print (std::cout); printf ("\n");*/ if (auxiliaries_ [i] -> Image () -> impliedBound (nvar+i, lb_, ub_, chg_bds) > COUENNE_EPS) { //      printf ("implied: [%g,%g] -> [%g,%g]", l0, u0, lb_ [nvar+i], ub_ [nvar+i]); //      auxiliaries_ [i] -> print (std::cout); printf (" := "); //      auxiliaries_ [i] -> Image () -> print (std::cout); printf ("\n"); nchg++; }
• ## branches/Couenne/Couenne/src/problem/tightenBounds.cpp

 r525 j < naux; j++) { //    for (int j=0; j uu + COUENNE_EPS) { /*printf ("w_%d has infeasible bounds [%g,%g]: ", i+j, ll, uu); Aux (j) -> Lb () -> print (std::cout); printf (" - "); Aux (j) -> Ub () -> print (std::cout); printf ("\n");*/ //      printf ("w_%d has infeasible bounds [%g,%g]: ", i+j, ll, uu); //      Aux (j) -> Lb () -> print (std::cout); printf (" - "); //      Aux (j) -> Ub () -> print (std::cout); printf ("\n"); return -1; // declare this node infeasible i+j, ll, lb_ [i+j]);*/ /*printf (" propaga: [%g,(%g)] -> [%g,(%g)] ", lb_ [i+j], ub_ [i+j], ll, uu); Aux (j)             -> print (std::cout); printf (" := "); Aux (j) -> Image () -> print (std::cout); printf ("\n");*/ //      printf (" propaga: [%g,(%g)] -> [%g,(%g)] ", lb_ [i+j], ub_ [i+j], ll, uu); //      Aux (j)             -> print (std::cout); printf (" := "); //      Aux (j) -> Image () -> print (std::cout); printf ("\n"); lb_ [i+j] = ll; i+j, uu, ub_ [i+j]);*/ /*printf (" propaga: [(%g),%g] -> [(%g),%g] ", lb_ [i+j], ub_ [i+j], ll, uu); Aux (j)             -> print (std::cout); printf (" := "); Aux (j) -> Image () -> print (std::cout); printf ("\n");*/ //      printf (" propaga: [(%g),%g] -> [(%g),%g] ", lb_ [i+j], ub_ [i+j], ll, uu); //      Aux (j)             -> print (std::cout); printf (" := "); //      Aux (j) -> Image () -> print (std::cout); printf ("\n"); ub_ [i+j] = uu;
Note: See TracChangeset for help on using the changeset viewer.