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:

2006 questions
0
votes
1 answer

Pulp add constraint that at least one LpAffineExpression is equal to one

Say I have a PuLP model defined as thus: model = pulp.LpProblem('',pulp.LpMaximize) And I have added an objective function (it does not matter) Now I have a list of LpAffineExpression objects: lps = [l1, l2, l3, ...] I want to add to the model the…
user1519226
  • 77
  • 2
  • 11
0
votes
1 answer

Formulate contraints that involve pairings of multiple LpVariables

Is it possible to formulate constraints that utilize pairings of LpVariables in PuLP? More specifically, say that I have LpVariables x1, x2, ... x100 (all Binary category), each of these representing an object. All of these objects have a type…
user1519226
  • 77
  • 2
  • 11
0
votes
0 answers

PuLP ignores constraints?

I have listed a constraint in my code (marked below) that PuLP is ignoring. Have I defined things incorrectly? Are certain functions not allowed when adding constraints? What's the difference between lpSum and sum? This is supposed to limit the…
krm
  • 1
  • 2
0
votes
2 answers

SoPlex yields wrong answer

I have an LP in CPLEX LP format, in file LP.tmp Maximize obj: x0 + 2 x1 + 3 x2 + 4 x3 + 5 x4 + 7 x5 Subject To c0: 1 x0 + 1 x1 + 1 x2 + 1 x3 + 1 x4 + 1 x5 + 1 x6 + 1 x7 + 1 x8 = 0 End On this I call soplex -X -x -o0 -f0 -v3 LP.tmp This is…
Hennich
  • 642
  • 3
  • 14
0
votes
1 answer

how to count the number of distinct items in a linear programming problem

I am studying some linear programming problems with all-binary variables, where it is necessary to count (and then either constrain or maximise/minimise) the number of distinct items in the solution. This is the post I could find that seemed closest…
user6376297
  • 345
  • 1
  • 10
0
votes
1 answer

Mixed Integer Linear Programming for a Ranking Constraint

I am trying to write a mixed integer linear programming for a constraint related to the rank of a specific variable, as follows: I have X1, X2, X3, X4 as decision variables. There is a constraint asking to define i as a rank of X1 (For example, if…
0
votes
1 answer

Feasible, bounded primal but infeasible dual in linear programming

I have a linear programming problem that has an optimal solution in its primal form, but I can't seem to find an optimal solution, or a solution in general, to its dual problem. Is that possible? The primal is: min -4x + y subject to 5x - 2y <=…
gahhh
  • 1
0
votes
1 answer

Mixed Integer to connect islands together or to a terminal

I am trying to use MIP using pulp package to connect islands together or to a terminal. The desired solution is to find the minimum distances in the system. The results of the MIP code below shows the minimum distance is to connect all islands to…
0
votes
1 answer

Get LP from a .mod file, solve it with GLPK and get the output in a usable form

I have a .mod file and want to solve the LP within it with GLPK. I know there is a method by using the cmd (Windows) with glpsol -m name.mod but then I will have to parse the output result which I want to avoid. Is there a method by using the glpk…
Georgios
  • 559
  • 5
  • 19
0
votes
0 answers

How to implement the TOU rate in this code?

I am new for coding. I try to find the optimal sizing battery with this code. this code is using Pulp modeling interface to LPsolver. # Tarrifs buy = 30.0 # buy price (c/kWh) sell = 8.0 # sell price (c/kWh) # formulation works only when sell <=…
Poom
  • 1
  • 1
0
votes
1 answer

Problem with defining linear programming constraints

Me and my friend are trying to implement a paper and the last step requires solving a linear programming problem to get the final result. We are not so familiar with LP so i'd like to ask for your help. Here's the function which is based on the…
Nikos
  • 3
  • 4
0
votes
1 answer

Bin packing with grouping

I have a list of products (i), each with given weight and volume. The optimization goes in two steps, of which I have been unable to solve the second step. First optimization: minimize number of bins used (solved) Minimize number of bins used to…
0
votes
2 answers

Python Gurobi setting up objective function

I am using the following code to define the objective function: objective = GBR.QUICKSUM(x[i,j] * c[i][j] for i in range(50) for j in range(50)) m.setObjective(objective) However, it gives me an error stating that name 'GBR' is not defined. I have…
0
votes
0 answers

How to call numpy solver to minimize a obj_func with constraints

I'm trying to solve a linear equation problem with constraints but I have no idea of how to call the solver. I'm using a function that I wrote called covariancia but there's no problem with it, so I'll not post it here. from funcs import…
0
votes
1 answer

Linear Programming feasible using linprog and unfeasible using Gurobi in Matlab

I have the following very simple linear programming problem to solve in Matlab clear %The unknown %x=[x1,...,x10]; %The constraints %x2+x8=Phi12 %x3+x7=Phi21 %x5=infvalue; %x10=infvalue; %The known parameters…
TEX
  • 2,098
  • 15
  • 36
1 2 3
99
100