问题
I'm looking for a good easy to use Java based Quadratic Programming (QP) solver.
Googling around I came across ojAlgo (http://ojalgo.org).
However, I was wondering if there are any other/better alternatives.
回答1:
Have a look at Apache Commons Math. I haven't used ojalgo, and I really can't say I've used Commons Lang enough to be able to provide you with a lot of details, but it did do what I needed.
Description from their website:
Commons Math is a library of lightweight, self-contained mathematics and statistics components addressing the most common problems not available in the Java programming language or Commons Lang.
Guiding principles:
- Real-world application use cases determine development priority.
- This package emphasizes small, easily integrated components rather than large libraries with complex dependencies and configurations.
- All algorithms are fully documented and follow generally accepted best practices.
- In situations where multiple standard algorithms exist, a Strategy pattern is used to support multiple implementations.
- Limited dependencies. No external dependencies beyond Commons components and the core Java platform (at least Java 1.3 up to version 1.2 of the library, at least Java 5 starting with version 2.0 of the library).
回答2:
SuanShu has implemented the Active Set method to solve quadratic programming problem. Examples are found here:
http://www.numericalmethod.com/trac/numericalmethod/browser/public/Examples/src/main/java/com/numericalmethod/suanshu/examples/QuadraticProgramming.java
来源:https://stackoverflow.com/questions/1095517/qp-solver-for-java