maybe I can also try to do it in scip.set file for the parameters. But I don’t know where to put the file. It doesn’t work when I put it in the current directory with Julia script.
This looks correct, if you want to use SCIP in direct mode. That is, you would continue with model = JuMP.direct_model(optimizer).
Otherwise, you could also use:
model = Model(with_optimizer(SCIP.Optimizer), limits_gap=0.05)
Note that even if you set the gap limit to 0.05, it can happen that SCIP solves the problem to optimality. Imagine that some heuristic finds the optimal solution while the dual bound was already at the optimal value. Or that all remaining nodes are pruned by detecting infeasibility, even though the dual bound was weak before.
Then does it mean that defining the gap in SCIP might not work?
I am getting an error when SCIP passed the defined gap (I tested 100% gap for testing and tightening the variable bounds, SCIP jumps from 111% to 54% gives an error)