1
$\begingroup$

I'm working on a problem using Pyomo with SCIP as the solver.

I've noticed that sometimes the same instances are solved almost instantly, while other times they take significantly longer (with a difference of 1 or 2 orders of magnitude). I want to explore the branching procedure (or any other relevant information) in each of these cases to improve parameter tuning.

How can I access this information using Pyomo as the interface?

$\endgroup$
2
  • $\begingroup$ SCIP itself offers SCIPprintStatistics but i doubt, there is a direct way to use it as SCIPAMPL seems to be the core wrapper-impl and i don't see anything there (the issue probably being: the feature is an post-call after solving). You maybe need to export lp/mps-serialized models and then use SCIPs shell for solving and calling display statistics after. $\endgroup$
    – sascha
    Commented Sep 12 at 13:47
  • $\begingroup$ Hey! Can you please share the instances where this behaviour is ocurring? $\endgroup$ Commented Sep 12 at 22:07

1 Answer 1

2
$\begingroup$

I doubt if you installed SCIP with PIP you can really apply its parameters on Pyomo. Instead by installing SCIP with conda you can directly pass its parameters to the solver. E.g. to analyze the branching strategies you can use the following method:

 branching rule       priority maxdepth maxbddist  description
 --------------       -------- -------- ---------  -----------
 relpscost               10000       -1    100.0%  reliability branching on pseudo cost values
 pscost                   2000       -1    100.0%  branching on pseudo cost values
 inference                1000       -1    100.0%  inference history branching
 mostinf                   100       -1    100.0%  most infeasible branching
 leastinf                   50       -1    100.0%  least infeasible branching
 distribution                0       -1    100.0%  branching rule based on variable influence on cumulative normal distribution of row activities
 fullstrong                  0       -1    100.0%  full strong branching
 cloud                       0       -1    100.0%  branching rule that considers several alternative LP optima
 lookahead                   0       -1    100.0%  full strong branching over multiple levels
 multaggr                    0       -1    100.0%  fullstrong branching on fractional and multi-aggregated variables
 allfullstrong           -1000       -1    100.0%  all variables full strong branching
 vanillafullstrong       -2000       -1    100.0%  vanilla full strong branching
 random                -100000       -1    100.0%  random variable branching
 nodereopt            -9000000       -1    100.0%  branching rule for node reoptimization

Option file:

  m.Options = {"limits/time": 300, "branching/fullstrong/priority": 10001}
  SolverFactory('scip').solve(m, tee= True, options = m.Options, load_solutions=True).write()

then you can see something like this in the solver log:

reading user parameter file <scip.set>
===========================

limits/time = 300
branching/fullstrong/priority = 10001

If you would like to see the statistics information of the model, you can easily pass its option to the file option as follows:

  m.Options = {"limits/time": 10, "branching/relpscost/priority": 10001, "display/statistics": True}

and the part of branching in statistics will show something like this:

Branching Rules    :   ExecTime  SetupTime   BranchLP  BranchExt   BranchPS    Cutoffs    DomReds       Cuts      Conss   Children
  allfullstrong    :       0.00       0.00          0          0          0          0          0          0          0          0
  cloud            :       0.00       0.00          0          0          0          0          0          0          0          0
  distribution     :       0.00       0.00          0          0          0          0          0          0          0          0
  fullstrong       :       0.00       0.00          0          0          0          0          0          0          0          0
  gomory           :       0.00       0.00          0          0          0          0          0          0          0          0
  inference        :       0.00       0.00          0          0          0          0          0          0          0          0
  leastinf         :       0.00       0.00          0          0          0          0          0          0          0          0
  lookahead        :       0.00       0.00          0          0          0          0          0          0          0          0
  mostinf          :       0.00       0.00          0          0          0          0          0          0          0          0
  multaggr         :       0.00       0.00          0          0          0          0          0          0          0          0
  nodereopt        :       0.00       0.00          0          0          0          0          0          0          0          0
  pscost           :       0.00       0.00          0          0          0          0          0          0          0          0
  random           :       0.00       0.00          0          0          0          0          0          0          0          0
  relpscost        :       0.30       0.00        404          0          0          2         16          0          6        798
  vanillafullstrong:       0.00       0.00          0          0          0          0          0          0          0          0
$\endgroup$
2
  • $\begingroup$ Before the parametrization of the branching procedure I expect to obtain (from the solution) how the branching was performed. Once with that info I would try what you suggest. $\endgroup$
    – Franco
    Commented Sep 13 at 14:21
  • $\begingroup$ @Franco, I just updated the answer. $\endgroup$
    – A.Omidi
    Commented Sep 13 at 19:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.