0

I am new to linear optimization and currently trying to use the SimplexSolver.class from org.apache.commons.math3.optim.linear.

So I looked up some examples on how to use it, to understand it and also to recall what the Simplex Algorithm exactly processes and how it works.

But unfortunately, I encountered some problems. For all the examples I was able to find, the class is used in that way:

PointValuePair s = new SimplexSolver().optimize(function, constraints, GoalType.MINIMIZE, false);

But the parameters in the example don't fit with the current expectation of the function optimize. Checking out the documentation was not very helpful for me, because it just says that I need one parameter of type OptimizationData. Because OptimizationData is just an interface, I don't really know which type to use.

Does anyone have an example of how to use the optimize function properly?

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Mr. Moose
  • 101
  • 8
  • You can use any class that implements the interface. See [What is an Interfece?](https://docs.oracle.com/javase/tutorial/java/concepts/interface.html). As for example - https://stackoverflow.com/questions/17954235/hello-world-example-for-simplexsolver – rushi Nov 13 '21 at 16:17
  • Does this answer your question? [Hello World example for SimplexSolver](https://stackoverflow.com/questions/17954235/hello-world-example-for-simplexsolver) – rushi Nov 13 '21 at 16:17
  • Unfortunately, I already saw this one and it does not help. In the provided example the only answer again contains only `solver.optimize(new MaxIter(100), f, ... , ...., ... );`. And as I have stated in my question, calling the method with multiple parameters is no longer possible. So the provided answer to the linked post does not even satisfy the original question of the post. – Mr. Moose Nov 13 '21 at 18:52

0 Answers0