Open Verdict7 opened 7 years ago
Pseudo code to clarify:
CC* getBestCC(priority_queue<CC*>& activeCCs) {
CC* best = activeCCs.pop();
IntervalT newInterval = best.getContractedInterval();
best.updateHistory(newInterval);
activeCCs.insert(best);
return best;
}
@DavidWz This has been implemented in the experimental branch. Please take a look at it, since I am not really sure if the behaves as intended.
Update after dddcb5d1f0c16668adfbb16487c552a636eca5d7: There was a severe bug in the comparator (it always returned truthy...), this was fixed and the best of 5 method implemented. It seems to work quite well. Todo:
This is probably one of the main reasons why big problems are extremely slow. Implementation ideas: Save contraction candidates in a priority queue (that is created once in the beginning) sorted by history/ some random factor/ other ideas?/... Only contract variables in the queue until one is found that is above the gainThreshold (or some other thresholds) and ignore the rest (for now. Later maybe with best of three, or look at a fixed relative number of candidates). Update the queue by removing the best candidate, recalculating the history value, and inserting it again.