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

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

Public Member Functions

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

Detailed Description

template<bool ignore_path_vars>
class operations_research::NearestNeighbors< ignore_path_vars >

--— 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 1550 of file local_search.cc.

Constructor & Destructor Documentation

◆ NearestNeighbors() [1/2]

template<bool ignore_path_vars>
operations_research::NearestNeighbors< ignore_path_vars >::NearestNeighbors ( Solver::IndexEvaluator3 evaluator,
const PathOperator< ignore_path_vars > & path_operator,
int size )

Definition at line 1576 of file local_search.cc.

◆ NearestNeighbors() [2/2]

template<bool ignore_path_vars>
operations_research::NearestNeighbors< ignore_path_vars >::NearestNeighbors ( const NearestNeighbors< ignore_path_vars > & )
delete

This type is neither copyable nor movable.

◆ ~NearestNeighbors()

template<bool ignore_path_vars>
virtual operations_research::NearestNeighbors< ignore_path_vars >::~NearestNeighbors ( )
virtualdefault

Member Function Documentation

◆ DebugString()

template<bool ignore_path_vars>
virtual std::string operations_research::NearestNeighbors< ignore_path_vars >::DebugString ( ) const
inlinevirtual

Definition at line 1564 of file local_search.cc.

◆ Initialize()

template<bool ignore_path_vars>
void operations_research::NearestNeighbors< ignore_path_vars >::Initialize ( absl::Span< const int > path)

Definition at line 1585 of file local_search.cc.

◆ Neighbors()

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

Definition at line 1593 of file local_search.cc.

◆ operator=()

template<bool ignore_path_vars>
NearestNeighbors & operations_research::NearestNeighbors< ignore_path_vars >::operator= ( const NearestNeighbors< ignore_path_vars > & )
delete

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