Skip to main content

New answers tagged

4 votes
Accepted

Avoid double counting in objective function for a maintenance scheduling problem

You want to minimize $\sum_i \sum_t r_t \max_j x_{ijt}$. To linearize this objective, introduce binary decision variable $y_{it}$ to represent $\max_j x_{ijt}$, impose constraints $x_{ijt} \le y_{it}$...
RobPratt's user avatar
  • 32.7k
1 vote

Inconsistencies in modeling a binary variable that indicates a switch

I'm going to assume that time indexing starts at 1. You can introduce a new binary variable $\gamma_{p,t}$ together with the constraints $$\gamma_{p,1}=1$$ $$\gamma_{p,t} \le \gamma_{p, t-1}$$ $$\...
prubin's user avatar
  • 39.6k
1 vote

PULP: Optimization Assignment of Bicycle production per month

For both Q1 and Q2, you need to enforce $y_i = 1 \implies x_i \ge 1$, which you can do via linear constraint $y_i \le x_i$. For Q1: Replace $15 x_C$ with $15(1 - 0.2 y_A y_H) x_C$ in the working ...
RobPratt's user avatar
  • 32.7k
6 votes
Accepted

Model ```a > 0 implies b = 1```, where a is unbounded above

I thought of SOS1 constraints, but they state that at most one variable can be non-zero, not exactly one. This is not an issue. The constraint $$a \gt 0 \implies b=1$$ for $a\ge0$ and $b\in\{0,1\}$ ...
Erwin Kalvelagen's user avatar
0 votes

Generalize working days constraints

Have you also considered an alternate formulation where you give all possible blocks as decision variables? So, instead of working day making the model choose which working blocks should be used? ...
Arvind Kumar's user avatar
4 votes

How to linearize the following logical constraints?

Assume $0 \le x \le U$ for some constant $U$. Introduce binary decision variable $\delta$ and impose $x=y+z$ and indicator constraints: \begin{align} \delta=0 &\implies (0 \le x \le A \land y = x)...
RobPratt's user avatar
  • 32.7k
3 votes

General convention for demand determination

You should checkout this question. The answers state that often Poisson distributions are used due to nice properties and as they are often quite good representations of actual demand arrival patterns....
PeterD's user avatar
  • 1,706
14 votes

Why do I get a binary solution even when I solve an LP problem with continuous variables?

Totally unimodular (see added tag) constraint matrices have this property. One common example is when the constraint matrix corresponds to a network flow problem, with one variable per arc and one ...
RobPratt's user avatar
  • 32.7k

Top 50 recent answers are included