We're making a copy of the "remaining" source range in the vrptw::PDShift operator ctor:
|
_source_without_pd(s_route.begin() + _s_p_rank + 1, |
|
s_route.begin() + _s_d_rank), |
This means a lot of overhead for a downstream use where we only use iterators in validity checks. The tricky part is that the copy is indeed necessary inapply since we can't replace part of a route while iterating over a subset of the same route. But we could make it so that the copy only happens in apply which is only called a marginal number of times across all instances of the operator.
We're making a copy of the "remaining" source range in the
vrptw::PDShiftoperator ctor:vroom/src/problems/vrptw/operators/pd_shift.cpp
Lines 35 to 36 in 0aeb2cc
This means a lot of overhead for a downstream use where we only use iterators in validity checks. The tricky part is that the copy is indeed necessary in
applysince we can't replace part of a route while iterating over a subset of the same route. But we could make it so that the copy only happens inapplywhich is only called a marginal number of times across all instances of the operator.