Given a sequence of row sums $r_1, \ldots, r_m$ and column sums $c_1, \ldots, c_n$, all positive, I'd like to find a matrix $A_{m\times n}$ consistent with the given row and column sums that has the fewest nonzero entries. That is, we want to minimize $|\{a_{ij} \ne 0\}|$ under the constraint that $\sum_j a_{ij} = r_i$ and $\sum_i a_{ij} = c_j$.
One can also think of this as a network flow problem, with $m$ sources and $n$ sinks that must be connected with the minimum number of edges to achieve the specified flow out of each source ($r_i$) or into each sink ($c_j$).
Is this a known problem, or does it fit into a well-known class of problems? What is the computational complexity of finding the optimal solution? According to the comments on this Reddit discussion, it could be related to the cutting stock problem, but it's not exactly the same.
The motivation for this problem comes from settling debts. Suppose you have a set of people $P$ with debts between them. These debts can be settled by (1) finding the net debt $d(p)$ owed to each person $p \in P$, (2) dividing $P$ into two disjoint sets of people who are owed, $P_+ = \{p : d(p) > 0\}$, and people who owe, $P_- = \{p : d(p) < 0\}$, and (3) having the people in $P_-$ pay the ones in $P_+$. Then the problem of resolving debts with the fewest transactions is equivalent to the above optimization problem, with $a_{ij}$ being the amount that the $i$th person in $P_-$ must give the $j$th person in $P_+$.