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