andreasks

20 Reputation

One Badge

8 years, 329 days

MaplePrimes Activity


These are replies submitted by andreasks

Thanks for the massive response!

 

This seems to be a bug for win64-bit, because a Linux and Mac software solves the problem. The NLPSolve can solve the problem on my setup without any problems which is odd because the problem isnt Non-linear. 

I have tried to upload the maple-sheet. 

 

To clarify some things:

Im not trying to solve the binary problem im trying to solve the LP-relaxation (in this case throwing away the binary constraint) of the binary problem. This is a very common method inside the integer programming field to get an upper bound. Actually im used to dealing with much more complex solvers like CPLEX and GAMS but since their license is very expenzive we cant give this out to all of our students, where if we had maple to do it would be much easier. So at the moment im testing it as a valid solver. 

The original code:

restart; with(Optimization);

LPSolve(3*x__1+14*x__2+18*x__3+6*x__4+2*x__5, {3*x__1+5*x__2+6*x__3+2*x__4+x__5 <= 10}, x__1 = 0 .. 1, x__2 = 0 .. 1, x__3 = 0 .. 1, x__4 = 0 .. 1, x__5 = 0 .. 1, maximize = true);
Warning, problem appears to be unbounded
 [21.5000000000000, [x__1 = HFloat(0.5), x__2 = HFloat(0.5), 

   x__3 = HFloat(0.5), x__4 = HFloat(0.5), x__5 = HFloat(0.5)]]

 

The code that solved it:

f := 3*x__1+14*x__2+18*x__3+6*x__4+2*x__5; cstr := {3*x__1+5*x__2+6*x__3+2*x__4+x__5 <= 10}; res := Optimization:-NLPSolve(f, cstr, x__1 = 0 .. 1, x__2 = 0 .. 1, x__3 = 0 .. 1, x__4 = 0 .. 1, x__5 = 0 .. 1, maximize = true);
          3 x__1 + 14 x__2 + 18 x__3 + 6 x__4 + 2 x__5
        {3 x__1 + 5 x__2 + 6 x__3 + 2 x__4 + x__5 <= 10}

 

But this isnt a complete solve of the problem because this will also solve a non-linear problem and therefore i have to prove convexity. 
 

Hey, thanks for the NLPsolve solution it worked!

Im not trying to solve the binary problem im trying to solve the LP-relaxation (in this case throwing away the binary constraint) of the binary problem. This is a very common method inside the integer programming field to get an upper bound. Actually im used to dealing with much more complex solvers like CPLEX and GAMS but since their license is very expenzive we cant give this out to all of our students, where if we had maple to do it would be much easier. So at the moment im testing it as a valid solver. 

Page 1 of 1