Since this is a linear problem you can use SimplexSolver (only available in Commons Math 2.0). You can reformulate the problem to the equivalent: Maximize C1 (you can put anything here since in your case you don't care about the maximization aspect of the problem but only the constraint satisfaction) Subject To 1 * c1 + 4 * c2 + 4 * c3 + 4 * c4 = 2.5 1 * c1 + 4 * c2 + 1 * c3 + 4 * c4 = 3.0 1 * c1 + 1 * c2 + 1 * c3 + 1 * c4 = 1.0
> 1 *c1 + 4 * c2 + 4* c3 + 4 * c4 = 2.5 > 1 *c1 + 4 * c2 + 1* c3 + 4 * c4 = 3.0 > > here the constraints: > 1) c1+c2+c3+c4 = 1 (of course this could be expressed as an additional > equation: c1 + c2 + c3 + c4 = 1.0) > 2) c1,c2,c3 and c4 are all positive > -- View this message in context: http://www.nabble.com/-math--Re%3A-solving-a-linear-optimization-problem-with-commons-math---tp14624075p23548298.html Sent from the Commons - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
