You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Piotr Kolanowski <pi...@googlemail.com> on 2011/04/15 11:12:22 UTC

[Math] MultivariateRealOptimizer: how to use commons math to solve linear programming problems

Hi all,

I'm looking for examples for MultivariateRealOptimizer. I've been
reading the available
documentation but unfortunately I still have no clue how to use it.

I would like to maximize following example objective function:

5x1 + 13x2 + 11x3

constrained by:

x1 + 3x2 + x3  <= 22,
x1 + x2 + 3x3 <= 50,

where all x >= 0

Could anyone point me to examples, documentation on how to use commons math to
solve linear programming problems?

Thanks for any help,

Piotr

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [Math] MultivariateRealOptimizer: how to use commons math to solve linear programming problems

Posted by Piotr Kolanowski <pi...@googlemail.com>.
Thanks a million!

SimplexSolver solves my problem ;-)

Cheers,
Piotr

On Fri, Apr 15, 2011 at 4:32 PM, Luc Maisonobe <Lu...@free.fr> wrote:
> Le 15/04/2011 11:12, Piotr Kolanowski a écrit :
>> Hi all,
>>
>> I'm looking for examples for MultivariateRealOptimizer. I've been
>> reading the available
>> documentation but unfortunately I still have no clue how to use it.
>>
>> I would like to maximize following example objective function:
>>
>> 5x1 + 13x2 + 11x3
>>
>> constrained by:
>>
>> x1 + 3x2 + x3  <= 22,
>> x1 + x2 + 3x3 <= 50,
>>
>> where all x >= 0
>>
>> Could anyone point me to examples, documentation on how to use commons math to
>> solve linear programming problems?
>
> You should use the SimplexSolver class in the optimization.linear
> package. It seems we forgot to put this in the user guide :-(.
> You can find example code in the unit tests in the source distribution.
> see for example
> <http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/linear/SimplexSolverTest.java?view=markup>.
>
> Luc
>
>>
>> Thanks for any help,
>>
>> Piotr
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [Math] MultivariateRealOptimizer: how to use commons math to solve linear programming problems

Posted by Luc Maisonobe <Lu...@free.fr>.
Le 15/04/2011 11:12, Piotr Kolanowski a écrit :
> Hi all,
> 
> I'm looking for examples for MultivariateRealOptimizer. I've been
> reading the available
> documentation but unfortunately I still have no clue how to use it.
> 
> I would like to maximize following example objective function:
> 
> 5x1 + 13x2 + 11x3
> 
> constrained by:
> 
> x1 + 3x2 + x3  <= 22,
> x1 + x2 + 3x3 <= 50,
> 
> where all x >= 0
> 
> Could anyone point me to examples, documentation on how to use commons math to
> solve linear programming problems?

You should use the SimplexSolver class in the optimization.linear
package. It seems we forgot to put this in the user guide :-(.
You can find example code in the unit tests in the source distribution.
see for example
<http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/linear/SimplexSolverTest.java?view=markup>.

Luc

> 
> Thanks for any help,
> 
> Piotr
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org