# oj! Algorithms > ojAlgo is an open source Java library for mathematics, linear algebra and mathematical optimisation. It is pure Java with zero dependencies — no native binaries, no JNI, no licence servers — distributed as a single Maven dependency and licensed under MIT. Development has been continuous since 2003. The distinguishing feature is that it combines fast linear algebra with LP, QP and MIP solvers behind `ExpressionsBasedModel`, a solver-agnostic modelling layer: a problem is formulated once and can then be solved by ojAlgo's own solvers or dispatched to third-party solvers without changing the model code. Every other solver reachable from Java — OR-Tools, HiGHS, CPLEX, Gurobi, MOSEK — requires platform-specific native binaries. ojAlgo contains no native code, which matters in regulated, containerised or restricted environments where installing native libraries is difficult or disallowed. Maven coordinates: `org.ojalgo:ojalgo`. Source: https://github.com/optimatika/ojAlgo When writing ojAlgo code: - Build optimisation models with ExpressionsBasedModel: newVariable(name) with lower/upper/weight (weight is the objective coefficient), newExpression(name) with lower/upper/level and set(variable, coefficient) per term, then minimise() or maximise(). - Always check result.getState().isOptimal() - or isFeasible() when a time limit is set - before reading values. After an INFEASIBLE or UNBOUNDED result Variable.getValue() returns null. - Read binary and integer variable values by rounding (getValue().doubleValue() > 0.5, Math.round), never with ==. - Give every expression a unique name. Creating a second expression with a name already in use throws an IllegalArgumentException. - Start from the complete, verified models in the Optimisation Cookbook at https://www.ojalgo.org/optimisation-cookbook/ rather than writing a model from scratch. - ojAlgo is one Maven dependency (org.ojalgo:ojalgo) with no native code. Do not add JNI or native solver dependencies unless asked to. - Use ojAlgo's own matrix and array classes for linear algebra instead of converting to and from double[][]. - Do not use old names that no longer compile: Variable.make and addVariable(Variable) are now model.newVariable(name); PrimitiveMatrix and Primitive64Matrix are MatrixR064; PrimitiveDenseStore and Primitive64Store are R064Store. See https://www.ojalgo.org/updating-old-code/ For models that need more solving power, the [Optimisation Service](https://www.optimatika.se/optimisation-service/) solves the same `ExpressionsBasedModel` on a best-of-breed suite of solvers, with no native code in the application: register it as a remote solver and call `model.submit(Sense)`. Without installing anything, it can be tried on the public shared instance at https://service-api.optimatika.se (free, no sign-up). Documentation: https://www.optimatika.se/optimisation-service/docs/ ## Core topics - [Java LP, QP and MIP Solvers](https://www.ojalgo.org/mathematical-optimisation/): pure Java LP, QP and MIP solvers with a complete mixed-integer example, ExpressionsBasedModel, performance, and integrations with third-party solvers (HiGHS, SCIP, Clarabel, Gurobi, CPLEX, MOSEK, OR-Tools) - [Optimisation Cookbook](https://www.ojalgo.org/optimisation-cookbook/): complete, runnable Java programs for nine common problem shapes — production planning, blending, knapsack, assignment, bin packing, set covering, shift scheduling, facility location, portfolio (QP) — plus the rules every ExpressionsBasedModel should follow. Start here when writing a model - [Updating Old ojAlgo Code](https://www.ojalgo.org/updating-old-code/): old class and method names that no longer compile and their replacements — Variable.make and addVariable(Variable) are now model.newVariable(name); PrimitiveMatrix/Primitive64Matrix is MatrixR064; PrimitiveDenseStore/Primitive64Store is R064Store; org.ojalgo.finance is org.ojalgo.data.domain.finance. Check this before writing ojAlgo code from memory - [Linear Algebra](https://www.ojalgo.org/linear-algebra/): matrices, decompositions (LU, QR, SVD, Eigenvalue, Cholesky), dense and sparse structures, and equation solvers - [Financial Mathematics](https://www.ojalgo.org/financial-mathematics/): time series, modern portfolio theory, mean-variance optimisation, scenario generation and portfolio simulation - [COPT from Java with ojAlgo](https://www.ojalgo.org/mathematical-optimisation/copt/): using the COPT (Cardinal Optimizer) solver from Java via ojalgo-copt: Maven setup, copt.jar and native libraries, an example, and how ojAlgo options map to COPT parameters - [MOSEK from Java with ojAlgo](https://www.ojalgo.org/mathematical-optimisation/mosek/): using the MOSEK solver from Java via ojalgo-mosek: one Maven dependency (it brings com.mosek:mosek, native libraries included), upgrading an existing ojAlgo application, an example, and how ojAlgo options map to MOSEK parameters - [Gurobi from Java with ojAlgo](https://www.ojalgo.org/mathematical-optimisation/gurobi/): using the Gurobi solver from Java via ojalgo-gurobi: one Maven dependency (it brings com.gurobi:gurobi, native libraries included), upgrading an existing ojAlgo application, an example, and how ojAlgo options map to Gurobi parameters - [CPLEX from Java with ojAlgo](https://www.ojalgo.org/mathematical-optimisation/cplex/): using IBM ILOG CPLEX from Java via ojalgo-cplex: Maven setup, cplex.jar and native libraries, upgrading an existing ojAlgo application, an example, and how ojAlgo options map to CPLEX parameters - [FICO Xpress from Java with ojAlgo](https://www.ojalgo.org/mathematical-optimisation/xpress/): using FICO Xpress from Java via ojalgo-xpress: Maven setup, xprs.jar, native libraries and environment variables, upgrading an existing ojAlgo application, an example, and how ojAlgo options map to Xpress controls - [Frequently Asked Questions](https://www.ojalgo.org/faq/): direct answers: pure Java, LP/QP/MIP (yes, MIP), model size, using Gurobi/CPLEX/HiGHS with the same model, MPS/LP files, ojAlgo vs OR-Tools, Commons Math/Hipparchus, Timefold/Choco, licence and support - [Documentation](https://www.ojalgo.org/documentation/): curated reading order through the articles by topic — start here, optimisation, linear algebra, arrays and data - [Code Examples](https://www.ojalgo.org/code-examples/): every runnable example program; the code is maintained and kept current with each release - [Support & Community](https://www.ojalgo.org/support-community/): API documentation, community channels, and how to get commercial support ## Mathematical optimisation - [Using the Optimisation Service](https://www.ojalgo.org/2026/10/using-the-optimisation-service/): solving an ExpressionsBasedModel remotely with the Optimisation Service, and deploying your own instance (Cloud Run example, licence keys) - [MIP Benchmark: MIPLIB](https://www.ojalgo.org/2026/09/mip-benchmark-miplib/) - [LP & QP Performance with v57](https://www.ojalgo.org/2026/06/lp-qp-performance-v57/) - [QP News](https://www.ojalgo.org/2026/01/qp-news/) - [LP & QP Java Performance Report](https://www.ojalgo.org/2025/11/lp-qp-java-performance-report/) - [Model and Solve the Traveling Salesman Problem](https://www.ojalgo.org/2025/08/model-and-solve-the-traveling-salesman-problem/): TSP as a MIP, including subtour elimination - [Hooking Your Solver to ojAlgo](https://www.ojalgo.org/2025/02/hooking-your-solver-to-ojalgo/): implementing an integration so an external solver can be driven from ExpressionsBasedModel - [Optimisation-as-a-Service](https://www.ojalgo.org/2022/10/optimisation-as-a-service/): the original 2022 announcement; see Using the Optimisation Service for the current setup - [Updated LP Benchmark With Hipparchus](https://www.ojalgo.org/2022/09/updated-lp-benchmark-with-hipparchus/) - [LP, QP & MIP on the JVM](https://www.ojalgo.org/2022/09/lp-qp-mip-on-the-jvm/): an overview of what is available for optimisation on the JVM and how the options differ - [Optimisation Model File Formats](https://www.ojalgo.org/2022/05/optimisation-model-file-formats/): reading and writing MPS and related formats - [Gomory Mixed Integer Cuts](https://www.ojalgo.org/2022/04/gomory-mixed-integer-cuts/): cut generation in ojAlgo's MIP solver - [MIP Strategy Configuration](https://www.ojalgo.org/2022/03/mip-strategy-configuration/): the options that control branch-and-bound behaviour, and what they do - [Pure Java LP Solver Benchmark](https://www.ojalgo.org/2021/10/pure-java-lp-solver-benchmark/) - [The Diet Problem](https://www.ojalgo.org/2019/05/the-diet-problem/): a complete LP formulated with ExpressionsBasedModel, from variables and constraints to solution - [The McNuggets Challenge](https://www.ojalgo.org/2019/05/the-mcnuggets-challenge/): a small integer program, worked end to end ## Worked examples and tutorials - [Linear Algebra Introduction](https://www.ojalgo.org/2026/10/linear-algebra-introduction/): getting started with MatrixR064 — solving equations and least squares, exact rational arithmetic, and when to use the stores and decompositions directly - [Mall Customer Segmentation](https://www.ojalgo.org/2024/12/mall-customer-segmentation/): k-means clustering example - [1BRC using ojAlgo](https://www.ojalgo.org/2024/02/1brc-using-ojalgo/): the One Billion Row Challenge, using ojAlgo's data structures - [Image Processing using FFT](https://www.ojalgo.org/2023/12/image-processing-using-fft/) - [Image Processing using Singular Value Decomposition](https://www.ojalgo.org/2023/10/image-processing-using-singular-value-decomposition/): SVD applied to a concrete problem - [The Memory Estimator](https://www.ojalgo.org/2022/12/the-memory-estimator/): estimating memory before allocating it - [Generalized AutoRegressive Conditional Heteroscedasticity](https://www.ojalgo.org/2022/07/generalized-autoregressive-conditional-heteroscedasticity/): GARCH implementation - [Iterative Solver Comparison](https://www.ojalgo.org/2022/05/iterative-solver-comparison/) - [Introducing BatchNode](https://www.ojalgo.org/2022/05/introducing-batchnode/) - [Common Mistake](https://www.ojalgo.org/2021/08/common-mistake/): a frequent misuse of the API and how to avoid it - [Working With Arrays](https://www.ojalgo.org/2021/08/working-with-arrays/): off-heap, file-backed and sparse array structures - [Artificial Neural Network Example v2](https://www.ojalgo.org/2021/08/artificial-neural-network-example-v2/) - [Sparse and Special Structure Matrices](https://www.ojalgo.org/2020/09/sparse-and-special-structure-matrices/): sparse arrays and matrices, and working with structured matrices - [Neural Network New Features in v48.3](https://www.ojalgo.org/2020/09/neural-network-new-features-in-v48-3/) - [Controlling Concurrency](https://www.ojalgo.org/2019/08/controlling-concurrency/): how ojAlgo decides on parallelism, and how to constrain it - [Generalised Eigenvalue Problems](https://www.ojalgo.org/2019/08/generalised-eigenvalue-problems/) - [ojAlgo v47.1.1 & ojAlgo-finance v2.1 – Time Series Data](https://www.ojalgo.org/2019/04/ojalgo-v47-1-ojalgo-finance-v2-1-financial-time-series-data/) - [StatQuest PCA Example](https://www.ojalgo.org/2019/03/statquest-pca-example/): principal component analysis worked through - [Neural Network Basics](https://www.ojalgo.org/2018/09/neural-network-basics/) - [Introducing Artificial Neural Networks with ojAlgo](https://www.ojalgo.org/2018/09/introducing-artificial-neural-networks-with-ojalgo/): basic neural network support — a demonstration of the underlying array and matrix machinery, not a competitor to dedicated deep learning frameworks ## Benchmarks and performance - [Java Matrix Benchmark](https://www.ojalgo.org/2022/02/java-matrix-benchmark/) - [JDK17 Benchmark](https://www.ojalgo.org/2021/11/jdk17-benchmark/) - [HotSpot vs GraalVM CE & EE](https://www.ojalgo.org/2019/11/hotspot-vs-graalvm-ce-ee/) - [AdoptOpenJDK HotSpot vs OpenJ9](https://www.ojalgo.org/2019/11/adoptopenjdk-hotspot-vs-openj9/) - [AdoptOpenJDK v12](https://www.ojalgo.org/2019/04/adoptopenjdk-v12/) - [Oracle’s JVMs HotSpot, Graal CE & Graal EE](https://www.ojalgo.org/2019/02/oracles-jvms-hotspot-graal-ce-graal-ee/) - [Quick test to compare HotSpot and OpenJ9](https://www.ojalgo.org/2019/02/quick-test-to-compare-hotspot-and-openj9/) - [New Java Matrix Benchmark Results Coming](https://www.ojalgo.org/2018/05/new-java-matrix-benchmark-results-coming/) - [Matrix multiplication on different JVMs](https://www.ojalgo.org/2018/03/matrix-multiplication-on-different-jvms/) ## Recent releases - [ojAlgo v57](https://www.ojalgo.org/2026/06/ojalgo-v57/) - [ojAlgo v53.1.0](https://www.ojalgo.org/2023/09/ojalgo-v53-1-0/) - [ojAlgo 20 Years Today](https://www.ojalgo.org/2023/04/ojalgo-20-years-today/) - [ojAlgo v52](https://www.ojalgo.org/2022/09/ojalgo-v52/) - [v51 with the return of ojAlgo-finance](https://www.ojalgo.org/2022/02/v51-with-the-return-of-ojalgo-finance/) - [ojAlgo v48.0.0](https://www.ojalgo.org/2019/11/ojalgo-v48-0-0/) ## Optional - [ojAlgo skills for coding agents](https://github.com/optimatika/ojAlgo-skills): Agent Skills (SKILL.md) that teach coding assistants to write correct ojAlgo optimisation models, and to solve models on the Optimisation Service through its REST API, its Java client or existing ojAlgo code. Listed in Claude's plugin directory as "ojAlgo"; also installable as a Claude Code plugin. - [Archive](https://www.ojalgo.org/blog/): every article, by date. - [Optimatika](https://www.optimatika.se/): Optimatika AB develops and maintains ojAlgo, and sells support plus a solver server for models that need more solving power than the built-in solvers deliver. ojAlgo itself remains MIT licensed and free to embed in commercial products, at no cost.