Stay organized with collections
Save and categorize content based on your preferences.
C++ Reference: class PairRelocateOperator
Note: This documentation is automatically generated.
Operator which moves a pair of nodes to another position where the first
node of the pair must be before the second node on the same path.
Possible neighbors for the path 1 -> A -> B -> 2 -> 3 (where (1, 3) are
first and last nodes of the path and can therefore not be moved, and (A, B)
is a pair of nodes):
1 -> [A] -> 2 -> [B] -> 3
1 -> 2 -> [A] -> [B] -> 3
The pair can be moved to another path.
[[["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."],[[["\u003cp\u003eThe PairRelocateOperator moves two connected nodes to a different position within the same route or to another route.\u003c/p\u003e\n"],["\u003cp\u003eThe first node of the pair must precede the second node on the same path after the move.\u003c/p\u003e\n"],["\u003cp\u003eThis operator is used within the constraint solver for vehicle routing problems.\u003c/p\u003e\n"],["\u003cp\u003eThe operator's behavior can be customized by specifying index pairs and empty path classes.\u003c/p\u003e\n"]]],["The `PairRelocateOperator` class allows moving a pair of nodes within a path or to a different path, ensuring the first node precedes the second. It defines methods `MakeNeighbor` (to perform the move operation) and `DebugString` (to return a string representation). The constructor `PairRelocateOperator` takes variables, secondary variables, a function for empty path classes, and index pairs. A destructor `~PairRelocateOperator` is also included. Valid moves include relocating the pair within the same path.\n"],null,["# PairRelocateOperator\n\nC++ Reference: class PairRelocateOperator\n=========================================\n\n\nNote: This documentation is automatically generated.\nOperator which moves a pair of nodes to another position where the first node of the pair must be before the second node on the same path. Possible neighbors for the path 1 -\\\u003e A -\\\u003e B -\\\u003e 2 -\\\u003e 3 (where (1, 3) are first and last nodes of the path and can therefore not be moved, and (A, B) is a pair of nodes): 1 -\\\u003e \\[A\\] -\\\u003e 2 -\\\u003e \\[B\\] -\\\u003e 3 1 -\\\u003e 2 -\\\u003e \\[A\\] -\\\u003e \\[B\\] -\\\u003e 3 The pair can be moved to another path.\n\n| Method ||\n|--------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [`DebugString`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_neighborhoods.h#L177) | Return type: `std::string ` \u003cbr /\u003e |\n| [`MakeNeighbor`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_neighborhoods.h#L176) | Return type: `bool ` \u003cbr /\u003e |\n| [`PairRelocateOperator`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_neighborhoods.h#L170) | \u003cbr /\u003e Arguments: `const std::vector\u003cIntVar*\u003e& vars, const std::vector\u003cIntVar*\u003e& secondary_vars, std::function\u003cint(int64_t)\u003e start_empty_path_class, const RoutingIndexPairs& index_pairs` \u003cbr /\u003e |\n| [`~PairRelocateOperator`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_neighborhoods.h#L174) | \u003cbr /\u003e |"]]