简体   繁体   中英

Solving multiple LPs in SCIP

I need to implement benders decomposition from scratch in pyscipopt. I solve a master problem LP, then solve a subproblem, which gives a violated constraint for the master problem. I add that constraint and this loop continues till I find the optimal solution. In pyscipopt, I use model.freeTransform() and then add the new constraint, and then optimize the new model.

But in SCIP, I have noticed that solving these LPs sequentially is leading to numerical problems. The log of the LP solve after a few 100 iterations -

[linear] <c622>: <z_0>[C] (+432898.075) +17748<y_T1_H7>[C] (+0.108609174) +14508<y_T1_H8>[C] (+1) +6864<y_T2_H9>[C] (+1) +19890<y_T3_H1>[C] (+0.269210591) +8961<y_T3_H5>[C] (+0) +8272<y_T3_H10>[C] (+0) +20696<y_T3_H7>[C] (+1) +25894<y_T4_H7>[C] (+1) +1337<y_T4_H10>[C] (+0.705202577) +41301<y_T4_H3>[C] (+1) +6438<y_T5_H4>[C] (+1) +10048<y_T7_H1>[C] (+1) +63232<y_T8_H7>[C] (+0.319396021) +16014<y_T8_H2>[C] (+1) +15794<y_T8_H4>[C] (+0.0312903007) +21054<y_T8_H5>[C] (+0.308289301) +36068<y_T9_H6>[C] (+0.568178888) +13231<y_T10_H6>[C] (+1) >= 645351.22;
;
violation: left hand side is violated by 1560.04766214639
9/10 feasible solutions given by solution candidate storage, new primal bound 1.692124e+06

presolving:
(round 1, fast)       0 del vars, 0 del conss, 0 add conss, 25 chg bounds, 0 chg sides, 0 chg coeffs, 0 upgd conss, 0 impls, 0 clqs
(round 2, fast)       0 del vars, 0 del conss, 0 add conss, 36 chg bounds, 0 chg sides, 0 chg coeffs, 0 upgd conss, 0 impls, 0 clqs
   (0.0s) running MILP presolver
   (0.0s) MILP presolver found nothing
(round 3, exhaustive) 0 del vars, 1 del conss, 0 add conss, 36 chg bounds, 1 chg sides, 0 chg coeffs, 0 upgd conss, 0 impls, 0 clqs
(round 4, exhaustive) 0 del vars, 1 del conss, 0 add conss, 36 chg bounds, 1 chg sides, 1210 chg coeffs, 0 upgd conss, 0 impls, 0 clqs
(round 5, exhaustive) 0 del vars, 1 del conss, 0 add conss, 36 chg bounds, 1 chg sides, 2386 chg coeffs, 0 upgd conss, 0 impls, 0 clqs
   (0.1s) symmetry computation started: requiring (bin +, int +, cont +), (fixed: bin -, int -, cont -)
   (0.1s) no symmetry present
presolving (6 rounds: 6 fast, 4 medium, 4 exhaustive):
 0 deleted vars, 1 deleted constraints, 0 added constraints, 36 tightened bounds, 0 added holes, 1 changed sides, 2386 changed coefficients
 0 implications, 0 cliques
presolved problem has 38 variables (0 bin, 0 int, 0 impl, 38 cont) and 625 constraints
    625 constraints of type <linear>
Presolving Time: 0.09

(node 1) unresolved numerical troubles in LP 1 -- using pseudo solution instead (loop 1)
(node 1) forcing the solution of an LP (last LP 1)...
[solve.c:3907] ERROR: (node 1) unresolved numerical troubles in LP 2 cannot be dealt with
[solve.c:4192] ERROR: Error <-6> in function call
[solve.c:4986] ERROR: Error <-6> in function call
[scip_solve.c:2774] ERROR: Error <-6> in function call
Traceback (most recent call last):
  File "/Experiments/topcuts.py", line 77, in benders
    self.master.optimize()
  File "src/pyscipopt/scip.pyx", line 3217, in pyscipopt.scip.Model.optimize
  File "src/pyscipopt/scip.pyx", line 248, in pyscipopt.scip.PY_SCIP_CALL
Exception: SCIP: error in LP solver!

I also created the LP file to check if pyscipopt is not able to solve that particular LP. But that isn't the case as it solves the problem without any errors. So, is there some way to solve these multiple problems in a more robust manner?

Is there some function to restart the solving process without using any prior information?

May I ask why you are reimplementing a benders decomposition from scratch? Are you aware that there is both a readily usable Benders Implementation as well as a way to add plugins for a custom benders implementation available in SCIP? And it seems to me that this is also avaible in PySCIPopt. Even if your approach works eventually it will be terribly inefficient since you resolve from scratch after every benders iteration.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM