Questions tagged [lpsolve]

lp_solve is a free linear (integer) programming solver. The solver is a callable library written in ANSI C.

lp_solve is a free (see LGPL for the GNU lesser general public license) linear (integer) programming solver based on the revised simplex method and the Branch-and-bound method for the integers.

lp_solve solves pure linear, (mixed) integer/binary, semi-continuous and special ordered sets (SOS) models.

It can also be called as a library from different languages like C, VB, .NET, Delphi, Excel, Java, ... It can also be called from AMPL, MATLAB, O-Matrix, Scilab, Octave, R via a driver program. lp_solve is written in ANSI C and can be compiled on many different platforms like linux and WINDOWS.

More details, including an FAQ, and an intro to lp_solve can be found here.

271 questions
0
votes
1 answer

Unable to load "lpsolve55.dll" in VS2015 on 64-bits OS

For a project I am working on, I need to solve a mathematical model. I chose to do this using Microsoft.Solver.Foundation and the SolverFoundation.Plugin.LpSolve plugin. Both associated .dll files for these extension seem to work fine, as VS2015…
Dr.Ripper
  • 89
  • 8
0
votes
0 answers

lp_solve all optimal solutions

I am using the lp_solve java wrapper to find an optimal solution to an IP. Is there an easy way to find all solutions? Or do I have to add new constraints to rule out the current solution and re-solve?
Austen
  • 65
  • 7
0
votes
0 answers

lpsolve - how to define variable to accept values only from two intervals

I need to set up all my variables to accept only values from two intervals, e.g. for var C1: C1 = 0 or 100 <= C1 <= 1000 and so on for each variable. I can specify either first (=0) or second ([100;1000]) constraints for every variable…
Alex
  • 533
  • 4
  • 12
0
votes
0 answers

lpSolve - how to define constraint with discrete values

Is there any way to define constraint for lpSolve as a set of discrete values. E.g., I can define constraint with '<=','=','>=': fn.obj <- c(3.62, 5.19, 7.29, 7.76, 3.82, 4.86, 4.03, 8.81, 9.14) require(lpSolveAPI) ... …
Alex
  • 533
  • 4
  • 12
0
votes
0 answers

Matlab invalid vector using lpsolve

I am using a function in Matlab based on lp_solve. In my case, lp_solve is structured as follows: A = rand (13336,3); %A is made of real numbers between 0 and 1. For this mwe, I thought 'rand' was fine W = [0; 0; 1]; C = A(:,3); B = 1E+09; e =…
Patapunfate
  • 297
  • 1
  • 4
  • 12
0
votes
0 answers

Loading an external class folder in eclipse - java

I am trying to use the LPsolver on a project I am working on. (it contains both jar and DLLs). When I ran it locally it worked (System.loadLibrary("lpsolver")) But now I am trying to upload it to an amazon server which is running tomcat. I can't get…
UserED
  • 33
  • 10
0
votes
1 answer

How to force similarity of variables in an optimization? (with lp_solve)

I have a small example: /* LPSolver */ /* Objective function */ min: -x1 -x2 -x3 -x4 -x5 -x6 + 3; /* Constraints */ C1: +x1 -x2 >= 0; C2: +x3 -x4 >= 0; C3: +x5 -x6 >= 0; C4: -x1 -x2 -x3 -x4 -x5 -x6 + 3 > 0; /* Variable bounds */ x1 <= 1; x2 <=…
mathew11
  • 3,382
  • 3
  • 25
  • 32
0
votes
2 answers

Non-negative ratio constraint with linear programming in lp_solve

With lp_solve I need to constrain the ratio of two linear functions to be non-negative: min: 13.21 y0 + 27.46 y1 + 35.66 y2 + 89.21 y3 + 60.69 y4; y0 + y1 + y2 + y3 + y4 >= 50000; y0 <= 69148; y1 <= 25460; y2 <= 34020; y3 <= 69873; y4 <=…
ABSimon
  • 651
  • 1
  • 6
  • 18
0
votes
1 answer

Combine two calculations with lp_solve (linear programming)

I am new to lp_solve. I would like to combine these two calculations, (because the raw materials are the same...) First Production: min: 13.21 x0 + 27.46 x1 + 35.66 x2 + 89.21 x3 + 60.69 x4; x0 + x1 + x2 + x3 + x4 >= 200000; x0 <=…
ABSimon
  • 651
  • 1
  • 6
  • 18
0
votes
1 answer

Linearize non-linear constraint

I have a problem which may be defined as: max 5 x11 + 6 x12 + 2 x21 + 3 x22 st st. x11,x12,x21,x22 binary x11 + x12 = 1 x21 + x22 = 1 -25 x1 x2 >= 0 I want to check only if both x11 and x21 are 1. How can I linearize this constraint? Or is it…
0
votes
0 answers

LP_Solve Model for This Case

I need help creating a model that can solve the problem below. i01 <= 30; i02 <= 25; a01 = 10; a02 = 12; a03 = 23; The result should be: i01 i02 a01 10 0 a02 12 0 a03 8 15 Is that possible?
Rafael
  • 41
  • 3
0
votes
1 answer

solving a logarithmic equation using lpsolve

is there any chance to solve a logarithmic objective function using lpsolve? indeed, I want to change the first line of the following code in lpsolve IDE to log(x11 b11 + x12 b12 + x21 b21 + x22 b22), but lpsolve can not solve it then. Does anybody…
sdsajjadi
  • 3
  • 5
0
votes
0 answers

Can lp_solve give bounds if a solution cannot be found within a certain time limit?

Gurobi can give bounds of the optimal value if it cannot solve a given problem instance within a certain time limit. Can lp_solve do the same? (Bounds mean an interval in which the optimal value must reside).
xuhdev
  • 8,018
  • 2
  • 41
  • 69
0
votes
1 answer

Linear programming accuracy

I am working on a linear problem to minimize. It is well-defined and uses numbers in range [0;1] mostly. The Excel's linear solver as well as Mathematica's LinearProgramming do find a solution, however as I see it violates one of my constraints in a…
Ghostwriter
  • 2,461
  • 2
  • 16
  • 18
0
votes
0 answers

Lpsolve for php Help installing

I am new here and I really need your help. I am trying to use lpsolve and I would like some help. I followed the steps in the documentation. I also have read everything here that is said about lpsolve for PHP.