onerow: add cut selection parameters

This commit is contained in:
2017-05-05 11:50:09 -04:00
parent b6026771ed
commit fac2c3e6e9
8 changed files with 78 additions and 39 deletions

View File

@@ -69,10 +69,11 @@ public:
* cuts as possible. The cuts are generated by the provided generator class.
*
* @tparam Generator Class used to generate the cuts.
* @param max_rows The maximum number of rows to consider.
* @returns The number of cuts added.
*/
template<class Generator>
int add_single_row_cuts();
int add_single_row_cuts(int max_rows);
/**
* Gets a single row from the current tableau.
@@ -90,7 +91,7 @@ public:
*
* @returns The solution status, as returned by CPXgetstat.
*/
int solve(bool save_stats = false);
void solve(bool save_stats = false);
void dump_constraint(const Constraint &c, const char *msg = "");
@@ -107,7 +108,7 @@ public:
void print_solution(double *x);
void find_good_rows();
void find_good_rows(int max_rows);
int n_rows;
int n_cols;
@@ -134,6 +135,9 @@ public:
int n_good_rows;
int *good_rows;
double *reduced_costs;
double cost_cutoff;
};
#include "cplex_helper.tpp"

View File

@@ -30,12 +30,17 @@ using std::endl;
template<class Generator>
int CplexHelper::add_single_row_cuts()
int CplexHelper::add_single_row_cuts(int max_rows)
{
total_cuts = 0;
if(n_good_rows < 0)
find_good_rows();
if(n_good_rows > 0)
{
n_good_rows = 0;
delete good_rows;
}
find_good_rows(max_rows);
eta_reset();
eta_count = 0;
@@ -48,7 +53,6 @@ int CplexHelper::add_single_row_cuts()
for (int i = 0; i < n_good_rows; i++)
{
Row *row = get_tableau_row(good_rows[i]);
//Row *row = good_rows[i];
Generator generator(*row);

View File

@@ -25,16 +25,14 @@ const long REDUCE_FACTOR_RHS = 1000000;
const long REDUCE_FACTOR_R1 = 1000;
const long REDUCE_FACTOR_COEFFICIENT = 1000000;
const int MAX_CUT_DEPTH = 200;
const int MAX_R1_RAYS = 1000000;
const int MAX_CUT_DEPTH = 1000000;
const int MAX_GOOD_ROWS = 1000000;
const int ETA_UPDATE_INTERVAL = 300;
const unsigned int MAX_CUT_BUFFER_SIZE = 100;
const double COEFFICIENT_SAFETY_MARGIN = 0.00001;
#define INTERSECTION_CUT_USE_DOUBLE
#define ENABLE_TRIVIAL_LIFTING
// #define ENABLE_EXTENDED_STATISTICS
// #define PRETEND_TO_ADD_CUTS

View File

@@ -66,6 +66,8 @@ struct Row {
int basic_var_index;
bool* is_integer;
double* reduced_costs;
double cost_cutoff;
};
/**