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

How to update this outdated example so that ggplot2 does not give "error: use theme instead"

I found a great linear programming example using lpsolveapi. It was mentioned on R bloggers, and the link to the original post can be found here. The Rscript can be downloaded from Github here. The problem is that the code was based on a version of…
user3580643
  • 111
  • 3
  • 11
2
votes
1 answer

How to stich a 2D image mosaic with LPSolve

I'm new to the LPSolve and the toolkit. I'm trying to use the LPSolve IDE to stitch 4 image 1024x1024 tiles. To simplify the task, I use only the x coordinates of the tiles. ------------------------------- | Tile1 |Tile2 | …
2
votes
1 answer

LPSolve, Python and Ubuntu?

I'm trying to install LP solve 5.5 to use with python 2.7 in ubuntu 13.10 64 bit. I'm at my wits end! :,( I have python installed. /home/user/$ python Python 2.7.5+ (default, Sep 19 2013, 13:48:49) [GCC 4.8.1] on linux2 The python path is as…
erichfw
  • 344
  • 3
  • 15
2
votes
1 answer

lpsolve solves the integer linear programming without meeting the given constraints

I am wondering whether any one here uses lpsolve to solve linear programming problem. I have defined a integer linear programming problem in a file where there is a constraint x45=0(there are also other integer variables). After the problem is…
Hao Shen
  • 2,605
  • 3
  • 37
  • 68
2
votes
1 answer

"undefined reference" when trying to use lp_solve in C/C++ on Linux

I'm new to linear programming and C. I am trying to use the lp_solve library to solve a linear equation. The problem is I can't get the demo code to work. As described in the documentation, I downloaded lp_solve_5.5_dev.gz to my Linux machine. I…
zambro
  • 414
  • 1
  • 6
  • 17
2
votes
1 answer

Maximising the benefit of a given scenario

I'm having trouble with a question given to us by my professor: A husband and wife are going on a trip and wish to maximise the benefit of bringing certain items with them. The husband can bring 20kgs and the wife can bring 17kgs. What should they…
Joe Austin
  • 557
  • 7
  • 24
2
votes
2 answers

Custom binaries on Heroku

I'm trying to get the lp_solve library working on Heroku, but can't seem to get it to be recognized. I've tried every resource I've been able to find, including working with vulcan, adding it to the /bin directory of my project, adding it in /vendor…
lobati
  • 9,284
  • 5
  • 40
  • 61
2
votes
0 answers

optimization, lpSolve lp.transport: computational time?

I am trying to run an optimization using lp.transport from the package lpSolve in R, using the generic form lp.transport (cost, "min", row.signs, row.rhs, col.signs, col.rhs) The cost matrix is large, 6791 x 15594. The rows correspond to food…
user12975
  • 121
  • 1
  • 2
  • 9
1
vote
1 answer

How to solve linear programming problem with nxn matrix such that rows and columns sum to given values

I am trying to contract a program on R that solves for the optimal organisation of trade between 243 countries to minimise carbon emissions. I am investigating 4 types of transport - air, water, road and rail. Therefore, I want to solve the…
1
vote
1 answer

Solve a linear programming (LP) problem in R

The function takes in the coefficients of the objective function, the constraints matrix, the right-hand side values for the constraints, the direction of the constraints, and the type of the LP problem (minimization or maximization). It then uses…
proxyy
  • 11
  • 2
1
vote
2 answers

Linear programming/MIP setting up sum of conditional constraints?

I'm trying to set up MIP problem using LpSolve and I'm at a loss on how to set it up. We are trying to allocate resources to various investments, to maximize revenue, subject to a budget constraint. Each business is located in a particular state,…
1
vote
1 answer

optimize network for three connections each in r

I have a list of locations and their weights (calculated distances apart) in a matrix. I would like the optimal solution for each location having 3 connections, minimizing total distance. costs6 <-…
Qwo
  • 15
  • 4
1
vote
0 answers

How to code a minimization Problem of machine Capacity with lpSolve in R?

I have an optimization problem which I'm trying to solve with lpSolve. Imagine you have 17 machines. On some of these machines you can produce product i, on some of them not (here the objective function is 0, on the others it has a certain value…
Chocolino
  • 31
  • 3
1
vote
1 answer

Integer optimization with binary choice variable in R

I am working on an optimization problem in which my choice variable (to build or not) is a binary variable. The photo attached shows the optimal build choices (solved using Solver in Excel). I am trying to replicate this problem in R. Minimizing the…
1
vote
1 answer

How should i set up linear model in R using lpSolve() library

How should i set up the linear model using lpSolve library in R? I have the following code but realized I dont know how to add the constraint library(lpSolveAPI) library(lpSolve) ### create a new lpSolve linear program model object (lps.model <-…
Yogurt
  • 93
  • 1
  • 7