views:

2336

answers:

4

Does anyone know of such a library that performs mathematical optimization (linear programming, convex optimization, or more general types of problems)? I'm looking for something like MATLAB, but with the ability to handle larger problems. Do I have to write my own implementations, or buy one of those commercial products (CPLEX and the like)?

+1  A: 

You may want to look at JScience, it looks pretty complete. (Mathematical structures, linear algebra solving, etc.)

Ryan
Thanks for your answer. Unfortunately JScience stops short of actually implementing optimization algorithms.
Zach Scrivena
A: 

Look into AMPL. The basic edition is free, but it costs money for larger problems. You don't pay for the language; you pay for solvers. It is also possible to upload your code and have it run on their servers.

Scottie T
how is AMPL a good solution for a java environment.
David Nehme
+4  A: 

There is a linear optimization tool called lpsolve. It's written in C (I think) but comes with a Java/JNI wrapper (API is not very OO but it does the job). It's pretty easy to use and I have had it running quite happily and stably in a live system for the last year.

oxbow_lakes
+3  A: 

A good answer is dependent on what you mean by "convex" and "more general" If you are trying to solve large or challenging linear or convex-quadratic optimization problems (especially with a discrete component to them), then it's hard to beat cplex unless money is a big issue for you. It has a clean JNI interface and is available on most major platforms. Dash is a competitor, with a JNI interface and a strong underlying optimization engine. There's an interesting java-based modeling environment called optimj, that allows you to hook into several optimizers, but it requires a license for itself and whatever solvers you get (but there are some free solvers).

The coin-or project has several optimizers and have a project for JNI interface. It is totally free (CPL-style license), but will take more work to set-up and probably not give you the same performance.

David Nehme