MCPcopy Index your code
hub / github.com/PyVRP/PyVRP / makeNeighbours

Method makeNeighbours

pyvrp/cpp/Solution.cpp:119–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117Duration Solution::timeWarp() const { return timeWarp_; }
118
119void Solution::makeNeighbours()
120{
121 for (auto const &route : routes_)
122 for (auto const &trip : route.trips())
123 {
124 auto const startDepot = trip.startDepot();
125 auto const endDepot = trip.endDepot();
126
127 for (size_t idx = 0; idx != trip.size(); ++idx)
128 neighbours_[trip[idx]] = {
129 idx == 0 ? startDepot : trip[idx - 1], // pred
130 idx == trip.size() - 1 ? endDepot : trip[idx + 1]}; // succ
131 }
132}
133
134bool Solution::operator==(Solution const &other) const
135{

Callers

nothing calls this directly

Calls 3

startDepotMethod · 0.45
endDepotMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected