Stay organized with collections
Save and categorize content based on your preferences.
C++ Reference: class MakeRelocateNeighborsOperator
Note: This documentation is automatically generated.
Relocate neighborhood which moves chains of neighbors.
The operator starts by relocating a node n after a node m, then continues
moving nodes which were after n as long as the "cost" added is less than
the "cost" of the arc (m, n). If the new chain doesn't respect the domain of
next variables, it will try reordering the nodes.
Possible neighbors for path 1 -> A -> B -> C -> D -> E -> 2 (where (1, 2)
are first and last nodes of the path and can therefore not be moved, A must
be performed before B, and A, D and E are located at the same place):
1 -> A -> C -> [B] -> D -> E -> 2
1 -> A -> C -> D -> [B] -> E -> 2
1 -> A -> C -> D -> E -> [B] -> 2
1 -> A -> B -> D -> [C] -> E -> 2
1 -> A -> B -> D -> E -> [C] -> 2
1 -> A -> [D] -> [E] -> B -> C -> 2
1 -> A -> B -> [D] -> [E] -> C -> 2
1 -> A -> [E] -> B -> C -> D -> 2
1 -> A -> B -> [E] -> C -> D -> 2
1 -> A -> B -> C -> [E] -> D -> 2
This operator is extremely useful to move chains of nodes which are located
at the same place (for instance nodes part of a same stop).
TODO(user): Consider merging with standard Relocate in local_search.cc.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-06 UTC."],[[["The MakeRelocateNeighborsOperator in C++ relocates chains of nodes in a path, potentially reordering them to minimize cost and respect constraints."],["This operator is particularly useful for moving groups of nodes at the same location, like those representing a stop in a route."],["It considers the cost of arcs and the domain of next variables when determining valid moves."],["The operator may be merged with the standard Relocate operator in the future for optimization."],["It offers methods like `DebugString`, `MakeNeighbor`, and `MakeRelocateNeighborsOperator` for functionality and interaction."]]],["The `MakeRelocateNeighborsOperator` class relocates chains of neighboring nodes within a path. It moves a node and subsequent nodes if the added \"cost\" is acceptable, potentially reordering them if domain constraints are violated. The method `MakeNeighbor` performs the relocation. This class is particularly useful for moving node chains at the same location, like nodes within a stop. The class includes methods like `DebugString` to display a string format and `MakeRelocateNeighborsOperator` for class instantiation.\n"]]