Linear program solvers in Java

This post summarizes my exploration of programs that can solve linear programming (LP) problems in Java using one of the standard solvers. I will keep updating it as I learn more about the solvers and ways to make them work.

I have had a bit frustrating start on finding a thing that actually works. Here are the free resources that I tried:
  1. SCPSolver: The website says that this tool enables a java programmer to solve an LP in 5 minutes. The caveat is the solution doesn't work for 64 bit JVM. I must install a 32-bit JDK, but that impacts the way other components of my code work!
  2. Java ILP: A Java interface for integer and linear programs, but it requires installing a separate solver as well.
It was frustrating because all these tools required me to install new software on my machine, which requires administrative rights on a UT machine. Hopefully, someone from our IT department will reply back to me soon.

UPDATE:
I finally had to resort to CPLEX, which is a paid software, though available for free to faculty members and students (also because it has its potential advantages of having all optimization solvers in one place).

After a bit of struggle, I finally got CPLEX to work with Java. For future references, here are the steps I followed:

  1. Download CPLEX for students online (visit IBM website)
  2. Install the optimization package (the whole software occupies around 4GB on your hard disk)
  3. Open the Netbeans project properties where CPLEX is intended to be used. Add cplex.jar file as an external jar located in ~\IBM\ILOG\CPLEX_Studio128\cplex\lib. 
  4. Add the reference to the bin folder under cplex to Djava.library.path using command line (or you may set VMoptions under Run properties of the project, but I could not get that to work)
    1. Open cmd
    2. Type the following command: java -Djava.library.path="C:\Program Files\IBM\ILOG\CPLEX_Studio128\cplex\bin\x64_win64"
  5. Run CPLEX commands in Java (the tutorial for which is available online: getting started with CPLEX pdf)

Comments

Popular posts from this blog

New start | Purpose of this blog