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.

567 questions
Filter by
Sorted by
Tagged with
51 views

Mixed Integer Linear Programming

I don't know if this is appropriate and accepted here, so I apologize in advance. I just really need help in a problem that I've been working on for months now. Is someone up to help me create a model ...
32 views

Need help with understanding LP and ILP modelling

Hoping someone may be able to point me in the right direction. Im looking more for a "Tutor" to help with my Uni work. I am struggling to grasp LP, ILP and NLP concepts. The only part I seem ...
58 views

How to constrain variables to fit a normal distribution

Given a time series $s_t$, I would like to define for each $t$ a perturbation $e_t$ such that the set of all $e_t$ "fits" (within some range) a normal distribution with mean $\mu=0$ and a ...
34 views

Add second "constraint" to model a binary variable

in my model I have the binary variable $f_{ij}$ which pushes a time-dependent $j$ integer variable $D_{ij}$ to zero if $f_{ij}$ takes the value 1 and keeps the integer number if $f_{ij}$ equals 0. Yes,...
56 views

Is it possible to transform MIQP into MILP without introducing new variable?

I have a QP optimization problem in the form $$\min {\bf x}^T{\bf Qx}-{\bf c}^T{\bf x}$$ here $\bf Q$ is a symmetric matrix. $\bf x$ is the optimization variable, and it is binary. Is there a way to ...
316 views

How to maximize the number of variables with value at least 0?

Given a matrix $A$ and a vector $b$, I would like to find a vector $x$ satisfying the set of linear constraints $A x \leq b$, and subject to that, contains as many variables as possible with ...
482 views

A relaxed version of job shop scheduling

I am working on a formulation for a problem that seems similar to the bin packing problem. My problem variables include items that are to be placed in bins, special events that are conditionally ...
435 views

Trouble with optional nodes in a VRP model using Gurobi for python

I am currently working on a VRP problem where the vehicles are electric. This means that I have range restrictions, and charging stations as nodes which are optional to visit. In my model I have the ...
1 vote
110 views

Modeling of a special form of the precedence constraint

There exists a scheduling problem in which some tasks should be processed on some resources. Additionally, each task needs to be assigned to a specific position on each resource. Let the decision ...
26 views

R package cannot find PYOMO. How do I point to the correct location of where it's located?

As a quick note this is a re-post from the main StackOverflow. I am trying to use the PYOMO linear programming solver from within an R script. When I type ...
1 vote
83 views

volume-weighted mean equality constraints

I have the following optimization objective function for a dynamic pricing problem: \begin{align*} sum\_profit = \sum_{i \in sales\_point} \Bigg( constant[i] + {elasticity[i]} \cdot (movement[i] + ...
121 views

Converting a piecewise function to linear equations

I am trying to build a MILP model. In this model, I have a dependent variable (alpha) that its value depends on the value of some other variables (or different combination of some other variables). In ...
122 views

To maintain safe order level from a customer

A telecommunication company (CALLME TEL Co., Ltd) receives and processes customers’ orders. Orange Co., Ltd is an important customer, who mostly places orders every 2 months. Medium quantity of ...
73 views

Are there standard symbols to describe discrete event simulations (DES)

I just wonder, whether there is a good reference for the symbols used in a flow chart to describe a DES process. I am looking for something like Kendall notation but with a reference to the symbols. I ...
135 views

I am reading these notes from Stanford called "Optimization with uncertain data". In section 2.2, Example 2 (page 7), the author mentions the following portfolio problem $(P)$: \max \; t ... 0 votes 1 answer 78 views How to model this constraint for a QP problem? I have a system with 100 users. There are 6 resources. At any point of time, only 2 resources are made available and those resources can be shared among the users. Some users may not get any resource, ... 0 votes 0 answers 53 views How to initialize a parameter (belonging to the first stage model) in a two stage model, taking its value from second stage model? I am working on a two stage approach in order to reduce the complexity of a scheduling model which is an NP-hard problem. I have to implement a while loop in order to repeat solving the models in case ... 0 votes 0 answers 33 views proper notation for union of dictionary Traditionally, our notation has separated out a set and values associated with said set. We'll say something like the state is a tuple of (V, f), where V is a set of control values and f is a ... 5 votes 1 answer 232 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\\ &... 5 votes 3 answers 3k views How to represent an integer variable via binary variables? Suppose we have a model with N integer variables, i.e. x \in \mathbb{Z}^{N} with L \leq x \leq U. How can we represent the integer variables via binary variables? Or in other words: how can we ... 1 vote 1 answer 109 views Incorporate fixed effects in pricing decisions with linear models I have the following model the predict the log of volume: fixed_effect + day_of_week_effect + elasticity * (Price - competitor_price). I want to formulate an optimization problem that maximize my ... 0 votes 1 answer 86 views Deploying optimization model to production environment I have developed an inventory optimization model for my warehouse and I want to know, how to validate this model, perform User acceptance testing and deploy it to production environment? 1 vote 1 answer 168 views Lagrangian Relaxation Lower Bound exceeds the Upper bound and the Optimal solution I'm trying to minimize an MIP model employing a Lagrangian relaxation approach. However, I've encountered an issue where, in certain instances, the lower bound (resulting from the Lagrangian sub-... 0 votes 1 answer 119 views Generalize working days constraints I have the following constraints. The first ensures that in my shift plan there are always exactly two days off between blocks of working days and only then does the next block begin. It reads as ... 3 votes 2 answers 184 views Can an Operations Research model optimize on a vector's indexes? Theoretical model Suppose that I have an input vector E_{t}\in\mathbb R^n for n\in \mathbb N Suppose that I want to optimize \displaystyle\max_{t,x} E_tx. That is, my decision variables are the ... 1 vote 0 answers 31 views Modeling start point constraint for TSP in the Dantzig-Fulkerson-Johnson formulation I'm trying to use the DFJ formulation to solve TSPLib problems using JuMP and Gurobi. I want to add a constraint to the starting point by fixing either the start or the end to the first node (because ... 1 vote 1 answer 114 views How to model the following Constraint I would like to model the following: B \le \alpha \implies \sum_i W(i) \ge \beta, where B a continuous variable, W(i) binary variables, \alpha a real constant number, \beta an integer ... 3 votes 1 answer 297 views How to convert non-normal probabilistic constraints to deterministic ones for mathematical modelling? I am working on a chance-constrained optimisation model that takes into account uncertainty. I am aware of how to convert constraints that are of a probabilistic nature into the equivalent ... 0 votes 1 answer 63 views Formulation of a stepwise linear approximation I am currently trying to solve an MILP in Gurobi. Unfortunately, Gurobi does not support non-linear functions and I would like to do the following. I currently have the following constraint. It ... 3 votes 2 answers 221 views Convex equivalent of a constraint I have a constraint as follows in my MILP model: \sum_{e} (a_1(e) - a_2(e))^2 \leq M Where, a_1(e) and a_2(e) are binary variables. Would you please guide me how can I find the equivalent ... 1 vote 3 answers 190 views Formulating a constraint to select the minimum value of an index To provide a clear description of my problem, let me outline the scenario. I have a binary variable \phi_{k,c} where k is an index belonging to the set \{1, 2, 3, ..., 9\}. As an example, for a ... 2 votes 1 answer 63 views How to Group IDs Based on the Difference of Each ID’s Min and Max Value? I have a dataset that contains IDs along with their corresponding minimum and maximum values. Here’s a sample of the data: ... 1 vote 2 answers 90 views In a routing and scheduling problem with break consideration, How can I determine whether a node is met before a break or after it? I'm working on a routing and scheduling problem in the home care services context. I consider a break as a dummy patient, so routing and scheduling are also implemented for the break node (with some ... 0 votes 1 answer 101 views Travelling salesman problem This is a CVRP problem and I have difficulty understanding the constraints in the red box. For the sub-eliminator constraint (MTZ), my question is how can we make it on our own? I am sure there is ... 1 vote 1 answer 59 views Modelling set of binaries as SOS1 H.P. Williams states in his book "Model Building in Mathematical Programming: "An SOS1 is a set of variables (continuous or integer) within which exactly one variable must be non-zero." ... 0 votes 0 answers 71 views Removing min operator from max objective I am reading a paper where the authors made the following statement on page 16: I wonder why dropping the 'min' operator inside a 'max' objective function is a valid operation here. Any explanation ... 1 vote 1 answer 86 views Problems with Big-M Constraint I have the following constraints for my roster optimisation problem: \begin{align} &(1-r_{i,t})\le \sum_{j=t-\chi}^{t-1}sc_{i,j}\quad &\forall i\in I, t\in \{1+\chi,\ldots,T\} \end{align} \... 1 vote 0 answers 43 views How to model membership to a set using MILP? Consider the following problem. I have two regions X1=[a,b] and X2=[b,c]. Notice that they are disjoint except for point b. I have a continuous variable x and two binary variables, y_1,y_2 ... 1 vote 0 answers 57 views Dealing with a problem that contains a specific structure with a standard MILP solver Suppose we have a specific formulation in which contains a special structure. For example, the formulation has a block diagonal format with some linking constraints. As far as I know, this format ... 1 vote 1 answer 149 views Creating a decision variable that is the sum of other variables in PuLP I'm trying to represent the following problem with PuLP: A car factory needs to maximize profit with an X amount of car models. Each car model has an individual profit and a manufacturing limit, and ... 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 ... 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 ... 1 vote 1 answer 156 views Job Scheduling with Energy Consumption using Linear Programming I'm looking for some advice for an optimization problem regarding scheduling jobs in a datacenter. So I have a list of jobs and each job has a required time for finishing and a number of cores it has ... 11 votes 1 answer 500 views Modeling an assignment/scheduling problem to minimize total wait I have an assignment type problem in which there is a set of students, S, and a set of training classes T. Each training has a fixed start and end day and can accommodate at most 1 student. In ... 3 votes 1 answer 126 views Nurse Rostering Code with custom constraints Not Working Could someone please check this code. I modified constraints as : No. of nurses - 10 Max No. of nurses in Morning/Afternoon/Evening Shifts - 3/4/2 Max no. of shifts in a week per nurse - 5 ... 2 votes 1 answer 125 views How to model a set of integer variables getting assigned different values than another set of integer variables Assume we have variables x_1, x_2, x_3, x_4 that each can belong to \{1,2,...,10\}. How can we model a constraint that variables x_1, x_2 get assigned different values than x_3, x_4? Because ... 8 votes 1 answer 203 views Strategy for filling a table only slightly dependant on the number of columns I'm using the OR-Tools CP-SAT solver to fill a table with integers, with various constraints, as illustrated by the x in the following figure. ... 4 votes 0 answers 106 views Modelling issue with rcpsp and boolean expressions I'm trying to solve an RCPSPDc problem in OR-Tools with CP-SAT solver. In my RCPSPDc model (with discount rate) i want to set this objective:\max_{s}\sum_{j\in J}\text{profit}_{j}\cdot \frac{1}{(1+...
I'm using the OR-Tools CP-SAT solver on a list of $n$ boolean variables $x_i$. I'm trying to maximize the minimal distance between two true variables in this list, as illustrated by the following ...