Go to the documentation of this file.
28 #ifndef CBC_SYMMETRY_HPP
29 #define CBC_SYMMETRY_HPP
35 #include "nauty/nauty.h"
36 #include "nauty/nausparse.h"
38 #include "nauty/traces.h"
52 #define NTY_BAD_DEPTH 4
61 #define COUENNE_HACKED_EPS 1.e-07
62 #define COUENNE_HACKED_EPS_SYMM 1e-8
63 #define COUENNE_HACKED_EXPRGROUP 8
82 void node(
int,
double,
double,
double,
int,
int);
91 inline void bounds(
register double a,
register double b)
114 inline bool operator()(
register const char *a,
register const char *b)
const
116 return strcmp(a, b) < 0;
168 int largestOrbit(
const double *lower,
const double *upper)
const;
169 void ChangeBounds(
const double *lower,
const double *upper,
175 OsiSolverInterface * solver,
int mode)
const;
177 OsiSolverInterface * solver)
const;
179 OsiSolverInterface * solver)
const;
180 int fixSome(
int iColumn,
double *columnLower,
double *columnUpper)
const;
182 int worthBranching(
const double *saveLower,
const double *saveUpper,
183 int iColumn,
int & numberCouldFix)
const;
189 inline bool compare(
register Node &a,
register Node &b)
const;
248 CbcNauty(
int n,
const size_t *v,
const int *d,
const int *e);
277 std::vector< std::vector< int > > *
getOrbits()
const;
294 inline optionblk *
options()
const
342 std::multimap< int, int >::iterator
it;
344 std::pair< std::multimap< int, int >::iterator,
345 std::multimap< int, int >::iterator >
366 int numberExtra,
const int *extraToZero);
387 virtual void fix(OsiSolverInterface *solver,
388 double *lower,
double *upper,
389 int branchState)
const;
402 virtual void print();
std::vector< std::vector< int > > * getOrbits() const
Returns the orbits in a "convenient" form.
int worthBranching(const double *saveLower, const double *saveUpper, int iColumn, int &numberCouldFix) const
return number of orbits if worth branching
virtual void fix(OsiSolverInterface *solver, double *lower, double *upper, int branchState) const
Update bounds in solver as in 'branch' and update given bounds.
void adjustStats(const CbcSymmetry *other)
Adjust statistics from threads.
int way() const
Get the state of the branching object.
void incrementNautyBranches(int n)
bool operator()(register const Node &a, register const Node &b)
CbcSymmetry & operator=(const CbcSymmetry &rhs)
Assignment operator.
void node(int, double, double, double, int, int)
void deleteElement(int ix, int jx)
void incrementBranchSucceeded()
int orbitalFixing(OsiSolverInterface *solver)
Fixes variables using orbits (returns number fixed)
CbcOrbitalBranchingObject & operator=(const CbcOrbitalBranchingObject &rhs)
void Print_Orbits(int type=0) const
std::multimap< int, int > constr_rhs
int numberExtra_
Number extra.
virtual void previousBranch()
Reset every information so that the branching object appears to point to the previous child.
CbcSymmetry()
Default constructor.
virtual void print()
Print something about branch - only if log level high.
void setupSymmetry(CbcModel *model)
empty if no NTY, symmetry data structure setup otherwise
void addElement(int ix, int jx)
virtual int compareOriginalObject(const CbcBranchingObject *brObj) const
Compare the original object of this with the original object of brObj.
virtual double branch()=0
Execute the actions required to branch, as specified by the current state of the branching object,...
bool compare(register Node &a, register Node &b) const
CbcOrbitalBranchingObject()
std::vector< int > * Find_Orbit(int) const
bool operator()(register const char *a, register const char *b) const
void fixSuccess(int nFixed)
virtual void previousBranch()
Reset every information so that the branching object appears to point to the previous child.
CbcNauty()
Default constructor.
double getGroupSize() const
int nautyBranchSucceeded_
virtual CbcRangeCompare compareBranchingObject(const CbcBranchingObject *brObj, const bool replaceIfOverlap=false)
Compare the this with brObj.
int lastNautyBranchSucceeded_
~CbcSymmetry()
Destructor.
int changeBounds(int kColumn, double *saveLower, double *saveUpper, OsiSolverInterface *solver, int mode) const
for simple stuff - returns number can fix if can use saved orbit (mode 1) otherwise may fix and retur...
void ChangeBounds(const double *lower, const double *upper, int numberColumns, bool justFixedAtOne) const
Class to deal with symmetry.
std::pair< std::multimap< int, int >::iterator, std::multimap< int, int >::iterator > ret
int fixSome(int iColumn, double *columnLower, double *columnUpper) const
Branching object for Orbital branching.
void Compute_Symmetry() const
#define COUENNE_HACKED_EPS_SYMM
int statsOrbits(CbcModel *model, int type) const
void setWriteAutoms(const std::string &afilename)
Methods to classify orbits.
Simple Branch and bound class.
int orbitalFixing2(OsiSolverInterface *solver)
Fixes variables using root orbits (returns number fixed)
optionblk * options() const
Pointer to options.
void insertRHS(int rhs, int cons)
virtual void print() const
Print something about branch - only if log level high.
Abstract branching object base class Now just difference with OsiBranchingObject.
virtual CbcBranchObjType type() const
Return the type (an integer identifier) of this.
void bounds(register double a, register double b)
int lastNautyFixSucceeded_
void addPermutation(cbc_permute permutation)
takes ownership of cbc_permute (orbits part)
int numberColumns() const
virtual double branch()
Does next branch and updates state.
void getVstat(double *v, int nv)
std::multimap< int, int >::iterator it
int numberOther_
Number (without column) going to zero on down branch.
int numberUsefulObjects() const
double nautyOtherBranches_
void color_vertex(register int k)
int largestOrbit(const double *lower, const double *upper) const
CbcNauty & operator=(const CbcNauty &rhs)
Assignment operator.
int * permutation(int which) const
Permutation arrays.
std::vector< Node > node_info_
int numberPermutations() const
Number of permutation arrays.
cbc_permute * permutations_
int getNumGenerators() const
void color_node(int ix, int color)
int * fixToZero_
Fix to zero.
CbcModel * model() const
Return model.
int column_
Column to go to 1.
virtual CbcBranchingObject * clone() const
Clone.
int numberInPermutation(int which) const
int * fixedToZero() const
int changeBounds2(double *saveLower, double *saveUpper, OsiSolverInterface *solver) const
bool operator()(register const Node &a, register const Node &b)
int numberUsefulOrbits() const
virtual ~CbcOrbitalBranchingObject()