Lab for local searches impl
- randomly choose starting point;
- if condition met, save solution and rerun from step 1.
- start with random solution.
- while condition not met:
- find best local solution;
- perturb best local solution;
- build initial Solution with shuffle;
- initialize Penalties;
- while condition not met:
- calculate augmented objective function as: h = f(x) + \lambda * \sum p_i * I_i;
where h is augmented function, f(x) - cost function, \lambda - metaheuristic parameter, p_i - penalty for i-feature, I_i - indicator, if i-feature exists or not. - run local search, based on previous solution;
- calculate utility for each feature as: util_i = I_i * c_i / (1 + p_i);
where c_i - cost of feature i in objective function. - increase penalty for feature with maximum utility;
- calculate augmented objective function as: h = f(x) + \lambda * \sum p_i * I_i;
Note: we assume, that feature i means, that at place i we put i factory.
So it's cost might be calculated as follows:
for (int j = 0; j < n; j++) { costOfFeatureI += p.distance[i][j] * p.flow[location[i]][location[j]]; }
Instance | BKV | RLS | ILS | GLS |
---|---|---|---|---|
Tai20a | 703482 | 773936 | 760740 | 757400 |
Tai40a | 3139370 | 3559148 | 3521372 | 3386346 |
Tai60a | 7205962 | 8219922 | 8167046 | 7805588 |
Tai80a | 13499184 | 15145328 | 15206250 | 14475326 |
Tai100a | 21052466 | 23471174 | 23481320 | 22414046 |
BKV was taken from here