# Is it abnormal for a model to take 8+ hours to solve?

I am building my first optimization model, it is quite large and also a non-linear problem. I have had my model solving on the NEOS Optimization Server and after 8 hours of trying to solve, the server cut out because it reached a time limit. So what I am wondering is if it's abnormal for models to run over 8 hours or if this is a fairly normal occurrence.

I am using the NEOS server because it is free and the solver I am using (KNITRO) is quite expensive.

Edit: I will be updating this problem later today.

• Does the ,model have any binary or integer variables? Have you seen the solver log for what it had done prior to the time limit expiration? Apr 16 '20 at 13:54
• The model does not have any binary or integer variables, everything is continuous. I did not see the solver log though but i'm guessing it was a mistake not to. I can run it again over night and hit that 8 hour limit though and get that log. Apr 16 '20 at 14:25
• I'm also currently looking into Rolling Horizon methods, but another potential alternative that I have found is to try and export some of the computation to a simulation program, compute some values, and then use them as inputs into the optimization model. This method seems somewhat advanced though, i'm not sure if you can tweak Knitro to include a simulation though. Apr 16 '20 at 15:10
• 8h of running time is large for a continuous problem, even non-linear. Are you formulating your problem in Ampl, or with a programming language (Julia, Python, R, C++)? My guess here is that most of the resolution time is being spent in the callbacks. Apr 16 '20 at 15:26
• Would you try solving your problem in a small instance? Is it solved in the optimal sense? Apr 16 '20 at 15:55

## 3 Answers

It is highly dependent to the problem, and to the size of the instance you are solving. For example, in many scheduling problems I have dealt with, the optimal solution cannot be found within 8 hours for medium-sized instances.

Recently, I have been using NEOS server since I didn't have access to my uni PC as a result of quarantine! I had an MILP model for a certain type of single machine scheduling problem, where NEOS was unable to optimally solve the instances with 15 jobs within 8 hours (I tried both CPLEX and Gurobi).

• It would be considered, It depends on the structure of the problem under study. I had faced with a single machine scheduling problem which takes hours to solve but, by using another formulation it was solved in less than an hour. I have really founded that the problem structure is very important to decrease the solving time. Apr 16 '20 at 16:06

It is totally normal for some instances to take more than hours to be solved(and that's why NEOS Server has the limitation of 8 hours for each instance to be able to serve more users). The thing that you can try is starting your solving process with multi-start(which is one of many options that are available with Knitro on NEOS). 'ms_enable'=1 is the option to activate multi-start in Knitro. More information about it can be found here. Hope this works for your problem.

In my experience I have run some very large scale problems for 8+ hours with over 500K+ binary variables due computational issues because of not having larger RAMs. In around 2008, cloud computing was just starting and availability of machines with huge RAMs was hard to find unlike these days where we can just swipe a credit card on AWS. I would be surprised still if a model is running that long. I would solve smaller instances to check, understand the logs, linearize the math formulation if possible and fine tune KNITRO parameters as some users are suggesting.