Function ADS::partitionLocalSearch
Defined in File Heuristics.h
Function Documentation
-
inline std::vector<int> ADS::partitionLocalSearch(const std::vector<long> &A, std::vector<int> side)
the side, 0 or 1, of each element of A, by the local search from side that moves an element or swaps two while the difference of the sums decreases, the best move first; O( n^2 ) each step
- Pre:
side gives each element 0 or 1
- Post:
sides 0 or 1, the difference not larger than that of side