# Questions tagged [linear-programming]

For questions related to problems that optimize (i.e., minimize or maximize) a linear objective subject to linear constraints.

265 questions
Filter by
Sorted by
Tagged with
85 views

### Analytically finding the maximizer of a trace optimization problem

$A \in \mathbb{R}^{m \times n}$ is an arbitrary data matrix. Moreover, $w \in \mathbb{R}^m$ is a data vector which is a probability vector, i.e., $w\succeq 0, \sum_{i=1}^m w_i = 1$. I have a ...
86 views

### How to linearize difference of absolutes?

How to linearize difference of absolutes? $$|a|\ge k|b|$$ where $a,b$ are variables and $k$ is a constant.
111 views

### How to write a LP/MIP to mark the items in a time-series list after a fixed delta?

I have a time series list like this. ...
97 views

### how to penalize a shortfall of a sum of absolute values

I have a model where there is a constraint on the sum of absolute values, and I would like to add a penalty on the shortfall from the constraint. More specifically: \begin{align*} \text{maximize}\ &...
87 views

### Linear programming explanation in Algorithms by Sanjoy Dasgupta

I am reading about simplex algorithms in a textbook titled Algorithms by Dasgupta-Papadimitriou-Vairani. On each iteration, simplex has two tasks: Check whether the current vertex is optimal (and if ...
205 views

### Transforming a Quadratic constraint to SOCP

I have a problem similar to Markowitz portfolio optimization that I would like to transform into second-order cone programming. I have a linear objective function with a quadratic constraint (assuming ...
111 views

### Minimizing a variable over the intersection of simplex and linear constraints

I am solving: \begin{align} \begin{array}{rll} y^* = \min & y & \\ \mathrm{s.t.} & a_i^\top x \leq y, & i=1,\ldots,m \\ & x \succeq 0,\ \mathbf{1}^\top x = 1. & \end{array} \...
147 views

### Propagate value through a graph

Here is my question where I am propagating distance through the graph, I was wondering if it is possible to do when the graph has cycles, i.e., traveling the same node multiple time then is it ...
134 views

### Controlling the constraint execution sequence in docplex

I have tried to implement my question asked here with the help of Github code link. Below is the linearized version of the MTZ like constraint as per the answer given here. Constraints below assign ...
150 views

### TSP subtour elimination with multiple formulations

Referring to the question here. Given a set $S$, which we need to travel following TSP rules. I was wondering if this sub tour elimination method is good enough or not? Let $b_{i,j}$ denote edge ...
740 views

### Is there a way to view added constraints in Gurobi (Python)?

I should note that I am very new to Gurobi so apologies if this is obvious. I am working on a project for a class to maximize profit on a theoretical flight network by deciding which routes to fly at ...
58 views

### How to set combined stop condition in AMPL/CPLEX?

I would like to set a stop condition combined of a timelimit and a relative MIP gap. So I would like AMPL/CPLEX to look for the solution of my LP for an hour and if there isn't a solution stop if or ...
184 views

### Linear programming sensitivity analysis using Matlab

I have a linear program in the MPS file format listing all the rows, columns, right-hand sides, etc. I can read that in Matlab and solve it using linprog. However, it seems there is no easy way to do ...
306 views

### if-else condition for the objective variable using big M notation

Let $0\leq \beta\leq 1$ be an objective variable. The size of $\beta$ is $N\!\times\!N$. Now, how can I impose the following? if $\beta_{i,j}>0$ then $\beta_{j,i}=0$ Big M notation can be ...
142 views

136 views

### Modeling traffic in a city

I am trying to model traffic in a city, $(i,j)$ represents a road in a city. There are $H$ vehicles in a city they have some prescheduled set of destinations to visit, $A_{j,h}$ denotes arrival time ...
516 views

120 views

### Choosing better objective function for vehicle routing problem

I have a graph $G$ and the following variables. $b_{i,j}$ is $(i,j)$ edge is taken or not. $t_{i,j}$ is time to travel $(i,j)$ $A_{i}$, $D_{i}$ are arrival and departure time at node $i$. My first ...
76 views

### Building the Scheurman's Model II constraints for a multi period linear program

Scheurman's paper discusses Model I and model II Formulation to solve harvesting and scheduling problems. It is a specific implementation to solve multi period linear programs. Both models are also ...
195 views

### Trade off between number of constraints and bounds of a variable

I am not familiar with the inner working of the solvers. I mostly use the python pulp or IBM CPLEX solver. For fast execution ...
109 views

### Linearizing constraint with continuous and boolean variables

I have two continuous variables $A$, $B$ and two binary variables $x$, $y$. Condition: if $A = B \wedge x = 1 \wedge y=1$ then $z = 1$ else $z = 0$ from In an integer program, how I can force a ...
177 views

### Reducing number of suppliers for product portfolio

I have the following matrix of suppliers who are able to make a certain product, against all products in my portfolio. What is the best way of finding the solution to "the least suppliers necessary ...
268 views

### Negative reduced cost for basic variable

I am observing something unusual : after solving a linear program, some basic variables have negative reduced costs (instead of $0$) : ...
103 views

### Optimising the current model

After developing the MIP model I noticed that solver is taking a lot of time to reach the solution. So, how should I approach to optimize the current model? Are there any visualization tools or any ...
209 views

### Can we have all reduced costs (strictly) positive?

I had a number of students claim on their homework that "All $z_j-c_j$ values are positive, therefore the solution is optimal." Of course, I noted that they should say "non-negative" instead of "...
1k views

### How to formulate problems in the language of mathematical programming?

The question says it all. I am having difficulties formulating general problems (meaning no numbers just variables). When I read the solution, I understand but I can't figure how to formulate myself ...
36 views

791 views

### Open Source MILP software for Python with user-friendly API to define the optimization problem

Following the accepted answer to Assignment problem where assignments must be done sequentially I would like to write a Python script which can solve the problem defined there. It's a Mixed Integer ...