Stay organized with collections
Save and categorize content based on your preferences.
C++ Reference: class PairExchangeRelocateOperator
Note: This documentation is automatically generated.
Operator which exchanges the paths of two pairs (path have to be different).
Pairs are inserted in all possible positions in their new path with the
constraint that the second node must be placed after the first.
Possible neighbors for the path 1 -> A -> B -> 2 -> 3, 4 -> C -> 5 -> D -> 6
1 -> C -> D -> 2 -> 3 4 -> A -> B -> 5 -> 6
1 -> C -> 2 -> D -> 3 4 -> A -> 5 -> B -> 6
1 -> 2 -> C -> D -> 3 4 -> 5 -> A -> B -> 6
1 -> C -> D -> 2 -> 3 4 -> A -> B -> 5 -> 6
1 -> C -> 2 -> D -> 3 4 -> A -> 5 -> B -> 6
1 -> 2 -> C -> D -> 3 4 -> 5 -> A -> B -> 6
1 -> C -> D -> 2 -> 3 4 -> A -> B -> 5 -> 6
1 -> C -> 2 -> D -> 3 4 -> A -> 5 -> B -> 6
1 -> 2 -> C -> D -> 3 4 -> 5 -> A -> B -> 6
[[["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 \u003ccode\u003ePairExchangeRelocateOperator\u003c/code\u003e exchanges the paths of two pairs in a routing problem, ensuring the second node is placed after the first in the new path.\u003c/p\u003e\n"],["\u003cp\u003eIt explores different insertion positions for the pairs within their new paths, generating various neighbor solutions.\u003c/p\u003e\n"],["\u003cp\u003eThe operator is defined by the \u003ccode\u003ePairExchangeRelocateOperator\u003c/code\u003e class in the \u003ccode\u003erouting_neighborhoods.h\u003c/code\u003e file, offering methods like \u003ccode\u003eMakeNeighbor\u003c/code\u003e and \u003ccode\u003eDebugString\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThis operator is used within constraint programming to optimize routes by considering pair exchanges and relocations.\u003c/p\u003e\n"]]],["The `PairExchangeRelocateOperator` exchanges paths of two pairs, ensuring they are different. Pairs are relocated to all possible positions within their new path, with the constraint that the second node follows the first. Key methods include `MakeNeighbor`, which returns a boolean, `DebugString`, returning a string, and the constructor `PairExchangeRelocateOperator`, accepting variables, a function and index pairs, as arguments. A destructor `~PairExchangeRelocateOperator` is also defined.\n"],null,["# PairExchangeRelocateOperator\n\nC++ Reference: class PairExchangeRelocateOperator\n=================================================\n\n\nNote: This documentation is automatically generated.\nOperator which exchanges the paths of two pairs (path have to be different). Pairs are inserted in all possible positions in their new path with the constraint that the second node must be placed after the first. Possible neighbors for the path 1 -\\\u003e A -\\\u003e B -\\\u003e 2 -\\\u003e 3, 4 -\\\u003e C -\\\u003e 5 -\\\u003e D -\\\u003e 6 1 -\\\u003e C -\\\u003e D -\\\u003e 2 -\\\u003e 3 4 -\\\u003e A -\\\u003e B -\\\u003e 5 -\\\u003e 6 1 -\\\u003e C -\\\u003e 2 -\\\u003e D -\\\u003e 3 4 -\\\u003e A -\\\u003e 5 -\\\u003e B -\\\u003e 6 1 -\\\u003e 2 -\\\u003e C -\\\u003e D -\\\u003e 3 4 -\\\u003e 5 -\\\u003e A -\\\u003e B -\\\u003e 6 1 -\\\u003e C -\\\u003e D -\\\u003e 2 -\\\u003e 3 4 -\\\u003e A -\\\u003e B -\\\u003e 5 -\\\u003e 6 1 -\\\u003e C -\\\u003e 2 -\\\u003e D -\\\u003e 3 4 -\\\u003e A -\\\u003e 5 -\\\u003e B -\\\u003e 6 1 -\\\u003e 2 -\\\u003e C -\\\u003e D -\\\u003e 3 4 -\\\u003e 5 -\\\u003e A -\\\u003e B -\\\u003e 6 1 -\\\u003e C -\\\u003e D -\\\u003e 2 -\\\u003e 3 4 -\\\u003e A -\\\u003e B -\\\u003e 5 -\\\u003e 6 1 -\\\u003e C -\\\u003e 2 -\\\u003e D -\\\u003e 3 4 -\\\u003e A -\\\u003e 5 -\\\u003e B -\\\u003e 6 1 -\\\u003e 2 -\\\u003e C -\\\u003e D -\\\u003e 3 4 -\\\u003e 5 -\\\u003e A -\\\u003e B -\\\u003e 6\n\n| Method ||\n|----------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [`DebugString`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_neighborhoods.h#L259) | Return type: `std::string ` \u003cbr /\u003e |\n| [`MakeNeighbor`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_neighborhoods.h#L258) | Return type: `bool ` \u003cbr /\u003e |\n| [`PairExchangeRelocateOperator`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_neighborhoods.h#L251) | \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| [`~PairExchangeRelocateOperator`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_neighborhoods.h#L256) | \u003cbr /\u003e |"]]