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

How to add divisibility constraint in GNU mathprog

I want to add a constraint that a variable should be divisible by a particular integer. I tried using mod operator but it cannot be used with variables: s.t. c1 x1 mod 10 = 0 I get the following error: operand preceding mod has invalid type How…
0
votes
1 answer

Complex constraints in Pyomo with Exists and forall quantifiers

If I have a constraint reading like this: For all a in A there exists a b in B so that for all c in C it holds that a variable x(a, b + c) is equal to a parameter m(a, c) short: forall a in A, exists b in B, forall c in C: x(a,b+c)=m(a,c) I tried…
baxbear
  • 860
  • 3
  • 9
  • 27
0
votes
1 answer

How to define in pyomo parameters representing differently sized vectors and sets?

I have an LP with a set of vectors as input parameter containing 2 to 12 elements: [1,2,0,0,3] [1,0,0,0,0,1,2] [5,0,0,1,0,7] for each node: model.Nodes = pyo.Set(initialize = range(0, len(nodes)) so…
baxbear
  • 860
  • 3
  • 9
  • 27
0
votes
1 answer

Cplex definition of variables

Firstly I am newly with cplex, i want to define R as a set of two pairs (i,j) and then write the below constrains: zij ∈ {0, 1}, ∀ i, j s.t.(i, j) ∈ R fj − fi ≥ 0 − M(1 − zij ), ∀ i, j…
MO MO MA
  • 49
  • 5
0
votes
0 answers

how to fix pyomo conflict constraint?

I am using the pyomo for my thesis project and working on MILP model. I have an objective function which is to minimise the late arrival of certain goods to the warehouse and hence I came with an objective function as follows, Here, I am unable to…
0
votes
1 answer

How to sum up a two dimensional pulp solution

I have following code cutouts: a = range(0, 30) b = range (0, 88) Power_consumption = LpVariable.dicts('Power_consumption', (a,b), lowBound=0, upBound=5, cat='Continuous') ... result= [[]] for i in a: for j…
Mada
  • 1
  • 1
0
votes
1 answer

Simplex LP Value of in Pyhton

Use Python for solving a Linear Programming porblem with the objective being a Value of: x Hello people of internet I'm having trouble with a process I'm trying to automatize in Python it´s a LP problem I found Simplex LP method in Solver from Excel…
0
votes
0 answers

Detect Disconnected Subtours in Graph

I have used an Integer Linear Program (ILP) to generate a path from source to sink in a graph. Each variable Pij in the solution represents a transition from node i to j in the path. Unfortunately, the result is a collection of 2 or more…
0
votes
2 answers

Pulp staffing optimization problem: shift combination constraint

I'm trying to solve a staffing optimization problem and this is the model I have. First constraint: a minimum number of employee needs to be scheduled for each shift. For exemple: shift requirement 1 1 2 1 3 2 4 2 5 1 Second…
0
votes
1 answer

model conditional constraint in Gurobi

I am trying to model a conditional constraint in Guuobi python: if a>= b then c == 1, otherwise c == 0 a and c are both model variables and c is binary I have the following code based on How do I model conditional statements in Gurobi?but something…
0
votes
1 answer

Variation without the cost of foods using the Diet Problem(Maximization Problem)

I've been looking for an algorithm that helps me to create the best possible diet based on a certain amount of nutrients. After a lot of research and attempts, it didn't succeed. But I found something that almost worked, which was the diet problem,…
0
votes
1 answer

How to dynamically compute nurse walking distance based on assignments in a nurse-patient scheduler model in Pyomo?

I am writing a Nurse-Patient assignment algorithm in Pyomo, but I am having trouble dynamically computing the walking distance between assigned patient beds for each nurse. The relevant sets and variables are below with a small example. The…
0
votes
1 answer

if condition in Gurobi Python Objective Function

I have an objective function with if condition. I am having trouble implementing it in Gurobi Python. Background information: there are multiple items (1,5). LP need to generate a production plan for 12 months on how to replenish these items to meet…
0
votes
1 answer

PuLP: Minimizing the standard deviation of decision variables

In an optimization problem developed in PuLP i use the following objective function: objective = p.lpSum(vec[r] for r in range(0,len(vec))) All variables are non-negative integers, hence the sum over the vector gives the total number of units for…
0
votes
2 answers

Python Knapsack problem - using the average value of the selected items as a constraint?

I'm still relatively new to python so I'm having trouble figuring out how to accomplish a certain feat. What I'm trying to do: I have an Excel file with two columns - Sell and margin. There could be a variable number of rows. I need to find a "best…
Cayshin
  • 11
  • 2