Software Solver for Java

My problem is trying to solve a binary integer program through Java. I want to start a series of experiments, and the integral component of these experiments is to solve an integer program where the variables are limited between 0 and 1.

In the past, I solved such problems in MatLab, with the bintprog function. Looking for such a function (or class? I am very new to Java) for use in Java, I came up empty-handed.

Is there a Java library for solving entire programs that have really good documentation?

In my search, I saw offers to use a package called LP_Solve , on which the Java shell was built, and a similar shell built for a package called GLPK (wrappers here and here ) (which I used earlier). The problem with these tools is that they are not strictly intended for Java and, therefore, do not have the documentation that I think I need, and even worse, they have complex instructions that even begin to use them in my own code. Since I'm currently learning the Java language, I wonder if there are any really good packages for solving binary whole programs, mixed whole linear programs, or just whole programs from my own Java code.

As a side note, I really don't want to switch to another language, because I build past code and classes that perform the tasks that I want.

+4
source share
4 answers

LP_Solve with a Java wrapper is what I will use. This is a free algorithm for solving a mixed integer linear program. LP_Solve for Java is very easy to install after these instructions . The packages you download include files with lots of code samples that I found useful. The only part of the installation that slowed me down was to join the Yahoo group to find the files to download.

+1
source

IBM cplex, although the c library has java wrappers and documentation

0
source

if you want the values ​​0 or 1 to try to use the bool data type ... if you look at probabilities (which lie between 0 and 1), try limiting the float value so that it is> = 0 and <= 1;

-1
source

Source: https://habr.com/ru/post/1340808/


All Articles