Questions tagged [linear-programming]

An optimization technique for minimizing or maximizing a function of several variables in the presence of constraints where all relationships are linear.

Linear Programming is a mathematical optimization technique for minimizing or maximizing a linear function of several variables (called the objective function) subject to several linear constraints. The objective function and the set of constraints are collectively called the Linear Program.

The dual Simplex Method is a commonly used solution technique in Linear Programming. There are several commercial and open-source software packages for solving linear programs.

Brief history:
1939. Production, planning. [Kantorovich]
1947. Simplex algorithm. [Dantzig]
1947. Duality. [von Neumann, Dantzig, Gale-Kuhn-Tucker]
1947. Equilibrium theory. [Koopmans]
1948. Berlin airlift. [Dantzig]
1975. Nobel Prize in Economics. [Kantorovich and Koopmans]
1979. Ellipsoid algorithm. [Khachiyan]
1984. Projective-scaling algorithm. [Karmarkar]
1990. Interior-point methods. [Nesterov-Nemirovskii, Mehorta, ...]

External links:

2509 questions
9
votes
2 answers

Scipy - find bases of column space of matrix

I'm trying to code up a simple Simplex algorithm, the first step of which is to find a basic feasible solution: Choose a set B of linearly independent columns of A Set all components of x corresponding to the columns not in B to zero. Solve the m…
MikeRand
  • 4,788
  • 9
  • 41
  • 70
9
votes
1 answer

Fantasy football linear programming in R with RGLPK

long time listener first time caller to S.O... I am asking a question that has been asked very similarly before, however I don't believe I am smart enough to decipher how to implement the solution, for this I apologize. Here is the link to the…
8
votes
2 answers

Any good implementation of greedy set cover for large datasets?

This question follows from a related question of mine posted here. @mhum suggested that my problem falls into the covering problem domain. I tried encoding my question into a minimum set cover problem and currently I have a dataset in this form: Set…
Legend
  • 113,822
  • 119
  • 272
  • 400
8
votes
3 answers

Time limit for mixed integer programming with Python PuLP

I've been using PuLP to solve a particular mixed integer linear program (MIP) I am interested in. However, as the problem size grows, PuLP is taking too long. I want to be able to run the solver for some time and terminate it prematurely if its…
eepperly16
  • 181
  • 1
  • 3
  • 4
8
votes
2 answers

Interpretation of GAP in CPLEX

This is a part of the engine-log output that I get from a small-scale mixed integer linear optimization problem that I solved in CPLEX 12.7.0 Nodes Cuts/ Node Left Objective IInf Best Integer …
8
votes
1 answer

Algorithm for optimal packing with known inventory

Hospitals are changing the way they sterilize their equipment. Previously the local surgeons kept all their own equipment and made their own surgery trays. Now they have to confine to a country wide standard. They want to know how many of the new…
NicolaiF
  • 1,283
  • 1
  • 20
  • 44
8
votes
2 answers

Scipy: Linear programming with sparse matrices

I want to solve a linear program in python. The number of variables (I will call it N from now on) is very large (~50000) and in order to formulate the problem in the way scipy.optimize.linprog requires it, I have to construct two N x N matrices (A…
Samufi
  • 2,465
  • 3
  • 19
  • 43
8
votes
2 answers

Good linear programming library for C#?

I'm looking for a linear programming solver for C#. In the other words I'm looking for a library for C# that solves linear programming problems. I need an easy to use library (so I can learn how to use it quickly), but it would be nice if it…
Rasto
  • 17,204
  • 47
  • 154
  • 245
8
votes
1 answer

Apache common SimplexSolver ObjectiveFunction for maximizing the sum of values in a matrix

I am trying to solve the following linear problem by using the Simplex solver from apache-commons: org.apache.commons.math3.optim.linear.SimplexSolver. n is the number of rows m is the number of columns L is a global limit for the sum value of each…
8
votes
2 answers

PuLP very slow when adding many constraints

I'm trying to use PuLP, but it is taking 50 seconds to add 4000 constraints (with 67 variables). Solving the problem only takes a fraction of a second. We want to use PuLP to easily test several solvers on a large set of problems. Should it be…
jmilloy
  • 7,875
  • 11
  • 53
  • 86
8
votes
1 answer

gurobi - Error code = 10004 Unable to retrieve attribute 'X'

I am getting an error in my c++/gurobi file: Error code = 10004 Unable to retrieve attribute 'X' I read that this might have something to do with labels? But I don't see how there is a problem. It works for some input files, but not for others. So I…
dorien
  • 5,265
  • 10
  • 57
  • 116
8
votes
1 answer

How do you find the optimal assignment of pupils in classes?

23 pupils from level A, 24 from level B and 30 from level C need to be assigned into three classes. The classes need to be almost exactly of the same size. Different levels can be mixed into a single class, however it is better if it can be avoided.…
8
votes
3 answers

Gurobi python get value of the defined variable

How do i get the value of the variable that i have define previously(using addVar) in gurobi python? I need to compare the value of the gurobi variable and then perform calculations to reach to my objective variable. The same has to be done before…
7
votes
2 answers

Linear Programing- Max value optimization

I'm trying to find the best possible combination that will maximize my sum value, but it has to be under 2 specific constraints, therefore I am assuming Linear programming will be the best fit. The problem goes like this: Some educational…
7
votes
2 answers

Find Fraction using LP

I have two polygons BP and GP described by the set of inequalities constraints -x+y<=1 and x+y<= 5 and x-y<=3 and -y <= 0 for the Black Polygon and -1<=x<=4 and 0 <= y <= 3 for the Green Polygon. My goal here is to use an LP to find the optimal…
R.W
  • 123
  • 7