Changeset 86 for trunk/Samples/longthin.cpp
- Timestamp:
- Mar 23, 2005 4:51:39 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Samples/longthin.cpp
r83 r86 112 112 for (iColumn=0;iColumn<numberColumns;iColumn++) { 113 113 if (solver3->isInteger(iColumn)) { 114 double costPer = objective[iColumn]/ ((double) columnLength[iColumn]); 114 /* Branching up gets us much closer to an integer solution so we want 115 to encourage up - so we will branch up if variable value > 0.333333. 116 The expected cost of going up obviously depends on the cost of the 117 variable so we just choose pseudo costs to reflect that. We could also 118 decide to try and use the pseudo costs to make it more likely to branch 119 on a variable with many coefficients. This leads to the computation below. 120 */ 121 double cost = objective[iColumn]*(1.0 + 0.2*((double) columnLength[iColumn])); 115 122 CbcSimpleIntegerPseudoCost * newObject = 116 123 new CbcSimpleIntegerPseudoCost(&model,numberIntegers,iColumn, 117 costPer,costPer);124 2.0*cost,cost); 118 125 newObject->setMethod(3); 119 126 objects[numberIntegers++]= newObject;
Note: See TracChangeset
for help on using the changeset viewer.