linear-programming

mathematical optimization library for Java --- free or open source recommendations?

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 l...

Solving an inequality for minimum value

I'm working on a programming problem which boils down to a set of an equation and inequality: x[0]*a[0] + x[1]*a[1] + ... x[n]*a[n] >= D x[0]*b[0] + x[1]*b[1] + ... x[n]*b[n] = C I want to solve for the values of X that will give the absolute minimum of C, given the input D and lists and A and B consisting of a[0 - n] and b[0 - n ]. ...

Linear Programming Tool/Libraries for Java

I'd like to set up a large linear programming model to solve an interesting problem. I would be most comfortable in Java. What tools/libraries are available? ...

Linear Programming Problem with Complication

I'm trying to solve a problem that looks like a standard Linear Programming problem with one twist. We have as input a set of "phrases" each of which has a weight. We need to choose how many times to repeat each phrase in a text to maximize the total weight, subject to a max character length limitation. This seems like a straightforwa...

Best open source Mixed Integer Optimization Solver

I am using CPLEX for solving huge optimization models (more than 100k variables) now I'd like to see if I can find an open source alternative, I solve mixed integer problems (MILP) and CPLEX works great but it is very expensive if we want to scale so I really need to find an alternative or start writing our own ad-hoc optimization librar...

Java Library? - Simplex / Linear Programming / Optimization

I'm looking for an optimization library. My two requirements are that it does not use JNI and that it does not have license restrictions preventing it from being used on multiple computers commercially. The only one I've found that meets these requirements is Choco, but it is unusably buggy. ...

Which algorithm for assigning shifts (discrete optimization problem)

I'm developing an application that optimally assigns shifts to nurses in a hospital. I believe this is a linear programming problem with discrete variables, and therefore probably NP-hard: For each day, each nurse (ca. 15-20) is assigned a shift There is a small number (ca. 6) of different shifts There is a considerable number of const...

How do I solve a set of constraints in Perl?

I have the following set of constraints in Perl (just a sample set of constraints, not the ones I really need): $a < $b $b > $c $a is odd => $a in [10..18] $a > 0 $c < 30 And I need to find a list ($a, $b, $c) that meet the constraints. My naive solution is sub check_constraint { my ($a, $b, $c) = @_; if !($a < $b) {return 0...

number of possible combinations in a partitioning

Given is a set S of size n, which is partitioned into classes (s1,..,sk) of sizes n1,..,nk. Naturally, it holds that n = n1+...+nk. I am interested in finding out the number of ways in which I can combine elements of this partitioning so that each combination contains exactly one element of each class. Since I can choose n1 elements fr...

The GNU Linear Programming Kit

Has anyone used the GLPK for production systems? I have an application currently powered by CPLEX and wish to replace it with a free software alternative. It is used to solve a large MIP (thousands of variables) for a scheduling problem. I would like to know whether GLPK is mature enough to handle this. Thanks ...

LP Simplex algorithm in C++

I need the robust C++ source code of the simplex algorithm (is a popular algorithm for numerical solution of the linear programming problem). Please, no links to wikipedia. I need good source code in C++, using templates, clear user-friendly names and work very well. Preferably algorithm must check the unstable floating-point calcula...

How to solve a system of inequalities?

I've reduced my problem (table layout algorithm) to the following problem: Imagine I have N variables X1, X2, ..., XN. I also have some (undetermined) number of inequalities, like: X1 >= 2 x2 + X3 >= 13 etc. Each inequalities is a sum of one or more variables, and it is always compared to a constant by using the >= operator. I cannot ...

Linear Independence Matrix

Suppose we have a m by n matrix A with rank m and a set K⊆{1..n} such that the columns of A indexed by K are linearly independent. Now we want to extend K and find a set L so that k⊆L and columns indexed by L are linearly independent too. One way of doing it would be to start adding column indexes to K and test if the new set are linear...

Integer Linear Programming Java: Multiple Open Source and Commercial tools are available. Which one to use?

Hi, I need to use Integer Linear Programming API/Tool for my application. Though my application is in Java but I don’t mind calling an EXE (Tool) from Java providing input using file (MPS, etc). My search analysis is as follows: There are multiple Open Source and Commercial tools available to solve ILP Following I found and think are ...

Integer linear programming: example and good tools?

Find a vector x which minimizes c . x subject to the constraint m . x >= b, x integer. Here's a sample input set: c : {1,2,3} m : {{1,0,0}, {0,1,0}, {1,0,1}} b : {1,1,1} With output: x = {1,1,0} What are good tools for solving this sort of problem, and examples of how to use them? ...

NSPredicate as a constraint solver?

I'm working on a project which includes some slightly more complex dynamic layout of interface elements than what I'm used to. I always feel stupid writing complex code that checks if so-and-so is close to such-and-such and in that case move it x% in some direction, etc. That's just not how programming should be done. Programming should ...

ILOG CPLEX: how to populate IloLPMatrix while using addGe to set up the model?

I have a queatoin about IloLPMatrix and addGe. I was trying to follow the example of AdMIPex5.java to generate user defined cutting planes based on the solution to the LP relaxation. The difference is that eh initial MIP model is not read in from a mps file, but set up in the code using methods like addGe, addLe etc. I think this is wh...

Which linear programming package should I use for high numbers of constraints and "warm starts"

I have a "continuous" linear programming problem that involves maximizing a linear function over a curved convex space. In typical LP problems, the convex space is a polytope, but in this case the convex space is piecewise curved -- that is, it has faces, edges, and vertices, but the edges aren't straight and the faces aren't flat. Ins...

Why is glpk-java.jar not the same across all platforms?

I'm using glpk-java in one of my projects. It provides a JNI to GLPK, a free LP/MIP solver. To use it under different platforms, you need different shared libraries (libglpk.so under Linux, libglpk.dylib under Mac OS X, glpk.dll under Windows) which is fully understandable. In addition, a java library is needed: glpk-java.jar. It's creat...

Python MPS-format reader

I need to read MPS files into Python. [MPS is an old and standard format for representing linear programs.] Pure Python would be best, but I would be happy to use f2py if it meant that I could easily leverage existing Fortran MPS readers. Any pointers welcome! ...