From e3708c754034c793de684ccb076782366cf76574 Mon Sep 17 00:00:00 2001 From: fwesselm Date: Tue, 16 Jul 2024 23:15:39 +0200 Subject: [PATCH 1/4] Update relevant substitutions if a variable is transformed --- src/mip/HighsImplications.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mip/HighsImplications.h b/src/mip/HighsImplications.h index ac66aaf771..793374b3de 100644 --- a/src/mip/HighsImplications.h +++ b/src/mip/HighsImplications.h @@ -119,6 +119,10 @@ class HighsImplications { vlbs[col].for_each(transformVbd); vubs[col].for_each(transformVbd); + + for (auto& substitution : substitutions) { + if (substitution.substcol == col) substitution.offset -= constant; + } } std::pair getBestVub(HighsInt col, From 91da631610639462e5e4d6cd7ee8e479e488007c Mon Sep 17 00:00:00 2001 From: fwesselm Date: Wed, 17 Jul 2024 14:26:55 +0200 Subject: [PATCH 2/4] Take scale into account --- src/mip/HighsImplications.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mip/HighsImplications.h b/src/mip/HighsImplications.h index 793374b3de..ddbb0d2d04 100644 --- a/src/mip/HighsImplications.h +++ b/src/mip/HighsImplications.h @@ -121,7 +121,10 @@ class HighsImplications { vubs[col].for_each(transformVbd); for (auto& substitution : substitutions) { - if (substitution.substcol == col) substitution.offset -= constant; + if (substitution.substcol == col) { + substitution.offset -= substitution.scale * constant; + substitution.scale /= scale; + } } } From 8966bc0e8c6f09e66119456ccd606cb17603aa0a Mon Sep 17 00:00:00 2001 From: fwesselm Date: Wed, 17 Jul 2024 23:30:21 +0200 Subject: [PATCH 3/4] Update analogous to variable bounds --- src/mip/HighsImplications.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mip/HighsImplications.h b/src/mip/HighsImplications.h index ddbb0d2d04..1240762121 100644 --- a/src/mip/HighsImplications.h +++ b/src/mip/HighsImplications.h @@ -122,7 +122,8 @@ class HighsImplications { for (auto& substitution : substitutions) { if (substitution.substcol == col) { - substitution.offset -= substitution.scale * constant; + substitution.offset -= constant; + substitution.offset /= scale; substitution.scale /= scale; } } From d318f6500fcc3dc800b142e95275e2d06d7e3087 Mon Sep 17 00:00:00 2001 From: fwesselm Date: Wed, 17 Jul 2024 23:34:49 +0200 Subject: [PATCH 4/4] Add comment --- src/mip/HighsImplications.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mip/HighsImplications.h b/src/mip/HighsImplications.h index 1240762121..33e04a87ac 100644 --- a/src/mip/HighsImplications.h +++ b/src/mip/HighsImplications.h @@ -109,6 +109,7 @@ class HighsImplications { double vlbconstant); void columnTransformed(HighsInt col, double scale, double constant) { + // Update variable bounds affected by transformation if (scale < 0) std::swap(vubs[col], vlbs[col]); auto transformVbd = [&](HighsInt, VarBound& vbd) { @@ -120,6 +121,7 @@ class HighsImplications { vlbs[col].for_each(transformVbd); vubs[col].for_each(transformVbd); + // Update substitutions affected by transformation for (auto& substitution : substitutions) { if (substitution.substcol == col) { substitution.offset -= constant;