linear-programming

R: Isotonic regression Minimisation

时光总嘲笑我的痴心妄想 提交于 2019-12-11 12:05:51
问题 I want minimize the following equation: F=SUM{u 1:20}sum{w 1:10} Quw(ruw-yuw) with the following constraints: yuw >= yu,w+1 yuw >= yu-1,w y20,0 >= 100 y0,10 >= 0 I have a 20*10 ruw and 20*10 quw matrix, I now need to generate a yuw matrix which adheres to the constraints. I am coding in R and am familiar with the lpsolve and optimx packages, but don't know how to use them for this particular question. 回答1: Because Quw and ruw are both data, all constraints as well as the objective are linear

cplex.linear_constraints.add too slow for large models

半世苍凉 提交于 2019-12-11 10:49:28
问题 I've been trying to use cplex to solve an optimal transportation problem. The problem model is normally very large (in my description below the total number of variables are 1048576 (= 1024^2), and the number of constraints is 2048). My problem is that the process of adding constraints is far too slow to be practical ( the time spent in solving the model is fine though). I googled this issue, there are some tips, but still I couldn't find a feasible solution. The problem is as follows: Given

LP relaxation in SCIP

梦想的初衷 提交于 2019-12-11 08:28:59
问题 I'm trying to solve a MIP using the SCIP command line, with the problem input in CPLEX LP format. However, due to large number of variables, the optimization is taking a lot of time. Is there some way to compute the LP Relaxtion solution of the same MIP in SCIP? Or any other way to get an approximate, somewhat suboptimal solution? 回答1: If you are just interested in the LP relaxation you should try to use SoPlex to solve your problem. If you want to limit the computation time in SCIP you can

solving multiple equations with many variables and inequality constraints

戏子无情 提交于 2019-12-11 08:06:17
问题 I am trying to solve a problem with many variables using scipy and linear programming. I have a set of variables X which are real numbers between 0.5 and 3 and I have to solve the following equations : 346 <= x0*C0 + x1*C1 + x2*C2 +......xN*CN <= 468 25 <= x0*p0 + x1*p1 + x2*p2 +......xN*pN <= 33 12 <= x0*c0 + x1*c1 + x2*c2 +......xN*cN <= 17 22 <= x0*f0 + x1*f1 + x2*f2 +......xN*fN <= 30 the numbers C0...CN , p0...pN , c0...cN , f0...fN are already given to me. I tried to solve this in the

I there a way to specify two constraints for the same variable when using Puthon PuLP for a linear program

做~自己de王妃 提交于 2019-12-11 04:46:47
问题 I was wondering if there is a way two have a variable with two different constraints when using Python PuLP. prob += lpSum([evaptwohundredF[i] * component_vars[i] for i in name]) >= 30.0000, "evaptwohundredFrequirement" prob += lpSum([evaptwohundredF[i] * component_vars[i] for i in name]) <=70.0000, "evaptwohundredFrequirement" This is an example fo what i would want where the same variable has two constraints so >= 30 and <= 70, but the problem is that i get an error which says 'pulp

Gurobi reports unbounded model despite mathematical impossibility

廉价感情. 提交于 2019-12-11 04:15:44
问题 I'm using Julia's wonderful JuMP package to solve a linear program with Gurobi 6.0.4 as a solver. The objective function is a sum of decision variables, clearly defined as nonnegative, and the problem requires it to be minimized. For some reason, Gurobi thinks the model is unbounded. Here is the definition of the variables and the objective: @defVar(model, delta2[i=irange,j=pair[i]] >= 0) @setObjective(model, Min, sum{delta2[i,j], i=irange, j=pair[i]}) Strange observation #1: although this is

Why does scipy.optimize.linprog return a solution that does not satisfy constraints?

拈花ヽ惹草 提交于 2019-12-11 02:18:02
问题 Am I doing something wrong or it is a bug? c = np.array([-1., 0., 0., 0., 0., 0., 0., 0., 0.]) A_ub = np.array([[ 1., -724., 911., -551., -555., -896., 478., -80., -293.], [ 1., 566., 42., 937., 233., 883., 392., -909., 57.], [ 1., -208., -894., 539., 321., 532., -924., 942., 55.], [ 1., 857., -859., 83., 462., -265., -971., 826., 482.], [ 1., 314., -424., 245., -424., 194., -443., -104., -429.], [ 1., 540., 679., 361., 149., -827., 876., 633., 302.], [ 0., -1., -0., -0., -0., -0., -0., -0.,

Iterative use of bintprog on MATLAB

寵の児 提交于 2019-12-11 02:16:38
问题 We have a problem formulation as shown in this link. Considering that the first call of bintprog gives a solution x that after some post processing does not adequately addresses the physical problem, is it possible to recall bintprog and exclude the prior solution x ? 回答1: You need a nogood cut. Suppose you find a solution \hat{x} that you then decide is infeasible (through some sort of post-processing). Let x and \hat{x} be indexed by i. You can add a constraint of the following form: \sum_

Integer Linear Programming Java: Multiple Open Source and Commercial tools are available. Which one to use?

99封情书 提交于 2019-12-11 01:37:50
问题 I need to use Integer Linear Programming API/Tool for my application. Though my application is in Java but I don’t mind calling an EXE (Tool) from Java providing input using file (MPS, etc). My search analysis is as follows: There are multiple Open Source and Commercial tools available to solve ILP Following I found and think are useful for my needs. 1. Gnu LP Kit(GLPK): I think this is the oldest and probably most stable and efficient 2. IP_Solve: Has good reviews about it. 3. JavaILP: Found

How to select n objects from a set of N objects, maximizing the sum of pairwise distances between them

浪子不回头ぞ 提交于 2019-12-11 00:20:03
问题 You have a set of N=400 objects, each having its own coordinates in a, say, 19-dimensional space. You calculate the (Euclidean) distance matrix (all pairwise distances). Now you want to select n=50 objects, such that the sum of all pairwise distances between the selected objects is maximal. I devised a way to solve this by linear programming (code below, for a smaller example), but it seems inefficient to me, because I am using N*(N-1)/2 binary variables, corresponding to all the non