Questions tagged [modeling]

For questions related to the process of converting a real-world problem into a mathematical model. Can include questions related to linearization, logical constraints, tightness of formulations, and so on.

Filter by
Sorted by
Tagged with
1 vote
1 answer
211 views

MILP constraint modelling

Lets assume $x$, $y$ are non negative continuous variables and $P$ an integer variable assuming either the value $1$ or the value $2$. How could I possibly model the relation If $x = y$ then $P = 2$ ...
Clement's user avatar
  • 2,252
5 votes
1 answer
122 views

Linearizing this absolute difference objective function $\min\sum_{i=1}^{I}\sum_{j=1}^{i}|x_i-x_j|$

For $x_i>0, i=1,\ldots,I$, I tried to linearize this objective function $$\min\sum_{i=1}^{I}\sum_{j=1}^{i}|x_i-x_j|$$ as $$\min\sum_{i=1}^{I}\sum_{j=1}^{i}y_{ij}$$ subject to \begin{align} & y_{...
user avatar
5 votes
2 answers
834 views

Knapsack - How to optimize bonuses for each pair of items

I am trying to solve a variation of the knapsack problem where every pair of items in my knapsack has a bonus or penalty associated with it. My knapsack can hold a dozen items There are thousands of ...
Eddie's user avatar
  • 197
2 votes
1 answer
140 views

How to optimize multiple linear regressions based on cost?

I have an optimization problem where I'd like to maximize revenue and I have separate variables for cost and revenue. Building a single unit of a product takes 100 hours of labor I have a list of ...
Eddie's user avatar
  • 197
4 votes
1 answer
682 views

How to use max flow to schedule machines? (building a network)

Suppose you manage a machine shop with $k$ machines and have $n$ jobs to process today. Each job $i=1,2,3,4,5,\ldots,n$ requires $p_i>0$ minutes of processing time on any machine and has a ...
Fernando Martinez's user avatar
7 votes
1 answer
243 views

MILP - quantify magnitude of overlap

I'm building a manufacturing line optimization model. Part of the model is (lightly) penalizing running the line on the weekend. With time in minutes and t=0 ...
Ralph Asher's user avatar
5 votes
1 answer
838 views

How to model a max-min-max problem?

Everyone knows how to model max-min or min-max problems. I have a problem with objective to maximize min-max. So it can be called as a max-min-max problem. Any ideas how to model it efficiently? The ...
Joseph's user avatar
  • 61
1 vote
1 answer
419 views

How to get negative shadow price for minimization problem in Gurobi?

I am currently working on a scheduling problem (MIP) to minimize cost, and my idea is to first generate a set of discrete initial solutions, and build an LP model with the discrete initial solution to ...
Heng's user avatar
  • 19
3 votes
1 answer
95 views

Are there examples where introducing clusters of binary variables provides a benefit for solving?

I have a larger model with a large number of binary variables among many others. For the purpose of this question, consider the effect that the binary variables impose on the model to be similar to ...
Andreas's user avatar
  • 313
1 vote
1 answer
423 views

How to create Gurobi model using a matrix? (C++ API)

I have been working on the Gurobi (C++ API) using its reference manual for some time. I did not see any description in the manual regarding how to create the Gurobi model using a matrix and iterate ...
asdf's user avatar
  • 105
6 votes
1 answer
264 views

Binary decision variable to indicate whether a continous decision variable is equal to its upper bound

Given a continuous nonnegative decision variable $x\in [0,T]$ bounded by $T$, how can we enforce a relation between $x$ and another binary decision variable $y$ such that when $x$ is equal to its ...
A. H's user avatar
  • 147
4 votes
1 answer
160 views

Binary decision variable to indicate whether an inequality is satisfied or not

I have a problem where I have a continuous decision variable (let's call it $m$) that is bounded between $(0, T]$ where $T>0$ is a predefined parameter. I also have another binary decision variable ...
A. H's user avatar
  • 147
8 votes
2 answers
950 views

MILP Penalty Function Only for Negative Values

This is (hopefully) an easy answer but I haven't dealt with this before. I have a MILP which includes an unbounded, continuous decision variable. However, I generally don't want this decision ...
Ralph Asher's user avatar
4 votes
1 answer
113 views

Modeling $x=1$ iff $y\leq D$ and $x=0$ otherwise (either-or-constraints)

We have decision variables $x\in\{0,1\}$ and $y>0$. We know that $x=1$ if and only if $y\leq D$ and $x=0$ iff $y>D$. $D>0$ is a model parameter. How I modeled these constraints is \begin{...
user avatar
8 votes
3 answers
625 views

How to tackle this VRP variant?

I am currently working on the following problem, which is a variation of a vehicle routing problem. I am looking for different ideas to tackle it. Problem description A set of nodes with a given ...
Kuifje's user avatar
  • 13.3k
6 votes
1 answer
116 views

Help modeling grid placement problem

I'm trying to model a grid placement problem to exercise in OR. The problem is defined as: a grid of some dimension (let's say 500x500) N users that need connection. Every user has: a defined ...
rsella's user avatar
  • 169
11 votes
5 answers
2k views

How to compute all paths between two given nodes in a network?

In this post, Erwin Kalvelagen describes a method to compute all paths between two nodes in a given network, such that: no arc is used more than once a given path does not contain more than $M$ arcs ...
Kuifje's user avatar
  • 13.3k
3 votes
1 answer
289 views

Disjunctive equality constraints: modelling

I have the following constraint in my model: $$x = 0 \lor \sum_{i=1}^n y_i = 3$$ where $x$ and $y_i$ are all binary variables. How this can be linearized by means of big-M notation? Should I include ...
ORLover's user avatar
  • 33
2 votes
1 answer
63 views

RCPS with time buckets for resource capacity constraints

Goal: My goal is to come up with a Resource-Constrained Project Scheduling (RCPS) model where the resource capacity constraints are aggregated and verified on time buckets, which can be of varying ...
Rutger's user avatar
  • 115
1 vote
2 answers
424 views

How to create A, b and c matrices from very large .lp file?

I am working on Scaling MIP. I use Gurobi within Clion. I need to extract the coefficient of Xs (A matrix), right-hand side (B matrix), and an objective function(c matrix) from the .lp file and ...
asdf's user avatar
  • 105
6 votes
0 answers
88 views

Issue of Dense columns in the formulation

I'm working on a price-selection model where we need to identify price point for each time-period (could be day/week). Objective of the model is to figure out optimal price-point for each time-point ...
anjikum's user avatar
  • 984
0 votes
1 answer
242 views

How to make CLion read .lp file and make Gurobi solve that file within CLion?

I am working on the scaling of a MIP using C++. I use Gurobi within CLion. The Gurobi model I use now in Clion require me to enter everything manually (model.addVar, model.addConstr...). However, in a ...
asdf's user avatar
  • 105
2 votes
1 answer
71 views

Ensure that scheduled repeating maintenance has to be completed

I'm trying to model the scheduling of maintenance in some machines, and was wondering how I could ensure that, if maintenance is planned to start in period $t$, then it has to be carried out until ...
J. Dionisio's user avatar
4 votes
1 answer
475 views

Minimum up time for a machine in a linear program?

If we let $x_i$ = 1 if a machine is on during hour $i$, and 0 if the machine is off, how would we enforce a constraint that requires the machine to be “on” for a minimum of at least $M$ hours? For ...
Mason's user avatar
  • 515
3 votes
1 answer
148 views

Model generation for large-sized instances

I have a scheduling model where each job $p$ requires three operations (with fixed precedence and they must happen in a row) for a fixed number of $i$ service sessions (each session on a specific day)....
mdslt's user avatar
  • 615
3 votes
1 answer
155 views

"Complex" scheduling problem model structure

So, I'm modelling a job assigning problem in OR-Tools CP-SAT. I want to maximize rescheduled jobs based on some constraints. Right now jobs in my model look like this: ...
Gleb S's user avatar
  • 51
6 votes
1 answer
396 views

Binary variable switch constraints

I have a set of binary variables $X = \{ x_1, x_2, x_3, ... x_N \}$ which are connect and used with the rest of the model. I want to define a set of binary variables which represents the change ...
CharcoalG's user avatar
  • 163
10 votes
1 answer
2k views

No "not equals" constraint in Gurobi

I'm using Gurobi and trying to set a constraint that two variables A, B are not equal ...
pigsun's user avatar
  • 145
6 votes
2 answers
508 views

Integer Programming Constraints - Min/Max Days Between Deliveries

I'm starting a consulting project for a client who manufacturers perishable food. They want to optimize their delivery schedule to each of their DSD (Direct Store Delivery) customers. For each store, ...
Ralph Asher's user avatar
3 votes
2 answers
278 views

Piece-wise linear approximation of a constraint

We have a decision variable $0<y<1$ and the following constraint $$z=\frac{y^2-y+1}{y(1-y)},\tag{1}$$ We also have another constraint $$y=f(x),\tag{2}$$ where $f(x)$ is a linear function of $x$. ...
user avatar
-3 votes
1 answer
99 views

Modelling constraint

I have the following problem statement: A company is considering to hire more operators. Starting with four machine operators in May, the company wants to investigate if it pays off to hire more. Each ...
nostres's user avatar
3 votes
1 answer
131 views

Master Problem Infeasible after Iterations of Unbounded Sub Problem (Generic Benders Decomposition in non Stochastic MILP)

I am dealing with a large problem of MILP problem and interested to apply Benders Decomposition. I have already check the original problem and it was feasible to run in large number of computation ...
Lizard White's user avatar
1 vote
1 answer
136 views

How to introduce an optional decision variable

I try to model a decision process in which I first need to decide about a binary variable $x$. In case $x=1$, I also need to decide upon variable $y$ and the value of $y$ is not defined otherwise. ...
PeterD's user avatar
  • 1,536
12 votes
5 answers
2k views

Dividing machines into groups of equal sizes so that each group has approximately same productivity

I have set of machines with varying productivity. I want put the machines in different groups so that the groups have approximately equal productivity. Lets say, we have $M$ machines. and we want to ...
KGM's user avatar
  • 2,265
2 votes
1 answer
102 views

Formulating a coefficient from a table

We have a table of data as follows $$\begin{array}{c|c|c|c|c} & b \leqslant a & a < b \leqslant 2a & 2a < b \leqslant 3a & 3a < b \leqslant 4a \\ \hline i=1 & e & 2d ...
Vitamin Z's user avatar
  • 103
9 votes
1 answer
284 views

Modelling stronger binary expression

$\delta_1, \delta_2, ..., \delta_k, W$ are binary variables and the constraint $δ_1 + δ_2 + \ldots + δ_k ≤ W$ holds. Is it better to write $$\delta_1 + \delta_2 + \ldots +\delta_k \leq W$$ or \begin{...
Clement's user avatar
  • 2,252
3 votes
1 answer
184 views

If-then condition formulation to avoid variable multiplication

I'm trying to formulate the following logic: If $y_i =1$, then $c_i \leq x_i$ If $y_i =0$, then $c_i \leq 0$ Where $y_i$, $c_i$, and $x_i$ are decision variables. The easy way would be to write: $$c_i ...
Daniel Baquero's user avatar
1 vote
3 answers
341 views

optimize days between work shift

For a work shift optimization problem, I've defined a binary variable in PuLP as follows: pulp.LpVariable.dicts('VAR', (range(D), range(N)), 0, 1, 'Binary') where ...
Jason's user avatar
  • 19
6 votes
0 answers
225 views

Airline revenue management re-solving problem

I am considering a bid prices (shadow price of the capacity constraint) problem (from Chen, L. and Homem-de Mello, T. (2009)., page 14) where the acceptable classes for booking requests for ...
SimonCello94's user avatar
7 votes
3 answers
2k views

Solving Logic puzzles through optimization

I have the following "logic puzzle" (I think this is considered as a "scheduling problem"): In this problem, there are 5 basketball players - provided some clues about their ...
stats_noob's user avatar
  • 1,831
2 votes
0 answers
57 views

How to construct a restriction for a blending problem that has 2 inputs that are blended, and as result we get 2 outputs?

THE PROBLEM A refinery has 10 million barrels of type A crude and 6 million barrels of Type B crude oil. The refinery has 3 plants to produce Gasoline (it makes a profit of 2 USD / barrel) and Naphtha ...
ergch24's user avatar
  • 67
3 votes
0 answers
101 views

What is the general name (e.g. facility location problem) for this problem (if any)?

I would like to know if there is a general name for the following problem: We will open several facilities. Each facility has an associated facility type. There exists a given number of facility ...
Displayed_Name's user avatar
3 votes
0 answers
190 views

Good book to get familiar with the key concepts of Operations Research for a person which didn't enjoy a good math education in university?

I am currently reading research papers on optimization problems in logistics and struggle to understand the math notation. Any good beginner friendly books you would recommend? This is the paper I ...
Eddiee's user avatar
  • 533
3 votes
1 answer
406 views

How to construct the linear programing representation of a blending problem?

THE PROBLEM A refinery has 10 million barrels of type A crude and 6 million barrels of Type B crude oil. The refinery has 3 plants to produce gasoline (it produces a profit of 2 USD / barrel) and ...
ergch24's user avatar
  • 67
0 votes
1 answer
87 views

Conclusion from many-to-many relationship

Raw data as below: on the left, there are teams of musicians. On the right, there are the features of the music the team composed, for style, duration and musical instrument. ...
Mark K's user avatar
  • 429
3 votes
1 answer
247 views

What does nonconvex multilinear mean?

I am not a math student so I am sometimes a bit confused when it comes to math lingo. For me non-convex would mean its concave which means functions have local minima in case of a minimization problem....
Eddiee's user avatar
  • 533
6 votes
2 answers
319 views

Multi-commodity Network Flow: Convert a node-arc solution to an arc-path solution

For a logistics optimization problem I am working on, the most natural expression of the problem is using a node-arc formulation of the MCNF. It is solved using an LP/MIP solver like CPLEX/Gurobi. ...
anerjee's user avatar
  • 119
7 votes
1 answer
644 views

How to construct my mixed integer programming problem with constraint of minimum consecutive ones

My target is to formulate a binary sequence with fixed size $N$ = 10, such as $[1, 0, 0, 0 ,1, 1, 0, 1, 0, 0]$. However, I want to constrain this sequence so that when 1 appears, it has to appear at ...
shaojie liu's user avatar
3 votes
3 answers
304 views

Scheduling for the shortest days using ILP

I've tried Or-Tools and MILP solvers a couple of different ways on this, but they take a surprisingly long time to realize that the solution they generated fairly quickly is in fact minimal. Is there ...
triskett's user avatar
7 votes
2 answers
193 views

Network design problem with rounded capacity constraints

I have a network design problem with complicating capacity constraints which I'm trying to model through a Mixed Integer Programming formulation. The problem is defined on a directed, incomplete graph ...
Joris Kinable's user avatar

1
3 4
5
6 7
12