I have the following optimization problem which is a MILP. I can solve it with a MILP solver.
\begin{align}\min_t&\quad t\\\text{s.t.}&\quad d_{c}-t\le \sum_{n=1}^{N} B_{n,c}x_{n}\le d_{c}+t,\quad\forall c\in\{1,2,\cdots,C\}\\&\quad\sum_{n=1}^{N} x_n = M\end{align}
where
$B$ is a binary matrix of size $N\times C$
$d$ is a known vector of the positive numbers of size $1\times C$
$M$ is a known parameter
$x_n$ is an optimization variable (integer variable, $x_n\ge 0$, $x_n\in\{0,1,2,3,\cdots,M\}$)
$t$ is also an optimization variable (integer/continuous)
Therefore, I am looking for a heuristic solution to the problem above.
$"EDIT"$
I have $C=10$, $N=6$, and $M=50$. Each row of $B$ has 3 ones. $d=\begin{bmatrix} 32 & 14 & 18 & 20 & 10 & 15 & 10 & 12 & 16 & 18 \end{bmatrix}$
With @prubin's approach:
Lets say, the first 5 rows of B looks like this
$\begin{bmatrix} 1 & 1 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 1 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 1 & 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 1 & 0 & 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 1 & 0 & 1 \\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 1 & 1 \\ \end{bmatrix}$
With the approach, we will have $M$ iterations. In each iteration, we increase one of the variables $x_n,n=1,2,\cdots,N$ by 1.