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

#include <set_cover.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 73 of file set_cover.h.

Constructor & Destructor Documentation

◆ RandomSolutionGenerator()

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

Definition at line 75 of file set_cover.h.

Member Function Documentation

◆ NextSolution() [1/2]

bool operations_research::RandomSolutionGenerator::NextSolution ( )

Returns true if a solution was found.

RandomSolutionGenerator.

Definition at line 55 of file set_cover.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 59 of file set_cover.cc.


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