I am working on using SCIP to generate cutting planes for my project. I am doing so using a C++ code directly with default plugins included, modified from scip/examples/MIPsolver/src/cppmain. However the array of cutting planes is not saved. The program will be run using the command
./scipplanes [problem file]
The affected part of my program is shown below:
/*******************
* Problem Presolving *
*******************/
/* Presolve problem */
std::cout << "=============" << std::endl;
std::cout << "Presolve problem" << std::endl;
std::cout << "=============" << std::endl;
SCIP_CALL( SCIPpresolve(scip) ); //Presolve to simplify the problem
SCIP_CALL( SCIPsetRealParam(scip, "limits/time", 60) ); //Limit of solving time in seconds
/*************************
* Obtain cutting planes *
*************************/
std::cout << "=============" << std::endl;
std::cout << "Obtaining cutting planes" << std::endl;
std::cout << "=============" << std::endl;
SCIP_ROW** allcuts; //Because SCIPgetCuts outputs this kind of data (memory address/pointer)
int n_cuts; //For for loop iteration
SCIP_CALL( SCIPsolve(scip) );
allcuts = SCIPgetCuts(scip); /*Documentation says that this outputs the array of cuts currently stored in the separation storage,
in the form of a memory address of pointer of SCIP_ROW** */
std::cout << "allcuts is " << allcuts << std::endl;
n_cuts = SCIPgetNCuts(scip);
std::cout << "n_cuts is " << n_cuts << std::endl;
When I ran my code, I obtain n_cuts = 0
, but the table of statistics shows :
time | node | left |LP iter|LP it/n|mem/heur|mdpt |vars |cons |rows |cuts |sepa|confs|strbr| dualbound | primalbound | gap | compl.
60.0s| 1 | 0 | 33295 | - | 333M | 0 |1164 | 39k| 39k| 120 | 10 | 19 | 0 | 0.000000e+00 | -- | Inf | unknown
There are 120 cuts. I have double checked by running the SCIP binary and using presolve
and optimize
with a time limit of 60s. The results are the same when display statistics
is used.
I have also tried to iterate through allcuts
by doing SCIPprintRow(scip, *allcuts, NULL);
, but got a segmentation fault.
Thus, I have no idea why the cutting planes are not saved. Would it be possible to offer me some advice on how to solve this problem? Thank you.