Stay organized with collections
Save and categorize content based on your preferences.
C++ Reference: class LocalSearchOperator
Note: This documentation is automatically generated.
The base class for all local search operators.
A local search operator is an object that defines the neighborhood of a
solution. In other words, a neighborhood is the set of solutions which can
be reached from a given solution using an operator.
The behavior of the LocalSearchOperator class is similar to iterators.
The operator is synchronized with an assignment (gives the
current values of the variables); this is done in the Start() method.
Then one can iterate over the neighbors using the MakeNextNeighbor method.
This method returns an assignment which represents the incremental changes
to the current solution. It also returns a second assignment representing
the changes to the last solution defined by the neighborhood operator; this
assignment is empty if the neighborhood operator cannot track this
information.
TODO(user): rename Start to Synchronize ?
TODO(user): decouple the iterating from the defining of a neighbor.
[[["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."],[[["`LocalSearchOperator` is the base class for all local search operators in C++, defining the neighborhood of a solution (reachable solutions from a current one)."],["It behaves like an iterator, synchronizing with an assignment using the `Start()` method to establish the current solution."],["`MakeNextNeighbor` iterates through neighbors, providing an assignment representing changes to the current and last solutions."],["`LocalSearchOperator` includes methods like `HasFragments`, `HoldsDelta`, `Reset`, and `Self` for further manipulation and information."]]],["The `LocalSearchOperator` class defines a solution's neighborhood, reachable via an operator. It synchronizes with an assignment using the `Start()` method. `MakeNextNeighbor` iterates through neighbors, returning assignments representing changes to the current and last solutions. The class includes methods like `HasFragments`, `HoldsDelta`, `Reset`, and `Self`. It functions similarly to iterators, enabling exploration of a solution's neighborhood. This class provides a method to find nearby solution to a given one.\n"]]