From e2b611c0f4e5021a3050fa22d3dbd25053735e19 Mon Sep 17 00:00:00 2001 From: Stefan Vigerske Date: Wed, 20 Nov 2024 16:01:12 +0100 Subject: [PATCH 1/5] update install info on sym - bliss is not included with scip (since 8.1) - nauty is included with scip - prefer nauty over bliss in SYM options --- INSTALL.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 37be673fce..9f528dc59b 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -52,7 +52,8 @@ make install # Note: For a full ctest run `ctest` instead of `make check` after compilation. CMake checks for available third-party libraries like GMP or ZLIB and sets up the configuration accordingly. -Note that the symmetry codes [Bliss](https://users.aalto.fi/~tjunttil/bliss/) and [Sassy](https://github.com/markusa4/sassy) are shipped with SCIP. +Note that the symmetry codes [Nauty](https://pallini.di.uniroma1.it/) and [Sassy](https://github.com/markusa4/sassy) are shipped with SCIP. +A version of Bliss that is compatible with SCIP is available at https://github.com/scipopt/bliss. Note: Here is a list of apt package requirements for ubuntu or debian users that want to build the entire SCIP Optimization Suite from source tarball: ``` @@ -185,7 +186,7 @@ e.g., `cmake -DSOPLEX_DIR=`. | `IPOPT` | `on`, `off` | `IPOPT=[true,false]` | requires IPOPT version >= 3.12.0; specify `IPOPT_DIR` if not found automatically | | `LAPACK` | `on`, `off` | `LAPACK=[true,false]` | requires Lapack to be installed on the system | | `LPS` | `spx`, `cpx`, `grb`, `xprs`, ... | `LPS=...` | specify `SOPLEX_DIR`, `CPLEX_DIR`, `MOSEK_DIR`, ... if LP solver is not found automatically | -| `SYM` | `bliss`, `sbliss`, `none`, ... | `SYM=[bliss, sbliss, none]`| choose symmetry handling | +| `SYM` | `nauty`, `snauty`, `none`, ... | `SYM=[nauty, snauty, none]`| choose symmetry handling | | `WORHP` | `on`, `off` | `WORHP=[true,false]` | should worhp be linked; specify `WORHP_DIR` if not found automatically | | `ZIMPL` | `on`, `off` | `ZIMPL=[true, false]` | specify `ZIMPL_DIR` if not found automatically | | `AMPL` | `on`, `off` | `AMPL=[true, false]` | | @@ -346,7 +347,7 @@ In your SCIP main directory, enter `make [options]` with the following options: | `PAPILO=false` | `[false, true]` | to disable or disable the MILP presolver based on the presolving library PaPILO | | `READLINE=true` | `[true, false]` | to enable or disable readline library for interactive shell | | `SHARED=false` | `[false, true]` | to suppress or create shared libraries (only Gnu compiler) | -| `SYM=none` | `[none, bliss, sbliss, nauty, snauty]` | to choose method for computing symmetries in mixed nonlinear integer programs | +| `SYM=none` | `[none, nauty, snauty, bliss, sbliss]` | to choose method for computing symmetries in mixed nonlinear integer programs | | `TPI=none` | `[none, omp, tny]` | to disable the task processing interface or use it with the openmp or tinycthreads interface for concurrent solves | | `VERBOSE=false` | `[false, true]` | to suppress or display of compiler and linker invocations | | `WORHP=false` | `[false, true]` | to disable or enable WORHP interface (needs WORHP >= 2.00) | From fe9e3d66ae791c50addfbc90090d2e92f747f611 Mon Sep 17 00:00:00 2001 From: Stefan Vigerske Date: Wed, 20 Nov 2024 16:05:40 +0100 Subject: [PATCH 2/5] update info on default symmetry package - SYM=snauty is default, user does not need to enable this explicitly - bliss isn't included anymore --- doc/xternal.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/doc/xternal.c b/doc/xternal.c index 9b8a4fdedd..9939d79304 100644 --- a/doc/xternal.c +++ b/doc/xternal.c @@ -8431,14 +8431,12 @@ * invariant. To detect such formulation symmetries, SCIP builds an auxiliary colored graph whose * color-preserving automorphisms correspond to symmetries of the integer program. The symmetries of * the graph, and thus of the integer program, are then computed by an external graph automorphism - * library that needs to be linked to SCIP. Currently, SCIP ships with two such libraries: The graph + * library that needs to be linked to SCIP. Currently, SCIP can use two such libraries: The graph * automorphism libraries bliss or nauty/traces are the basic workhorses to detect symmetries. Moreover, one can use * sassy, a graph symmetry preprocessor which passes the preprocessed graphs to bliss or nauty/traces. - * The current default is to use bliss in combination with sassy for symmetry detection. - * - * @note To detect symmetries, SCIP needs to be built with sassy/bliss, which can be achieved - * by using the options SYM=sassy and -DSYM=sassy in the Makefile and CMake - * system, respectively. + * The current default is to use nauty in combination with sassy for symmetry detection. + * To use other symmetry packages, options SYM and -DSYM in the Makefile and CMake + * system, respectively, need to be set. * * Besides purely integer linear problems, SCIP also supports symmetry detection for general * constraint mixed-integer programs containing most of the constraint types that can be handled From e68590c3f650fc2a37cfdcf67bdcd6dd8d8ee472 Mon Sep 17 00:00:00 2001 From: Marc Pfetsch Date: Sat, 23 Nov 2024 14:41:34 +0100 Subject: [PATCH 3/5] also clear partial solutions --- CHANGELOG | 1 + src/scip/primal.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index b86f7f9881..844040b64d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -8,6 +8,7 @@ Fixed bugs - apply same feasibility definition in PaPILO as SCIP to avoid numerical inconsistencies - check variable cancellation in SCIPvarAddVlb() and SCIPvarAddVub() to avert wrong infeasibility +- SCIPfreeReoptSolve now also clears the partial solutions Unit tests ---------- diff --git a/src/scip/primal.c b/src/scip/primal.c index 2bcfae18f2..fe0ed8bed2 100644 --- a/src/scip/primal.c +++ b/src/scip/primal.c @@ -184,6 +184,7 @@ SCIP_RETCODE SCIPprimalFree( { SCIP_CALL( SCIPsolFree(&(*primal)->sols[s], blkmem, *primal) ); } + /* free partial CIP solutions */ for( s = 0; s < (*primal)->npartialsols; ++s ) { @@ -228,10 +229,18 @@ SCIP_RETCODE SCIPprimalClear( SCIP_CALL( SCIPsolFree(&(*primal)->sols[s], blkmem, *primal) ); } + /* free partial CIP solutions */ + for( s = 0; s < (*primal)->npartialsols; ++s ) + { + SCIP_CALL( SCIPsolFree(&(*primal)->partialsols[s], blkmem, *primal) ); + } + assert((*primal)->nexistingsols == 0); + (*primal)->currentsol = NULL; (*primal)->primalray = NULL; (*primal)->nsols = 0; (*primal)->nsolsfound = 0; + (*primal)->npartialsols = 0; (*primal)->nlimsolsfound = 0; (*primal)->nbestsolsfound = 0; (*primal)->nlimbestsolsfound = 0; From 72a124110a0b19c31b77ed6fa5303711e2ac932d Mon Sep 17 00:00:00 2001 From: Stefan Vigerske Date: Sat, 23 Nov 2024 16:26:06 +0100 Subject: [PATCH 4/5] use SCIPprimalClear in SCIPprimalFree --- src/scip/primal.c | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/src/scip/primal.c b/src/scip/primal.c index fe0ed8bed2..b92e3590d9 100644 --- a/src/scip/primal.c +++ b/src/scip/primal.c @@ -162,35 +162,10 @@ SCIP_RETCODE SCIPprimalFree( BMS_BLKMEM* blkmem /**< block memory */ ) { - int s; - assert(primal != NULL); assert(*primal != NULL); - /* free temporary solution for storing current solution */ - if( (*primal)->currentsol != NULL ) - { - SCIP_CALL( SCIPsolFree(&(*primal)->currentsol, blkmem, *primal) ); - } - - /* free solution for storing primal ray */ - if( (*primal)->primalray != NULL ) - { - SCIP_CALL( SCIPsolFree(&(*primal)->primalray, blkmem, *primal) ); - } - - /* free feasible primal CIP solutions */ - for( s = 0; s < (*primal)->nsols; ++s ) - { - SCIP_CALL( SCIPsolFree(&(*primal)->sols[s], blkmem, *primal) ); - } - - /* free partial CIP solutions */ - for( s = 0; s < (*primal)->npartialsols; ++s ) - { - SCIP_CALL( SCIPsolFree(&(*primal)->partialsols[s], blkmem, *primal) ); - } - assert((*primal)->nexistingsols == 0); + SCIP_CALL( SCIPprimalClear(primal, blkmem) ); BMSfreeMemoryArrayNull(&(*primal)->sols); BMSfreeMemoryArrayNull(&(*primal)->partialsols); From 95bc1ab57760d9d689cdd20c3c76f7ebc22d13a3 Mon Sep 17 00:00:00 2001 From: Stefan Vigerske Date: Sat, 23 Nov 2024 16:28:08 +0100 Subject: [PATCH 5/5] remove unnecessary reference for primal of SCIPprimalClear() --- src/scip/primal.c | 51 +++++++++++++++++++++---------------------- src/scip/primal.h | 2 +- src/scip/scip_solve.c | 2 +- 3 files changed, 27 insertions(+), 28 deletions(-) diff --git a/src/scip/primal.c b/src/scip/primal.c index b92e3590d9..efc9c4641c 100644 --- a/src/scip/primal.c +++ b/src/scip/primal.c @@ -165,7 +165,7 @@ SCIP_RETCODE SCIPprimalFree( assert(primal != NULL); assert(*primal != NULL); - SCIP_CALL( SCIPprimalClear(primal, blkmem) ); + SCIP_CALL( SCIPprimalClear(*primal, blkmem) ); BMSfreeMemoryArrayNull(&(*primal)->sols); BMSfreeMemoryArrayNull(&(*primal)->partialsols); @@ -177,51 +177,50 @@ SCIP_RETCODE SCIPprimalFree( /** clears primal data */ SCIP_RETCODE SCIPprimalClear( - SCIP_PRIMAL** primal, /**< pointer to primal data */ + SCIP_PRIMAL* primal, /**< pointer to primal data */ BMS_BLKMEM* blkmem /**< block memory */ ) { int s; assert(primal != NULL); - assert(*primal != NULL); /* free temporary solution for storing current solution */ - if( (*primal)->currentsol != NULL ) + if( primal->currentsol != NULL ) { - SCIP_CALL( SCIPsolFree(&(*primal)->currentsol, blkmem, *primal) ); + SCIP_CALL( SCIPsolFree(&primal->currentsol, blkmem, primal) ); } /* free solution for storing primal ray */ - if( (*primal)->primalray != NULL ) + if( primal->primalray != NULL ) { - SCIP_CALL( SCIPsolFree(&(*primal)->primalray, blkmem, *primal) ); + SCIP_CALL( SCIPsolFree(&primal->primalray, blkmem, primal) ); } /* free feasible primal CIP solutions */ - for( s = 0; s < (*primal)->nsols; ++s ) + for( s = 0; s < primal->nsols; ++s ) { - SCIP_CALL( SCIPsolFree(&(*primal)->sols[s], blkmem, *primal) ); + SCIP_CALL( SCIPsolFree(&primal->sols[s], blkmem, primal) ); } /* free partial CIP solutions */ - for( s = 0; s < (*primal)->npartialsols; ++s ) - { - SCIP_CALL( SCIPsolFree(&(*primal)->partialsols[s], blkmem, *primal) ); - } - assert((*primal)->nexistingsols == 0); - - (*primal)->currentsol = NULL; - (*primal)->primalray = NULL; - (*primal)->nsols = 0; - (*primal)->nsolsfound = 0; - (*primal)->npartialsols = 0; - (*primal)->nlimsolsfound = 0; - (*primal)->nbestsolsfound = 0; - (*primal)->nlimbestsolsfound = 0; - (*primal)->upperbound = SCIP_INVALID; - (*primal)->cutoffbound = SCIP_INVALID; - (*primal)->updateviolations = TRUE; + for( s = 0; s < primal->npartialsols; ++s ) + { + SCIP_CALL( SCIPsolFree(&primal->partialsols[s], blkmem, primal) ); + } + assert(primal->nexistingsols == 0); + + primal->currentsol = NULL; + primal->primalray = NULL; + primal->nsols = 0; + primal->nsolsfound = 0; + primal->npartialsols = 0; + primal->nlimsolsfound = 0; + primal->nbestsolsfound = 0; + primal->nlimbestsolsfound = 0; + primal->upperbound = SCIP_INVALID; + primal->cutoffbound = SCIP_INVALID; + primal->updateviolations = TRUE; return SCIP_OKAY; } diff --git a/src/scip/primal.h b/src/scip/primal.h index fe8aa781c2..c2aa4c78eb 100644 --- a/src/scip/primal.h +++ b/src/scip/primal.h @@ -67,7 +67,7 @@ SCIP_RETCODE SCIPprimalFree( /** clears primal data */ SCIP_RETCODE SCIPprimalClear( - SCIP_PRIMAL** primal, /**< pointer to primal data */ + SCIP_PRIMAL* primal, /**< pointer to primal data */ BMS_BLKMEM* blkmem /**< block memory */ ); diff --git a/src/scip/scip_solve.c b/src/scip/scip_solve.c index c91379d205..8c28557a04 100644 --- a/src/scip/scip_solve.c +++ b/src/scip/scip_solve.c @@ -1812,7 +1812,7 @@ SCIP_RETCODE freeReoptSolve( } /* free the debug solution which might live in transformed primal data structure */ - SCIP_CALL( SCIPprimalClear(&scip->primal, scip->mem->probmem) ); + SCIP_CALL( SCIPprimalClear(scip->primal, scip->mem->probmem) ); if( scip->set->misc_resetstat ) {