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
3
votes
1answer
82 views

How to design the objective function of an MILP problem

In an MILP problem, I wonder if it is better to use an objective function that involves as many of the variables of the problem as possible as opposed to an objective function with only a few ...
2
votes
0answers
57 views

Problem classification: optimal weights for Weighted Arithmetic Mean

I want to write an optimisation problem then solve it, to get optimised weights to compute a final score using a weighted arithmetic mean. The problem is as follows. I have an entity (an input vector ...
3
votes
1answer
110 views
4
votes
1answer
94 views

Constraint programming in OPL: intervals covering time slots

I am trying to model the following: There is a shop open from xx AM to yy PM. In each 30 min time slot, there have to be demand[timeSlot] = x employees present. E.g. the shop is open from 08am to ...
5
votes
1answer
147 views

Propagate value through a graph

Here is my question where I am propagating distance through the graph, I was wondering if it is possible to do when the graph has cycles, i.e., traveling the same node multiple time then is it ...
3
votes
1answer
99 views

Controlling the constraint execution sequence in docplex

I have tried to implement my question asked here with the help of Github code link. Below is the linearized version of the MTZ like constraint as per the answer given here. Constraints below assign ...
5
votes
2answers
262 views

How can this relationship be modelled?

I declare an array of binary variables as $y(i), i = 1, ..., N$ I would like to model the following: If $y(i-1) + y(i) = 1$ then $y(k) = 0$ for $k < i$ and $y(m) = 1$ for $m \geq i$ To make ...
4
votes
1answer
139 views

TSP subtour elimination with multiple formulations

Referring to the question here. Given a set $S$, which we need to travel following TSP rules. I was wondering if this sub tour elimination method is good enough or not? Let $b_{i,j}$ denote edge ...
3
votes
2answers
105 views

How can I direct the behaviour of a MILP Solver

I have a model involving constraints of the form $$d(i) = a \cdot W(i) + b \cdot B(i)$$ where $W(i)$ is binary and $d(i), B(i)$ are positive reals. The objective function is $\max\sum B(i)$. While ...
5
votes
1answer
182 views

How to represent multiple elements of the same set correctly?

In a mathematical model, I have a set $J$ of distinct jobs, and a constraint dealing with pairs of elements from the job set. Which of the following is the most accurate way to address two jobs $j$ ...
6
votes
1answer
139 views

TSP subtour elimination by assigning distance traveled

Given a set $S$ which we need to travel following TSP rules. I was wondering if this sub tour elimination method is good enough or not? Let $b_{i,j}$ denote edge from $i$ to $j$ is taken or not and $...
5
votes
1answer
116 views

Delayed column generation in Dantzig-Fulkerson-Johnson formulation

In TSP wiki it is said that delayed column generation method is used to solve Dantzig-Fulkerson-Johnson formulation as it has an exponential number of possible constraints. I wanted to know whether it ...
5
votes
1answer
126 views

TSP on a non-complete graph

I have a non-complete graph $G$ with $V$ vertices and a set $D \subset V$ that needs to be traveled by a vehicle and then return to source at last. Binary variables $b_{i,j}$ represent if the edge $(...
7
votes
0answers
136 views

Modeling traffic in a city

I am trying to model traffic in a city, $(i,j)$ represents a road in a city. There are $H$ vehicles in a city they have some prescheduled set of destinations to visit, $A_{j,h}$ denotes arrival time ...
12
votes
3answers
705 views

On using correct notation in research papers

This question is about using correct notation while writing a research paper. Say I have a directed graph $G$, partitioned into $T$ layers. Denote the set of nodes in layer $t$ by $V_t$. Suppose, I ...
4
votes
3answers
165 views

Problem Clustering and Suggestions for Solving it (Job-Shop?)

I am trying to find the amount that an item may get produced. To produce this item I need casting-molds. A casting-mold can be used multiple times after it becomes available again. For the ...
5
votes
2answers
296 views

How to measure model quality in OR-Tools?

After creating my model for a problem, what steps should I take to test if a change in the model is actually helpful or not? In Python, ...
3
votes
0answers
44 views

Discrete optimization in transport economics

I was working on a problem in transport economics where the optimal number of trips in a given duration of time is to be found out. The profit is a function of the price vector $p$ and time cost $c$ ...
9
votes
1answer
162 views

How to classify and model this problem?

I was given the task to model the following problem and find a solution for it, but as I do not have any experience in this field, I already have trouble classifying it. There are a number of ...
10
votes
2answers
979 views

Linear programming: objective function with “buckets”

I had a linear programming problem with the following objective function $$f(x) = \sum_{j}x_jq_jp_j - \sum_{i}\left(\sum_{j}x_jq_jC_{ij} \right) c_i$$ Where $q, p, C, c$ are known. This problem was ...
6
votes
1answer
70 views

How to minimize a weighted sum of RMSE-like terms?

I am trying to solve the following problem: \begin{align} \min&\quad f(x) = \sum_{i=1}^{n}{a_ix_i} + \sum_{i=1}^{n}{b_i\sqrt{\sum_{j=1}^{m}{\left(y_{i,j}-x_i\right)^2}}}\\\text{s.t.}&\quad x_{...
3
votes
1answer
40 views

defining Mixed integer linear inequalities for a set of variables

The problem is described as follows: considering $n$ variables which are continuous and bounded such that $$L_i \le x_i \le U_i\quad \forall i=1,2,\dots,n.$$ How can i define a set of mixed integer ...
4
votes
1answer
62 views

How to model $A_i=B_i$ for only one $i$

I would like to model the following: Only one of the following equalities can hold. $$(A_1 = B_1)\quad\text{OR}\quad(A_2 = B_2)\quad\text{OR}\quad\dots\quad\text{OR}\quad(A_k = B_k)$$ I can ...
8
votes
3answers
618 views

Bin packing variant

I am currently struggling with a bin packing variant, where we have fuel and compartments of a tank truck. Some industry constraints apply, but the whole picture is that you must fit the total volume ...
3
votes
1answer
207 views

Comparing formulation for traveling salesman

I have a graph $G$ and have a set $S$ which are the points in the graph to visit in a TSP manner. Since the length of the TSP route can't be known as it can use any number of nodes to complete the ...
5
votes
1answer
189 views

TSP with constraints in OR Tools

I am completely new to OR Tools, but what I have tried so far seems very powerful. I have, however, run into a problem that I cannot seem to figure out how to solve. I am trying to model a TSP ...
5
votes
2answers
247 views

How to model If $A \le B$ then $Y = 1$, otherwise $Y = 0$

Somehow I don't get it right. I would like to model the following conditional: If $A\le B$ then $Y=1$ otherwise $Y=0$ where $A, B$ are reals and $Y$ is binary. I can model as follows: $Y \cdot A \le B$...
8
votes
1answer
120 views

Choosing better objective function for vehicle routing problem

I have a graph $G$ and the following variables. $b_{i,j}$ is $(i,j)$ edge is taken or not. $t_{i,j}$ is time to travel $(i,j)$ $A_{i}$, $D_{i}$ are arrival and departure time at node $i$. My first ...
12
votes
1answer
1k views

How do we call this problem in literature and how to model it?

I have a set of sources and a set of sinks. Each source $s$ can produce a set of different products $P_s$. The transportation inter-sources and inter-sinks are allowed. The sources do not ...
5
votes
2answers
185 views

Trade off between number of constraints and bounds of a variable

I am not familiar with the inner working of the solvers. I mostly use the python pulp or IBM CPLEX solver. For fast execution ...
6
votes
2answers
98 views

Optimising the current model

After developing the MIP model I noticed that solver is taking a lot of time to reach the solution. So, how should I approach to optimize the current model? Are there any visualization tools or any ...
8
votes
2answers
1k views

How to formulate problems in the language of mathematical programming?

The question says it all. I am having difficulties formulating general problems (meaning no numbers just variables). When I read the solution, I understand but I can't figure how to formulate myself ...
6
votes
1answer
96 views

How to write a constraint for a directed graph?

I'm working on an optimization problem regarding a directed acyclic graph. The constraint looks in pyomo like this: ...
6
votes
0answers
111 views

Modelling issue with precedence constraint in OR-Tools

I'm trying to solve an RCPSPDc model It is infeasible, although Ilog Cplex solves it, so I think I have a modelling issue. I have more constraints but the precedence is the one that makes it ...
8
votes
2answers
126 views

Bounding arrival time at a node in a resource-constrained shortest path problem

Given a city map (a graph) $G$, $b_{i,j}$ is a Boolean variable for whether or not edge $i$,$j$ is allocated, $d_{i,j}$ denotes the distance between $i$,$j$. The objective is to move from $s$ to $e$ ...
5
votes
0answers
68 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+...
7
votes
1answer
60 views

Expressing a chain of boolean if-then with logical ANDs using MIP

How to express a chain of boolean If-then as MIP such as: If $(x_{10} \ge b_1$ and $x_{11} \le b_1)$ AND $(x_{20} \ge b_2$ and $x_{21} \le b_2)$... AND... then $y_1 = 1$ else $y_1 = 0$. So basically,...
5
votes
1answer
149 views

How to model shipment size constraint?

I am working on an LP problem where I have to model a constraint as: "The total number of units of product A and B should be shipped in multiples of $1200$" e.g. $700\text{(product A)} + 500\text{(...
6
votes
0answers
61 views

Data Formulation for Mixed-Integer-Programming Models

Until now, I have used the Gurobi, CPLEX and OR-Tools (GCO) interface to formulate mixed-integer-programming models. Recently, I have discovered MiniZinc and want to utilize it to formulate big ...
10
votes
0answers
122 views

Column generation for TSP

For teaching purposes, I would like to solve the Travelling Salesman Problem with a column generation approach. In the academic literature, an approach is proposed (for example here), where columns ...
4
votes
0answers
158 views

Publishing paper that uses LP solver to solve equation

I was reading this paper by Cerna et al. (2018)1. In the paper there are only CPLEX-solvable equations given by the authors and the results. How valuable is this paper, and what is its quality? Can ...
5
votes
4answers
199 views

MIP for similar production percentages in production planning

As a task, I want to produce three products $x,y,z$ in different quantities $a,b,c>0$ respectively. It is not always possible to produce the full amount of each product, because of a lack of ...
7
votes
1answer
163 views

Custom Nurse Rostering Problem

I've asked this question also on Math Stack Exchange. It's a custom nurse rostering problem: $N$ is a set of nurses; $S$ is the set of shift-type (morning, afternoon, night, rest) $n_\mathrm{...
7
votes
0answers
66 views

Why does PuLP call copy for addition and how can I avoid it?

Using a for loop to append terms to an expression seems to be much faster than summing a group of terms all at once. Constructing the expression using a for loop uses __iadd__, which does not include ...
4
votes
2answers
103 views

Can I export to .cpo file using OPL?

I have a model written in CPLEX OPL. Is there a way to export the model to .cpo extension? In Python ...
13
votes
2answers
792 views

How to choose between high number of binary variables or fewer number of integer (not only 0 and 1) variables in a IP formulation?

When I have to write the formulation of an IP, I usually have the choice between writing $i\times j$ binary variables with two indices such as $ x_{i,j} $ or, writing $j$ integer variables $x_i$. Is ...
10
votes
1answer
268 views

Partial Relaxation

In the context of a larger optimization problem I realized that I am missing the skill to implement/exploit the following observation: In the problem I was faced with two related sets of indicator ...
7
votes
0answers
60 views

Modelling a simple ordering problem to have balanced delivery days

Assuming that I should buy 50 items from 25 different vendors with pre-known delivery duration between 2-7 day for each, which day of a week should I place each order so that the delivery days be even ...
11
votes
1answer
291 views

Minimize number of pieces required to cover distances, with overlap

The specific optimization problem I'm trying to solve is this: Find the minimum integer number of $2$m pieces required to cover $2$ or $4$ distances of length $D$ given that adjacent pieces must have ...
9
votes
3answers
423 views

Interval variables in MIP

In Constraint Programming it is possible to use interval variables to represent intervals of time during which something happens (see here), usable in scheduling problems, for example. Is there ...