Stay organized with collections
Save and categorize content based on your preferences.
C++ Reference: class PairExchangeOperator
Note: This documentation is automatically generated.
Operator which exchanges the position of two pairs; for both pairs the first
node of the pair must be before the second node on the same path.
Possible neighbors for the paths 1 -> A -> B -> 2 -> 3 and 4 -> C -> D -> 5
(where (1, 3) and (4, 5) are first and last nodes of the paths and can
therefore not be moved, and (A, B) and (C,D) are pairs of nodes):
1 -> [C] -> [D] -> 2 -> 3, 4 -> [A] -> [B] -> 5
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-08-06 UTC.
[null,null,["Last updated 2024-08-06 UTC."],[],["The `PairExchangeOperator` class exchanges the positions of two pairs of nodes within paths. Each pair's first node must precede the second. This operator's `MakeNeighbor` method attempts to create a new solution where node pairs are swapped, returning a boolean indicating success. The constructor `PairExchangeOperator` takes variables, secondary variables, a function defining empty path classes, and index pairs as input. `DebugString` provides a string representation of the operation. There is a destructor `~PairExchangeOperator` for cleanup.\n"],null,[]]