I am sending a pretty complex Pyomo MINLP to NEOS using Couenne. I'm getting an error message that the solve time is too long (sorry, I don't have it still in my Python console). Is there a way to set a max time and return the best feasible result? I was able to get solutions back prior to adding my last set of constraints. Current code is:

# lots of code for model building...

solver_manager = SolverManagerFactory('neos')
results = solver_manager.solve(model , opt='couenne',load_solutions=True,tee=True)

1 Answer 1


complex Pyomo MINLP to NEOS using Couenne.

So, I had to Google a bit to understand this part as I am not familiar with the package nor the NEOS service.

It would be beneficial as to where in the run-time progress you get the error message and what it exactly states.

From the NEOS webpage I found the following limitations

Retrieving results If you are having trouble receiving results, you should read the NEOS Server FAQ section on results before contacting support. Jobs that exceed the 8 hour time limit or the 3 GB memory limit will not return results.

I am guessing your model doesn't run for 8 hours, but maybe you are hitting the 3 GB memory limit before a solution has been found?

Edit below, as a comment shed some new light for the reason to the time limit (or I misunderstood the question).

If you simply want a feasible solution (fast), then I would model the problem as a decision problem (see this answer on Comp Sci SE).

Shortly put and in general terms, you change the problem from something like:

\begin{align} \min&\quad f(x) \\ \text{s.t.} &\quad Ax = b \\ &\quad x \in \Bbb R\end{align}


\begin{align} \min&\quad 0 \\ \text{s.t.} &\quad Ax = b \\ &\quad f(x)\leq K\\ &\quad x \in \Bbb R\end{align}

where $K$ is a large constant you are fairly certain a feasible solution has an objective less than (or Integer.MAX_VALUE or "large enough"). The problem should terminate as soon as a solution has been found.

  • $\begingroup$ It may actually be taking that long. The issue is that I am willing to settle for a feasible solution, within a given time limit that I want to be able to specify. $\endgroup$
    – Ralph
    Commented Jun 3, 2019 at 1:22
  • $\begingroup$ In that case I think you need to look at your Counne model to see if you can force it to run more frequent heuristics or maybe set an internal timelimit of e.g. 7 hours. This could force it to stop more gracefully and send the best solution back to you. I guess that if you hit the 8 hour limit then the server kills the process in brutal manner with no callback of the solution, but I don't know. $\endgroup$ Commented Jun 3, 2019 at 8:37
  • 1
    $\begingroup$ That's the point - I'm trying to pass a time limit as an argument to Couenne. For the purposes of this project, essentially any feasible solution will be fine, I am much more concerned about getting a fast feasible answer than the optimal answer. $\endgroup$
    – Ralph
    Commented Jun 3, 2019 at 10:53
  • $\begingroup$ That seems to be something else than what you originally stated, so that would require a slightly different approach. I will make an edit for it. $\endgroup$ Commented Jun 3, 2019 at 10:57
  • $\begingroup$ Thanks Tue. I'll give that a shot. The issue is that there are many thousands (millions?) of feasible solutions. The objective function is nonlinear (constraints are linear / integer) so I think Couenne is spending way too much time searching the solution space for a global maximum when a local maximum will be generally acceptable. $\endgroup$
    – Ralph
    Commented Jun 3, 2019 at 11:50

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.