ojAlgo aims to have the best set of pure Java solvers available, and to be roughly on par with good native code solvers when the models are not too big or numerically challenging. Below are the results from 3 benchmark executions comparing ojAlgo to the best Java alternatives as well as some native code reference. The solvers used in the benchmarks are:
- ojAlgo (Open Source, Java, LP & QP)
- Hipparchus (Open Source, Java, LP & QP)
- JOptimizer (Open Source, Java, QP only)
- OR-Tools, GLOP (Open Source, native code, LP only)
- CPLEX (Commercial, native code, LP & QP) – community/trial version limited to 1,000 variables or constraints.
LP 1k
Netlib LP models with no more than 1,000 variables or constraints. (44 models)

Both the x- and y-axis have execution time in nano seconds as their scale. CPLEX acts as a reference (the common x-value).
For these problem sizes ojAlgo is totally comparable to OR-Tools.
Hipparchus fails to solve about 1/3 of the models and is always the slower alternative (by a good margin).
The slope of the trend lines indicate that the Java solvers will struggle, at some point, when the models get bigger.
LP 10k
Netlib LP models up to 10,000 variables or constraints. (97 models, including the 44 previous)

This time CPLEX could not be used. Therefore OR-Tools doubles as the reference – that’s why all the blue dots are perfectly on the trend line.
Primarily we see here that the Java solvers scale worse than native code solvers. There is also an increase in the number of models the Java solvers cannot solve. In this set ojAlgo can solve about 90% of the models while Hipparchus is almost down to 50%.
QP 1k
Maros and Meszaros collection of convex problems, limited to 1,000 variables and pure quadratic models, all variables quadratic. (33 models)

Here, the x-axis show the number of variables in the model
- For really small models (around 10 variables or less) don’t bother with native code solvers.
- At around 100 variables ojAlgo still performs about the same as native code, while Hipparchus appears slower.
- Close to 1,000 variables both ojAlgo and Hipparchus are clearly distanced by native code.
Previously JOptimizer was the only Java QP alternative, but Hipparchus now also has a QP solver, and Hipparchus performs much better than JOptimizer. The main problem with JOptimizer is that it can only solve about 20% of the models. Future benchmarks will most likely only compare with Hipparchus. It is worth noting that none of the solvers could solve all the models – not even CPLEX.
Solver Success Rate
It’s not always clear from the charts above that some solvers can’t handle all the models. Not being able to solve a model at all is of course much more of a problem than solving it slower than others. Therefore we also show a table of success rates. There is a strong correlation between being fast (scaling well) and being able to solve many cases.
| Solver | LP 1k | LP 10k | QP 1k |
|---|---|---|---|
| CPLEX | 100% | 94% | |
| OR-Tools | 100% | 100% | |
| JOptimizer | 21% | ||
| Hipparchus | 68% | 55% | 82% |
| ojAlgo | 100% | 1 88% / 93% | 91% |
- With ojAlgo there are actually 4 different LP solvers/configurations. 88% is the best single solver/configuration, 93% is the combination of all. ↩︎
What about MIP
There are 2 main reasons why there’s no MIP benchmark included here:
- There is no other pure Java MIP solver to compare with
- We don’t know of any suitable MIP test library to use. MIPLIB does contain a large collection of MIP models, but these are too hard or time consuming to solve.
In MIPLIB there are plenty of models that no solver have ever solved, and a model is considered “easy” if top-of-the-line commercial native code solvers can solve it in less than an hour. That’s entirely different execution times than with the LP and QP models used in these comparisons.
Results / Interpretation
Well, not that much to say actually. In therms of pure Java alternatives there aren’t that many. It’s essentially just ojAlgo and Hipparchus. As shown in these benchmarks (and others) ojAlgo performs better. For LP there is no contest – nothing indicates that Hipparchus would (ever) be better than ojAlgo. For QP maybe you can try Hipparchus when/if ojAlgo fails. Even if ojAlgo overall performs better and handles more cases, there may be differences in what the solvers are good at, that could make Hipparchus a better choice in some cases. For MIP ojAlgo is the only Java alternative.
There are many native code solvers, commercial as well as open source, of different categories – and there are many good choices. ojAlgo is for when you want to avoid native code and/or commercial licenses. Up towards 1,000 variables ojAlgo compares well. The differences are probably not noticeable, unless measured.
Benchmark Code & Methodology
The benchmark code can be found here: https://github.com/optimatika/ojAlgo-mathematical-programming-benchmark
More specifically the raw results and execution logs can be found here: https://github.com/optimatika/ojAlgo-mathematical-programming-benchmark/tree/master/results/2025/11
