File tree Expand file tree Collapse file tree
src/problems/cvrp/operators Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,23 +45,19 @@ IntraExchange::IntraExchange(const Input& input,
4545}
4646
4747void IntraExchange::compute_gain () {
48- const Eval s_gain = std::get<0 >(utils::addition_cost_delta (_input,
49- _sol_state,
50- source,
51- s_rank,
52- s_rank + 1 ,
53- target,
54- t_rank,
55- t_rank + 1 ));
56-
57- const Eval t_gain = std::get<0 >(utils::addition_cost_delta (_input,
58- _sol_state,
59- target,
60- t_rank,
61- t_rank + 1 ,
62- source,
63- s_rank,
64- s_rank + 1 ));
48+ s_gain = _sol_state.node_gains [s_vehicle][s_rank] -
49+ utils::in_place_delta_cost (_input,
50+ s_route[t_rank],
51+ _input.vehicles [s_vehicle],
52+ s_route,
53+ s_rank);
54+
55+ t_gain = _sol_state.node_gains [s_vehicle][t_rank] -
56+ utils::in_place_delta_cost (_input,
57+ s_route[s_rank],
58+ _input.vehicles [s_vehicle],
59+ s_route,
60+ t_rank);
6561
6662 stored_gain = s_gain + t_gain;
6763 gain_computed = true ;
You can’t perform that action at this time.
0 commit comments