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
2 votes
1 answer
134 views

linearize bilinear quadratic objective terms

I need to model a problem as a linear program. However my working solution contains a (bilinear) quadratic objective term: $$ \sum x_i * y_i \\ x \in \{0,1\} \\ y \in \mathbb{R}^+ $$ The value of $y$ ...
user avatar
  • 85
2 votes
0 answers
36 views

Assignment/scheduling how to formulate considering job time and job cost

I have the following problem that I do not know how to formulate. There are a fixed number of workers $w_i \in W$ for $i \in [1…N]$. Also, there are a fixed number of jobs that must be assigned to ...
user avatar
3 votes
2 answers
79 views

Coarse modelling - is there a name for this?

I'd like to produce a model that uses very coarse inputs and produces similarly coarse outputs. For example, if I were estimating personal sources of wealth I might say that in a given year: ...
user avatar
7 votes
2 answers
808 views

Is there a better way of defining a constraint on positive integer variables such that no two variables are the same and are uniquely assigned a value

So suppose I have integer variables $x_1,x_2,\dots,x_N$ and I enforce that the integer variables are bounded i.e $1 \leq x_i \leq N$ I was interested in posing a constraint so that in the collection $...
user avatar
  • 205
4 votes
0 answers
104 views

Hard time in understanding OR Research or Paper

I'm from soft-engineering background and really having a hard time when reading and understanding the formulation from a research or published paper. For example, when looking at a container loading ...
user avatar
  • 385
2 votes
1 answer
50 views

Using Gurobipy and solve in Neos Server

I have a model run in gurobipy (python api) for Gurobi solver and I want to solve it using NEOS Server. How can I send it to NEOS? What is a good way? I want to add a parameter like timelimit so my ...
user avatar
  • 385
2 votes
1 answer
57 views

Method to test compatibility between variable values

I have a problem with my current research that I have come across repeatedly over my research career in various different fields. It goes like this. You are trying to characterise instances of some ...
user avatar
  • 123
3 votes
1 answer
107 views

Modeling a special case of conservation of flow

At a particular mode, there are 2 inflow arcs, a and b, and two or more outflow arcs, which is kept to 3 for this example, i.e., c, d and e The first requirement is that only one of the two inflow ...
user avatar
  • 695
6 votes
2 answers
311 views

How to represent a constraint on the kth-smallest function?

How can I represent the following set of constraints in a linear program, where $c_1,\ldots, c_n$ are constants and $f_1,\ldots,f_n$ are functions of the optimization variables? The smallest of $f_1(...
user avatar
5 votes
1 answer
210 views

Additional resources for this type of problem formulation

I'm working on a problem with the following formulation: \begin{align} \min&\quad\sum_{i \in N} \sum_{j \in J} V_{ij}x_{ij} \\ \text{s.t.}&\quad \sum_j x_{ij} = 1 \quad \forall i \in N\\ &...
user avatar
3 votes
1 answer
156 views

Multiprocessor Scheduling Problem: How to modify some constraints after variable changing?

I am thinking about classic problems concerning partitions as the Multiprocessor Scheduling Problem (or Bin Packing or Number Partitioning): Given $n$ tasks, with times $\{t_i\}_{i\in I_n}$, and $m$ ...
user avatar
3 votes
1 answer
58 views

Disjunctive Constraint , Using Binary Variable to Replace a If or condition

I am trying to use a binary variable based on an inequality. The value of binary variable $q $ is 1 or 0 based on the following equation. [ $q $ = \begin{cases} 0,& \text{if } b \geq \pi ,\\ 1,...
user avatar
2 votes
2 answers
195 views

How to model Max-Cut as ILP

I want to model Max-Cut in IBM's CPLEX, but I fail at modeling the objective function. My attempt is to use is to sum the XOR of inclusion for vertices of each edge, as exactly then an edge is ...
user avatar
3 votes
0 answers
61 views

Car rental time series forecasting

I have the time series of car rentals/demand in a location. The time axis is every hour for 3 months. The y-axis is number of car rentals/demand. I want to do prediction for future hours given this ...
user avatar
6 votes
1 answer
337 views

How to Model Path Being Only Through Adjacent Cells

I am trying to develop a MILP for a path planning problem. I am operating on a grid of cells that represents a map. The arrangement of cells in the grid represents the placement of the cells in real ...
user avatar
3 votes
1 answer
72 views

cpu time in docplex

mdl.print_information() sol = mdl.solve() mdl.print_solution() if sol is None: print("Infeasible") print(mdl.solve_details) At the end of ...
user avatar
  • 307
2 votes
1 answer
178 views

How to model this user packing problem?

I have a system with $N$ resources. There are $K$ users in the system demanding these resources. The demand of resources for a given user $k$, $d_k$ follows $d_k\in\{1,3,6\}$ The constraints for this ...
user avatar
2 votes
1 answer
56 views

Marginal Cost of Storage vs. sum of storage cost

I'm working on a model for inventory management. I'm trying to decide for each unit if it is worth holding, or if it should be liquidated at a cost $x$. I'm wondering about the argument that marginal ...
user avatar
  • 63
4 votes
2 answers
512 views

Modeling an either-or-constraint

We would like to model a constraint for an assignment problem that dictates that either assign a specific subset of nodes $I\subset\mathcal{I}$ to a specific subset of nodes $J\subset\mathcal{J}$, or ...
user avatar
2 votes
1 answer
114 views

Coding some parameters with index zero in Julia

As part of our constraints, we have \begin{align*} &\sum_{i=1}^{I}c_ix_i\ge y, \\ &\sum_{i=1}^{I}c_{i-1}x_i\le y, \end{align*} where $y\ge0,x_i\in\{0,1\}, \forall i$. I am trying to code ...
user avatar
2 votes
3 answers
304 views

How to formulate if-then for two sums in an integer program

I have two sets of Boolean variables, $x_1, \dots, x_n$ and $y_1, \dots, y_m$ and a positive integer $b$. I would like to add the constraint: $$\text{If }\sum_i x_i = b \text{ then }\sum_i y_i > b$...
user avatar
  • 131
1 vote
1 answer
64 views

The impact of utilization rate of a queueing system on its average queue time

For an $M/M/c$ queue where arrivals follow a Poisson distribution with rate $\lambda$ and are iid, service follows a Poisson process with rate $\mu$ and there are $c$ parallel servers, we can estimate ...
user avatar
2 votes
2 answers
65 views

WIP Inventory Level Constraint?

I'm modeling a continuous-time, two-stage manufacturing process with an MIP. There are about 100 finished-goods SKUs, and each of those belongs to about 25 different semi-finished categories in a ...
user avatar
1 vote
1 answer
80 views

If $x=\min\{f(\mathbf{a}),1-\epsilon\}$, how can we model and partition $x$?

I have been dealing with a problem for sometime and although tried different things and asked some questions before, I think the problem might be somewhere that we didn't look before. Variables $0\le ...
user avatar
2 votes
1 answer
63 views

Linearizing $y=\sum_{i=1}^n(z+c)\left(\frac{r_i^2}{1-r_i}\right)\phi_i$

Variables $0\le x< 1$, $y,z\ge 0$. We have a constraint $$y=(z+c)\frac{x^2}{1-x},$$ where constant $c>0$. We partitioned $x$ into $n$ intervals of equal length and defined a new variable $\phi_i=...
user avatar
4 votes
2 answers
265 views

Trying to accelerate MILP solution

I developed a mathematical model that contains several thousand of binary variables (in addition to several thousand continuous variables). The binary variables model different things, say $X(i)$, $Y(...
user avatar
  • 1,946
2 votes
3 answers
257 views

How to use condition in cplex?

I want to use conditions to my variable. dvar boolean x[I][J][K][L] dvar in h[i] my code is ...
user avatar
  • 21
4 votes
1 answer
156 views

How to transform a (thermal) range constraint into the objective function

I have an mixed-integer linear optimization problem that includes a energetic difference equation for the temperature of a building for the time $t$: $$T(t) = T(t-1) + \frac{E^{\rm Heating}(t)-E^{\rm ...
user avatar
  • 1,576
2 votes
1 answer
511 views

Model the TSP as a shortest path

We have a directed graph $G=(N,A)$ where $N$ are the verticies $N=0,1,2,3,4,5,..,n$ the starting location is node 0. For each arc $a=i-j$ in A we have a distance $d_a>0$ So we want to start and ...
user avatar
0 votes
1 answer
89 views

How to model a simple routing problem using nodes and arcs

I have the following problem. I have a route which begins at node $0$. I want to begin and end in $0$ which is a depot. Now in this route even customer will be visited in order for example customer 2 ...
user avatar
5 votes
3 answers
793 views

how to "calm down" optimizer

I want to optimize a charging schedule for Battery Electric Vehicles (BEV) along a grid line, taking into account customer wishes (when to be done with charging with what State of Charge (SOC)) and ...
user avatar
  • 231
3 votes
0 answers
88 views

How to compute the time required to transport one unit of flow on a given path?

My question is related to freight transportation, but I am stuck on the logic. So, I am considering a path between two points $(a, b)$ where I am sending $n$ trucks where the capacity/truck is $k$. ...
user avatar
  • 83
4 votes
0 answers
75 views

Is this weighted feedback concept a known, solved, problem?

Imagine a fairly standard Thumbs Up/Down feedback system. For each piece of content they consume, every user has the ability to give a binary positive/negative feedback that piece of content. They're ...
user avatar
  • 171
8 votes
4 answers
259 views

Common problems/puzzles that can creatively be solved with linear programming?

I am interested in common problems/puzzles that have a clear set of rules/constraints and objective that lends itself to modeled and solved with a linear program. Especially for people new to LPs, I ...
user avatar
  • 433
1 vote
1 answer
79 views

Modeling constraints in gurobi

$$\max \lbrace 0, q_i \rbrace \le L^r_i \le \min \lbrace Q^r,Q^r+q_i \rbrace \quad \forall i\in N,r\in R$$ I am not sure if this type of question is allowed here but I am stuck at modeling this ...
user avatar
  • 499
1 vote
1 answer
118 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$ ...
user avatar
  • 1,946
5 votes
1 answer
102 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
754 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 ...
user avatar
  • 197
2 votes
1 answer
65 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 ...
user avatar
  • 197
5 votes
1 answer
179 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 ...
user avatar
7 votes
1 answer
215 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 ...
user avatar
5 votes
1 answer
466 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 ...
user avatar
  • 61
1 vote
1 answer
128 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 ...
user avatar
  • 19
3 votes
1 answer
76 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 ...
user avatar
  • 303
1 vote
1 answer
201 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 ...
user avatar
  • 105
6 votes
1 answer
180 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 ...
user avatar
  • 147
4 votes
1 answer
115 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 ...
user avatar
  • 147
8 votes
2 answers
611 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 ...
user avatar
4 votes
1 answer
74 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
434 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 ...
user avatar
  • 10.4k

1
2 3 4 5
9