I need to solve for a n x n (n usually <12) matrix subject to a few constraints:
1.Predetermined row and column sums are satisfied.
2.Each element in the matrix having a row number greater than column number must be zero (so basically the only nonzero elements must be in the top right portion).
3.For a given row, every element more than three columns to the right first nonzero element must also be zero.
So, a 4x4 matrix might look something like this (the row and column constraints will be much larger in practice, usually around 1-3 million):
|3 2 1 0| = 6
|0 2 1 1| = 4
|0 0 2 1| = 3
|0 0 0 4| = 4
3 4 4 6
I have been trying to use some solver approaches to do this in excel and also have tried some R based optimization packages but have been so unsuccessful so far.
Any suggestions on how else I might approach this would be much appreciated.
Thanks!