Stay organized with collections
Save and categorize content based on your preferences.
C++ Reference: routing_neighborhoods
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.
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."],[[["\u003cp\u003eThe \u003ccode\u003erouting_neighborhoods\u003c/code\u003e in C++ focuses on defining operators for local search in route optimization.\u003c/p\u003e\n"],["\u003cp\u003eThese operators primarily modify routes by relocating nodes or chains of nodes to improve solution quality.\u003c/p\u003e\n"],["\u003cp\u003eA key operator, \u003ccode\u003eRelocateExpensiveChain\u003c/code\u003e, moves chains of nodes based on cost considerations, aiming for better routes.\u003c/p\u003e\n"],["\u003cp\u003eSeveral classes are provided for implementing various neighborhood search strategies, including exchange, relocation, and swapping operations.\u003c/p\u003e\n"],["\u003cp\u003eThe documentation outlines a set of specific neighborhood operators, each designed for targeted route modifications.\u003c/p\u003e\n"]]],["The `Relocate neighborhood` operator moves chains of neighboring nodes within a path. It starts by relocating a node and then continues moving subsequent nodes if the added cost is less than the arc cost. It reorders nodes if the new chain violates domain constraints. The documentation provides examples of possible node movements, including the relocation of grouped nodes. It is designed for moving chains, especially those at the same location, and it lists the various classes involved in different types of operations for node movements.\n"],null,["# routing_neighborhoods\n\nC++ Reference: routing_neighborhoods\n====================================\n\n\nNote: This documentation is automatically generated.\n\n\u003cbr /\u003e\n\nRelocate 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 -\\\u003e A -\\\u003e B -\\\u003e C -\\\u003e D -\\\u003e E -\\\u003e 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 -\\\u003e A -\\\u003e C -\\\u003e \\[B\\] -\\\u003e D -\\\u003e E -\\\u003e 2 1 -\\\u003e A -\\\u003e C -\\\u003e D -\\\u003e \\[B\\] -\\\u003e E -\\\u003e 2 1 -\\\u003e A -\\\u003e C -\\\u003e D -\\\u003e E -\\\u003e \\[B\\] -\\\u003e 2 1 -\\\u003e A -\\\u003e B -\\\u003e D -\\\u003e \\[C\\] -\\\u003e E -\\\u003e 2 1 -\\\u003e A -\\\u003e B -\\\u003e D -\\\u003e E -\\\u003e \\[C\\] -\\\u003e 2 1 -\\\u003e A -\\\u003e \\[D\\] -\\\u003e \\[E\\] -\\\u003e B -\\\u003e C -\\\u003e 2 1 -\\\u003e A -\\\u003e B -\\\u003e \\[D\\] -\\\u003e \\[E\\] -\\\u003e C -\\\u003e 2 1 -\\\u003e A -\\\u003e \\[E\\] -\\\u003e B -\\\u003e C -\\\u003e D -\\\u003e 2 1 -\\\u003e A -\\\u003e B -\\\u003e \\[E\\] -\\\u003e C -\\\u003e D -\\\u003e 2 1 -\\\u003e A -\\\u003e B -\\\u003e C -\\\u003e \\[E\\] -\\\u003e D -\\\u003e 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.\n\n| Classes ------- ||\n|----------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [ExchangeSubtrip](/optimization/reference/constraint_solver/routing_neighborhoods/ExchangeSubtrip) |\n| [FilteredHeuristicLocalSearchOperator](/optimization/reference/constraint_solver/routing_neighborhoods/FilteredHeuristicLocalSearchOperator) |\n| [IndexPairSwapActiveOperator](/optimization/reference/constraint_solver/routing_neighborhoods/IndexPairSwapActiveOperator) |\n| [LightPairRelocateOperator](/optimization/reference/constraint_solver/routing_neighborhoods/LightPairRelocateOperator) |\n| [MakePairActiveOperator](/optimization/reference/constraint_solver/routing_neighborhoods/MakePairActiveOperator) |\n| [MakePairInactiveOperator](/optimization/reference/constraint_solver/routing_neighborhoods/MakePairInactiveOperator) |\n| [MakeRelocateNeighborsOperator](/optimization/reference/constraint_solver/routing_neighborhoods/MakeRelocateNeighborsOperator) |\n| [PairExchangeOperator](/optimization/reference/constraint_solver/routing_neighborhoods/PairExchangeOperator) |\n| [PairExchangeRelocateOperator](/optimization/reference/constraint_solver/routing_neighborhoods/PairExchangeRelocateOperator) |\n| [PairNodeSwapActiveOperator](/optimization/reference/constraint_solver/routing_neighborhoods/PairNodeSwapActiveOperator) |\n| [PairRelocateOperator](/optimization/reference/constraint_solver/routing_neighborhoods/PairRelocateOperator) |\n| [RelocateExpensiveChain](/optimization/reference/constraint_solver/routing_neighborhoods/RelocateExpensiveChain) |\n| [RelocateSubtrip](/optimization/reference/constraint_solver/routing_neighborhoods/RelocateSubtrip) |\n| [SwapIndexPairOperator](/optimization/reference/constraint_solver/routing_neighborhoods/SwapIndexPairOperator) |"]]