#include <CglClique.hpp>
Classes | |
struct | fnode |
A node of the fractional graph. More... | |
struct | frac_graph |
A graph corresponding to a fractional solution of an LP. More... | |
Public Member Functions | |
CglClique (const CglClique &rhs) | |
Copy constructor. More... | |
virtual CglCutGenerator * | clone () const |
Clone. More... | |
CglClique & | operator= (const CglClique &rhs) |
Assignment operator. More... | |
virtual void | generateCuts (const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo()) |
Generate cuts for the model data contained in si. More... | |
![]() | |
CglCutGenerator () | |
Default constructor. More... | |
CglCutGenerator (const CglCutGenerator &) | |
Copy constructor. More... | |
CglCutGenerator & | operator= (const CglCutGenerator &rhs) |
Assignment operator. More... | |
virtual | ~CglCutGenerator () |
Destructor. More... | |
virtual void | refreshSolver (OsiSolverInterface *) |
This can be used to refresh any information. More... | |
int | getAggressiveness () const |
Get Aggressiveness - 0 = neutral, 100 is normal root node. More... | |
void | setAggressiveness (int value) |
Set Aggressiveness - 0 = neutral, 100 is normal root node. More... | |
void | setGlobalCuts (bool trueOrFalse) |
Set whether can do global cuts. More... | |
bool | canDoGlobalCuts () const |
Say whether can do global cuts. More... | |
virtual bool | mayGenerateRowCutsInTree () const |
Returns true if may generate Row cuts in tree (rather than root node). More... | |
virtual bool | needsOptimalBasis () const |
Return true if needs optimal basis to do cuts. More... | |
virtual int | maximumLengthOfCutInTree () const |
Return maximum length of cut in tree. More... | |
Protected Attributes | |
const int * | cl_perm_indices |
variables/arrays that are used across many methods More... | |
int | cl_perm_length |
The length of cl_perm_indices. More... | |
int * | cl_indices |
List of indices that should be considered for extending the ones listed in cl_perm_indices. More... | |
int | cl_length |
The length of cl_indices. More... | |
int * | cl_del_indices |
An array of nodes discarded from the candidate list. More... | |
int | cl_del_length |
The length of cl_del_indices. More... | |
Private Member Functions | |
void | selectFractionalBinaries (const OsiSolverInterface &si) |
Scan through the variables and select those that are binary and are at a fractional level. More... | |
void | selectFractionals (const OsiSolverInterface &si) |
Scan through the variables and select those that are at a fractional level. More... | |
void | selectRowCliques (const OsiSolverInterface &si, int numOriginalRows) |
void | createSetPackingSubMatrix (const OsiSolverInterface &si) |
void | createFractionalGraph () |
int | createNodeNode () |
void | deleteSetPackingSubMatrix () |
void | deleteFractionalGraph () |
void | find_scl (OsiCuts &cs) |
void | find_rcl (OsiCuts &cs) |
int | scl_choose_next_node (const int current_nodenum, const int *current_indices, const int *current_degrees, const double *current_values) |
void | scl_delete_node (const int del_ind, int ¤t_nodenum, int *current_indices, int *current_degrees, double *current_values) |
int | enumerate_maximal_cliques (int &pos, bool *scl_label, OsiCuts &cs) |
int | greedy_maximal_clique (OsiCuts &cs) |
void | recordClique (const int len, int *indices, OsiCuts &cs) |
Friends | |
void | CglCliqueUnitTest (const OsiSolverInterface *siP, const std::string mpdDir) |
A function that tests the methods in the CglClique class. More... | |
Constructors and destructors | |
enum | scl_next_node_method { SCL_MIN_DEGREE, SCL_MAX_DEGREE, SCL_MAX_XJ_MAX_DEG } |
possible choices for selecting the next node in the star clique search More... | |
struct | frac_graph |
possible choices for selecting the next node in the star clique search More... | |
bool | setPacking_ |
An indicator showing whether the whole matrix in the solverinterface is a set packing problem or not. More... | |
bool | justOriginalRows_ |
True if just look at original rows. More... | |
int | sp_numrows |
pieces of the set packing part of the solverinterface More... | |
int * | sp_orig_row_ind |
possible choices for selecting the next node in the star clique search More... | |
int | sp_numcols |
possible choices for selecting the next node in the star clique search More... | |
int * | sp_orig_col_ind |
possible choices for selecting the next node in the star clique search More... | |
double * | sp_colsol |
possible choices for selecting the next node in the star clique search More... | |
int * | sp_col_start |
possible choices for selecting the next node in the star clique search More... | |
int * | sp_col_ind |
possible choices for selecting the next node in the star clique search More... | |
int * | sp_row_start |
possible choices for selecting the next node in the star clique search More... | |
int * | sp_row_ind |
possible choices for selecting the next node in the star clique search More... | |
frac_graph | fgraph |
the intersection graph corresponding to the set packing problem More... | |
bool * | node_node |
the node-node incidence matrix of the intersection graph. More... | |
double | petol |
The primal tolerance in the solverinterface. More... | |
bool | do_row_clique |
data for the star clique algorithm More... | |
bool | do_star_clique |
whether to do the star clique algorithm or not. More... | |
scl_next_node_method | scl_next_node_rule |
How the next node to be added to the star clique should be selected. More... | |
int | scl_candidate_length_threshold |
In the star clique method the maximal length of the candidate list (those nodes that are in a star, i.e., connected to the center of the star) to allow complete enumeration of maximal cliques. More... | |
bool | scl_report_result |
whether to give a detailed statistics on the star clique method More... | |
int | rcl_candidate_length_threshold |
In the row clique method the maximal length of the candidate list (those nodes that can extend the row clique, i.e., connected to all nodes in the row clique) to allow complete enumeration of maximal cliques. More... | |
bool | rcl_report_result |
whether to give a detailed statistics on the row clique method More... | |
CglClique (bool setPacking=false, bool justOriginalRows=false) | |
Default constructor. More... | |
virtual | ~CglClique () |
Destructor. More... | |
virtual std::string | generateCpp (FILE *fp) |
Create C++ lines to get to current state. More... | |
void | considerRows (const int numRows, const int *rowInd) |
possible choices for selecting the next node in the star clique search More... | |
void | setStarCliqueNextNodeMethod (scl_next_node_method method) |
possible choices for selecting the next node in the star clique search More... | |
void | setStarCliqueCandidateLengthThreshold (int maxlen) |
possible choices for selecting the next node in the star clique search More... | |
void | setRowCliqueCandidateLengthThreshold (int maxlen) |
possible choices for selecting the next node in the star clique search More... | |
void | setStarCliqueReport (bool yesno=true) |
possible choices for selecting the next node in the star clique search More... | |
void | setRowCliqueReport (bool yesno=true) |
possible choices for selecting the next node in the star clique search More... | |
void | setDoStarClique (bool yesno=true) |
possible choices for selecting the next node in the star clique search More... | |
void | setDoRowClique (bool yesno=true) |
possible choices for selecting the next node in the star clique search More... | |
void | setMinViolation (double minviol) |
possible choices for selecting the next node in the star clique search More... | |
double | getMinViolation () const |
possible choices for selecting the next node in the star clique search More... | |
Additional Inherited Members | |
![]() | |
int | aggressive_ |
Aggressiveness - 0 = neutral, 100 is normal root node. More... | |
bool | canDoGlobalCuts_ |
True if can do global cuts i.e. no general integers. More... | |
Definition at line 14 of file CglClique.hpp.
possible choices for selecting the next node in the star clique search
Enumerator | |
---|---|
SCL_MIN_DEGREE | |
SCL_MAX_DEGREE | |
SCL_MAX_XJ_MAX_DEG |
Definition at line 64 of file CglClique.hpp.
CglClique::CglClique | ( | const CglClique & | rhs | ) |
Copy constructor.
CglClique::CglClique | ( | bool | setPacking = false , |
bool | justOriginalRows = false |
||
) |
Default constructor.
If the setPacking argument is set to true then CglClique will assume that the problem in the solverinterface passed to the generateCuts() method describes a set packing problem, i.e.,
Otherwise the user can use the considerRows() method to set the list of clique rows, that is,
If the user does not set the list of clique rows then CglClique will start the generateCuts() methods by scanning the matrix for them. Also justOriginalRows can be set to true to limit clique creation
|
inlinevirtual |
Destructor.
Definition at line 55 of file CglClique.hpp.
|
virtual |
|
virtual |
Generate cuts for the model data contained in si.
The generated cuts are inserted into and returned in the collection of cuts cs.
Implements CglCutGenerator.
Reimplemented in CglFakeClique.
|
virtual |
Create C++ lines to get to current state.
Reimplemented from CglCutGenerator.
void CglClique::considerRows | ( | const int | numRows, |
const int * | rowInd | ||
) |
possible choices for selecting the next node in the star clique search
|
inline |
possible choices for selecting the next node in the star clique search
Definition at line 70 of file CglClique.hpp.
|
inline |
possible choices for selecting the next node in the star clique search
Definition at line 74 of file CglClique.hpp.
|
inline |
possible choices for selecting the next node in the star clique search
Definition at line 77 of file CglClique.hpp.
|
inline |
possible choices for selecting the next node in the star clique search
Definition at line 81 of file CglClique.hpp.
|
inline |
possible choices for selecting the next node in the star clique search
Definition at line 82 of file CglClique.hpp.
|
inline |
possible choices for selecting the next node in the star clique search
Definition at line 84 of file CglClique.hpp.
|
inline |
possible choices for selecting the next node in the star clique search
Definition at line 85 of file CglClique.hpp.
|
inline |
possible choices for selecting the next node in the star clique search
Definition at line 87 of file CglClique.hpp.
|
inline |
possible choices for selecting the next node in the star clique search
Definition at line 88 of file CglClique.hpp.
|
private |
Scan through the variables and select those that are binary and are at a fractional level.
|
private |
Scan through the variables and select those that are at a fractional level.
We already know that everything is binary.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
friend |
possible choices for selecting the next node in the star clique search
Definition at line 92 of file CglClique.hpp.
|
friend |
A function that tests the methods in the CglClique class.
The only reason for it not to be a member method is that this way it doesn't have to be compiled into the library. And that's a gain, because the library should be compiled with optimization on, but this method should be compiled with debugging.
|
protected |
An indicator showing whether the whole matrix in the solverinterface is a set packing problem or not.
Definition at line 139 of file CglClique.hpp.
|
protected |
True if just look at original rows.
Definition at line 141 of file CglClique.hpp.
|
protected |
pieces of the set packing part of the solverinterface
Definition at line 143 of file CglClique.hpp.
|
protected |
possible choices for selecting the next node in the star clique search
Definition at line 144 of file CglClique.hpp.
|
protected |
possible choices for selecting the next node in the star clique search
Definition at line 145 of file CglClique.hpp.
|
protected |
possible choices for selecting the next node in the star clique search
Definition at line 146 of file CglClique.hpp.
|
protected |
possible choices for selecting the next node in the star clique search
Definition at line 147 of file CglClique.hpp.
|
protected |
possible choices for selecting the next node in the star clique search
Definition at line 148 of file CglClique.hpp.
|
protected |
possible choices for selecting the next node in the star clique search
Definition at line 149 of file CglClique.hpp.
|
protected |
possible choices for selecting the next node in the star clique search
Definition at line 150 of file CglClique.hpp.
|
protected |
possible choices for selecting the next node in the star clique search
Definition at line 151 of file CglClique.hpp.
|
protected |
the intersection graph corresponding to the set packing problem
Definition at line 154 of file CglClique.hpp.
|
protected |
the node-node incidence matrix of the intersection graph.
Definition at line 156 of file CglClique.hpp.
|
protected |
The primal tolerance in the solverinterface.
Definition at line 159 of file CglClique.hpp.
|
protected |
data for the star clique algorithm
Parameters whether to do the row clique algorithm or not.
Definition at line 166 of file CglClique.hpp.
|
protected |
whether to do the star clique algorithm or not.
Definition at line 168 of file CglClique.hpp.
|
protected |
How the next node to be added to the star clique should be selected.
Definition at line 171 of file CglClique.hpp.
|
protected |
In the star clique method the maximal length of the candidate list (those nodes that are in a star, i.e., connected to the center of the star) to allow complete enumeration of maximal cliques.
Otherwise a greedy algorithm is used.
Definition at line 176 of file CglClique.hpp.
|
protected |
whether to give a detailed statistics on the star clique method
Definition at line 178 of file CglClique.hpp.
|
protected |
In the row clique method the maximal length of the candidate list (those nodes that can extend the row clique, i.e., connected to all nodes in the row clique) to allow complete enumeration of maximal cliques.
Otherwise a greedy algorithm is used.
Definition at line 184 of file CglClique.hpp.
|
protected |
whether to give a detailed statistics on the row clique method
Definition at line 186 of file CglClique.hpp.
|
protected |
variables/arrays that are used across many methods
List of indices that must be in the to be created clique. This is just a pointer, it is never new'd and therefore does not need to be delete[]'d either.
Definition at line 194 of file CglClique.hpp.
|
protected |
The length of cl_perm_indices.
Definition at line 196 of file CglClique.hpp.
|
protected |
List of indices that should be considered for extending the ones listed in cl_perm_indices.
Definition at line 200 of file CglClique.hpp.
|
protected |
The length of cl_indices.
Definition at line 202 of file CglClique.hpp.
|
protected |
An array of nodes discarded from the candidate list.
These are rechecked when a maximal clique is found just to make sure that the clique is really maximal.
Definition at line 207 of file CglClique.hpp.
|
protected |
The length of cl_del_indices.
Definition at line 209 of file CglClique.hpp.