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
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 ...
Hani Jamshidian's user avatar
2 votes
3 answers
829 views

Modeling: How to force customers visit their NEAREST facility

Let set $I$ denote the facility location set, $N$ denote the customer set, and $d_{ni}, \forall n\in N, i \in I $ is the distance between customer $n$ and facility $i$. The problem is to locate ...
Runfeng Yu's user avatar
2 votes
1 answer
213 views

Compute overlapping time

I am trying to solve an optimization problem in which there is a set of tasks, $S$, where $s_i$ and $e_i$ are the starting and ending time of task $i \in S$. Each task $i $ must be done within its ...
Christopher Expósito Izquierdo's user avatar
1 vote
1 answer
40 views

SET game: how to generate decks of 12 cards with 6 hidden sets?

This question was initially the second part of another question and justifies a new post. The context is a game called Set: In the game, certain combinations of three cards are said to make up a &...
Kuifje's user avatar
  • 13.3k
2 votes
4 answers
133 views

How to fill the days in sequence?

I have a scheduling problem. 20 hours of work load should be assigned to different days (max 4 days are available and the capacity of ech day is 8 hours max) $\sum_i h_i = 20$ $0 \leq h_i \leq 8$ The ...
Optimization team's user avatar
2 votes
1 answer
153 views

SET game: how to generate all sets with a MIP?

I am playing around with the game called Set: In the game, certain combinations of three cards are said to make up a "set". For each one of the four categories of features — color, number, ...
SetPlayer's user avatar
0 votes
0 answers
76 views

Optimize revenue function with log part

I am working on an optimization problem where I aim to maximize revenue. My current model has the following objective function: $$ Sales(P_i) * log(P_i - const_i))$$ where $P_i$ represents the price ...
MarcM's user avatar
  • 133
2 votes
1 answer
101 views

Representing a Multi-Level Categorical Variable using Big-M Method in Linear programming

I'm working with a statistical linear model where I have a variable, ( N ), representing the percentage of charging of a battery. Based on ( N ), I derive another variable, ...
MarcM's user avatar
  • 133
6 votes
1 answer
237 views

Large Language Models for Translating Natural Language to Mathematical Models - Suitable Venues?

I'm currently working on a paper that investigates the capabilities of Large Language Models (like OpenAI's GPT variants) to understand and write mathematical models based solely on natural language ...
Mehdi's user avatar
  • 683
1 vote
3 answers
96 views

Breaking symmetry

Suppose resources r1 and r2 are both able to perform jobs j1 and j2. The duration of the jobs being done is d. I would like to model the following rule: Within a time horizon H, perform j1 on r2 only ...
Clement's user avatar
  • 2,252
7 votes
3 answers
738 views

Binary logical constraint dependent on indices

I don't know if I can ask this here, but I've been pulling my hair out trying to think of how to represent this in constraints. I have two sets of binary variables: $X_t$ and $Y_{it}$. So, I want to ...
orpanter's user avatar
  • 517
3 votes
2 answers
127 views

Coefficient Scaling for MIP

I have a coefficient matrix for an MIP with a less than ideal range of magnitudes. For example, consider this constraint: $$\sum_{ij} {\rm cost}_{ij} \cdot x_{ij} \leq \rm Budget$$ $$x_{ij} \in \{0, 1\...
gomory-chvatal's user avatar
1 vote
3 answers
226 views

MIP constraints with chronological ordering

I am using a MIP formulation to decide which dates and locations (i.e. stops) should be chosen for a route that maximizes the total revenue over all chosen stops. My decision variable $X$ is the ...
3Li's user avatar
  • 35
3 votes
1 answer
104 views

using milp for a linear complementarity problem

I have to minimize $c^Tx$ subject to $Ax = b$, $x_iw_i = 0$ for all $i$, with $x$ non negative continuous and $w$ binary. What model should I use to solve this problem?
fischer justin's user avatar
2 votes
1 answer
368 views

CPLEX violating constraints (CPLEX - version 12.10 - C++)

I'm a researcher and I have a problem with CPLEX. The .lp file containing the model includes the following constraint: 1000000000 x(1,12,0) + T(1,0) - T(12,0) <= 999999992 where x and T are ...
Juliana Dantas's user avatar
3 votes
1 answer
102 views

Modify objective function for equal solution distribution

I have the following question. I have a LP with the objective function. $\max\sum_{i\in I}^{}\sum_{p\in P}^{}sales_{ip}$ Here, the number of sales over all individuals $i$ is to be maximized for all ...
lukdooxb1's user avatar
7 votes
1 answer
627 views

How can one model a binary variable?

I am looking for the formulation of a constraint that does the following. I want to introduce a new binary variable $\kappa_{it}$ that takes the value 1 if the sum of the other binary variable $\...
nflgreaternba's user avatar
2 votes
1 answer
136 views

Conditional constraints in MILPs

I want to understand how to represent iff constraints in MILPs. For example, I want to represent the following as the constraints of a MILP $$ c = \begin{cases} 1 &\text{if } d \geq e \\ 0 & \...
Anonymous Bunny's user avatar
-1 votes
1 answer
85 views

How do I translate the following constraint for gurobi py?

I successfully worked on the problem with following model in Excel, but I have a problem translating it into Python. This is the proposed way to code the problem form the book: ...
Wangcincay's user avatar
2 votes
2 answers
135 views

Transportation Problem

I want to create a transportation model. I have identified importing and exporting countries with their estimated demand and supply. The cost of transportation per one uni is already calculated for ...
user avatar
0 votes
1 answer
239 views

LP - How to model binary variable that indicates a switch

I have the following question / concern. I have a modeling problem with the decision variable $d_{ptm}$ which indicates whether product $p$ was serviced by machine $m$ in period $t$. It takes the ...
marvelfab12's user avatar
1 vote
2 answers
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 ...
A.Omidi's user avatar
  • 8,882
3 votes
2 answers
302 views

Modeling a continuous variable which can't take values between a and b

Consider two binary variables $p_1$ and $p_2$. Suppose, $x$ is a continuous variable that should not take values between $a$ and $b$. Here is my try: $$ p_1 =1 \mbox{ if } x \le a \\ p_1 =0 \mbox{ if }...
user11940's user avatar
4 votes
1 answer
92 views

Nurse Rostering constraints - LP

I am fairly new to linear programming since I came across this topic at university this semester. We mainly focus on nurse rostering. In the lecture, we created a very basic rostering model with an ...
nflgreaternba's user avatar
3 votes
2 answers
390 views

How to model a binary variable?

I am trying to find a constraint for the following relationship, but am failing a bit at it right now. I want to find a linear constraint that does the following. The binary variable $switch_{ot}$ is ...
mingabua's user avatar
2 votes
1 answer
175 views

Find the minimum number of equipment required for a service period

I'm starting to learn operations research and trying to get my head around this problem that I have. Problem statement: Find the minimum number of equipment needed to run a service schedule. There are ...
Asheesh's user avatar
  • 23
0 votes
2 answers
114 views

Is there a comprehensive list of problems in OR?

I was trying to search for different types of problems in OR and couldn't find a exhaustive list of problems. So far I have, Travelling salesman problem Cutting Stock problem Shortest path problem ...
Meet Saiya's user avatar
0 votes
1 answer
97 views

Mixed Integer Programming - How to model a term in objective function with a constant multiplied by (1-Decision Variable)

I am solving an optimization problem, where I want to minimize the objective function $$Z = \sum_q \left(D_q \text{fare}_q - \sum_{p \ne q} \Delta D^p_q \text{fare}_q \right) (1-Z_q)$$ Each $q$ is an ...
Eslam Mahmoud's user avatar
1 vote
1 answer
91 views

Workforce scheduling MIP formulation

I am working on a large scale workforce scheduling problem with a large number of hard and soft constraints. The soft constraints are modeled as objectives with penalties for violating them. So my ...
ORProfessional's user avatar
5 votes
4 answers
877 views

Rewriting if-then constraints of binary summations

Suppose both $x_{i,j}^{ab}$ and $y_{i,j}^a$ are binaries. Then how can I rewrite the following if-then in linear form? $\sum_b x_{i,j}^{ab} \ge 1 \implies \sum_{i,j} y_{i,j}^a = 0$ I was thinking of ...
linkho's user avatar
  • 177
1 vote
2 answers
167 views

how to satisfy time constraints with meeting points?

I have a specific pickup and delivery problem to work on and am thinking how to incorporate time windows effectively. The problem has some driver with some time window [$a_d, b_d$] which is the start ...
Hemfri's user avatar
  • 33
2 votes
2 answers
313 views

Model Complexity and Constraints in Mathematical Modeling

I have a few questions about mathematical modeling (MILPs mainly). My understanding is that the complexity of a model is primarily determined by the number of decision variables, rather than the ...
Rainbow's user avatar
  • 53
7 votes
0 answers
102 views

MIP formulation for graph planarity test

In this question, it was asked wether a MIP formulation exists to test for a graph's planarity. The inputs are the graph's nodes and edges, and the output would be a certificate which guarantees that ...
Kuifje's user avatar
  • 13.3k
4 votes
1 answer
264 views

MIP Model with relaxed integer constraints takes longer to solve than normal model, why?

I am currently working on my undergrad thesis which is a mathematical optimization problem of the territory design family of problems. I am using the mathematical formulation of the problem to solve ...
EduardoSalazarT's user avatar
1 vote
1 answer
55 views

Assistance in formulating implication constraints for inequalities

I would like to seek some advice on modeling the following logical implications, where $\delta$ is a binary variable, $D_{j}$ and $A_{j}$ are nonnegative discrete variables, and $p_{j}$ are ...
Mike's user avatar
  • 707
1 vote
1 answer
82 views

Traffic lights optimization (part 2)

This is a follow up question of this thread, in which it is asked how to model a circular layout of a given set of cliques of a graph, which represent simultaneous movements at an intersection. @...
Kuifje's user avatar
  • 13.3k
1 vote
2 answers
339 views

Is there a way to obtain coefficient matrix A and RHS b of constraints equation from cplex or guribi in python?

I have a non-linear program, minimizing sum of concave functions subject to linear constraints. Hence I'm using a different solver(in Julia). However, that solver assumes we have constraints in $Ax \...
Meet Saiya's user avatar
4 votes
3 answers
502 views

How can I formulate this 'if-then' constraint problem?

I have five integer variables, and I need to write some constraints on them: $x_0$ , $[x_1, x_2, x_3, x_4 ]$. $1 \leq x_i \leq 3$ if $x_0 =1$ then no constraint on $[x_1, x_2, x_3, x_4 ]$ if $x_0 =...
Optimization team's user avatar
2 votes
1 answer
48 views

A tighter relaxation of the mix logical constraints

Suppose the following logical form there exists. $$Iff: (x_{j,m} \land x_{k,m}) \implies ((C_{j} \leq S_{k}) \lor (C_{k} \leq S_{j}))$$ This is well-known as a no_overlap_constraint in the parallel ...
A.Omidi's user avatar
  • 8,882
1 vote
3 answers
87 views

PuLP ensure first and last choice

I have an assignment problem where I have $N$ locations and $M$ dates for each location, and the goal is to choose $K$ location-date pairs that maximize revenue. There are a number of constraints, for ...
3Li's user avatar
  • 35
7 votes
2 answers
320 views

Traffic lights optimization

I am interested in the following problem dealing with the optimization of traffic lights on the intersection illustrated below: The goal is maximize the duration during which each movement $m\in M=\{...
Kuifje's user avatar
  • 13.3k
1 vote
0 answers
36 views

Auxiliary parameters for two uncertain parameters Robust Optimization

I have the following constraint for robust counterpart formulation, where two uncertain parameters appear at the same time; $\sum{QG_{ij}}$*${\theta}$+$\sum_{}\sum{QD_{ij}}*p $ * ${\theta}$ where; ${...
Abde's user avatar
  • 81
1 vote
2 answers
59 views

Is it possible to route based only upon shortest path?

I have a routing problem and am wondering if it is even possible to only use the $k^{th}$ shortest path? There are a set of people with cars and a set of other people with no cars, each has its own ...
Rainbow's user avatar
  • 53
3 votes
2 answers
701 views

Writing a constraint of an integer programming in a linear form

I modeled an optimization problem in an integer programming format. The main constraint I came up with is now nonconvex. I would like to see if there is another equivalent formulation in which the ...
Red shoes's user avatar
  • 133
4 votes
2 answers
379 views

How to model $C_1=C_2$ implies $b_1 = b_2$

Suppose $C_1 \ge 0$, $C_2 \ge 0$ are continuous variables and $b_1$, $b_2$ are binary variables. How could I model the following? $C_1 = C_2 \implies b_1 = b_2$, the opposite does not hold.
Clement's user avatar
  • 2,252
3 votes
2 answers
389 views

How to model this binary constraint?

I have an optimization problem that has a variable in the matrix form. The variable is a binary matrix. It has size $M \times N = 10 \times 50$ where $M$ is the number of machines and $N$ is the ...
TheExerminate's user avatar
2 votes
2 answers
374 views

Representing "and"/"or" relationships into constraints

How do I represent the following constraints in terms of equations? For each i, either (1) holds or (2) holds- $$ x_{1}^i \geq x_{2}^i \quad and \quad x_{3}^i \geq x_{4}^i \quad {(1)} $$ $$ x_{1}^i \...
Krypt's user avatar
  • 77
3 votes
3 answers
262 views

Quantifying a measure of standard deviation in MILP

I am trying to set up a MILP for production scheduling. The specific details I'm not sure are important but in general a plant has M machines running N parts, each part requiring W workers. The model ...
Dano's user avatar
  • 55
1 vote
1 answer
68 views

how to minimize the distance to the final points with incomplete information?

Suppose we have a transportation problem similar to pickup and delivery problems. So, we have a set of drivers and a set of passengers. each passenger has predefined origins and destinations. I'd ...
linkho's user avatar
  • 177
0 votes
1 answer
82 views

Array of string in OPL

how to make 2d array of strings in Cplex //indics {string} cluster=...; setof(string) darkstore =...; setof(string)demandpoint =...; //data cluster={chav,sree}; demandpoint=[{tsnami,adholokam,...
Kiran Kumar S's user avatar

1
2
3 4 5
12