Mathematical Optimisation

Mathematical optimisation means finding the best solution to a problem defined by an objective function and a set of constraints. Solvers are the engines that do this work. They take a model — variables, constraints and an objective — and return the optimal values. The three most common model types are LP (linear programming), QP (quadratic programming) and MIP (mixed-integer programming), each allowing progressively more complex problem formulations.

ojAlgo includes solvers for all three, pure Java with zero dependencies.

Formulate once

You describe the problem with ExpressionsBasedModel — variables, expressions, bounds, an objective — then call minimise() or maximise(). Which solver runs is a decision the model does not encode.

That separation is the point. The model you write today is not tied to the engine that solves it, so moving to more solving power later never means rewriting the formulation. It also means you can put the same model through different solvers and compare, which is the only reliable way to find out whether your formulation or your solver is the problem.

Models can be read from and written to the standard MPS and LP file formats. That makes it possible to move a model between tools, reproduce a reported problem exactly, or archive a model alongside the solution it produced.

The built-in solvers

Linear programming. ojAlgo's LP solver handles the standard formulation — linear objective, linear constraints, variable bounds — and is the component with the most measured evidence behind it. See the benchmark for how it performs against both pure Java and native alternatives on public test sets.

Quadratic programming. Convex QP, the workhorse of portfolio optimisation and least-squares problems with constraints. This is where ojAlgo's own history is longest — the library exists because a client needed a pure Java QP solver and none existed. Recent releases have reworked it substantially; see QP news and the v57 release notes.

Mixed-integer programming. Branch-and-bound over the LP relaxation, for models where some or all variables must take integer values. MIP is where model formulation matters most — two mathematically equivalent formulations can differ by orders of magnitude in solve time.

Everything above runs anywhere Java runs. No native libraries, no platform-specific builds, no licence keys, no licence server. That matters most in exactly the environments where installing native code is hardest: locked-down build pipelines, regulated deployments, and anywhere a security review is the long pole.

Performance

ojAlgo is the fastest pure Java optimisation library available. The LP & QP benchmark has the current numbers, measured on standard public test sets.

The harness is open — ojAlgo-mathematical-programming-benchmark is the code that produces those figures, so any of it can be reproduced or re-run against your own models.

Against the other pure Java options the gap is not close. Hipparchus is the most capable alternative and still fails on roughly half the standard LP test models, and is significantly slower on those it does solve. Apache Commons Math is older and more limited — Hipparchus is its maintained fork — and JOptimizer's QP work is largely superseded by ojAlgo's own.

When a model needs more

The built-in solvers handle the great majority of the problems put to them. Some models eventually outgrow them, and there is no pure-Java solver stronger than ojAlgo's own — so more solving power means native code.

That is what the Optimisation Service is for. It is a solver server you deploy in your own cluster, running a suite of best-of-breed native solvers behind the same interface. A small pure Java client points ExpressionsBasedModel at it, so your model code does not change and no native code enters your application. You get native performance without the native deployment work — no platform-specific binaries, no JNI boundary to debug across JDK versions, no solver licences to manage.

In capability it sits between ojAlgo's built-in solvers and the large commercial solvers. For most models that outgrow pure Java it is enough, and it is considerably less work than licensing, packaging and operating a commercial solver yourself.

ojAlgo itself remains Open Source and free to use, and always will be. This is an option for models that need more — not a paywall on anything that works today.

Third-party solver integrations

ojAlgo has integration modules connecting ExpressionsBasedModel to external solvers — Clarabel, CPLEX, Gurobi, HiGHS, MOSEK, OR-Tools, SCIP and others. These are how the Optimisation Service is built.

They are also available to Optimatika’s support customers, together with the right to request new builds. Running them yourself means obtaining each solver and its licence, packaging platform-specific native binaries for every target environment, and maintaining the JNI boundary as JDK versions move — real engineering work, and precisely what the Optimisation Service exists to absorb.