Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::LocalSearchOperator Class Referenceabstract

#include <constraint_solveri.h>

Inheritance diagram for operations_research::LocalSearchOperator:
operations_research::BaseObject operations_research::IntVarLocalSearchOperator operations_research::NeighborhoodLimit operations_research::BaseLns operations_research::ChangeValue operations_research::FilteredHeuristicLocalSearchOperator operations_research::PathOperator operations_research::SwapIndexPairOperator operations_research::FilteredHeuristicCloseNodesLNSOperator operations_research::FilteredHeuristicExpensiveChainLNSOperator operations_research::FilteredHeuristicPathLNSOperator operations_research::RelocatePathAndHeuristicInsertUnperformedOperator operations_research::BaseInactiveNodeToPathOperator operations_research::Cross operations_research::Exchange operations_research::ExchangeSubtrip operations_research::GroupPairAndRelocateOperator operations_research::IndexPairSwapActiveOperator operations_research::LightPairRelocateOperator operations_research::LinKernighan operations_research::MakeChainInactiveOperator operations_research::MakeInactiveOperator operations_research::MakePairActiveOperator operations_research::MakePairInactiveOperator operations_research::MakeRelocateNeighborsOperator operations_research::PairExchangeOperator operations_research::PairExchangeRelocateOperator operations_research::PairNodeSwapActiveOperator< swap_first > operations_research::PairRelocateOperator operations_research::PathLns operations_research::Relocate operations_research::RelocateAndMakeInactiveOperator operations_research::RelocateExpensiveChain operations_research::RelocateSubtrip operations_research::SwapActiveToShortestPathOperator operations_research::TSPLns operations_research::TSPOpt operations_research::TwoOpt

Public Member Functions

 LocalSearchOperator ()
 
 ~LocalSearchOperator () override
 
virtual bool MakeNextNeighbor (Assignment *delta, Assignment *deltadelta)=0
 
virtual void Start (const Assignment *assignment)=0
 
virtual void Reset ()
 
virtual const LocalSearchOperatorSelf () const
 
virtual bool HasFragments () const
 
virtual bool HoldsDelta () const
 
- Public Member Functions inherited from operations_research::BaseObject
 BaseObject ()
 
 BaseObject (const BaseObject &)=delete
 This type is neither copyable nor movable.
 
BaseObjectoperator= (const BaseObject &)=delete
 
virtual ~BaseObject ()
 
virtual std::string DebugString () const
 

Detailed Description

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 ?

(user): decouple the iterating from the defining of a neighbor.

Definition at line 927 of file constraint_solveri.h.

Constructor & Destructor Documentation

◆ LocalSearchOperator()

operations_research::LocalSearchOperator::LocalSearchOperator ( )
inline

Definition at line 929 of file constraint_solveri.h.

◆ ~LocalSearchOperator()

operations_research::LocalSearchOperator::~LocalSearchOperator ( )
inlineoverride

Definition at line 930 of file constraint_solveri.h.

Member Function Documentation

◆ HasFragments()

virtual bool operations_research::LocalSearchOperator::HasFragments ( ) const
inlinevirtual

Reimplemented in operations_research::BaseLns, and operations_research::PathLns.

Definition at line 937 of file constraint_solveri.h.

◆ HoldsDelta()

virtual bool operations_research::LocalSearchOperator::HoldsDelta ( ) const
inlinevirtual

◆ MakeNextNeighbor()

◆ Reset()

virtual void operations_research::LocalSearchOperator::Reset ( )
inlinevirtual

Reimplemented in operations_research::PathOperator, and operations_research::TwoOpt.

Definition at line 933 of file constraint_solveri.h.

◆ Self()

virtual const LocalSearchOperator * operations_research::LocalSearchOperator::Self ( ) const
inlinevirtual

Definition at line 935 of file constraint_solveri.h.

◆ Start()

virtual void operations_research::LocalSearchOperator::Start ( const Assignment * assignment)
pure virtual

The documentation for this class was generated from the following file: