Taking derivatives of objective function with a binary variable to find minimum

I transform my minimization problem into one with only an objective function (no constraints). I only have one variable, which is binary.

• Can I derivate the objective and make it equal to 0 to find the objective values?
• If so, How? If you can send me an example, link, or a book to check how to derivate stuff like this, it would be amazing.

My objective function is as follows,

$$\min_x \sum_{j\in J}\sum_{i \in I} C_{ij} \sum_{i'=\tau}^i X_{i'j}$$

Let $$\tau=min(0,i-5)$$ for example. And $$X_{i,j} \in \{0,1\}$$ with $$i,j \in IxJ$$.

• Maybe this one can be helpful. Feb 28, 2022 at 10:30
• Can you say something about the signs, domains and dimensions of the variables? Feb 28, 2022 at 15:15
• Specifically, what is $\tau$ in the final summation?
– prubin
Feb 28, 2022 at 15:26
• Hi, X is binary with i,j in IxJ. And I 𝜏 is a function of i, should have fixed that. Mar 1, 2022 at 15:44

In this particular case, if $$\tau$$ is a constant (and assuming $$x$$ and $$X$$ are the same thing), the solution is trivial. Rewrite the objective as $$\min_X \sum_{i\in I : i \ge \tau}\sum_{j\in J} \left[ \sum_{k\in I : k\ge i} C_{kj} \right] X_{ij}.$$ Let $$d_{ij} = \sum_{k\in I : k\ge i} C_{kj}.$$ The optimal solution is found by inspection:$$X_{ij}=\begin{cases} 1 & d_{ij}<0\\ 0\textrm{ or }1 & d_{ij}=0\\ 0 & d_{ij}>0 \end{cases}.$$