Open Source Linear and Mixed-Integer Programming Software and Solvers

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 Academia 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 what we feel are the top choices, in terms of popularity and/or performance:

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 a 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)
CBC
  • CBC (Coin-OR Branch and Cut) is a set of routines written in C++ and can be used as a callable library or a stand-alone executable.
  • CBC solves linear programming (LP) and mixed-integer programming (MIP) problems.
  • Link: CBC (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 (no models solved) n/a (GLPK solved 0 models)
LP_Solve 5 22.8X slower than Gurobi
CBC 50 17.4X slower than Gurobi
Gurobi 84 1.0X (fastest)

* Hans Mittelmann MIPLIB 2010 benchmark (http://plato.asu.edu/ftp/milpc.html)

As you can see from the results, performance varies widely across solvers. The fastest of the free options solves fewer than half of the models in the test set, and the slowest is unable to solve even a single one.

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 and LP_Solve require you to use C, while CBC requires you to use C++.
  • Gurobi offers both C and C++ APIs, as well as a full range of other APIs 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

You can test, or even use, 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.