I would like to know if there is a method to solve the Problem.


**Problem**:   

Maximize the following function: $$f(p\_{1,i},p\_{2,i},\dotsc,p\_{m,i})=\sum\_{i=1}^{n}\begin{bmatrix}p\_{1,i} & p\_{2,i} & \cdots & p\_{m,i} \end{bmatrix}\*\begin{bmatrix}e\_1 \\ e\_2 \\ \vdots \\ e\_m \end{bmatrix} \* c\_i$$


where we know the values of each $e\_j$ ($j \in \{1, \dotsc, m\}$) and $c\_i$.   

The values of the $p\_{j,i}$ should be either 1 or 0 and we have the following constraints:


1. For all $j \in \{1,\dotsc,m\}$: $\sum\_{i=1}^n p\_{j,i} \le 1$.
2. For all $i \in \{1,\dotsc,n\}$: $\sum\_{j=1}^m p\_{j,i} = t\_i$, where $t\_i$ is a known value.


I would be grateful for every hint, method or solution.



Method for (binary) optimization under constraints
This is the [transportation problem](https://en.wikipedia.org/wiki/Transportation_theory_(mathematics)) in a bipartite network, with a supply of $1$ at each $j$ node and a demand of $t\_i$ at demand node $i$. The problem can be solved via linear programming, a minimum-cost network flow algorithm, or a specialized algorithm. Because of [total unimodularity](https://en.wikipedia.org/wiki/Unimodular_matrix#Total_unimodularity), you can relax the binary $\{0,1\}$ restriction to $\ge 0$ and still obtain an optimal binary solution.


