Re: [ojAlgo-user] bug report: ILP problem
Mathematics, linear algebra and optimisation
Brought to you by:
apete
From: Anders P. <an...@op...> - 2013-04-11 09:57:31
|
I've run this test case, and I've created another using the model description from your first message. By setting tmpModel.options.problem = NumberContext.getGeneral(12); I can get correct (but maybe not accurate enough) solutions to both models: OPTIMAL 4199.999999999861 @ { 4199.999999999861, 1891.9999999999998, 1929.0 } FEASIBLE 4849.999999999305 @ { 4849.999999999305, 1244.9999999999998, 1269.0000000000002, 1307.0 } With the first model description you sent in you stated the correct solution to be: x1 = 4200.000000000075 x2013 = 1892 x2014 = 1929 Do you really require full 16 digit accuracy on x1? With the second model something does go wrong with the linear solver in one of the integer solver's nodes (subproblems). That's why the result has state FEASIBLE rather than OPTIMAL. The fact that the returned feasible solution actually happens to be the correct/optimal solution is a coincidence. That problem with the linear solver is a bug - it somehow returns an infeasible solution. I'll look in to this further. Using NumberContext.getGeneral(12); as the default value for tmpModel.options.problem breaks a number of other test cases... /Anders On 8 apr 2013, at 18:02, Jeff Sherman <jef...@gm...> wrote: > Anders, > Please disregard the previous attachment and run this one. Also, on one run i got these results: > Obj val: 5250.000000000088 > Optimal: true > All vars: > x1 = 5.25E+3 > x2013 = 1244 > x2014 = 1269 > x2015 = 1308 > > > On Mon, Apr 8, 2013 at 11:52 AM, Jeff Sherman <jef...@gm...> wrote: > Andres, > Thanks for your response. The attached code produces the following results: > x1 = 0 > x2013 = 1245 > x2014 = 1269.9 > x2015 = 1306.1 > > Note that x2014 and x2015 are set as integral variables. > > If in the calls to model.addExpression, i change the strings that are passed in, I can also obtain the following results: > x1 = 2890.64039409 > x2013 = 1244 > x2014 = 1269.45812808 > x2015 = 1307.54187192 > > I did some looking into the code and I noticed in the ExpressionsBasedModel class you have: > > private final HashMap<String, Expression> myExpressions = new HashMap<String, Expression>(); > > and at points, you get a collection of myExpression.values(), the order of which is not guaranteed. I'm not sure if you care about this ordering but i thought id point it out in case. > > The correct results for the problem are: > x1 = 4849.999999997941 > x2013 = 1245 > x2014 = 1269 > x2015 = 1307 > > Please let me know if I can provide any additional information or clarification. > > Best, > Jeff > > > > On Mon, Apr 8, 2013 at 5:22 AM, Anders Peterson <an...@op...> wrote: > ...and please experiment with different values on the various model/solver options - in particular tmpYourModel.options..problem > > /Anders > > > On 8 apr 2013, at 08:58, Anders Peterson <an...@op...> wrote: > > > It's better you send me source code that I can execute and use as a test case. /Anders > > > > On 8 apr 2013, at 01:25, Jeff Sherman <jef...@gm...> wrote: > > > >> When I execute the following program: > >> Minimize > >> 1*x1 > >> Subject To > >> 1*x2013 >= 0 > >> 1*x2014 >= 0 > >> 1*x1 >= 0 > >> -5000.0*x2014 + 5100.0*x2013 + -1.0*x1 <= 0 > >> -5000.0*x2014 + 5100.0*x2013 + 1.0*x1 >= 0 > >> 5000*x2013 + 5000*x2014 = 19105000 > >> Bounds > >> Variables > >> x2014 integer > >> x2013 integer > >> x1 continuous > >> > >> I get these results which are suboptimal: > >> x1 = 5899.999999996906 > >> x2013 = 1891 > >> x2014 = 1930 > >> > >> Or these results (which seem to occur at random): > >> x1 = Infinity > >> x2013 = 0 > >> x2014 = 0 > >> > >> Using another solver, I obtain: > >> x1 = 4200.000000000075 > >> x2013 = 1892 > >> x2014 = 1929 > >> ------------------------------------------------------------------------------ > >> Minimize network downtime and maximize team effectiveness. > >> Reduce network management and security costs.Learn how to hire > >> the most talented Cisco Certified professionals. Visit the > >> Employer Resources Portal > >> http://www.cisco.com/web/learning/employer_resources/index.html_______________________________________________ > >> ojAlgo-user mailing list > >> ojA...@li... > >> https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > > > > ------------------------------------------------------------------------------ > > Minimize network downtime and maximize team effectiveness. > > Reduce network management and security costs.Learn how to hire > > the most talented Cisco Certified professionals. Visit the > > Employer Resources Portal > > http://www.cisco.com/web/learning/employer_resources/index.html > > _______________________________________________ > > ojAlgo-user mailing list > > ojA...@li... > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > > > > > ------------------------------------------------------------------------------ > Minimize network downtime and maximize team effectiveness. > Reduce network management and security costs.Learn how to hire > the most talented Cisco Certified professionals. Visit the > Employer Resources Portal > http://www.cisco.com/web/learning/employer_resources/index.html > _______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > <TestILP.java>------------------------------------------------------------------------------ > Minimize network downtime and maximize team effectiveness. > Reduce network management and security costs.Learn how to hire > the most talented Cisco Certified professionals. Visit the > Employer Resources Portal > http://www.cisco.com/web/learning/employer_resources/index.html_______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user |