diff --git a/CHANGELOG b/CHANGELOG index db093f87a1..ec0edb67d2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -41,6 +41,7 @@ Features - when parsing nonlinear constraints from CIP files, the * after the number in a term is now optional if followed by a variable, i.e., instead of 3**, now also 3* can be read, but 3 is not supported; this allows to read some CIP files that were written with SCIP < 8 +- when running bliss, we now limit the number of actually created generators and not the ones considered by bliss Performance improvements ------------------------ diff --git a/src/symmetry/compute_symmetry_bliss.cpp b/src/symmetry/compute_symmetry_bliss.cpp index a9244493a2..da13a62716 100644 --- a/src/symmetry/compute_symmetry_bliss.cpp +++ b/src/symmetry/compute_symmetry_bliss.cpp @@ -345,11 +345,6 @@ SCIP_RETCODE computeAutomorphisms( /* disable component recursion as advised by Tommi Junttila from bliss */ G->set_component_recursion(false); - /* do not use a node limit, but set generator limit */ -#ifdef BLISS_PATCH_PRESENT - G->set_search_limits(0, (unsigned) maxgenerators); -#endif - oldtime = SCIPgetSolvingTime(scip); #if BLISS_VERSION_MAJOR >= 1 || BLISS_VERSION_MINOR >= 76 /* lambda function to have access to data and pass it to the blisshook above */ @@ -357,17 +352,23 @@ SCIP_RETCODE computeAutomorphisms( blisshook((void*)&data, n, aut); }; - /* lambda function to have access to stats and terminate the search if maxgenerators are reached */ - long unsigned int terminatesearch = INT_MAX; - if ( maxgenerators != 0 ) - terminatesearch = (long unsigned int) maxgenerators; + /* lambda function to have access to data and terminate the search if maxgenerators are reached */ auto term = [&]() { - return (stats.get_nof_generators() >= terminatesearch); + return (maxgenerators != 0 && data.nperms >= maxgenerators); /* check the number of generators that we have created so far */ }; /* start search */ G->find_automorphisms(stats, reportglue, term); #else + + /* Older bliss versions do not allow to terminate with a limit on the number of generators unless patched. */ +#ifdef BLISS_PATCH_PRESENT + /* If patch is present, do not use a node limit, but set generator limit. This approach is not very accurate, since + * it limits the generators considered in bliss and not the ones that we generate (the ones that work on the variable + * set). */ + G->set_search_limits(0, (unsigned) maxgenerators); +#endif + /* start search */ G->find_automorphisms(stats, blisshook, (void*) &data); #endif diff --git a/src/symmetry/compute_symmetry_sassy_bliss.cpp b/src/symmetry/compute_symmetry_sassy_bliss.cpp index 67138fddcf..6d9f8fc250 100644 --- a/src/symmetry/compute_symmetry_sassy_bliss.cpp +++ b/src/symmetry/compute_symmetry_sassy_bliss.cpp @@ -312,18 +312,10 @@ SCIP_RETCODE computeAutomorphisms( /* disable component recursion as advised by Tommi Junttila from bliss */ blissgraph.set_component_recursion(false); - /* do not use a node limit, but set generator limit */ -#ifdef BLISS_PATCH_PRESENT - blissgraph.set_search_limits(0, (unsigned) maxgenerators); -#endif - #if BLISS_VERSION_MAJOR >= 1 || BLISS_VERSION_MINOR >= 76 - /* lambda function to have access to stats and terminate the search if maxgenerators are reached */ - long unsigned int terminatesearch = INT_MAX; - if ( maxgenerators != 0 ) - terminatesearch = (long unsigned int) maxgenerators; + /* lambda function to have access to data and terminate the search if maxgenerators are reached */ auto term = [&]() { - return (stats.get_nof_generators() >= terminatesearch); + return (maxgenerators != 0 && data.nperms >= maxgenerators); /* check the number of generators that we have created so far */ }; auto hook = [&](unsigned int n, const unsigned int* aut) { @@ -333,6 +325,15 @@ SCIP_RETCODE computeAutomorphisms( /* start search */ blissgraph.find_automorphisms(stats, hook, term); #else + + /* Older bliss versions do not allow to terminate with a limit on the number of generators unless patched. */ +#ifdef BLISS_PATCH_PRESENT + /* If patch is present, do not use a node limit, but set generator limit. This approach is not very accurate, since + * it limits the generators considered in bliss and not the ones that we generate (the ones that work on the variable + * set). */ + G->set_search_limits(0, (unsigned) maxgenerators); +#endif + /* start search */ blissgraph.find_automorphisms(stats, sassy::preprocessor::bliss_hook, (void*) &sassy); #endif