<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi Matheus,<br>
<br>
this is the list of constraint handlers, the only one of those that
is called during separation (#Separate) and adds cuts (Cuts,
Applied) is your constraint handler. The other constraint handlers
are called for enforcement, propagation, and domain propagation, but
do not add any cuts.<br>
You should also check the Separators section of the statistics,
there should be 0 there everywhere.<br>
<br>
Best,<br>
Gerald<br>
<br>
<div class="moz-cite-prefix">Am 29.11.19 um 16:44 schrieb Matheus
Ota:<br>
</div>
<blockquote type="cite"
cite="mid:CAL0UnZ3jYPXviwQifCucw3tBa_T3w6xzWKvGj3Tz3e1_tHS5jw@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div>Hi All,</div>
<div><br>
</div>
<div>My code had a bug, that why the constraint printed by SCIP
was different. My bad.</div>
<div>But now I'm still in doubt about how I deactivate all SCIP
default cuts. I'm using SCIPsetSeparating(scip,
SCIP_PARAMSETTING_OFF, TRUE). But when I print the statistics
I get:</div>
<div><br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>Constraints     :   Number  MaxNumber  #Separate
#Propagate   #EnfoLP   #EnfoRelax  #EnfoPS   #Check Â
#ResProp   Cutoffs   DomReds    Cuts   Applied  Â
 Conss  Children<br>
 benderslp     :      0      0      0   Â
  0     50      0      0     44      0
     0      0      0      0      0   Â
  0<br>
 My Cuts     :      1      1     101    Â
 0     50      0      0     40      0 Â
    0      0     746     746      0    Â
 0<br>
 integral     :      0      0      0   Â
  0     50      0      0     31      0
     0     37      0      0      0   Â
 70<br>
 knapsack     :      1      1      0   Â
 907      1      0      0     27      1
     0      0      0      0      0   Â
  0<br>
 setppc      :     25     25      0   Â
 963      1      0      0     26     24
     1     34      0      0      0   Â
  0<br>
 logicor      :      0+     3      0   Â
  3      0      0      0      0      0
     0      0      0      0      0   Â
  0<br>
 benders      :      0      0      0   Â
  0      1      0      0     27      0
     0      0      0      0      0   Â
  0<br>
 countsols     :      0      0      0   Â
  0      1      0      0     27      0
     0      0      0      0      0   Â
  0<br>
 components    :      0      0      0   Â
  0      0      0      0      0      0
     0      0      0      0      0   Â
  0<br>
</div>
</blockquote>
<div><br>
</div>
<div>And it seems (at least to me) that SCIP is adding more cuts
than mine.</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Matheus<br>
</div>
<div><br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">Em qui., 28 de nov. de 2019 Ã s
14:49, Matheus Ota <<a href="mailto:matheusota@gmail.com"
moz-do-not-send="true">matheusota@gmail.com</a>>
escreveu:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div>Hi Gregor,</div>
<div><br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div>sorry to hear you are facing trouble. Does SCIP find
the correct solution if you disable your custom cutting
planes?</div>
</blockquote>
<div>I believe this is not possible. I'm not sure if this is
how it is called in SCIP, but some of the constraints
added by this constraint handler are "lazy constraints".
In other words, they are constraints that are needed to
correctly describe the problem. Some of the constraints
are just "user cuts", I use them just to get better
bounds. Probably I should separate these into two
constraint handlers afterwards...<br>
</div>
<div><br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div>If not, in order to get to the bottom of this issue,
please pass the 3073 solution as a debug solution to
SCIP. Please see the last section of <a
href="https://scip.zib.de/doc/html/DEBUG.php"
target="_blank" moz-do-not-send="true">https://scip.zib.de/doc/html/DEBUG.php</a>
for instructions about how to recompile SCIP to enable
debug solutions.<br>
With a debug solution, SCIP crashes as soon as a bound
change/cut/conflict is found that renders this solution
infeasible, pretty much like your script.</div>
</blockquote>
<div>Â </div>
<div>Very nice to know this Debug Solution feature, thanks!
I did what you said and got the following result.</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div>SCIP using Gurobi 8.1.0<br>
Academic license - for non-commercial use only<br>
feasible solution found by trivial heuristic after 0.0
seconds, objective value 0.000000e+00<br>
presolving:<br>
***** debug: reading solution file
<tmp/cut_val.txt><br>
***** debug: read 50 non-zero entries (50 variables
found)<br>
(round 1, fast) Â Â Â 25 del vars, 25 del conss, 0 add
conss, 0 chg bounds, 0 chg sides, 0 chg coeffs, 0 upgd
conss, 0 impls, 0 clqs<br>
(round 2, exhaustive) 25 del vars, 25 del conss, 0 add
conss, 0 chg bounds, 0 chg sides, 0 chg coeffs, 1 upgd
conss, 0 impls, 0 clqs<br>
  (0.0s) probing cycle finished: starting next cycle<br>
presolving (3 rounds: 3 fast, 2 medium, 2 exhaustive):<br>
 25 deleted vars, 25 deleted constraints, 0 added
constraints, 0 tightened bounds, 0 added holes, 0
changed sides, 0 changed coefficients<br>
 0 implications, 0 cliques<br>
presolved problem has 25 variables (25 bin, 0 int, 0
impl, 0 cont) and 2 constraints<br>
   1 constraints of type <BCP Cuts><br>
   1 constraints of type <knapsack><br>
transformed objective value is always integral (scale:
1)<br>
Presolving Time: 0.00<br>
transformed 1/1 original solutions to the transformed
problem space<br>
<br>
 time | node  | left  |LP iter|LP it/n| mem |mdpt |frac
|vars |cons |cols |rows |cuts |confs|strbr| Â dualbound Â
| primalbound  |  gap  <br>
 0.0s|   1 |   0 |   0 |   - | 754k|  0 |  0
| Â 25 | Â 2 | Â 25 | Â 0 | Â 0 | Â 0 | Â 0 | 3.073000e+03
| 0.000000e+00 | Â Â Inf <br>
 0.0s|   1 |   0 |   1 |   - | 756k|  0 |  1
| Â 25 | Â 2 | Â 25 | Â 1 | Â 1 | Â 0 | Â 0 | 3.073000e+03
| 0.000000e+00 | Â Â Inf <br>
 R: x_24,0 + x_23,1 + x_21,0 + x_14,1 <= 3<br>
 R: x_23,1 + x_21,0 + x_20,1 + x_19,0 <= 3<br>
 R: x_24,0 + x_23,1 + x_15,0 + x_14,1 <= 3<br>
 R: x_23,1 + x_21,0 + x_10,1 + x_19,0 <= 3<br>
 R: x_24,0 + x_23,1 + x_5,0 + x_14,1 <= 3<br>
 R: x_23,1 + x_21,0 + x_0,1 + x_19,0 <= 3<br>
 R: x_23,1 + x_21,0 + x_1,1 + x_19,0 <= 3<br>
 R: x_23,1 + x_21,0 + x_2,1 + x_19,0 <= 3<br>
 R: x_23,1 + x_21,0 + x_3,1 + x_19,0 <= 3<br>
 R: x_24,0 + x_23,1 + x_4,0 + x_14,1 <= 3<br>
***** debug: row <face cut> violates debugging
solution (lhs=-1e+20, rhs=3, activity=[4,4], local=0,
lpfeastol=1e-06)<br>
face cut: -1e+20 <= -1<t_x_24,1>
+2<t_x_23,1> +1<t_x_14,1> -1<t_x_4,1>
+2 <= 3<br>
</div>
</blockquote>
<div><br>
</div>
<div>The prints that starts with "R:" are made by my code. I
have some constraints in my model of the type:</div>
<div>x_a,0 + x_a,1 = 1 (*)<br>
</div>
<div><br>
</div>
<div>Thus, replacing (*) at the constraint x_24,0 + x_23,1 +
x_4,0 + x_14,1 <= 3, I get:</div>
<div>Â => (1 - x_24,1) + x_23,1 + (1 - x_4,1) + x_14,1 =
-x_24,1 + x_23,1 - x_4,1 + x_14,1 + 2 <= 3</div>
<div>Which is similar to the constraint SCIP reports:</div>
<div>Â => face cut: -1e+20 <= -1<t_x_24,1>
+2<t_x_23,1> +1<t_x_14,1> -1<t_x_4,1> +2
<= 3</div>
<div>But it seems SCIP erroneously lifted the coefficient
for x_23,1.</div>
<div><br>
</div>
<div>Do you have any thoughts on this issue?</div>
<div><br>
</div>
<div>Also, is it possible for me to deactivate all default
SCIP cuts? For purposes of testing, I want to use only the
cuts made by my constraint handler.</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Matheus<br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">Em qui., 28 de nov. de
2019 Ã s 04:59, Gregor Hendel <<a
href="mailto:hendel@zib.de" target="_blank"
moz-do-not-send="true">hendel@zib.de</a>> escreveu:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div> Dear Matheus,<br>
<br>
sorry to hear you are facing trouble. Does SCIP find the
correct solution if you disable your custom cutting
planes?<br>
<br>
If not, in order to get to the bottom of this issue,
please pass the 3073 solution as a debug solution to
SCIP. Please see the last section of <a
href="https://scip.zib.de/doc/html/DEBUG.php"
target="_blank" moz-do-not-send="true">https://scip.zib.de/doc/html/DEBUG.php</a>
for instructions about how to recompile SCIP to enable
debug solutions.<br>
<br>
With a debug solution, SCIP crashes as soon as a bound
change/cut/conflict is found that renders this solution
infeasible, pretty much like your script.<br>
<br>
Let us know what causes this issue for you,<br>
Gregor<br>
<br>
<div>Am 28.11.19 um 03:51 schrieb Matheus Ota:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>Hello all,</div>
<div><br>
</div>
<div>My name is Matheus, I implementing a
Branch-and-Cut using SCIP for a problem that I'm
currently working on in my masters. In order to do
so, I implemented a custom Constraint Handler, and
the LP solver that I'm using with SCIP is Gurobi
8.1.</div>
<div><br>
</div>
<div>The objective function of my problem is of the
maximization type. I actually already implemented
the same model on Gurobi and I'm trying SCIP
because I want to add multiple cuts per node of
the Branch-and-Bound tree, and this is not
possible with Gurobi. My Gurobi model returns an
optimal solution with an objective function value
of 3073. I manually checked this solution and it
is ok. But the SCIP version says that a solution
with value 3056 is optimal. This is the log:</div>
<div><br>
</div>
<blockquote class="gmail_quote" style="margin:0px
0px 0px 0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div>SCIP using Gurobi 8.1.0<br>
Academic license - for non-commercial use only<br>
feasible solution found by trivial heuristic
after 0.0 seconds, objective value 0.000000e+00<br>
presolving:<br>
(round 1, fast) Â Â Â 25 del vars, 25 del conss,
0 add conss, 0 chg bounds, 0 chg sides, 0 chg
coeffs, 0 upgd conss, 0 impls, 0 clqs<br>
(round 2, exhaustive) 25 del vars, 25 del conss,
0 add conss, 0 chg bounds, 0 chg sides, 0 chg
coeffs, 1 upgd conss, 0 impls, 0 clqs<br>
  (0.0s) probing cycle finished: starting next
cycle<br>
presolving (3 rounds: 3 fast, 2 medium, 2
exhaustive):<br>
 25 deleted vars, 25 deleted constraints, 0
added constraints, 0 tightened bounds, 0 added
holes, 0 changed sides, 0 changed coefficients<br>
 0 implications, 0 cliques<br>
presolved problem has 25 variables (25 bin, 0
int, 0 impl, 0 cont) and 2 constraints<br>
   1 constraints of type <BCP Cuts><br>
   1 constraints of type <knapsack><br>
transformed objective value is always integral
(scale: 1)<br>
Presolving Time: 0.00<br>
transformed 1/1 original solutions to the
transformed problem space<br>
<br>
 time | node  | left  |LP iter|LP it/n| mem
|mdpt |frac |vars |cons |cols |rows |cuts
|confs|strbr|  dualbound  | primalbound  |  gap
 <br>
 0.0s|   1 |   0 |   0 |   - | 754k| Â
0 | Â 0 | Â 25 | Â 2 | Â 25 | Â 0 | Â 0 | Â 0 | Â
0 | 3.073000e+03 | 0.000000e+00 | Â Â Inf <br>
 0.0s|   1 |   0 |   1 |   - | 756k| Â
0 | Â 1 | Â 25 | Â 2 | Â 25 | Â 1 | Â 1 | Â 0 | Â
0 | 3.073000e+03 | 0.000000e+00 | Â Â Inf <br>
 0.0s|   1 |   0 |   18 |   - | 783k| Â
0 | Â 12 | Â 25 | Â 2 | Â 25 | Â 21 | Â 21 | Â 0 | Â
0 | 3.073000e+03 | 0.000000e+00 | Â Â Inf <br>
 0.0s|   1 |   2 |   18 |   - | 801k| Â
0 | Â 12 | Â 25 | Â 2 | Â 25 | Â 21 | Â 21 | Â 0 |
 12 | 3.073000e+03 | 0.000000e+00 |   Inf <br>
R 0.1s| Â Â 2 | Â Â 1 | Â Â 48 | Â 30.0 | 820k| Â
1 | Â 1 | Â 25 | Â 2 | Â 25 | Â 47 | Â 47 | Â 0 |
 12 | 3.073000e+03 | 2.975000e+03 |  3.29%<br>
R 0.1s| Â Â 4 | Â Â 3 | Â Â 96 | Â 26.0 | 854k| Â
3 | Â 2 | Â 25 | Â 2 | Â 25 | Â 81 | Â 81 | Â 0 |
 12 | 3.073000e+03 | 3.056000e+03 |  0.56%<br>
<br>
SCIP Status     : problem is solved [optimal
solution found]<br>
Solving Time (sec) : 0.18<br>
Solving Nodes    : 31<br>
Primal Bound    : +3.05600000000000e+03 (8
solutions)<br>
Dual Bound     : +3.05600000000000e+03<br>
Gap         : 0.00 %<br>
</div>
</blockquote>
<div>Â </div>
<div>Since it says the gap is 0%, I guess the
problem here is not the gap tolerance.</div>
<div>In my implementation I'm including the default
plugins (SCIPincludeDefaultPlugins), and the only
parameters that I'm changing are the threads
(lp/threads = 4) and the absolute gap
(limits/absgap = 1 - 1e-6), since I know the
objective value should be an integer. I also
already implemented the CONSLOCK method in my
constraint handler, so that the presolve doesnt
round the variables.</div>
<div><br>
</div>
<div>When executing with the LP info (display/lpinfo
= true), these are the last lines in the log.</div>
<blockquote class="gmail_quote" style="margin:0px
0px 0px 0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div>adding cuts<br>
x_24,0 + x_1,1 + x_2,0 + x_19,1 <= 3<br>
x_24,0 + x_1,1 + x_3,0 + x_19,1 <= 3<br>
 R: x_24,0 + x_3,0 - x_8,0 - x_7,0 - x_4,0 -
x_1,0 <= 1<br>
Optimize a model with 191 rows, 25 columns and
1033 nonzeros<br>
Coefficient statistics:<br>
 Matrix range   [1e+00, 5e+02]<br>
 Objective range  [3e+01, 5e+02]<br>
 Bounds range   [1e+00, 1e+00]<br>
 RHS range     [1e+00, 3e+03]<br>
Iteration   Objective    Primal Inf.   Dual
Inf. Â Â Â Time<br>
    0   3.0730000e+03  4.000000e+01 Â
0.000000e+00 Â Â Â 0s<br>
<br>
Solved in 15 iterations and 0.00 seconds<br>
Infeasible model<br>
Optimize a model with 191 rows, 25 columns and
1033 nonzeros<br>
Coefficient statistics:<br>
 Matrix range   [1e+00, 5e+02]<br>
 Objective range  [3e+01, 5e+02]<br>
 Bounds range   [1e+00, 1e+00]<br>
 RHS range     [1e+00, 3e+03]<br>
    0   3.0730000e+03  6.105000e+01 Â
0.000000e+00 Â Â Â 0s<br>
<br>
Solved in 17 iterations and 0.00 seconds<br>
Infeasible model<br>
<br>
SCIP Status     : problem is solved [optimal
solution found]<br>
Solving Time (sec) : 0.19<br>
Solving Nodes    : 31<br>
Primal Bound    : +3.05600000000000e+03 (8
solutions)<br>
Dual Bound     : +3.05600000000000e+03<br>
Gap         : 0.00 %<br>
check feasibility<br>
is feasible<br>
</div>
</blockquote>
<div><br>
</div>
<div>I added some custom prints ("add cuts" and
"check feasibility"). It seems that the solution
with value 3073 is getting "cut out" of the
polytope.</div>
<div>I have a script that gets a solution and checks
if a set of inequalities is violated or not. No
constraint added by my constraint handler is being
violated by the 3073 solution.</div>
<div>Is it possible that SCIP is adding cuts that is
cutting more than needed? Can you please help me
with this problem? Any ideas are welcome!</div>
<div><br>
</div>
<div>Thanks!</div>
<div>Matheus<br>
</div>
</div>
<br>
<fieldset></fieldset>
<pre>_______________________________________________
Scip mailing list
<a href="mailto:Scip@zib.de" target="_blank" moz-do-not-send="true">Scip@zib.de</a>
<a href="https://listserv.zib.de/mailman/listinfo/scip" target="_blank" moz-do-not-send="true">https://listserv.zib.de/mailman/listinfo/scip</a>
</pre>
</blockquote>
<br>
</div>
_______________________________________________<br>
Scip mailing list<br>
<a href="mailto:Scip@zib.de" target="_blank"
moz-do-not-send="true">Scip@zib.de</a><br>
<a href="https://listserv.zib.de/mailman/listinfo/scip"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://listserv.zib.de/mailman/listinfo/scip</a><br>
</blockquote>
</div>
</blockquote>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Scip mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Scip@zib.de">Scip@zib.de</a>
<a class="moz-txt-link-freetext" href="https://listserv.zib.de/mailman/listinfo/scip">https://listserv.zib.de/mailman/listinfo/scip</a>
</pre>
</blockquote>
<br>
</body>
</html>