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

lpSolve - find maximum value - formula with multiplications

I'm looking for a way to use lpSolve in a similar way to how I use it succesfully in Excel. I've calculated elasticity for various product. Based on whether a product is elasticity or not elastic I want to give an advice on which price to ask. I…
0
votes
1 answer

Adding priority to rows in LpsolveAPI in R

I have an optimised time allocation lp code in R using LpSolverAPI. The code works fine with the given constraints which are : The time allotted per job must be met The time a worker works cannot exceed the paid work time But, i need to add a…
MysticRenge
  • 373
  • 1
  • 4
  • 13
0
votes
0 answers

How to set up a Linear Programming Problem with lpSolveAPI in R

I'm running into a problem setting up a linear programming problem in R using lpSolveAPI. I have up to seven decision variables and would like to select the variables that maximize a linear reward function within some budget. An additional…
coolhand
  • 1,876
  • 5
  • 25
  • 46
0
votes
0 answers

Unable to load dynamic library 'phplpsolve55.so' undefined symbol: zif_drivername

I am on Debian Buster running in a LXC container. I use a self-compilied version for php of lpsolve. I install it using this commands from makao/lpsolve.md The sources I use come from this repo: myfarms/php_lp_solve While I was able to compile the…
0
votes
1 answer

lpsolve with constraints in r

I would like to use R to solve an optimization problem using the lpSolve which can perform processes similar to the solver add-in in excel. Below is a simple case where I would like to maximize npv value specifically using…
jsimpsno
  • 448
  • 4
  • 19
0
votes
1 answer

lpSolve running for extended period of time without finishing

I am trying to optimize a transportation problem in R using lpSolve::lp.transport. My code is as follows: library(lpSolve) cost <- matrix(rep(100, 34968), nrow = 372) row.signs <- rep("<=", 372) row.RHS <- c(t(vehicleGVWR2[,2])) col.signs <-…
0
votes
0 answers

Digit Accuracy in lpsolve55

I am using the lpsolve55 library in python to find some linear programming solutions. The input data that is loaded needs to have up to 14 digits accuracy, but when the lp solver writes the problem to a file the accuracy is only 11 digits. How can I…
0
votes
2 answers

Use sum of binary values as constraint coefficient in integer programming constraint

I am trying to formulate a shelf-optimization integer programming algorithm in lpsolveAPI and wish to add a constraint whereby the same number of each product is on each selected shelf (S): f My difficulty is accessing and using the sums as…
0
votes
0 answers

R LPSolve optimization

I am trying to solve a linear programming problem. My goal is to minimize the interest rate risk of a given bond at various parts of the interest rate curve, using Tsy futures. fut_dur = the total risk of 5 different Tsy futures, fut_krd = the…
0
votes
0 answers

Assignment using LpSolveAPI, how to fill the parameters in a breadthfirst-like way?

Firstly, I have a basic understanding of linear programming and may not know the correct terminology. I think what I need is a breadth-first solver. I have two tables of probabilities, which I would like to to use as constraints. My objective…
JasTonAChair
  • 1,948
  • 1
  • 19
  • 31
0
votes
0 answers

Why is lpSolveAPI solver slower when run the second time?

The lpSolveAPI package in R lets you specify and solve a linear program. However calling solve() on an already solved LP is significantly slower than solving the LP to begin with. Why does this happen, and how can this problem be avoided? Here is a…
0
votes
1 answer

R: Optimization problem with equal coefficients

I would like to optimize a simple function such as: max = a1 * x1 + a2 * x2 + a3 * x3 where the x's are known in advance and a1 + a2 + a3 = limit. Furthermore, I need to add a constraint where a1 = a2 = a3. Would some know how this can be…
roro
  • 1
0
votes
0 answers

Lpsolver not downloading, Rstudio

I am working with the 3.3.1 version of R studio and I am trying to download the package lpsolve but it is not working. So far I have tried (many times) Downloading LpSolve in RStudio: Tools>Install Packages> Lpsolve Defining LpSolve as a separate…
0
votes
1 answer

how to retrieve values of variables in the optimised objective function using Lpsolve in R

Im trying to find the values of x and y at the optimized objective function. This is the code for finding the optimum that i used objective.in=c(6.55,7.9) const.mat=matrix(c(0.25,0,0.25,0.5,0.5,0.5),nrow=3,byrow =…
sonus vareed
  • 31
  • 1
  • 8
0
votes
1 answer

What is the proper way to declare binary variables in lpsolve?

Having a problem getting a ilp to run. Resorted to the following small code for testing. None of them work. min: x1 + 10 x2 + 100 x3 + 1000 x4; x1 + x2 + x3 + x4 + x5 >= 3; /* Variable bounds */ //bin x1 x2 x3 x4 x5; // parse error //bin : x1 x2 x3…
cswor
  • 1
  • 2