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
1 answer

lpsolve API in R: Edit column

I'm using lpsolveAPI in R and would like to set coefficients for specified columns and rows (coefficient for specified constraint number and decision variable number). However, whereas I can add new column (new decision variable) or set existing…
Asayat
  • 645
  • 10
  • 23
1
vote
1 answer

php array error with lpsolve

I created a basic LP model, input the objective function into an array by hand and the model worked fine: $ret = lpsolve('set_obj_fn', $lp, array(1, 3, 7, 2)); I moved the array out and referenced it with a variable in the lp_solve function and…
1
vote
0 answers

Installing LPSolve for Matlab on Windows

I'm really stuck and need some help. I'm trying to install lpsolve for use with Matlab. I've tried following the instructions on the lpsolve webpage but don't find them very helpful. I've downloaded: lp_solve_5.5.2.0_MATLAB_exe_win64 …
Alanaj5
  • 37
  • 6
1
vote
1 answer

Using numpy arrays with lpsolve?

In the docs, it says you can use numpy arrays: numpy package In the above section Maximum usage of matrices with lpsolve the package numpy was already mentioned. See Link for a brief overview. This package is the successor of the older and obsolete…
AturSams
  • 7,568
  • 18
  • 64
  • 98
1
vote
1 answer

Load all constraints into Linear Programming object - lpSolveAPI

Hello and thanks in advance. I'm using the package lpSolveAPI to solve a linear programming problem. When I create my Linear Programming object then add my constraints, I'm iterating through all the rows in my constraint matrix mat and adding…
gtnbz2nyt
  • 1,465
  • 3
  • 17
  • 33
1
vote
1 answer

cutting stock optimization/waste minimize in r using lpsolve/lpsolveapi

I am having a tough time understanding the how to formulate code to a cutting stock problem. I have searched the web extensively and I see a lot of theory but no actual examples. The majority of query results point to the wikipedia page:…
runningbirds
  • 6,235
  • 13
  • 55
  • 94
1
vote
1 answer

AMPL IDE: unable to use lpsolve

I downloaded and extracted amplide-demo-linux64.tar.gz to /opt/amplide/. Then I downloaded lp_solve_5.5.2.0_exe_ux32.tar.gz and extracted file lpsolve to /opt/amplide/ampl/. And I have liblpsolve55.so under directory suggested on AMPL…
kjrz
  • 17
  • 3
1
vote
1 answer

Parse Error on line 2 LPSolve

I am new to LpSolve and im trying to solve a problem but i keep getting parse error and cant get the answer right. I cant find my mistake. here is my code: http://pastebin.com/wtzeDXVS
1
vote
0 answers

R: object of type 'externalptr' is not subsettable Issue

I created a Linear Programming model as follows: require(lpSolveAPI) % defining data liab<--c(100,500,200,400,210,-600,100,900,500,400,600,810,100) num_times<-length(liab) % details the rates of interest money <- 0.5/100; shorttermrate <-…
user131983
  • 3,787
  • 4
  • 27
  • 42
1
vote
2 answers

lp file format, how to multiply to variables

I am trying to use an lp file with this syntax: http://www.rpi.edu/dept/math/math-programming/cplex66/sun4x_58/doc/refman/html/appendixE13.html although it says that multiplication is like this: a * b the * gives me a syntax error. Any ideas? I…
Kyriakos
  • 757
  • 8
  • 23
1
vote
3 answers

How to using linear programming to solve the logical constraints

I wish to use linear programming to solve the below describe in logic. In the below example, n1, n2, n3, b1, b2, b3 are boolean variables. The objective is to minimize c1. Below are the constraints: constraint 1: ((n1==n2 xor n3) && c1==2 && b1 )…
user1487718
1
vote
0 answers

Finding IIS(irreducible infeasible subset) through LPSolve in c#

I am using LPsolve for optimizing a portfolio. I have defined the problem as: I am using the Buy and sell Weights as variables and some constraints like churn which specifies 0<= Sum(B+S) <= 20. Now I have several other constraints along with this.…
k n p
  • 13
  • 3
1
vote
0 answers

lpsolve errors when attempting to run

I am trying to use lpsolve for optimisation in MS Visual C++ 2010. However, I have attempted to follow the instructions on linking the libraries but I still get errors when trying to run the demo available on the lpsolve site. I am on a 64-bit…
1
vote
1 answer

Linear Programs using R

How can we solve a linear program using R? I want to solve the following example: min -a -2b +4c Constraints a + b + s1 = 5 a + 3c -s2 = 10 2b - 3c = 20 a >= 0, b >= 0, c >= 0, s1 >= 0, s2 >= 0 The equations might not make total sense. I just…
kartik
  • 83
  • 1
  • 3
  • 12
1
vote
0 answers

Find solution that does not satisfy the constraints?

I know how to find a solution that satisfies the constraints, but in my case I need to find a solution which does not satisfy the constraints. Is there anyway that lp_solve can do that for me? Lets say I have the following in LP format: max: a; 1 <…
dynamokaj
  • 471
  • 7
  • 19