I was wondering if someone may be able to help me characterise this optimisation problem as I am struggling to find a numerical library that will solve it and I suspect it is because I am using the wrong algorithms/techniques. I have tried the ActiveSetLineSearchSQP algorithm in the NMath library for C# without success.
I basically have an $n \times n$ array of "prices", $P$ (which are all fixed) and need to find the corresponding $n \times n$ array of "volumes", $V$ that maximise the value function:
$F = \sum_{i=1}^{n} \sum_{j=1}^{n} P_{ij} V_{ij}$
To simplify this from an implementation perspective I just consider the matrices $P$ and $V$ to be vectors and the value function their dot product. The main reason for introducing them as matrices here, is because in this form the constraints are easier to describe.
So far this problem is entirely linear and with linear constraints is relatively simple to solve. The constraints are restrictions on the sums of each column and row of the volume matrix $V$ (and here comes the non-linear aspect), where the maximum/minimum permitted values are dependent on a non-linear function of a linear combination of the elements of $V$.
This non-linear function is essentially a Heaviside step-function.
The non-linear optimisation algorithm in NMath (ActiveSetLineSearchSQP) requires that non-linear constraint functions are smooth. So in my first attempt I thought about approximating the Heaviside step-function with (for sufficiently large $k$):
$H(x) \approx \frac{1}{2} + \frac{1}{2} \tanh(kx)$
However, this doesn't seem to work at all. The algorithm just returns my "initial guess"/"start value" having not completed any iterations.
I am wondering if there is a problem with the way I am characterising the problem. Is there a better way to approach this? Any help or guidance would be much appreciated.
Very happy to clarify any of the above if it would help.
Thanks very much for your help!
Ben
EDIT: In case it helps $n$ is of the order of 10 to 15.