# linear-programming

##### 使用现有的线性规划工具找到所有替代的基本解决方案(Find all alternative basic solutions using existing linear-programming tool)

2021-09-18 15:01:53    分类:技术分享    linear-programming   glpk   lpsolve

##### 混合整数规划：每个条件的变量赋值（if then else）(Mixed integer programming: variable assignment per condition (if then else))

2021-09-18 12:40:50    分类:技术分享    optimization   mathematical-optimization   linear-programming   scientific-computing   integer-programming

##### 将 gurobi 与 java 一起使用 vs gurobi 与 ampl(Using gurobi with java vs gurobi with ampl)

2021-09-15 15:37:38    分类:技术分享    java   mathematical-optimization   linear-programming   ampl   gurobi

##### RGLPK 中的梦幻足球线性规划(Fantasy football linear programming in R with RGLPK)

2021-09-14 23:12:16    分类:技术分享    r   constraints   mathematical-optimization   linear-programming

##### R 多整数线性规划中的约束(Constraints in R Multiple Integer Linear Programming)

2021-09-14 11:43:45    分类:技术分享    r   optimization   constraints   linear-programming

##### 在 Windows 上安装 GLPK（GNU 线性编程工具包）(Installing GLPK (GNU Linear Programming Kit) on Windows)

2021-09-12 16:55:46    分类:技术分享    gnu   linear-programming

##### Using gurobi with java vs gurobi with ampl

What are the advantages of using Gurobi with AMPL instead of using Gurobi direct API (java, C#, C++, etc.) for solving large MIP problems? Are there performance benefits when using Gurobi's API instead of AMPL?

2021-09-07 10:53:21    分类:问答    java   mathematical-optimization   linear-programming   ampl   gurobi

##### Set up linear programming optimization in R using LpSolve?

I have this optimization problem where I am trying to maximize column z based on a unique value from column X, but also within a constraint that each of the unique values picked of X added up column of Y most be less than (in this example) 23. For example, I have this sample data: d=data.frame(x=c(1,1,1,2,2,2,3,3,3),y=c(9,7,5,9,7,5,9,7,5),z=c(25,20,5,20,10,5,10,5,3)) Which looks like this: X Y Z 1 1 9 25 2 1 7 20 3 1 5 5 4 2 9 20 5 2 7 10 6 2 5 5 7 3 9 10 8 3 7 5 9 3 5 5 The result should look like this: X Y Z 1 1 9 25 4 2 9 20 9 3 5 5 How do I set this problem up in the lpSolve::lp function?

2021-09-07 06:40:25    分类:问答    r   optimization   linear-programming   lpsolve

##### How to use Continuous Variables for IF-THEN constraints on DOCPLEX (Python)?

I'm using DOCPLEX to build up a Mixed Integer Linear Programming (MILP) problem which is then solved via CPLEX on Python. However, upon trying to solve the MILP problem using IF-THEN constraints, I receive the following error: DOcplexException: Model.if_then(), nbBus40 >= 3.0 is not discrete This is happening because I have declared nbbus40 variable to be continuous, as shown in the code below: from docplex.mp.model import Model mdl = Model(name='buses') nbbus40 = mdl.continuous_var(name='nbBus40') nbbus30 = mdl.integer_var(name='nbBus30') mdl.add_constraint(nbbus40*40 + nbbus30*30 >= 300,

2021-09-06 05:22:38    分类:问答    python   linear-programming   cplex   mixed-integer-programming   docplex

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

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-redundant elements of the distance matrix, and then a lot of constraints to ensure self-consistency of the

2021-09-06 02:42:48    分类:问答    r   optimization   linear-programming   euclidean-distance