# Tag Info

Accepted

### MIP formulation for a lower semi-continuous function

You want to maximize $\max(f(x),0)$. Assume $L \le f(x) \le U$ for constants $L$ and $U$. Maximize $g(x)$ subject to $$0 \le g(x) \le U y \\ 0 \le g(x) - f(x) \le (0-L)(1-y) \\ y \in \{0,1\}$$

### What is the best way to constrain a binary matrix so that at most one row has positive values?

Adding to the solution provided by @EhsanK. By introducing a binary variable $z$, which is 1 only if all $x_{i,j}$ are equal to 0, and adding a constraint, potential symmetries in the branch-and-bound ...

### Sum only over weekend days

I would just define another set, $T^{Weekends} = \{t \in T | t\mod 7 =6 \;\vee t \mod 7=0\}$. Here I have assumed that you have a set $T$ with all relevant days. Then you can write your constraint ...

### Starting with HiGHS

With version 1.5.3 you should add constraints using the addRow(...) method in the format lhs <= constraint <= rhs ...

### What is the best way to constrain a binary matrix so that at most one row has positive values?

Introduce a binary variable $y_{i}$ and then define these constraints: $x_{i,j} \le y_{i} \quad \forall i, j \tag{1}$ $\sum_{i} y_i \le 1 \tag{2}$ So, at most one of the $y_i$ can be 1 and in that ...
1 vote

### How to identify constraints that are good candidates for being lazy constraints?

Good candidates for lazy constraints are constraints which are not active in the optimal solutions of the relaxations. Thus, removing them speeds up the relaxation. For lazy constraints to be useful, ...
1 vote
Accepted

What you could do is the following: Introduce variable $t_{ij}$ that is the time between tasks $i$ and $j$. This variable is only defined for once per pair $ij$, therefore the $j >i$. Then, you can ...
The problem $$\begin{array}{rcl} \min & \sum_{j=1}^n c_j x_j & \\ \mbox{st} & \sum_{j=1}^n x_j & = & b, \\ & l \leq x \leq u. & & \\ \end{array}$$ can ...
Primal Problem \begin{align} \text{maximize} \quad & \sum_{i=1}^n c_i x_i \\\ \text{subject to} \quad & \sum_{i=1}^n x_i = 0 \\ & x_i \ge -1 \quad \forall i=1,\ldots,n \\ & x_i \le ...