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
4
votes
1answer
35 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,...
4
votes
1answer
131 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{(...
5
votes
0answers
45 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 ...
8
votes
0answers
49 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
124 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 ...
4
votes
4answers
171 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 ...
5
votes
1answer
115 views
+100

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{...
6
votes
0answers
53 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 ...
3
votes
1answer
66 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 ...
12
votes
2answers
712 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 ...
9
votes
1answer
253 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 ...
6
votes
0answers
54 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 ...
10
votes
1answer
275 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 ...
8
votes
3answers
370 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 ...
7
votes
2answers
236 views

Max flow problem without splitting the flow from the supply nodes - LP formulation help

Since max flow formulation can be easily solved using LP, I wanted to ask the following: I am trying to solve a simple max flow problem where the graph is bipartite but with one added constraint. The ...
3
votes
2answers
135 views

Find all Combinations of a Matrix

I have a $16\times11$ matrix and want to find all eligible* combinations of this matrix including always entities from all 11 columns. A simple example from a $2\times3$ matrix would be the following:...
9
votes
2answers
259 views

Debugging cplex model

I implemented a cplex model and I am convinced that the model should allow a better solution on a specific instance. However, when I impose the variable values of the solution onto the model, it ...
3
votes
1answer
76 views

Queuing Theoretic Model with Memory

Consider a telephone company which receives call request at some arrival rate and serves each request with some service rate. This can be modeled using a Poisson Process. However I wish to model the ...
7
votes
2answers
342 views

Solving a VRP (google hashcode competition) using an off-the-shelf solver

Problem summary : A complete problem description is given here Given a description of city streets and a number of Street View cars (cars that captures pictures as they move around) available for ...
13
votes
6answers
186 views

How to formulate: each pair of elements in $A$ has one common unit in $B$

We have two sets, $A$ and $B$. Some elements of $A$ must be connected to some elements of $B$, but no element of a given set is connected to another element of the same set. (Think of a bipartite ...
7
votes
1answer
115 views

Help with formulating an implication

I have a binary variable $y$ and a set of binary variables $x_i$, where $i\in I$. My problem requires that $$\sum\limits_{i\in I}x_i = b.$$ What I want to formulate is the following implication: if $\...
7
votes
1answer
110 views

CPLEX CP Optimizer Java API function missing

I can not seem to find the needed functions to model the following problem through the Java API (CP Optimizer): a machine that has downtime and sequence-dependent setup times, with the extra ...
9
votes
3answers
681 views

Modeling the Choose function

In statistics, one often encounters the choose function ${x \choose y}$ which encodes the number of ways of choosing $y$ items from a set of $x$ items. How would one go about modeling a choose ...
9
votes
1answer
110 views

How to tackle large nurse scheduling problem?

I have a nurse-scheduling type of problem with a time span of a year and many employees. Formulation My main variables are: \begin{align}x_{e,t} &= \begin{cases}1 \text{ if employee } e \text{ ...
7
votes
1answer
92 views

Maximize charging, minimize cost

The task pertains to choosing an algorithm based on the data, requirements and constraints. I have a number of electrical devices ($d_1,d_2,\dots,d_n$) with batteries. Throughout the day I will ...
7
votes
1answer
148 views

Logical Constraints Modelling using Big-M formulation

I am trying to model some logical constraints in ILOG. Logical constraints could be given such as: Constraint 1 or Constraint 2, Constraint 3 or Constraint 4, Constraint 5 or Constraint 6. The ...
8
votes
4answers
677 views

Modeling the Round (Nearest Integer) function

Modeling various non-differentiable functions is quite common knowledge including $\operatorname{abs}$, $\min$ and $\max$ functions. How would one go about modeling the nearest integer function, say ...
7
votes
1answer
171 views

Shipments consolidation - how to model mutually exclusive items with OR-Tools CP Solver in Python (multi-knapsack, updated)

I am implementing a solution for packages consolidation (basing on Nurse Problem solution) with OR-Tools CP Solver. There is a factory that manufactures some small Packages that need to be ...
6
votes
0answers
77 views

Help in solving resource allocation optimization problem

I've been pondering on this question for some work optimization, and I need some help in being directed to the right direction. I have multiple customers that require an amount of $X$, $Y$ and $Z$ ...
8
votes
1answer
180 views

Standard cumulative distribution function with optimization model variable

We all know that expressions in mathematical optimization models can't contain "black boxes" around a decision variable since everything has to be written using mathematical expressions. For example, "...
10
votes
2answers
161 views

Optimal set order to maximize stochastic reward

You have a ticket allowing you to visit up to $n$ of $M$ carnival booths offering games of chance. At each booth you have probability $p_{i}$ of winning a reward with average value $r_{i}$. Each booth ...
6
votes
1answer
75 views

How to decide the hiring headcount for a retail department

The job responsibility is exactly the same in the department. The department has a total number of working hours required. The total retention is about 50% a year, and the hiring cost is about $2000 ...
6
votes
1answer
110 views

How can I solve this problem?

I have $N_{\rm C}=8,$ and $N_{\rm U}=25$ Scenario 1: $$\frac{l_{c,u}}{\sum\limits_{c=1}^{N_{\rm C}}l_{c,u}}\ge 0.1,\quad\forall u,u=1,2,\cdots,N_{\rm U}$$ and $$\sum_{u=1}^{N_{\rm U}}l_{c,u}\le 1,...
9
votes
1answer
182 views

How can I model regression with an asymmetric loss function?

Mosek provided a concrete example of using the Huber loss function, Huber loss, which is great! One problem I am trying to tackle is to use asymmetric loss, as described in the answer of asymmetric ...
8
votes
3answers
227 views

How could we simplify solving the large scale MIPs without using any advanced methods like decompositions?

Many practical optimization models (specially MIPs) are NP-Hard and solving them need much time even with the modern solvers like CPLEX or GUROBI. One of the best way (but not easy) is using ...
7
votes
1answer
145 views

I've formulated my optimization model; now what?

I've formulated my linear/nonlinear/integer/mixed-integer optimization problem in algebraic form (possibly with the help of the folks on this site). Now what? How do I solve it?
4
votes
1answer
89 views

XOR constraint representation

In an scheduling optimization problem, for job $l$, $\xi_l$ is binary variable that $\xi_l=1$ shows job $l$ is selected. $t_{r,l}$ and $t_{e,l}$ are registration time and time that job is completed. ...
4
votes
1answer
115 views

Scheduling Optimization Problem

I want to solve below optimization problem. This is scheduling problem where I seek to complete as many of the jobs $\xi_l$ (objective function and constraint 1), with $T_C$ being the last time until ...
7
votes
1answer
141 views

Specific filter on the set using Python

I'm trying to write an optimization model using an open-source solver's Python API. I'm new to use Python. The model objective function is as follows: \begin{equation} \sum_{k=1}^{K} \sum_{j=1}^{n}\...
9
votes
1answer
82 views

Binary variable to count appearances

Let $x \in \mathbb{R}^n$ be an optimization variable. Now, at a constraint, I would like to count how many times a value, say $2$, appears in $x$ decision. I think we can have a binary variable $y_i$...
12
votes
3answers
1k views

Number of aircraft to operate in an airline company

Suppose that an airline company has X planes, in general the companies keep a number of these aircraft (say 80% of X) in reserve in case of hazards. My question is how the airline companies compute ...
9
votes
2answers
159 views

Valid Inequalities and Strong Inequalities

Consider the following mixed-integer set: \begin{equation} P(A, b ; S) \stackrel{\text { def }}{=}\left\{x \in \mathbb{R}^{n} : A x \leq b, x_{j} \in \mathbb{Z} \text { for } j \in S\right\} \end{...
7
votes
1answer
56 views

Get a MPS file using NEOS/GAMS web interface

I'm trying to use Neos/GAMS to solve an optimization problem. I will need to get a MPS file from the model. With using GAMS IDE it is easy to use an option file to get it but, it needs a licence file ...
9
votes
1answer
65 views

Using Spatial Multi Criteria Analysis for simultaneously locating various facilities?

Is it possible to use SMCA (Spatial Multi Criteria Analysis) for determining simultaneously where to locate various facilities? Suppose, for example, I'm planing to build a new city and everything ...
7
votes
2answers
401 views

Finding an Objective Function for Assigning Employees to Sequence Dates

I am using a mixed-integer-program to schedule employees to projects. These projects can have a time window to get completed from a few weeks to a few months. At the moment I am working in a ...
9
votes
1answer
82 views

How to model 24 hours demand into a daily shift schedule?

I am working on a weekly staff scheduling optimization problem with 24/7 demand. The binary decision variable is: $X_{\text{staff},\,\text{day},\,\text{shift}}$ whether to assign the staff $s$ to day ...
4
votes
0answers
181 views

How can I formulate this multi-objective optimization problem?

Now, for each system $X$ $(X=A,B,C,E)$, my objective is $$\max\min\frac{s_{x_u}}{d_{x_u}}$$ here, $x=a$ for system A, $x=b$ for system B and follows... and for the whole system, my objective is $$\...
9
votes
1answer
128 views

Profit Maximization vs Cost Minimization for Employee Scheduling

I wanted to write two objective functions for an employee scheduling problem (MIP) until it occurred to me, that one objective function may be redundant. Is there a difference between the cost ...
12
votes
3answers
602 views

What is a “hard problem” in the context of Mixed-integer programming?

As a practical (real-world problems) point of view, it's important we could solve optimization problems as quickly as possible (for instance, to release a daily schedule). Maybe a problem with many ...
12
votes
2answers
261 views

Expressing an implication as ILP where each implication term comprises a chain of boolean ORs

Consider an implication of the form $A \implies B$ where both $A, B$ comprises a chain of Boolean OR variables. For example, $(a_1 \lor a_2 \lor a_3) \implies (b_1 \lor b_2 \lor b_3)$. How can this ...