Skip to main content
Filter by
Sorted by
Tagged with
3 votes
2 answers
117 views

I'm trying to select 5 values in the first row, 1 value in rows 2-9, and maximize the objective function. The only thing I can't figure out how to embed in the problem is that I can only choose a ...
BSHuniversity's user avatar
1 vote
0 answers
55 views

So I'm a big fan of the LPSolve Package in R, but one of its weaknesses is trying to find a way to achieve multi-objective optimization (with the already existing set of constraints). I've got my code ...
mmagness's user avatar
0 votes
1 answer
85 views

Given a set of 140 options, my goal is to select the set of options that minimize the objective function and acheive a constraint that weight must be > 5584 units. Criteria 1 is the objective ...
Ira S's user avatar
  • 111
0 votes
1 answer
107 views

I am trying to create a linear programming model that will find the optimal mix of bonds to sell that maximizes book yield, exceed a certain market value, do not fall below a certain gain/loss amount, ...
mmagness's user avatar
0 votes
1 answer
111 views

I am modelling the logarithm of wages for 154 employees. The predictors are a binary matrix, where the rows are employees, the columns are work competencies, and the intersection is either 1 or 0 (i.e....
Dmitrii Asoskov's user avatar
4 votes
1 answer
357 views

I have a list of animals with their parents, that is used to calculate the relationship between them. I am using the Rsymphony R package to generate matings where each female is crosses only once and ...
Fernando Brito Lopes's user avatar
1 vote
1 answer
123 views

I wrote this code in C# using Or-tools for solve LP problem (LPSolve script down below) public static void test(ConvolutionData data) { Solver solver = Solver.CreateSolver("GLOP"...
mantissa's user avatar
  • 162
4 votes
2 answers
223 views

I have a number of variables denoting equipment I can replace. When replaced, they improve an impact metric, [I]. Each also has an associated annual cost savings [S] and replacement cost [C]. n <- ...
coolhand's user avatar
  • 2,110
1 vote
0 answers
71 views

I want to assign 4 judges to mark 15 entries, such that: Each entry is marked by exactly 2 judges; Each judge marks an equal number of entries (or close to equal given that the number of entries is ...
Hi_Viz's user avatar
  • 59
0 votes
0 answers
190 views

I am trying to run the following R code, about the calculation of the total variation distance library(lpSolve) f.obj <- c(0, 1, 1, 1, 0, 1, 1, 1, 0) f.con <- matrix (c(1, 0, 0, 1, 0, 0, 1, 0, ...
Ommo's user avatar
  • 305
1 vote
1 answer
336 views

I am trying to solve the Capacitated Plant Location Model from this YouTube Video using lp_solve: In Excel the objective function is done using SUMPRODUCT() and I developed this function in JavaScript ...
Alex Vinulescu's user avatar
0 votes
1 answer
78 views

I have a function that calculates the total value given a vector of unique integer numbers. For example, in the problem below i would like to find the maximum value by changing the vector numbers. ...
jsimpsno's user avatar
  • 460
1 vote
1 answer
168 views

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 ...
Lasith's user avatar
  • 11
2 votes
2 answers
123 views

I have a vector of 100 integers, x1, where each element of the vector is in [1, 7]. I want to find, using R, another vector of 100 elements, x2, also containing integers ranging from 1 to 7, that ...
Edward's user avatar
  • 22.4k
0 votes
0 answers
299 views

I am trying to use lpsolve in R to solve the following lp program. I want to maximize the obj function. The constraints are that the variable weights sum up to 1, and the individual weights have to be ...
akennedy12345's user avatar
0 votes
1 answer
128 views

Here is the data I'm working with: structure(list(Name = c("Jokic", "Butler", "Murray", "Adebayo", "Porter", "Gordon", "Martin", &...
Lcsballer1's user avatar
1 vote
1 answer
461 views

I have a linear programming task that I am struggling with. I have formulated the LP problem and have generated some code that appears to function; however, I am suspicious of the outputs and do not ...
Storm 's user avatar
  • 11
0 votes
3 answers
468 views

Problem set: I have 3 different groups that need to be assigned to 6 different locations. Objective: I need to minimize the unused space in each location. Constraints: For each location j, the sum of ...
user21861449's user avatar
0 votes
0 answers
60 views

i have three input matrices: profits: 5x4 matrix. column names plane types 1:4 and for route names rows routes 1:5, profit per route per plane type block hour per plane available: 1x4 matrix. column ...
Sarah's user avatar
  • 1
0 votes
1 answer
315 views

I am using LpSolveAPI package to solve a linear programming problem in R. This gives me one solution, but I would like to know if there are other solutions. Here is an example. Suppose I want to solve ...
Avocado's user avatar
  • 86
2 votes
2 answers
2k views

I would like to solve a large mixed integer programming problem, and I have tried with R, package lpSolveAPI. The problem is large - 410 variables each of which can be either 0 or 1, and about 49422 ...
Avocado's user avatar
  • 86
1 vote
1 answer
1k views

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 ...
proxyy's user avatar
  • 11
2 votes
1 answer
267 views

given a price and calorie matrix, I am trying to solve for the maximum amount of calories possible to buy with $15. I've read the docs for lpSolve + some older answers on here, but I am still having ...
codeweird's user avatar
  • 165
0 votes
1 answer
115 views

Formula, Objective and Constraints library(lpSolve) obj.fun<-c(420,360,300,420,360,300,420,360,300) constr<- matrix(c(1,1,1,1,1,1,1,1,1,20,15,12,20,15,12,20,15, 12,1,1,1,1,1,1,1,1,1,.0013,-.001,...
JFabian's user avatar
1 vote
2 answers
810 views

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. ...
Pewter City's user avatar
0 votes
1 answer
169 views

This is the first time I ask a question on the site. I am working in R and am looking to optimise the total biomethane production as the sum of that allowed by each substrate I mobilise. However, I ...
Nicolas MALET's user avatar
0 votes
2 answers
177 views

I'm having some trouble getting my head around why LPSOLVE can't find a solution to this. min:; x = 1000 ; 5000 - 1 x + 500 y = 0; From inspection, we can see that x = 1000, and y = -8. LPSOLVE ...
Pete's user avatar
  • 1
0 votes
1 answer
115 views

In cell costs[1,3] I need to use NULL or NA. Because in the problem there is a constraint that says that row 1 should not give supplies to column 3. I tried to use 0 but i'm not getting the corrrect ...
AppleJuiceJF's user avatar
1 vote
1 answer
95 views

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's user avatar
  • 15
0 votes
1 answer
143 views

I have a finite number of staff N, and I need to find an optimal schedule (using the least number of staff) meeting the demand Hour of Day Demand 0 d0 1 d1 ... ... 23 d23 where the d0, d1, ..., d23 ...
Elis's user avatar
  • 54
0 votes
0 answers
187 views

I have prepared the following reproducible example showing that lpSolve in R crashes with example 2 and I'm needing some help to identify why so it doesn't crash R. The data and constraints were a bit ...
dhc's user avatar
  • 837
1 vote
1 answer
186 views

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 ...
StrugglingMastersStudent's user avatar
0 votes
1 answer
109 views

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 ...
Frank Beke's user avatar
1 vote
1 answer
717 views

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 ...
Yogurt's user avatar
  • 93
1 vote
2 answers
2k views

I have the following problem. I have n (typically n = 1000) data points (integers from {1,2,3}, so there are a lot of repeting numbers) and a real number d. I have to choose k<n points (k is given) ...
treskov's user avatar
  • 328
0 votes
1 answer
64 views

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 ...
MysticRenge's user avatar
1 vote
1 answer
173 views

I am trying to solve linear optimization problem. I have 100 players with score and price for each player. My goal is to select 11 players and to maximize possible score while staying within budget (...
Андрій zOFsky's user avatar
1 vote
2 answers
190 views

Can lp_solve return a unifrom solution? (Is there a flag or something that will force this kinf of behavior?) Say that I have this: max: x + y + z + w; x + y + z + w <= 100; Results in: Actual ...
user avatar
1 vote
1 answer
682 views

Solving an integer programming problem with R, the model is: # variables: x1, x2, x3 max z = 25000x1 + 18000x2 + 31000x3 s.t.: x1 + x2 + x3 = 100 5000x1 + 11000x2 + 7000x3 <= 700000 x1 >= 10 ...
Mark K's user avatar
  • 9,506
0 votes
0 answers
250 views

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 ...
coolhand's user avatar
  • 2,110
0 votes
1 answer
330 views

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: ...
remoteclient's user avatar
0 votes
1 answer
301 views

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 ...
jsimpsno's user avatar
  • 460
2 votes
1 answer
308 views

I was researching methods to rank forecasts and found this paper, A novel ranking procedure for forecasting approaches using Data Envelopment Analysis, I've been working through the article and ...
KrutonCrab's user avatar
0 votes
1 answer
480 views

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("<...
Haley Talton's user avatar
1 vote
0 answers
121 views

Trying to form an LP-based clustering problem in R with binary variables. sample dataset: set.seed(123) id<- seq(1:50) lon <- rnorm(50, 88.5, 0.125) lat <- rnorm(50, 22.4, 0.15) demand <- ...
Shibaprasad's user avatar
  • 1,332
1 vote
1 answer
250 views

I am using the Java wrapper for LPsolve and I have a cost function with the traditional initial fixed cost + operating costs in the cost function How can I add this constraint that if y_i = 0, p_i ...
Platypenguin's user avatar
0 votes
0 answers
104 views

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 ...
CyberHunter's user avatar
0 votes
2 answers
697 views

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 ...
David Christopher Siddons's user avatar
1 vote
1 answer
450 views

Has anyone tried to replicate The Stigler Diet problen in R? So far this is what I have: library(lpSolve) library(linprog) # where d is the nutrients data frame found in the above link f.obj_ <- ...
Antarqui's user avatar
  • 508
0 votes
0 answers
91 views

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 ...
akennedy12345's user avatar

1
2 3 4 5 6