Stay organized with collections
Save and categorize content based on your preferences.
C++ Reference: class MakePairActiveOperator
Note: This documentation is automatically generated.
Operator which inserts pairs of inactive nodes into a path.
Possible neighbors for the path 1 -> 2 -> 3 with pair (A, B) inactive
(where 1 and 3 are first and last nodes of the path) are:
1 -> [A] -> [B] -> 2 -> 3
1 -> [B] -> 2 -> [A] -> 3
1 -> [A] -> 2 -> [B] -> 3
1 -> 2 -> [A] -> [B] -> 3
Note that this operator does not expicitely insert the nodes of a pair one
after the other which forbids the following solutions:
1 -> [B] -> [A] -> 2 -> 3
1 -> 2 -> [B] -> [A] -> 3
which can only be obtained by inserting A after B.
[[["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\u003eMakePairActiveOperator\u003c/code\u003e inserts pairs of inactive nodes into a path, exploring different insertion positions for the pair.\u003c/p\u003e\n"],["\u003cp\u003eIt avoids inserting nodes of a pair consecutively in reverse order, ensuring specific insertion patterns.\u003c/p\u003e\n"],["\u003cp\u003eThis operator is used within the constraint solver of or-tools, particularly for routing problems.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods for generating neighbor solutions (\u003ccode\u003eMakeNeighbor\u003c/code\u003e) and debugging (\u003ccode\u003eDebugString\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eThe operator is initialized with node variables, secondary variables, a path class function, and the pairs to be inserted.\u003c/p\u003e\n"]]],["The `MakePairActiveOperator` class inserts pairs of inactive nodes into a path. It explores possible neighbors by inserting the inactive pair (A, B) at different locations within the path, such as `1 -\u003e [A] -\u003e [B] -\u003e 2 -\u003e 3`. It does not insert the pair's nodes consecutively (e.g., `1 -\u003e [B] -\u003e [A] -\u003e 2 -\u003e 3`). Key methods include `MakeNeighbor` (to generate neighbors), `DebugString` (for string representation), and `MakePairActiveOperator` (the constructor), in addition to the destructor `~MakePairActiveOperator`.\n"],null,["# MakePairActiveOperator\n\nC++ Reference: class MakePairActiveOperator\n===========================================\n\n\nNote: This documentation is automatically generated.\nOperator which inserts pairs of inactive nodes into a path. Possible neighbors for the path 1 -\\\u003e 2 -\\\u003e 3 with pair (A, B) inactive (where 1 and 3 are first and last nodes of the path) are: 1 -\\\u003e \\[A\\] -\\\u003e \\[B\\] -\\\u003e 2 -\\\u003e 3 1 -\\\u003e \\[B\\] -\\\u003e 2 -\\\u003e \\[A\\] -\\\u003e 3 1 -\\\u003e \\[A\\] -\\\u003e 2 -\\\u003e \\[B\\] -\\\u003e 3 1 -\\\u003e 2 -\\\u003e \\[A\\] -\\\u003e \\[B\\] -\\\u003e 3 Note that this operator does not expicitely insert the nodes of a pair one after the other which forbids the following solutions: 1 -\\\u003e \\[B\\] -\\\u003e \\[A\\] -\\\u003e 2 -\\\u003e 3 1 -\\\u003e 2 -\\\u003e \\[B\\] -\\\u003e \\[A\\] -\\\u003e 3 which can only be obtained by inserting A after B.\n\n| Method ||\n|----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [`DebugString`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_neighborhoods.h#L121) | Return type: `std::string ` \u003cbr /\u003e |\n| [`MakeNeighbor`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_neighborhoods.h#L120) | Return type: `bool ` \u003cbr /\u003e |\n| [`MakePairActiveOperator`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_neighborhoods.h#L115) | \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& pairs` \u003cbr /\u003e |\n| [`~MakePairActiveOperator`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_neighborhoods.h#L119) | \u003cbr /\u003e |"]]