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
votes
0answers
7 views

Setting up a community Server for OR-enthusiasts [migrated]

It is more a suggestion than a question. I am thinking it would be a great idea to set up a OR-Discord-Server for people who are studying or working with the methods for operations research. I myself ...
5
votes
2answers
119 views

In a MIP, how to force a decision variable to be zero unless the sum of specific other decision variables is equal to a certain number?

In an MIP, how can I formulate a constraint such that a decision variable is only greater (or equal to) zero if (and only if) the sum of different decision variables is equal to something. I'm working ...
4
votes
2answers
119 views

How to model: If $X\ge\epsilon$ then $X\ge Y$

Let $0\le X\le\bar X$ and $0\le Y\le\bar Y$ be nonnegative continuous variables. Let $\epsilon$ be a small positive number. How can the constraint $X\ge\epsilon\implies X\ge Y$ be modeled?
7
votes
3answers
185 views

How to formulate the constraint If $x = k$, then $y = c$?

Given are two integer variables $L_x \leq x \leq U_x$ and $L_y \leq y \leq U_y$. I'd like to formulate the constraint $$ \text{If} \;\; x = k, \;\; \text{ then } \;\; y = c, $$ where $k$ and $c$ are ...
4
votes
1answer
89 views

Lot-sizing problem variant

I have a the following optimization problem: I have mandates,(e,g. to deliver 100 tonnes of products) that I need to schedule its delivery during the month (day 2: deliver 40 Tonnes, day 15: deliver ...
2
votes
1answer
119 views

How to code this with Cplex?

I have an optimization problem as below. For $g\in G$, let $\mathcal{N}_g$ be the nodes in group $g$, and let binary variable $u_g$ indicate whether group $g$ is used. The problem has this following ...
2
votes
1answer
123 views

Tuning the coefficients of an objective function of LP

I want to solve a problem that results in this general objective function which I want to maximize: $$a\cdot x_1+b\cdot x_2-c\cdot x_3-d\cdot x_4+e\cdot x_5$$ When I write out in full this objective ...
5
votes
1answer
87 views

Use of comparisons in objective function of an ILP

If the objective function of a problem contains a comparison between two linear statements, can the problem still be defined as an Integer Linear Program? For example: $$\text{max} \sum_{\forall i,j} ...
8
votes
2answers
207 views

VRP through constraint programming

I am with a problem that consists of determining whether a VRP instance is feasible, this question is a continuation of an older thread. In order to do it, I was thinking of using Constraint ...
0
votes
0answers
75 views

Products distribution planning model

I have a problem of planning the distribution of products for a month. I have different unique products. A Mandate is provided for each product, and the Mandated quantity for each product is to be ...
1
vote
0answers
85 views

How to approach this Truck Utilisation problem?

The problem statement currently I have is very broad (or you can say very vague at the same time): I have a number of dropping locations (Customer locations) I have the location of the HUB I have a ...
2
votes
1answer
55 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 ...
4
votes
2answers
187 views

Multi-product distribution modeling : too many constraints

I have received many helps to model the problem, thank's for that ! I just edited the post to make clear what my actuel problem is. The following model is giving me amazing results with few products (...
6
votes
2answers
71 views

If $t\le0$ then $P=1$, if $t > 0$ then $P =0$ or $P=1$

I am trying to model $t \leq 0.0 \implies P = 1.0$ else $P=1$ or $P=0$ where $0 \leq t \leq H$ is a bounded nonnegative real, and $P$ is binary. I can use the expression $t + \epsilon P \ge \epsilon$ ...
2
votes
2answers
110 views

Scheduling of planned orders while respecting certain stock levels

I am searching for the academic name of the problem of computing a valid schedule for planned order. More precisely, The problem consists of: list of orders O, available vehicle per day K, and the ...
1
vote
1answer
147 views

How do I write the following constraint?

I have defined the index for time to be T = [1,2,3,4,5,6]. I want that that the demand that to be addressed twice in a given a time period, when the difference between the time the demand is addressed ...
2
votes
0answers
58 views

Minimising average holding cost per unit time is equivalent to minimising average delay per customer in queue

This question was originally asked on Math Stack Exchange. It is probably better suited here. Introduction When one thinks about a queue, it is natural to want to find a policy that minimises the ...
2
votes
1answer
116 views

How to compute the minimum number of vehicles required

I am trying to solve the following problem: I have a set of $N$ requests that must be processed by vehicles. I do not know the locations of these requests. Requests can be processed by a same vehicle, ...
1
vote
1answer
52 views

Print Intermediate Solutions of Scheduling Problem and tackling FLAGS in jupyter notebook

I tried this code and it goes on and I'm clueless when it'll end so I manually interrupt it. Is there any way we can see intermediate solutions that are feasible solutions and can we limit time or ...
3
votes
1answer
90 views

How to exponentiate binary variables in QUBO-type problems?

Ising Model In an Ising model, the Hamiltonian of one configuration of spins $\vec{s}$ is: $$ H(\vec{s}, \mathcal{J}, \mathcal{h}) = \sum_{i} h_{i} s_{i} + \sum_{i \ne j}J_{ij} s_{i}s_{j} $$ where ...
2
votes
1answer
88 views

Violation of specific constraint in Pulp

I have successfully implemented a program where I allocate N truck drivers to M gathering hubs for each one of the days of the ...
8
votes
2answers
177 views

Inverse Ising problem

Inverse Ising Problem The inverse ising problem means fitting the coupling $J_{ij}$ and field $h_{i}$ parameters given a sample of configurations of spins. Each spin $s_{i}$ is either +1 or -1. The ...
4
votes
1answer
111 views

How do I formulate constraints that check if a parameter is between certain values, using binary variables?

I have $3$ parameters $a_1,a_2,a_3$ and a variable $d$ and $3$ binary variables $b_1,b_2,b_3$ and a "result" variable $s$. How do I model constraints so that: If $d$ is between $0$ and $a_1$...
5
votes
1answer
88 views

if $x = 0$ then $y \ne b$

I'm trying to model the following: if $x=0$ then $y \ne b$ $y$ is a positive integer number( $y\le U$) and $x$ is binary and $b$ is a constant.
9
votes
1answer
261 views

How to linearize membership in a finite set

Given finite set $S$ and variable $x$, how do I linearize the set membership constraint $x\in S$?
0
votes
1answer
122 views

Gurobi: How to define constraints that can accept multiple different values? [duplicate]

I have a question about Gurobi. How do I define a constraint that can accept multiple different values? For example, a sample constraint is shown as follows: ...
1
vote
0answers
88 views

How do I define multiple indices for the same set in python? (using CPLEX to solve a MILP)

I am using docplex in Python to solve a MILP and I am having some trouble defining the indices and sets of my model. I want to translate $w,v,a\in W$ into Python. In this case, $W$ is a set, and $w, v$...
1
vote
1answer
116 views

How to make the solution of linear programming within the specified elements [duplicate]

The constraint value of a variable must be an element of the specified list.A simple example is shown as follow,in which the value of the...
6
votes
1answer
181 views

Guides for strong MILP Formulations

When developing MILPs, often there are different alternatives possible to express a constraint. The question then arises, which of the alternatives is better, meaning, which alternative is expected to ...
1
vote
0answers
16 views

Prospective study and ascertainment of the exposure during the follow-up period [closed]

I'm reading several prospective studies published in top journals where a baseline modifiable exposure was associated with a final outcome. Just as an example might be this study. The Authors aimed to ...
5
votes
1answer
478 views

MILP - stronger models

Let $y, x_1, x_2, x_3$ be binary variables. The following holds: $y=1 \implies x_1=1, x_2=1, x_3=1$ I can model this by requiring (1) \begin{align}x_1 &\ge y\\x_2 &\ge y\\x_3 &\ge y\end{...
5
votes
3answers
2k 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
2answers
165 views

How to make the elements of the solution of gurobi belong to the elements of the specified list?

If I want to use the elements of the list as the range of the solution, like list1 = [10,20,50,60,30],and the elements of the solution must belong to the elements of the list The sample example as ...
1
vote
0answers
70 views

How can I set the solution of gurobi to be a multiple of 10 instead of all integers?

For example, the solution for gurobi has two solutions, as follows: [10,20,50,70] [55,79,30,80] I only want to output solutions that contain only multiples of 10. The sample example as follow: ...
2
votes
1answer
108 views

Obtaining solver timings from Pyomo

I would like to seek some advice on the following: I am currently using Pyomo to generate my MILP model in Pyomo and solve it using Gurobi, respectively. As the solution process is iterative, I would ...
4
votes
1answer
114 views

Problems modeling a constraint in network design problem

I'm working on a network design problem where the objective is to minimise the network design cost. Given a graph G = (V, E) and a set of point-to-point demands K, the task is to route the demands and ...
4
votes
1answer
154 views

How to partition a graph with optimal number of groups?

I have a graph with $N=12$ nodes. Some nodes may not have any edge between them. every edge has a weight. How to find the optimal partitioning of the graph so that total weight in the system is ...
3
votes
1answer
121 views

Best way to add dummy to transportation problem? Zero cost will be always chosen first?

I know that an unbalanced transportation problem could be made a balanced transportation problem by adding a dummy node which equals the difference between demand and supply. In literature, dummy ...
7
votes
1answer
240 views

Effect of 'unused' variables on the result and runtime of optimization algorithms

I have a general question about the effect of 'unused' variables on the result and runtime of optimization algorithms. I try to explain my question by giving an example. Let's say I have 2 type of ...
5
votes
1answer
163 views

How to model this multi-commodity flow problem with a twist?

Problem description I am working on a variation of the multicommodity flow problem on a graph $G=(V,E)$. I have requests $r_{uv}$ for pairs of nodes $(u,v), u\in V, v\in V$, which means that $r_{uv}$ ...
4
votes
2answers
167 views

Setting up Branching Priority for GUROBI in Pyomo

I am currently experimenting with GUROBI and would appreciate some kind advice on the following: In Pyomo: Setting variable branching priorities, there was a response to doing so for CPLEX, hence I ...
2
votes
1answer
64 views

Finding the minimum of a group of timings

I would like to seek some modeling advice on the following: Say for instance I have 5 nodes representing workstations of the operation of 5 jobs, and that I have less than 5 vehicles. Say I have two ...
5
votes
2answers
432 views

How to minimize the number of breaks in sports scheduling?

I have the following sports scheduling problem. For $n$ teams and $m$ rounds, I define the binary decision variable $$ x_{i,j,s} = \text{1 if team $i$ plays at home against team $j$ at round $s$, 0 ...
7
votes
1answer
145 views

How can I strengthen a family of constraints in the presence of a clique constraint?

Suppose $x_i$ are binary variables, $y_j$ are arbitrary variables, $a_j$ and $b$ are constants, and I have the following linear constraints: \begin{align} x_i + \sum_j a_j y_j &\le b &&\...
2
votes
2answers
98 views

How to deal with a decision variable in the objective function that depends on if-else conditions involving other decision variables?

I'm modeling an optimization problem in which a decision variable $x_1$ in the objective function depends on if-else conditions involving decision variables $x_2$ and $x_3$, as the following equation, ...
5
votes
1answer
210 views

How to set a limit for a switch to 0 of a variable for 2 variables combined

I have a follow up question to another question of mine How to set a limit for a switch to 0 of a variable about counting the number of switches to 0 of one decision variable. Now I would like to ask ...
0
votes
0answers
68 views

Recommendations on Operations Statistics/Analytics Approaches/Materials

I'm an operations data analyst. I was wondering if I can get recommendations on books/videos on statistical models specific to optimizing business operations through analytics and statistical modeling....
3
votes
1answer
76 views

Obtaining linear relaxation objective value from MILP model coded in Pyomo

I would like to seek some advice on modeling the following: I am currently using Pyomo to generate my MILP model in Pyomo. It seems that it is not possible to cast the integer and binary variables to ...
5
votes
1answer
195 views

How to set a limit for a switch to 0 of a variable

I would like to know how to define a constraint to set a limit for switching to 0 for a decision variable? So I have a linear variable $x(t)$ which quantifies the modulation degree of a heating device....
12
votes
6answers
913 views

Where can I find documentation on good practices for efficient formulations of a problem?

I am sort of new to mathematical optimization and have to build some fairly complicated models for my thesis. I was wondering where I could find literature to help me develop more efficient versions ...

1
2 3 4 5
7