Exploring options among open source solvers
We know there are a range of solvers, free and paid, to choose from. We also know that for some situations a free solver might be all that you need. This page is designed to help you better understand your choices among free solvers, their relative performance, and some questions to ask yourself in deciding what type of solver is right for you. Specifically, on this page we will cover the following topics:
- a list of some of the leading free linear and mixed-integer programming solvers
- relative solver performance comparisons
- when a free solver may be the best choice
- a general comparison of free vs. commercial solvers
Note, since you are exploring free solvers, our assumption is you are not an academic. If you are, we offer several license types of Gurobi completely free to academic users who meet certain criteria. If you are an academic user (student, faculty, or staff) at a degree-granting institution, or if you are currently taking an online course in optimization, please take a look at our Academic page.
Common free linear and mixed-integer programming solvers
You will find that there are many free solvers available. Below is a short overview of the two open-source solvers that appear to be the most popular choices:
Solver |
General Overview |
GLPK |
- GLPK (GNU Linear Programming Kit) is a set of routines written in C and organized in the form of a callable library
- GLPK solves linear programming (LP) and mixed integer programming (MIP) problems
- Link: GLPK (3rd party website)
|
LP_Solve |
- LP_Solve is written in C and compilable on both Linux and Windows
- LP_Solve solves linear programming (LP), mixed-integer programming (MIP), and semi-continuous and special ordered sets (SOS) problems
- Link: LP_Solve (3rd party website)
|
Relative solver performance comparisons
Performance is typically a crucial consideration when choosing a solver. To give a sense of the relative performance of the various solver options listed above, we’ve summarized the results of independent benchmarks tests maintained by Hans Mittelmann at Arizona State. If we look at performance on Mixed Integer Programming (MIP) models across a broad set of test models, the table below shows results along two key dimensions: a) was the solver able to solve the model, and b) how quickly was the model solved?
Solver |
# of Benchmark Problems Solved (out of the 87) |
Relative MIP Performance |
GLPK |
0 |
n/a (GLPK solved 0 of the test set models) |
LP_Solve |
5 |
n/a (LP_Solve solved 5 of the test set models) |
Gurobi |
87 |
1.0X (fastest) |
As you can see from the results, performance varies widely across solvers. While the above table presents performance in a quantitative way, we’ve seen several cases where solver performance had very qualitative effects. In particular, we know of several people who have built optimization models using free solvers and who were unable to solve the resulting models in an acceptable amount of time. They concluded from this that optimization technology was inappropriate for their problems, when in all likelihood, a more capable solver would have had no trouble solving them.
When a free solver may be the best choice
As you can see from the data above, free solvers tend to struggle with practical models, either failing to solve them at all or solving them relatively slowly. However, we don’t mean to give you the impression that free solvers are never the right choice. Below are a few scenarios where you may want to consider a free solver.
There is no approved budget
- Often times, when a company is first looking at using an optimization solver in their business, there may not be an approved budget. Management may still be trying to determine the role optimization can play in planning and decision making, and the team doing the work is still “getting their feet wet.”
- While the free trial version of Gurobi (limited to 2000 decision variables and 2000 constraints) or an unlimited temporary evaluation license of Gurobi may suit your needs, if your problem is larger than a trial version allows and/or your time horizon is longer than appropriate for an evaluation version, a free solver can be a good way to get started.
You prefer to program in C or C++
- Most free solvers are written in C or C++ and don’t offer other APIs. GLPK requires you to use C.
- Gurobi offers both C and C++ APIs, as well as a full range of other APIs, including Python, for you to choose from.
The model(s) being solved are both small and relatively easy to solve
- Free solvers tend to struggle with larger and more difficult models, but if a free solver is able to solve your problem now, and you are confident that your problem won’t become more difficult in the future, then a free solve could be a reasonable choice.
- We want to stress that you should consider future growth in the model. We’ve seen many situations where free solvers worked well on a small prototype but were unable to handle the production model. This can cause a lot of rework that you may be able to avoid.
- Before you make the choice to use a free solver, we suggest that you look at relative performance on models of similar size and complexity to those that you are likely to want to eventually solve. We are happy to assist if you like. We have a very large library of models and may be able to do a specific comparison.
Avoiding the “false negative” trap…
One of the most important questions people tend to ask when they are first exploring solvers is if optimization is a fit for their business. We have seen cases where someone selected a free solver, tried building a model, and the solver just couldn’t handle the problem. As a result, they assumed their problem was just too complex to use optimization techniques. Alternatively, they found it was just too hard to use, given the solver didn’t support the programming language they preferred, they couldn’t get support, etc. The team then ends the project and moves on. This is unfortunate, since with the right tools and support the project might have been a great success. If you find yourself in this situation, please do contact us. We may be able to help steer you in the right direction so you get the results you need to support continuing with the project.
Overview of free vs. paid solvers
There are several important differences between free and commercial solvers you should keep in mind when comparing free and paid solvers.
Solver Class |
Detail |
Free Solvers |
- No licensing or maintenance fees
- No direct support, must reply on a “community” for support
- Maintenance and on-going improvement levels vary across the free solvers
- Able to solve smaller/simpler models within those problem types, but may not be able to solve harder models, or only able to solve them very slowly
|
Paid Solvers |
- Both licensing and maintenance fees (for support and upgrades)
- Direct support available from the company
- No risk of infringing code
- Actively maintained and improved over time
- Able to solve a wider range of problem types including linear programming (LP) and mixed-integer programming (MIP), as well as quadratic (QP) and quadratically-constrained (QCP) programming problems
- Offer a broad range of programming and modeling language APIs
- Offer distributed optimization features
- Much better at solving harder models, and solving them quickly
|
Test Gurobi for Free
We are very confident that when you try it for yourself you will come to the same conclusion so many other companies have: that Gurobi is the smart alternative to “free” solvers. As a result, we provide easy access to a full-featured evaluation version of Gurobi. Simply log in, or register if you don’t already have an account, and then go to our evalution request page. Importantly, Gurobi can read and solve MPS files. This allows you to easily export your existing model from your existing solver and see for yourself how much better Gurobi is. Simply visit our Exporting MPS Files page for more information. We are always happy to discuss your specific situation and needs. Just contact us at your convenience. Learn more on the linear programming basics page.
Hear how performance, reliability, interfaces and support are the key differences between the Gurobi Optimizer and free solvers.