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

#include <set_cover_heuristics.h>

Public Member Functions

 RandomSolutionGenerator (SetCoverInvariant *inv)
 
bool NextSolution ()
 Returns true if a solution was found.
 
bool NextSolution (const std::vector< SubsetIndex > &focus)
 

Detailed Description

A slightly more complicated but better way to compute a first solution is to select columns randomly. Less silly than the previous one, and provides much better results.

Todo
(user): make it possible to use other random generators. Idea: bias the generator towards the columns with the least marginal costs.

Definition at line 128 of file set_cover_heuristics.h.

Constructor & Destructor Documentation

◆ RandomSolutionGenerator()

operations_research::RandomSolutionGenerator::RandomSolutionGenerator ( SetCoverInvariant * inv)
inlineexplicit

Definition at line 130 of file set_cover_heuristics.h.

Member Function Documentation

◆ NextSolution() [1/2]

bool operations_research::RandomSolutionGenerator::NextSolution ( )

Returns true if a solution was found.

RandomSolutionGenerator.

Definition at line 93 of file set_cover_heuristics.cc.

◆ NextSolution() [2/2]

bool operations_research::RandomSolutionGenerator::NextSolution ( const std::vector< SubsetIndex > & focus)

Computes the next partial solution considering only the subsets whose indices are in focus.

Definition at line 97 of file set_cover_heuristics.cc.


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