Search code examples
javamathematical-optimizationlinear-programming

Convex optimization, java


I'm looking for a Java library to solve this problem:

enter image description here

We know X is sparse(most of it's entries are zero), so X can be recovered by solving this:

   variable X;
   minimize(norm(X,1)+norm(A*X - Y,2));

It's a MATLAB code, matrix A and vector Y are known and I want the best X.

I saw JOptimizer, but I couldn't use it. (Doesn't have good documentation or examples).


Solution

  • What you need is a reasonably good LP Solver.

    Possible Java LP Solver Options

    1. Apache Commons (Math) Simplex Solver. See this blog post.

    2. If you have access to CPLEX (not-free), its Java API would work great.

    3. Also, you can look into SuanShu, a Java numerical and statistical library

    4. lpSolve has a Java wrapper which can do the job.

    5. Finally, JOptimizer is indeed a good option. Not sure if you looked at this example.

    Hope at least one of those help.