Cbc 2.10.12
Loading...
Searching...
No Matches
CbcSOS Class Reference

Branching object for Special Ordered Sets of type 1 and 2. More...

#include <CbcSOS.hpp>

Inheritance diagram for CbcSOS:
Collaboration diagram for CbcSOS:

Public Member Functions

 CbcSOS ()
 CbcSOS (CbcModel *model, int numberMembers, const int *which, const double *weights, int identifier, int type=1)
 Constructor with SOS type and member information.
 CbcSOS (const CbcSOS &)
virtual CbcObject * clone () const
 Clone.
CbcSOSoperator= (const CbcSOS &rhs)
virtual ~CbcSOS ()
virtual double infeasibility (const OsiBranchingInformation *info, int &preferredWay) const
 Infeasibility - large is 0.5.
virtual void feasibleRegion ()
 This looks at solution and sets bounds to contain solution.
virtual CbcBranchingObjectcreateCbcBranch (OsiSolverInterface *solver, const OsiBranchingInformation *info, int way)
 Creates a branching object.
virtual CbcObjectUpdateData createUpdateInformation (const OsiSolverInterface *solver, const CbcNode *node, const CbcBranchingObject *branchingObject)
 Pass in information on branch just done and create CbcObjectUpdateData instance.
virtual void updateInformation (const CbcObjectUpdateData &data)
 Update object by CbcObjectUpdateData.
virtual OsiSolverBranch * solverBranch () const
 Create an OsiSolverBranch object.
virtual void redoSequenceEtc (CbcModel *model, int numberColumns, const int *originalColumns)
 Redoes data when sequence numbers change.
OsiSOS * osiObject (const OsiSolverInterface *solver) const
 Construct an OsiSOS object.
int numberMembers () const
 Number of members.
const int * members () const
 Members (indices in range 0 ... numberColumns-1).
int sosType () const
 SOS type.
int numberTimesDown () const
 Down number times.
int numberTimesUp () const
 Up number times.
const double * weights () const
 Array of weights.
void setNumberMembers (int n)
 Set number of members.
int * mutableMembers () const
 Members (indices in range 0 ... numberColumns-1).
double * mutableWeights () const
 Array of weights.
virtual bool canDoHeuristics () const
 Return true if object can take part in normal heuristics.
void setIntegerValued (bool yesNo)
 Set whether set is integer valued or not.

Protected Attributes

int * members_
 data
double * weights_
 Weights for individual members.
double shadowEstimateDown_
 Current pseudo-shadow price estimate down.
double shadowEstimateUp_
 Current pseudo-shadow price estimate up.
double downDynamicPseudoRatio_
 Down pseudo ratio.
double upDynamicPseudoRatio_
 Up pseudo ratio.
int numberTimesDown_
 Number of times we have gone down.
int numberTimesUp_
 Number of times we have gone up.
int numberMembers_
 Number of members.
int sosType_
 SOS type.
bool integerValued_
 Whether integer valued.
bool oddValues_
 Whether odd values e.g. negative.

Detailed Description

Branching object for Special Ordered Sets of type 1 and 2.

SOS1 are an ordered set of variables where at most one variable can be non-zero. SOS1 are commonly defined with binary variables (interpreted as selection between alternatives) but this is not necessary. An SOS1 with all binary variables is a special case of a clique (setting any one variable to 1 forces all others to 0).

In theory, the implementation makes no assumptions about integrality in Type 1 sets. In practice, there are places where the code seems to have been written with a binary SOS mindset. Current development of SOS branching objects is proceeding in OsiSOS.

SOS2 are an ordered set of variables in which at most two consecutive variables can be non-zero and must sum to 1 (interpreted as interpolation between two discrete values). By definition the variables are non-integer.

Definition at line 29 of file CbcSOS.hpp.

Constructor & Destructor Documentation

◆ CbcSOS() [1/3]

CbcSOS::CbcSOS ( )

◆ CbcSOS() [2/3]

CbcSOS::CbcSOS ( CbcModel * model,
int numberMembers,
const int * which,
const double * weights,
int identifier,
int type = 1 )

Constructor with SOS type and member information.

Type specifies SOS 1 or 2. Identifier is an arbitrary value.

Which should be an array of variable indices with numberMembers entries. Weights can be used to assign arbitrary weights to variables, in the order they are specified in which. If no weights are provided, a default array of 0, 1, 2, ... is generated.

◆ CbcSOS() [3/3]

CbcSOS::CbcSOS ( const CbcSOS & )

◆ ~CbcSOS()

virtual CbcSOS::~CbcSOS ( )
virtual

Member Function Documentation

◆ clone()

virtual CbcObject * CbcSOS::clone ( ) const
virtual

Clone.

◆ operator=()

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

◆ infeasibility()

virtual double CbcSOS::infeasibility ( const OsiBranchingInformation * info,
int & preferredWay ) const
virtual

Infeasibility - large is 0.5.

◆ feasibleRegion()

virtual void CbcSOS::feasibleRegion ( )
virtual

This looks at solution and sets bounds to contain solution.

◆ createCbcBranch()

virtual CbcBranchingObject * CbcSOS::createCbcBranch ( OsiSolverInterface * solver,
const OsiBranchingInformation * info,
int way )
virtual

Creates a branching object.

◆ createUpdateInformation()

virtual CbcObjectUpdateData CbcSOS::createUpdateInformation ( const OsiSolverInterface * solver,
const CbcNode * node,
const CbcBranchingObject * branchingObject )
virtual

Pass in information on branch just done and create CbcObjectUpdateData instance.

If object does not need data then backward pointer will be NULL. Assumes can get information from solver

◆ updateInformation()

virtual void CbcSOS::updateInformation ( const CbcObjectUpdateData & data)
virtual

Update object by CbcObjectUpdateData.

◆ solverBranch()

virtual OsiSolverBranch * CbcSOS::solverBranch ( ) const
virtual

Create an OsiSolverBranch object.

This returns NULL if branch not represented by bound changes

◆ redoSequenceEtc()

virtual void CbcSOS::redoSequenceEtc ( CbcModel * model,
int numberColumns,
const int * originalColumns )
virtual

Redoes data when sequence numbers change.

◆ osiObject()

OsiSOS * CbcSOS::osiObject ( const OsiSolverInterface * solver) const

Construct an OsiSOS object.

◆ numberMembers()

int CbcSOS::numberMembers ( ) const
inline

Number of members.

Definition at line 92 of file CbcSOS.hpp.

◆ members()

const int * CbcSOS::members ( ) const
inline

Members (indices in range 0 ... numberColumns-1).

Definition at line 98 of file CbcSOS.hpp.

◆ sosType()

int CbcSOS::sosType ( ) const
inline

SOS type.

Definition at line 104 of file CbcSOS.hpp.

◆ numberTimesDown()

int CbcSOS::numberTimesDown ( ) const
inline

Down number times.

Definition at line 109 of file CbcSOS.hpp.

◆ numberTimesUp()

int CbcSOS::numberTimesUp ( ) const
inline

Up number times.

Definition at line 114 of file CbcSOS.hpp.

◆ weights()

const double * CbcSOS::weights ( ) const
inline

Array of weights.

Definition at line 120 of file CbcSOS.hpp.

◆ setNumberMembers()

void CbcSOS::setNumberMembers ( int n)
inline

Set number of members.

Definition at line 126 of file CbcSOS.hpp.

◆ mutableMembers()

int * CbcSOS::mutableMembers ( ) const
inline

Members (indices in range 0 ... numberColumns-1).

Definition at line 132 of file CbcSOS.hpp.

◆ mutableWeights()

double * CbcSOS::mutableWeights ( ) const
inline

Array of weights.

Definition at line 138 of file CbcSOS.hpp.

◆ canDoHeuristics()

virtual bool CbcSOS::canDoHeuristics ( ) const
inlinevirtual

Return true if object can take part in normal heuristics.

Definition at line 145 of file CbcSOS.hpp.

◆ setIntegerValued()

void CbcSOS::setIntegerValued ( bool yesNo)
inline

Set whether set is integer valued or not.

Definition at line 150 of file CbcSOS.hpp.

Member Data Documentation

◆ members_

int* CbcSOS::members_
protected

data

Members (indices in range 0 ... numberColumns-1)

Definition at line 159 of file CbcSOS.hpp.

◆ weights_

double* CbcSOS::weights_
protected

Weights for individual members.

Arbitrary weights for members. Can be used to attach meaning to variable values independent of objective coefficients. For example, if the SOS set comprises binary variables used to choose a facility of a given size, the weight could be the corresponding facilty size. Fractional values of the SOS variables can then be used to estimate ideal facility size.

Weights cannot be completely arbitrary. From the code, they must be differ by at least 1.0e-7

Definition at line 172 of file CbcSOS.hpp.

◆ shadowEstimateDown_

double CbcSOS::shadowEstimateDown_
mutableprotected

Current pseudo-shadow price estimate down.

Definition at line 174 of file CbcSOS.hpp.

◆ shadowEstimateUp_

double CbcSOS::shadowEstimateUp_
mutableprotected

Current pseudo-shadow price estimate up.

Definition at line 176 of file CbcSOS.hpp.

◆ downDynamicPseudoRatio_

double CbcSOS::downDynamicPseudoRatio_
protected

Down pseudo ratio.

Definition at line 178 of file CbcSOS.hpp.

◆ upDynamicPseudoRatio_

double CbcSOS::upDynamicPseudoRatio_
protected

Up pseudo ratio.

Definition at line 180 of file CbcSOS.hpp.

◆ numberTimesDown_

int CbcSOS::numberTimesDown_
protected

Number of times we have gone down.

Definition at line 182 of file CbcSOS.hpp.

◆ numberTimesUp_

int CbcSOS::numberTimesUp_
protected

Number of times we have gone up.

Definition at line 184 of file CbcSOS.hpp.

◆ numberMembers_

int CbcSOS::numberMembers_
protected

Number of members.

Definition at line 186 of file CbcSOS.hpp.

◆ sosType_

int CbcSOS::sosType_
protected

SOS type.

Definition at line 188 of file CbcSOS.hpp.

◆ integerValued_

bool CbcSOS::integerValued_
protected

Whether integer valued.

Definition at line 190 of file CbcSOS.hpp.

◆ oddValues_

bool CbcSOS::oddValues_
protected

Whether odd values e.g. negative.

Definition at line 192 of file CbcSOS.hpp.


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