I have written a huge optimization code in pyomo. The code serves for any planning horizon. The variables are indexed in time (t). When I set t to have 365 days, the termination condition is feasible/optimal. It solves the planning for a year, but when I set t having a cardinality equal to 500, the problem gives a termination condition different of infeasible. It makes no sense, since the problem is controlled, stable and linear, the solution should be feasible (termination condition = feasible/optimal). Conversely, it gives the terminal condition "other". What does it mean? Does it have any reference to provide information about "other"? Does Pyomo or GLPK solver is limited?

The status of the solver is:

# ==========================================================
# = Solver Results                                         =
# ==========================================================
# ----------------------------------------------------------
#   Problem Information
# ----------------------------------------------------------
- Name: unknown
  Lower bound: -inf
  Upper bound: inf
  Number of objectives: 1
  Number of constraints: 71102
  Number of variables: 42302
  Number of nonzeros: 1161420
  Sense: maximize
# ----------------------------------------------------------
#   Solver Information
# ----------------------------------------------------------
- Status: ok
  Termination condition: other
    Branch and bound: 
      Number of bounded subproblems: 0
      Number of created subproblems: 0
  Error rc: 0
  Time: 202.43064308166504

Funcobj =  4500
  • $\begingroup$ What is the largest value of t by which you can get a feasible/optimal solution from the problem? Have you tried 366? It looks like it does not take long time for the solver to solve the problem. Also look at: pyomo.org/blog/2015/1/8/accessing-solver for clarifications about termination conditions. $\endgroup$ May 1, 2023 at 1:16
  • $\begingroup$ Yes, the problem solves for more than 365 days. Curiously when I deactivate some optional constraints, the solver can go further in planning horizon. It seems that either pyomo or GLPK cannot go longer for large-scale problems, but I am not sure yet. It is hard to find an error if it exists, since pyomo do not show constraints details after running. It is not sure if any constraint are being violated, but as the termination condition was not infeasible, I believe it is not the point. Now, I will try to change some constraints or ignore some of existing ones. I will also test different inputs. $\endgroup$
    – Alex
    May 2, 2023 at 10:58
  • $\begingroup$ Maybe GLPK cannot handle all kind of convergences for large-scale problems? Or Pyomo constructor has some bug? $\endgroup$
    – Alex
    May 2, 2023 at 11:02
  • $\begingroup$ for making a recap, when I changed some constraints, and for a cardinality of 500 for the set t, the problem gives "other" termination condition way faster, in just 14 seconds: Number of objectives: 1 Number of constraints: 76502 Number of variables: 46002 Number of nonzeros: 910966 Sense: maximize Solver: - Status: ok Termination condition: other Branch and bound: Number of bounded subproblems: 0 Number of created subproblems: 0 Error rc: 0 Time: 14.11853814125061 $\endgroup$
    – Alex
    May 2, 2023 at 11:50
  • 1
    $\begingroup$ that is probably right that the root of the problem is related to the solver and it definitely true for GLPK (as an open source solver it is not the best solver out there). Maybe you can use any commercial solvers such as Gurobi (free educational license if you are in academia) to see if it is really related to the solver or may have some other causes... $\endgroup$ May 2, 2023 at 20:56


Your Answer

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

Browse other questions tagged or ask your own question.