I intend to solve the following linear programming problem using the Simplex method provided in the Apache Commons Math library. I do not get it to work and I find the API documentation limited.
Problem
Starting from the vector s0
, determine s
, the solution of:
| min f' * s
| s
|
| s.t. s_l <= s <= s_u
where f
is a vector, s_l
and s_u
are the lower and upper bounds of s
, respectively.
I can solve this problem easily in Matlab using the command linprog(f, [], [], [], [], s_l, s_u, s0, options)
and wish to do the same in Java, preferably using Apache Commons Math.
SimplexSolver
I have tried to use the Apache Commons Math SimplexSolver
similar the explanation here:
http://google-opensource.blogspot.se/2009/06/introducing-apache-commons-math.html
But I can't seam to define my bounds s_l
and s_u
and I have to provide LinearConstraint
(which I do not have any) using this method.
Are you supposed to be able to to that?