72 virtual double getCost(
const T& sol) = 0;
92 const T& initialSol, T& finalSol,
double upperLevel = HUGE_VAL,
93 double maxComputationTime = HUGE_VAL)
100 std::multimap<double, T> partialSols;
102 std::pair<double, T>(
getTotalCost(initialSol), initialSol));
105 double currentOptimal = upperLevel;
107 std::vector<T> children;
110 while (!partialSols.empty())
113 if (time.
Tac() >= maxComputationTime)
return found ? 2 : 0;
114 typename std::multimap<double, T>::iterator it =
116 double tempCost = it->first;
120 if (tempCost >= currentOptimal)
return found ? 1 : 0;
121 T tempSol = it->second;
122 partialSols.erase(it);
128 currentOptimal = tempCost;
137 for (
typename std::vector<T>::const_iterator it2 = children.begin();
138 it2 != children.end(); ++it2)
141 bool alreadyPresent =
false;
144 typename std::multimap<double, T>::const_iterator,
145 typename std::multimap<double, T>::const_iterator>
146 range = partialSols.equal_range(cost);
147 for (
typename std::multimap<double, T>::const_iterator it3 =
149 it3 != range.second; ++it3)
150 if (it3->second == *it2)
152 alreadyPresent =
true;
161 return found ? 1 : 0;