Hi,
I am working on a model that includes both linear and non-linear constraints. I am using Ipopt and Juniper solvers for my model.

What I am trying to do is to limit the time of the model and obtain the sub-optimal solution of the objective function and the decision variables. I am limiting the time using the following code:

However, the outcome of both implementations is the same. The model stops running and does not provide any results of the objective function and the decision variables. Is there a way I can limit the time of the model and obtain the sub-optimal results found by the model so far?

I am trying to limit the time because the model takes a very long time (in days, I am not sure if this is normal) to run. The same model (code) works perfectly fine if I use a smaller number of input parameters (variables) and provides the results within a few hours. But with a higher number of input parameters, the model takes so long and I am not sure if the model is stuck in some infinite loop or if there are any other reasons.

PS: I am new to optimization and JuMP/Julia so I apologize for the incorrect use of terminologies if there are any.

What will be returned depends on the solver and the problem. If it has a feasible solution to return when hitting the time limit, most solvers will return that (but not every solver). It might also have no feasible solution to return.

You can see what Juniper has to return using termination_status(model) and primal_status(model). What do you get for this problem?

You could try KNITRO if you have a license, but Juniper is good choice.

In this case, it looks like there is a solution available that you could check. But it looks like it might be infeasible. You could check with primal_feasbility_report(model).

I am working on the suggestion you just mentioned. But I have a question.

What does â€śinfeasibleâ€ť means here? (a) Does it mean that the current solution does not meet all the constraints? or (b) does it mean that it meets all the constraints but it is not the optimal value of the objective function?

I tried changing the solver and I tested almost all non-commercial solvers. But each had its own errors and issues with my model, which I am not going to explain here.

But currently I am working with SCIP Solver, and surprisingly I am able to get the results from the model in a very short time. This is the output using SCIP solver:

SCIP Status : problem is solved [optimal solution found]
Solving Time (sec) : 34.32
Solving Nodes : 7506
Primal Bound : +2.62483019292676e+01 (18 solutions)
Dual Bound : +2.62483019292676e+01
Gap : 0.00 %
objective_value= 26.24830192926761
Status:OPTIMAL

While running the exact same model with the exact same inputs using Juniper produces the following output:

I verified the outputs I got using SCIP and it satisfies all the constraints in my model. My question is, why is there a huge difference in the model run time between Juniper and SCIP? I just want to understand from where this difference is coming, the model or the solver.

For anyone looking at this post in the future, I will explain how I got around this issue.

As I mentioned in my previous reply, I changed the solver from Juniper to SCIP.

With SCIP, I used the time limiting option to limit the time of the model and obtain the sub-optimal solution. This is how I defined the SCIP solver and the time limit (in seconds) option:

using SCIP
model = Model(() -> SCIP.Optimizer(limits_time = 10800))

Once the limit is reached, the SCIP will provide the best solution reached so far.

Hopefully, the bug with Juniper will be fixed. But I wanted to help anyone visiting this post for a similar issue they are facing.