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
0
votes
1 answer

Gurobi: Objective Value of Primal not equal to dual (transportation problem)

Using the solution here for the transportation problem with the model: m = Model("transport_problem_2") flow = {} for c in cities: for b in bases: flow[c,b] = m.addVar(obj=distance[c,b], name='flow_%s_%s' %(c,b)) m.update() for c in…
0
votes
0 answers

Characteristics of a linear programming problem

How to know if a problem can be solved using linear programming ? I have to write a statement of a problem to be solved with linear programming, what characteristics of the statement assure me that it can be solved with linear programming ?
John
  • 3
  • 1
0
votes
1 answer

How to add precedence constraints to LP when time is used as an index in a Pulp variable?

Dear fellow programmers, I want to know how to schedule activities based on availability (see input). There are people available on days where the number of available hours is more than zero. We want our schedule to be as close to zero as possible…
0
votes
1 answer

How to Convert Quadratic Contraint to Linear

I have this constraint in my model: (X - Y) @ B >= 0 where B is a boolean vector variable, X and Y are variables vector that represent quantities I'm working with CVXPY, so I have to keep linear expressions How could I translate this constraint in…
0
votes
1 answer

Creating several variables/constraints in one shot in SCIP

I have a C++ application that can use indistinctly (vía polymorphism and virtual methods) CPLEX, GUROBI or COIN to solve an LP, and now I'm adding support for SCIP. In the first three solvers I can add several constraints/variables at once, using…
0
votes
0 answers

Numerical instability creating wrong result on Mixed-Integer Linear Program, bug or error?

I created a bug ticket for Google or-tools Java library. I was told it is a feature of Mixed-Integer solvers. But those results for this simple program makes me think it is a bug, since I would have to round every coefficients in order to not get a…
0
votes
0 answers

Linear programming. How can I add a constraint that is not constant value ? (like the allocation for each ad <= budgets, both two sides can change)

I am building an optimal model using linear programming like below: m = gp.Model("allocation_budget") #keywords are given tuple about keyword in ad.{UK retail, free shipping UK etc.} allocation = m.addVars(keywords, lb = 0, name="allocation") #…
kris
  • 27
  • 6
0
votes
2 answers

PV Overproduction within a linear cost factor optimization

So I am currently trying to optimize the costs for energy in a household. The optimization is based on a cost factor function which I am trying to minimize. model = ConcreteModel() model.t = RangeSet(0, 8759) def costs(model, t): return…
saschav
  • 37
  • 6
0
votes
1 answer

Getting KeyError: 1822253855912 when using pyomo (any solver)

I am using Pyomo with Spyder IDE, and running a simple linear programming example and while I have installed pyomo, gurabi, CPLEX, GLPK and other solvers, no matter which one I use, I get an error similar to (KeyError: 1822253855912): Traceback…
0
votes
1 answer

Linear Programming with a specific sequence in PulP (Python)

Would it be possible to implement events that occur in a specific order in a linear model? I would like to create a model where there are several activities in this order with a clear time constraint: Intake - 60 minutes Write intake transcript -…
0
votes
1 answer

Best way to obtain the LP relaxation of a MIP using SCIP

I've a C++ app which can use indistinctively CPLEX or COIN, and now I want to add SCIP as a choice. As a part of the functionality, it's required to run the LP relaxation of a MIP problem. In CPLEX or COIN that's simple, I just create the problem…
0
votes
2 answers

consecutive days constraint in linear programming

For a work shift optimization problem, I've defined a binary variable in PuLP as follows: pulp.LpVariable.dicts('VAR', (range(D), range(N), range(T)), 0, 1, 'Binary') where D = # days in each schedule we create (=28, or 4 weeks) N = # of workers T…
Jason
  • 13
  • 2
0
votes
1 answer

Minimize number of unallocated tasks in PuLP

I'm new to linear programming and am trying to use PuLP to allocate tasks to volunteers. I've generated some fake data below. In this fake dataset, each of 50 volunteers (numbered V1 to V50) were given a list of 100 tasks (numbered T1 to T100). They…
Beep
  • 5
  • 3
0
votes
0 answers

pyDEA running as a python script

I am attempting to run pyDEA. The main_gui approach does not work from wha appears to be the ValueError: cannot use LOCALE flag with a str pattern issue with the latest version of Python (I am running Python 3.8.5, Anaconda on MacOS). Has anyone run…
LancDec
  • 2,078
  • 1
  • 12
  • 7
0
votes
2 answers

Either or constraint WITH ONE POINT IN COMMON in linear programming operations-research

suppose we have a quantity variable x (which is upperbounded by n), and a logic variable y which is equal to y = 1 if x >= s; where s is a generic number y = 0 otherwise => if x is strictly lesser than s => if x < s Surfing around on the internet I…
Matteo
  • 1
1 2 3
99
100