Alps  2.0.2
List of all members
AbcCutGenerator Class Reference

Interface between Abc and Cut Generation Library. More...

#include <AbcCutGenerator.h>

+ Collaboration diagram for AbcCutGenerator:

Public Member Functions

Generate Cuts
bool generateCuts (OsiCuts &cs, bool fullScan)
 Generate cuts for the client model. More...
 
bool generateCuts (OsiCuts &cs, bool fullScan)
 Generate cuts for the client model. More...
 
bool generateCuts (OsiCuts &cs, bool fullScan)
 Generate cuts for the client model. More...
 
Constructors and destructors
 AbcCutGenerator ()
 Default constructor. More...
 
 AbcCutGenerator (AbcModel *model, CglCutGenerator *generator, int howOften=1, const char *name=NULL, bool normal=true, bool atSolution=false, bool infeasible=false)
 Normal constructor. More...
 
 AbcCutGenerator (const AbcCutGenerator &)
 Copy constructor. More...
 
AbcCutGeneratoroperator= (const AbcCutGenerator &rhs)
 Assignment operator. More...
 
 ~AbcCutGenerator ()
 Destructor. More...
 
 AbcCutGenerator ()
 Default constructor. More...
 
 AbcCutGenerator (AbcModel *model, CglCutGenerator *generator, int howOften=1, const char *name=NULL, bool normal=true, bool atSolution=false, bool infeasible=false)
 Normal constructor. More...
 
 AbcCutGenerator (const AbcCutGenerator &)
 Copy constructor. More...
 
AbcCutGeneratoroperator= (const AbcCutGenerator &rhs)
 Assignment operator. More...
 
 ~AbcCutGenerator ()
 Destructor. More...
 
 AbcCutGenerator ()
 Default constructor. More...
 
 AbcCutGenerator (AbcModel *model, CglCutGenerator *generator, int howOften=1, const char *name=NULL, bool normal=true, bool atSolution=false, bool infeasible=false)
 Normal constructor. More...
 
 AbcCutGenerator (const AbcCutGenerator &)
 Copy constructor. More...
 
AbcCutGeneratoroperator= (const AbcCutGenerator &rhs)
 Assignment operator. More...
 
 ~AbcCutGenerator ()
 Destructor. More...
 

Gets and sets

AbcModelmodel_
 The client model. More...
 
CglCutGenerator * generator_
 
int whenCutGenerator_
 Number of nodes between calls to the CglCutGenerator::generateCuts routine. More...
 
char * generatorName_
 Name of generator. More...
 
bool normal_
 Whether to call the generator in the normal place. More...
 
bool atSolution_
 Whether to call the generator when a new solution is found. More...
 
bool whenInfeasible_
 Whether to call generator when a subproblem is found to be infeasible. More...
 
void refreshModel (AbcModel *model)
 Set the client model. More...
 
const char * cutGeneratorName () const
 return name of generator More...
 
void setHowOften (int value)
 Set the cut generation interval. More...
 
int howOften () const
 Get the cut generation interval. More...
 
bool normal () const
 Get whether the cut generator should be called in the normal place. More...
 
void setNormal (bool value)
 Set whether the cut generator should be called in the normal place. More...
 
bool atSolution () const
 Get whether the cut generator should be called when a solution is found. More...
 
void setAtSolution (bool value)
 Set whether the cut generator should be called when a solution is found. More...
 
bool whenInfeasible () const
 Get whether the cut generator should be called when the subproblem is found to be infeasible. More...
 
void setWhenInfeasible (bool value)
 Set whether the cut generator should be called when the subproblem is found to be infeasible. More...
 
CglCutGenerator * generator () const
 Get the CglCutGenerator bound to this AbcCutGenerator. More...
 
void refreshModel (AbcModel *model)
 Set the client model. More...
 
const char * cutGeneratorName () const
 return name of generator More...
 
void setHowOften (int value)
 Set the cut generation interval. More...
 
int howOften () const
 Get the cut generation interval. More...
 
bool normal () const
 Get whether the cut generator should be called in the normal place. More...
 
void setNormal (bool value)
 Set whether the cut generator should be called in the normal place. More...
 
bool atSolution () const
 Get whether the cut generator should be called when a solution is found. More...
 
void setAtSolution (bool value)
 Set whether the cut generator should be called when a solution is found. More...
 
bool whenInfeasible () const
 Get whether the cut generator should be called when the subproblem is found to be infeasible. More...
 
void setWhenInfeasible (bool value)
 Set whether the cut generator should be called when the subproblem is found to be infeasible. More...
 
CglCutGenerator * generator () const
 Get the CglCutGenerator bound to this AbcCutGenerator. More...
 
void refreshModel (AbcModel *model)
 Set the client model. More...
 
const char * cutGeneratorName () const
 return name of generator More...
 
void setHowOften (int value)
 Set the cut generation interval. More...
 
int howOften () const
 Get the cut generation interval. More...
 
bool normal () const
 Get whether the cut generator should be called in the normal place. More...
 
void setNormal (bool value)
 Set whether the cut generator should be called in the normal place. More...
 
bool atSolution () const
 Get whether the cut generator should be called when a solution is found. More...
 
void setAtSolution (bool value)
 Set whether the cut generator should be called when a solution is found. More...
 
bool whenInfeasible () const
 Get whether the cut generator should be called when the subproblem is found to be infeasible. More...
 
void setWhenInfeasible (bool value)
 Set whether the cut generator should be called when the subproblem is found to be infeasible. More...
 
CglCutGenerator * generator () const
 Get the CglCutGenerator bound to this AbcCutGenerator. More...
 

Detailed Description

Interface between Abc and Cut Generation Library.

AbcCutGenerator is intended to provide an intelligent interface between Abc and the cutting plane algorithms in the CGL. A AbcCutGenerator is bound to a CglCutGenerator and to an AbcModel. It contains parameters which control when and how the generateCuts method of the CglCutGenerator will be called.

The builtin decision criteria available to use when deciding whether to generate cuts are limited: every X nodes, when a solution is found, and when a subproblem is found to be infeasible. The idea is that the class will grow more intelligent with time.

Todo:
Add a pointer to function member which will allow a client to install their own decision algorithm to decide whether or not to call the CGL generateCuts method. Create a default decision method that looks at the builtin criteria.
Todo:
It strikes me as not good that generateCuts contains code specific to individual CGL algorithms. Another set of pointer to function members, so that the client can specify the cut generation method as well as pre- and post-generation methods? Taken a bit further, should this class contain a bunch of pointer to function members, one for each of the places where the cut generator might be referenced? Initialization, root node, search tree node, discovery of solution, and termination all come to mind. Initialization and termination would also be useful for instrumenting sbb.

AbcCutGenerator is intended to provide an intelligent interface between Abc and the cutting plane algorithms in the CGL. A AbcCutGenerator is bound to a CglCutGenerator and to an AbcModel. It contains parameters which control when and how the generateCuts method of the CglCutGenerator will be called.

The builtin decision criteria available to use when deciding whether to generate cuts are limited: every X nodes, when a solution is found, and when a subproblem is found to be infeasible. The idea is that the class will grow more intelligent with time.

Todo:
Add a pointer to function member which will allow a client to install their own decision algorithm to decide whether or not to call the CGL generateCuts method. Create a default decision method that looks at the builtin criteria.
Todo:
It strikes me as not good that generateCuts contains code specific to individual CGL algorithms. Another set of pointer to function members, so that the client can specify the cut generation method as well as pre- and post-generation methods? Taken a bit further, should this class contain a bunch of pointer to function members, one for each of the places where the cut generator might be referenced? Initialization, root node, search tree node, discovery of solution, and termination all come to mind. Initialization and termination would also be useful for instrumenting sbb.

AbcCutGenerator is intended to provide an intelligent interface between Abc and the cutting plane algorithms in the CGL. A AbcCutGenerator is bound to a CglCutGenerator and to an AbcModel. It contains parameters which control when and how the generateCuts method of the CglCutGenerator will be called.

The builtin decision criteria available to use when deciding whether to generate cuts are limited: every X nodes, when a solution is found, and when a subproblem is found to be infeasible. The idea is that the class will grow more intelligent with time.

Todo:
Add a pointer to function member which will allow a client to install their own decision algorithm to decide whether or not to call the CGL generateCuts method. Create a default decision method that looks at the builtin criteria.
Todo:
It strikes me as not good that generateCuts contains code specific to individual CGL algorithms. Another set of pointer to function members, so that the client can specify the cut generation method as well as pre- and post-generation methods? Taken a bit further, should this class contain a bunch of pointer to function members, one for each of the places where the cut generator might be referenced? Initialization, root node, search tree node, discovery of solution, and termination all come to mind. Initialization and termination would also be useful for instrumenting sbb.

Definition at line 73 of file AbcCutGenerator.h.

Constructor & Destructor Documentation

◆ AbcCutGenerator() [1/9]

AbcCutGenerator::AbcCutGenerator ( )

Default constructor.

◆ AbcCutGenerator() [2/9]

AbcCutGenerator::AbcCutGenerator ( AbcModel model,
CglCutGenerator *  generator,
int  howOften = 1,
const char *  name = NULL,
bool  normal = true,
bool  atSolution = false,
bool  infeasible = false 
)

Normal constructor.

◆ AbcCutGenerator() [3/9]

AbcCutGenerator::AbcCutGenerator ( const AbcCutGenerator )

Copy constructor.

◆ ~AbcCutGenerator() [1/3]

AbcCutGenerator::~AbcCutGenerator ( )

Destructor.

◆ AbcCutGenerator() [4/9]

AbcCutGenerator::AbcCutGenerator ( )

Default constructor.

◆ AbcCutGenerator() [5/9]

AbcCutGenerator::AbcCutGenerator ( AbcModel model,
CglCutGenerator *  generator,
int  howOften = 1,
const char *  name = NULL,
bool  normal = true,
bool  atSolution = false,
bool  infeasible = false 
)

Normal constructor.

◆ AbcCutGenerator() [6/9]

AbcCutGenerator::AbcCutGenerator ( const AbcCutGenerator )

Copy constructor.

◆ ~AbcCutGenerator() [2/3]

AbcCutGenerator::~AbcCutGenerator ( )

Destructor.

◆ AbcCutGenerator() [7/9]

AbcCutGenerator::AbcCutGenerator ( )

Default constructor.

◆ AbcCutGenerator() [8/9]

AbcCutGenerator::AbcCutGenerator ( AbcModel model,
CglCutGenerator *  generator,
int  howOften = 1,
const char *  name = NULL,
bool  normal = true,
bool  atSolution = false,
bool  infeasible = false 
)

Normal constructor.

◆ AbcCutGenerator() [9/9]

AbcCutGenerator::AbcCutGenerator ( const AbcCutGenerator )

Copy constructor.

◆ ~AbcCutGenerator() [3/3]

AbcCutGenerator::~AbcCutGenerator ( )

Destructor.

Member Function Documentation

◆ generateCuts() [1/3]

bool AbcCutGenerator::generateCuts ( OsiCuts &  cs,
bool  fullScan 
)

Generate cuts for the client model.

Evaluate the state of the client model and decide whether to generate cuts. The generated cuts are inserted into and returned in the collection of cuts cs.

If fullScan is true, the generator is obliged to call the CGL generateCuts routine. Otherwise, it is free to make a local decision. The current implementation uses whenCutGenerator_ to decide.

The routine returns true if reoptimisation is needed (because the state of the solver interface has been modified).

◆ operator=() [1/3]

AbcCutGenerator& AbcCutGenerator::operator= ( const AbcCutGenerator rhs)

Assignment operator.

◆ refreshModel() [1/3]

void AbcCutGenerator::refreshModel ( AbcModel model)

Set the client model.

In addition to setting the client model, refreshModel also calls the refreshSolver method of the CglCutGenerator object.

◆ cutGeneratorName() [1/3]

const char* AbcCutGenerator::cutGeneratorName ( ) const
inline

return name of generator

Definition at line 128 of file AbcCutGenerator.h.

◆ setHowOften() [1/3]

void AbcCutGenerator::setHowOften ( int  value)

Set the cut generation interval.

Set the number of nodes evaluated between calls to the Cgl object's generateCuts routine.

If value is positive, cuts will always be generated at the specified interval. If value is negative, cuts will initially be generated at the specified interval, but Abc may adjust the value depending on the success of cuts produced by this generator.

A value of -100 disables the generator, while a value of -99 means just at root.

◆ howOften() [1/3]

int AbcCutGenerator::howOften ( ) const
inline

Get the cut generation interval.

Definition at line 150 of file AbcCutGenerator.h.

◆ normal() [1/3]

bool AbcCutGenerator::normal ( ) const
inline

Get whether the cut generator should be called in the normal place.

Definition at line 154 of file AbcCutGenerator.h.

◆ setNormal() [1/3]

void AbcCutGenerator::setNormal ( bool  value)
inline

Set whether the cut generator should be called in the normal place.

Definition at line 157 of file AbcCutGenerator.h.

◆ atSolution() [1/3]

bool AbcCutGenerator::atSolution ( ) const
inline

Get whether the cut generator should be called when a solution is found.

Definition at line 160 of file AbcCutGenerator.h.

◆ setAtSolution() [1/3]

void AbcCutGenerator::setAtSolution ( bool  value)
inline

Set whether the cut generator should be called when a solution is found.

Definition at line 163 of file AbcCutGenerator.h.

◆ whenInfeasible() [1/3]

bool AbcCutGenerator::whenInfeasible ( ) const
inline

Get whether the cut generator should be called when the subproblem is found to be infeasible.

Definition at line 168 of file AbcCutGenerator.h.

◆ setWhenInfeasible() [1/3]

void AbcCutGenerator::setWhenInfeasible ( bool  value)
inline

Set whether the cut generator should be called when the subproblem is found to be infeasible.

Definition at line 173 of file AbcCutGenerator.h.

◆ generator() [1/3]

CglCutGenerator* AbcCutGenerator::generator ( ) const
inline

Get the CglCutGenerator bound to this AbcCutGenerator.

Definition at line 176 of file AbcCutGenerator.h.

◆ generateCuts() [2/3]

bool AbcCutGenerator::generateCuts ( OsiCuts &  cs,
bool  fullScan 
)

Generate cuts for the client model.

Evaluate the state of the client model and decide whether to generate cuts. The generated cuts are inserted into and returned in the collection of cuts cs.

If fullScan is true, the generator is obliged to call the CGL generateCuts routine. Otherwise, it is free to make a local decision. The current implementation uses whenCutGenerator_ to decide.

The routine returns true if reoptimisation is needed (because the state of the solver interface has been modified).

◆ operator=() [2/3]

AbcCutGenerator& AbcCutGenerator::operator= ( const AbcCutGenerator rhs)

Assignment operator.

◆ refreshModel() [2/3]

void AbcCutGenerator::refreshModel ( AbcModel model)

Set the client model.

In addition to setting the client model, refreshModel also calls the refreshSolver method of the CglCutGenerator object.

◆ cutGeneratorName() [2/3]

const char* AbcCutGenerator::cutGeneratorName ( ) const
inline

return name of generator

Definition at line 128 of file AbcCutGenerator.h.

◆ setHowOften() [2/3]

void AbcCutGenerator::setHowOften ( int  value)

Set the cut generation interval.

Set the number of nodes evaluated between calls to the Cgl object's generateCuts routine.

If value is positive, cuts will always be generated at the specified interval. If value is negative, cuts will initially be generated at the specified interval, but Abc may adjust the value depending on the success of cuts produced by this generator.

A value of -100 disables the generator, while a value of -99 means just at root.

◆ howOften() [2/3]

int AbcCutGenerator::howOften ( ) const
inline

Get the cut generation interval.

Definition at line 150 of file AbcCutGenerator.h.

◆ normal() [2/3]

bool AbcCutGenerator::normal ( ) const
inline

Get whether the cut generator should be called in the normal place.

Definition at line 154 of file AbcCutGenerator.h.

◆ setNormal() [2/3]

void AbcCutGenerator::setNormal ( bool  value)
inline

Set whether the cut generator should be called in the normal place.

Definition at line 157 of file AbcCutGenerator.h.

◆ atSolution() [2/3]

bool AbcCutGenerator::atSolution ( ) const
inline

Get whether the cut generator should be called when a solution is found.

Definition at line 160 of file AbcCutGenerator.h.

◆ setAtSolution() [2/3]

void AbcCutGenerator::setAtSolution ( bool  value)
inline

Set whether the cut generator should be called when a solution is found.

Definition at line 163 of file AbcCutGenerator.h.

◆ whenInfeasible() [2/3]

bool AbcCutGenerator::whenInfeasible ( ) const
inline

Get whether the cut generator should be called when the subproblem is found to be infeasible.

Definition at line 168 of file AbcCutGenerator.h.

◆ setWhenInfeasible() [2/3]

void AbcCutGenerator::setWhenInfeasible ( bool  value)
inline

Set whether the cut generator should be called when the subproblem is found to be infeasible.

Definition at line 173 of file AbcCutGenerator.h.

◆ generator() [2/3]

CglCutGenerator* AbcCutGenerator::generator ( ) const
inline

Get the CglCutGenerator bound to this AbcCutGenerator.

Definition at line 176 of file AbcCutGenerator.h.

◆ generateCuts() [3/3]

bool AbcCutGenerator::generateCuts ( OsiCuts &  cs,
bool  fullScan 
)

Generate cuts for the client model.

Evaluate the state of the client model and decide whether to generate cuts. The generated cuts are inserted into and returned in the collection of cuts cs.

If fullScan is true, the generator is obliged to call the CGL generateCuts routine. Otherwise, it is free to make a local decision. The current implementation uses whenCutGenerator_ to decide.

The routine returns true if reoptimisation is needed (because the state of the solver interface has been modified).

◆ operator=() [3/3]

AbcCutGenerator& AbcCutGenerator::operator= ( const AbcCutGenerator rhs)

Assignment operator.

◆ refreshModel() [3/3]

void AbcCutGenerator::refreshModel ( AbcModel model)

Set the client model.

In addition to setting the client model, refreshModel also calls the refreshSolver method of the CglCutGenerator object.

◆ cutGeneratorName() [3/3]

const char* AbcCutGenerator::cutGeneratorName ( ) const
inline

return name of generator

Definition at line 128 of file AbcCutGenerator.h.

◆ setHowOften() [3/3]

void AbcCutGenerator::setHowOften ( int  value)

Set the cut generation interval.

Set the number of nodes evaluated between calls to the Cgl object's generateCuts routine.

If value is positive, cuts will always be generated at the specified interval. If value is negative, cuts will initially be generated at the specified interval, but Abc may adjust the value depending on the success of cuts produced by this generator.

A value of -100 disables the generator, while a value of -99 means just at root.

◆ howOften() [3/3]

int AbcCutGenerator::howOften ( ) const
inline

Get the cut generation interval.

Definition at line 150 of file AbcCutGenerator.h.

◆ normal() [3/3]

bool AbcCutGenerator::normal ( ) const
inline

Get whether the cut generator should be called in the normal place.

Definition at line 154 of file AbcCutGenerator.h.

◆ setNormal() [3/3]

void AbcCutGenerator::setNormal ( bool  value)
inline

Set whether the cut generator should be called in the normal place.

Definition at line 157 of file AbcCutGenerator.h.

◆ atSolution() [3/3]

bool AbcCutGenerator::atSolution ( ) const
inline

Get whether the cut generator should be called when a solution is found.

Definition at line 160 of file AbcCutGenerator.h.

◆ setAtSolution() [3/3]

void AbcCutGenerator::setAtSolution ( bool  value)
inline

Set whether the cut generator should be called when a solution is found.

Definition at line 163 of file AbcCutGenerator.h.

◆ whenInfeasible() [3/3]

bool AbcCutGenerator::whenInfeasible ( ) const
inline

Get whether the cut generator should be called when the subproblem is found to be infeasible.

Definition at line 168 of file AbcCutGenerator.h.

◆ setWhenInfeasible() [3/3]

void AbcCutGenerator::setWhenInfeasible ( bool  value)
inline

Set whether the cut generator should be called when the subproblem is found to be infeasible.

Definition at line 173 of file AbcCutGenerator.h.

◆ generator() [3/3]

CglCutGenerator* AbcCutGenerator::generator ( ) const
inline

Get the CglCutGenerator bound to this AbcCutGenerator.

Definition at line 176 of file AbcCutGenerator.h.

Member Data Documentation

◆ model_

AbcModel * AbcCutGenerator::model_
private

The client model.

Definition at line 182 of file AbcCutGenerator.h.

◆ generator_

CglCutGenerator * AbcCutGenerator::generator_
private

Definition at line 185 of file AbcCutGenerator.h.

◆ whenCutGenerator_

int AbcCutGenerator::whenCutGenerator_
private

Number of nodes between calls to the CglCutGenerator::generateCuts routine.

Definition at line 190 of file AbcCutGenerator.h.

◆ generatorName_

char * AbcCutGenerator::generatorName_
private

Name of generator.

Definition at line 193 of file AbcCutGenerator.h.

◆ normal_

bool AbcCutGenerator::normal_
private

Whether to call the generator in the normal place.

Definition at line 196 of file AbcCutGenerator.h.

◆ atSolution_

bool AbcCutGenerator::atSolution_
private

Whether to call the generator when a new solution is found.

Definition at line 199 of file AbcCutGenerator.h.

◆ whenInfeasible_

bool AbcCutGenerator::whenInfeasible_
private

Whether to call generator when a subproblem is found to be infeasible.

Definition at line 202 of file AbcCutGenerator.h.


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