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

--— Lin Kernighan --— More...

Public Member Functions

 NearestNeighbors (Solver::IndexEvaluator3 evaluator, const PathOperator &path_operator, int size)
 
 NearestNeighbors (const NearestNeighbors &)=delete
 This type is neither copyable nor movable.
 
NearestNeighborsoperator= (const NearestNeighbors &)=delete
 
virtual ~NearestNeighbors ()
 
void Initialize ()
 
const std::vector< int > & Neighbors (int index) const
 
virtual std::string DebugString () const
 

Detailed Description

--— Lin Kernighan --—

For each variable in vars, stores the 'size' pairs(i,j) with the smallest value according to evaluator, where i is the index of the variable in vars and j is in the domain of the variable.

Note
the resulting pairs are sorted. Works in O(size) per variable on average (same approach as qsort)

Definition at line 1728 of file local_search.cc.

Constructor & Destructor Documentation

◆ NearestNeighbors() [1/2]

operations_research::NearestNeighbors::NearestNeighbors ( Solver::IndexEvaluator3 evaluator,
const PathOperator & path_operator,
int size )

Definition at line 1753 of file local_search.cc.

◆ NearestNeighbors() [2/2]

operations_research::NearestNeighbors::NearestNeighbors ( const NearestNeighbors & )
delete

This type is neither copyable nor movable.

◆ ~NearestNeighbors()

virtual operations_research::NearestNeighbors::~NearestNeighbors ( )
inlinevirtual

Definition at line 1737 of file local_search.cc.

Member Function Documentation

◆ DebugString()

virtual std::string operations_research::NearestNeighbors::DebugString ( ) const
inlinevirtual

Definition at line 1741 of file local_search.cc.

◆ Initialize()

void operations_research::NearestNeighbors::Initialize ( )
Todo
(user): recompute if node changes path ?

Definition at line 1760 of file local_search.cc.

◆ Neighbors()

const std::vector< int > & operations_research::NearestNeighbors::Neighbors ( int index) const

Definition at line 1771 of file local_search.cc.

◆ operator=()

NearestNeighbors & operations_research::NearestNeighbors::operator= ( const NearestNeighbors & )
delete

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