Stay organized with collections
Save and categorize content based on your preferences.
C++ Reference: class BaseLns
Note: This documentation is automatically generated.
This is the base class for building an Lns operator. An Lns fragment is a
collection of variables which will be relaxed. Fragments are built with
NextFragment(), which returns false if there are no more fragments to build.
Optionally one can override InitFragments, which is called from
LocalSearchOperator::Start to initialize fragment data.
[[["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."],[[["`BaseLns` is the foundation for creating Large Neighborhood Search (LNS) operators in constraint programming, used to define relaxations of problem variables."],["LNS fragments represent collections of variables to be relaxed, and are created iteratively using the `NextFragment()` method, which returns `false` when all fragments have been generated."],["The `InitFragments()` method is available to initialize data for fragments, and is automatically called at the beginning of the search."],["The provided code example demonstrates a simple LNS implementation (`OneVarLns`) that relaxes one variable at a time."]]],["`BaseLns` is a base class for building Lns operators, which relax collections of variables called fragments. `NextFragment()` builds these fragments, returning false when none remain. `InitFragments()` initializes fragment data, called at the start of local search. `AppendToFragment()` adds a variable to the current fragment. `BaseLns` constructor, `~BaseLns` destructor, `FragmentSize()`, and `HasFragments()` are also part of this class. The provided example demonstrates a `OneVarLns` subclass, which relaxes one variable at a time.\n"]]