Forum Numerical Method Optimization
Mixed Integer Programming – Possible with SuanShu?
-
oberParticipant 2012-04-12 at 2:58 pm
Dear members,
Is this a possibility? If so, how… If not does anybody know a package that can do this?
Best regards
-
Haksun LiModerator 2012-04-12 at 3:23 pm
Yes, it is possible but only starting with version 1.10.0, which is scheduled to be released in two weeks.
SuanShu has implemented these algorithms for MIP:
-
Branch and Bound
-
Cutting Plane
-
Brute Force
Please stay tuned.
-
-
oberParticipant 2012-04-12 at 3:32 pm
Thanks for the very fast response!
The problem is that I have to figure out a way to solve a MIP in java as fast as possible due to deadline constraints :(…
Anybody that could help me out? Thanks a million!!
Best regards
-
Haksun LiModerator 2012-04-12 at 3:39 pm
Maybe you can try the [tt:1ptry9u2]BruteForceMinimizer[/tt:1ptry9u2] class for now? http://www.numericalmethod.com/javadoc/suanshu/com/numericalmethod/suanshu/optimization/constrained/integer/BruteForceMinimizer.html
-
oberParticipant 2012-04-12 at 3:49 pm
Is there any example code for this?
I must say I come from a commercial background, so programming is not really my second nature, making it very difficult to understand the preceding link (I know, I’m a noob :p).
-
Haksun LiModerator 2012-04-12 at 3:53 pm
Do you want to solved a mixed integer linear programming problem? If so, that would not work. [tt:6bk2n2s1]BruteForceMinimizer[/tt:6bk2n2s1] is only for unconstrained optimization. You will have to wait for version 1.10.0 unless you have access to our daily build.
Here is an example anyway.
<br /> /**<br /> * one out of the two variable is an integer, consecutive<br /> */<br /> @Test<br /> public void test_0010() throws Exception {<br /> RealScalarFunction f = new RealScalarFunction() {<br /> <br /> public double evaluate(double... x) {<br /> return x[0] * x[0] + x[1] * x[1];<br /> }<br /> <br /> public int dimensionOfDomain() {<br /> return 2;<br /> }<br /> <br /> public int dimensionOfRange() {<br /> return 1;<br /> }<br /> };<br /> <br /> ArrayList<integerdomain> domains = new ArrayList</integerdomain><integerdomain>();<br /> domains.add(new BruteForceIPProblem.IntegerDomain(0, -5, 5));//x0 ∈ [-5, 5]<br /> BruteForceIPProblem problem = new BruteForceIPProblem(f, domains.toArray(new IntegerDomain[0]), 1e-14);<br /> BruteForceIPMinimizer solver = new BruteForceIPMinimizer(1e-14, 20);<br /> solver.solve(problem);<br /> Vector minimizer = solver.search(new DenseVector(-5.0, -5.0));<br /> double min = f.evaluate(minimizer.toArray());<br /> <br /> assertEquals(0, min, 0);<br /> assertEquals(min, solver.minimum(), 0);<br /> }<br /> </integerdomain> -
oberParticipant 2012-04-12 at 4:07 pm
Then it will not be able to solve my problem :(.
Thanks for the very fasts responds either way!
Best regards