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

LP warehouse problem with a certain truck capacity

The problem that I need to solve is almost like the basic LP warehouse problem, where you have n warehouses, each one with a certain amount of a product, and m shops, each one demanding a certain amount of that product. So the goal is to minimize…
GeorgeKA
  • 3
  • 2
0
votes
0 answers

Can I get the inverse of an LP basis from a GUROBI model object in Python API?

Is it possible to get the inverse of an LP basis the model is solved? For example, I can get the names of the variables that are in the basis with the following code. I am looking for something similar to the following…
0
votes
0 answers

How to understand this Pyomo Constraint (rewriting the constraint)

I am new to Pyomo. I wrote this constraint in Pyomo written below as shown in this equation: model.amount_of_energy_con = pe.ConstraintList() for t in model.time: for b in model.boats: for s in model.chargers: lhs =…
0
votes
1 answer

What is the name of this optimization problem?

suppose that we can describe a problem with two formulas, i.e. we have: f(a,b) and g(b,c) with unknown a,b,c with a=inv(c) and we have such optimization algorithm as a solution: -1: start with random a, name it old-a -2: solve f(old-a,b), and…
0
votes
1 answer

Is it possible to conduct bi-objective linear programming with 12 variables?

I have 12 variables (x1-x12), and I want to conduct linear programming between these 12 variables and 2 dependent variables(y1,y2). Here is my original data: df<-structure(list(Crop = c("Vegetable A", "Vegetable B", "Maize", "Barley", "Potato",…
0
votes
1 answer

How do you write Ranged Inequality Constraint in Pyomo

I'm new to Pyomo and I need help writing this equation in Pyomo. I'm trying to write a (ranged inequality) constraint equation in Pyomo. Here is the equation: So far I wrote these 2 versions: Version 1: Not sure if this…
0
votes
1 answer

How to iterate over external input list in pyomo objective function?

I am trying to run a simple LP pyomo Concrete model with Gurobisolver : import pyomo.environ as pyo from pyomo.opt import SolverFactory model = pyo.ConcreteModel() nb_years = 3 nb_mins = 2 step = 8760*1.5 delta = 10000 #Range of hour model.h =…
Qnbt
  • 1
  • 2
0
votes
1 answer

lpSolve constraint for choices of start and length of shifts

I have a finite number of staff N, and I need to find an optimal schedule (using the least number of staff) meeting the demand Hour of Day Demand 0 d0 1 d1 ... ... 23 d23 where the d0, d1, ..., d23 are real numbers denoting the…
0
votes
1 answer

CPLEX solve one problem with many different inputs

I am solving a basic linear programming problem: min c*x, with an A*x = b constraint, using CPLEX with Python (DOCPLEX). Then I run the above LP for 10k-100k different combinations of b and c (A stays fixed), in order to find the minimal solution…
Vidak
  • 1,083
  • 14
  • 29
0
votes
1 answer

Converting bounds to inequality constraints does not yield the correct answer

I have a linear program in the general form: https://i.stack.imgur.com/Nqnei.png I was playing around with scipy's linprog. In the documentation they provide an example: https://i.stack.imgur.com/4Y7Q8.png They provide the code: c = [-1, 4] G =…
0
votes
1 answer

How to use the random function for producing different flows in Cplex

I am implementing the mathematical model in cplex that I have a set of different types of Network Functions(NFs) that can be used to generate different flows. For example, {V11, V12, V31} produce a flow. I want 20 different flows, where each flow…
0
votes
1 answer

Resource Constrained Scheduling Project Using Pyschedule

Introduction: I am working on a Resource Constraint Project Scheduling Problem (RCPS) and I was looking for some guidance. This is an optimization problem at its root. Currently, I am using a library called Pyschedule where I can define an…
0
votes
1 answer

Finding min and max of a linear system

So I'm trying to make sense of a scenario in my class exercise which is to find the max and min value of a function. I have two vectors, w and v, of weights which are to sum to 1. The vectors are w = [0.6, 0.2, 0.2]^T v = [0.8, -0.2, 0.4]^T These…
gunsnfloyd
  • 49
  • 4
0
votes
2 answers

Modeling XNOR in Pyomo

I am writing a nurse patient matching algorithm, and I want to incorporate something into the objective function that measures how well the new patient-nurse assignments match the patient-nurse assignments from the previous day. I've introduced a…
0
votes
0 answers

Optimize sum(B[indices]) , which indices from top n selection in array A [CVXPY]

I have a model to predict customer ltv ( called pltv), and we want to find a best cutoff of pltv to select customers with condition sum of revenue from top n customer, higher is better. objective = cp.Maximize(cp.sum_largest( revenue[ y_pred >=…
Mithril
  • 12,947
  • 18
  • 102
  • 153