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
1
vote
0 answers

Quality of fit in LpSolve

I am using LPSolve for a system with approximately 40,000 variables, 100 sum-of-a1*x1 = c1 constraints and 40,000 x1 < n constraints. Normally I am getting a solution, but occasionally LPSolve doesnt reach a solution whereas running the same data…
Penguino
  • 2,136
  • 1
  • 14
  • 21
1
vote
1 answer

Compile and build lp_solve from source code, ubuntu

I am using ubuntu machine and I've downloaded lp_solve source (lp_solve_5.5.2.5_source.tar.gz) and unpack it. Then I cd my command prompt into the path, lp_solve_5.5/lpsolve55. Then I run command ./ccc Then I got this error and created empty bin…
1
vote
0 answers

iteratively finding the best k solutions to linear/binary programming problems

I am solving a maximization binary programming problem (binary programming is the same as integer programming but the solution is a vector of 0's and 1's). I would like to find the best 10 solutions. I don't mean the best 10 solutions where all 10…
1
vote
0 answers

compiling c++ with external library : lpsolve

I am trying to compile a program written in C++ using the lpsolve external library. I have written the following line in my .cpp : #include However, when I'm trying to compile this using g++, I get this weird message…
Guillaume Leseur
  • 140
  • 1
  • 1
  • 15
1
vote
1 answer

Finding optimal project team using R

I'm just starting to learn R and have run into something that I'm not sure how to handle in code. I'm creating a data.frame with a pool of individuals who are available to be assigned to a project. The project needs one BA, one PM, two SA, and…
M3SSYM4RV1N
  • 135
  • 10
1
vote
1 answer

LPsolve Hybrid constraints

I use the following R code to optimize Soccer lineups for my fantasy sports league. It has been working great up until now, but a new wrinkle has been added into the list of constraints that I would like to resolve. A lineup consists of 8 players.…
1
vote
1 answer

R Team Roster constraint with lpsolve - must pick at least x players from Team

I'm having trouble trying to build on the foundation of a previous question I'd like to optimize so there are at least 3 players from the same team, but I don't care which team it is. In the code below I can brute-force it to pick 3 players from the…
spantz
  • 11
  • 4
1
vote
1 answer

lpsolve - results are different every time I change the order of constraints

I have noticed a strange behaviour of lpsolve library (using it in python 3.4). When I change the order of constraints which I add to the lpsolve model the results are also slightly different. Will be glad for any hints why this is happening. Adding…
Alex
  • 533
  • 4
  • 12
1
vote
1 answer

LPSolve C++ source library and IDE gives different LP task solution results

I have LP task. The problem has appeared suddenly. I use automated code for create the objective function, equations and constrains, from two vectors of nodes and lines, also I use the method for create code of my tas in LPSolve format and write it…
Ja_Dim
  • 143
  • 7
1
vote
0 answers

Method readLp from LPSolve library called doesn't parse float values when it is called from Java

I am using LPSolve from Java and I need to use a decimal constant value but it ignores the digits after the point. For example: The follow lp model (in lp format): max: 0.5 x1; r_1: x1 <= 5; It has an objective function's "optimal value" of 0…
fraverta
  • 75
  • 1
  • 13
1
vote
1 answer

Freeing lpsolve memory

I'm working on a C++ project that involves using lpsolve version 5.5 to solve many linear programs. I'm having trouble with memory leaks. I wrote some test-code: int main(){ for(int i = 0; i < 100; i++){ lprec* lp = make_lp(0, 5000); //0…
1
vote
1 answer

How to substitute variable at lpSolveAPI in R

I'am doing solve the linear program by lpSolveAPI and I want to substitute object function's variable for subject to's variable. for example, i mimic orignal my lp like this x5 <- x1 + x2 x6 <- x2 + x3 + x4 object funtion min x5 + x6 subject…
MINGYU LEE
  • 13
  • 2
1
vote
2 answers

dramatic error in lp_solve?

I've a simple problem that I passed to lp_solve via the IDE (5.5.2.0) /* Objective function */ max: +r1 +r2; /* Constraints */ R1: +r1 +r2 <= 4; R2: +r1 -2 b1 = 0; R3: +r2 -3 b2 = 0; /* Variable bounds */ b1 <= 1; b2 <= 1; /* Integer definitions…
Michael Hecht
  • 2,093
  • 6
  • 25
  • 37
1
vote
2 answers

Assign weights in lpSolveAPI to prioritise variables

I am trying to set up a linear programming solution using lpSolveAPI and R to solve a scheduling problem. Below is a small sample of the data; the minutes required for each session id, and their 'preferred' order/weight. id <- 1:100 min <-…
sactyr
  • 172
  • 1
  • 1
  • 14
1
vote
1 answer

How can I make use of an 'OR' statement in a linear program?

I am interested in building what is essentially an or statement in a linear program. Currently I am using lpSolveAPI in R, but I also hope to get answers on the best practices in linear programming for this type of problem. Here is some working…
rrbest
  • 1,619
  • 3
  • 14
  • 22