Pyomo / pyomo

An object-oriented algebraic modeling language in Python for structured optimization problems.
https://www.pyomo.org
Other
1.97k stars 505 forks source link

SCIP Solver Results undefined/unknown/inf #1615

Open goghino opened 4 years ago

goghino commented 4 years ago

After solving a model (code here) using SCIP (SCIP version 7.0.1 [precision: 8 byte] [memory: block] [mode: optimized] [LP solver: SoPlex 5.0.1] [GitHash: b41d526acf]), the results components (i.e. gap, bounds, sense) remain undefined or inf, as shown below. The solution is correct though, the same as found with Gurobi (version 9.0.1 build v9.0.1rc0 (mac64)). The bounds and gap shown in the solver output (tee=True) is also the same as in case of Gurobi. What can be done about correctly setting the results object?

solver = pyo.SolverFactory('scip')
results = solver.solve(m, keepfiles=True, tee=True, load_solutions=False)

results.write()

if results.solver.termination_condition == pyo.TerminationCondition.optimal:
    m.solutions.load_from(results)

m.pprint()
# ==========================================================
# = Solver Results                                         =
# ==========================================================
# ----------------------------------------------------------
#   Problem Information
# ----------------------------------------------------------
Problem: 
- Lower bound: -inf
  Upper bound: inf
  Number of objectives: 1
  Number of constraints: 0
  Number of variables: 20
  Sense: unknown
pmlpm1986 commented 2 years ago

I have the same issue with SCIP 8.0.0 and Pyomo 6.2.

hygorxaraujo commented 10 months ago

I also have this same issue with Pyomo 6.6.2 and SCIP 8.0.4.

Problem: 
- Lower bound: -inf
  Upper bound: 46259048.8645032
  Number of objectives: 1
  Number of constraints: 0
  Number of variables: 97146
  Sense: unknown
Solver: 
- Status: ok
  Message: optimal solution found
  Termination condition: optimal
  Id: 0
  Error rc: 0
  Time: 143.75
  Gap: 0.0
  Primal bound: 46259048.8645032
  Dual bound: 46259048.8645032
Solution: 
- number of solutions: 0
  number of solutions displayed: 0
pmlpm1986 commented 1 month ago

This problem still exists with scip 9.1 and pyomo 6.6.2. From what I can tell, pyomo does not add the optimisation sense and the number of constraints to the results object.