Re: [ojAlgo-user] bug report: ILP problem
Mathematics, linear algebra and optimisation
Brought to you by:
apete
From: Anders P. <an...@op...> - 2013-04-09 08:55:56
|
One or two months ago there was another problem report regarding the IntegerSolver returning non-integer solutions. That took me a long time to find/fix. The main problem was actually with the LinearSolver, and I believe it's the same here. I'm a little short on time these days. This wont be a quick fix. If you want to try to debug the problem here's a few pointers: 1) To log debug info call tmpModel.options.debug(LinearSolver.class); specifying which solver class/implementation you want to debug. 2) Experiment with different values on the various options in tmpModel.options and tmpModel.options.problem in particular. 3) The method SimplexTableauSolver#findNextPivotRow() is a very likely culprit. 4) The IntegerSolver is multithreaded. To get log statement from one subproblem at the time set a breakpoint at the very beginning of the IntegerSolver.BranchAndBoundNodeTask#compute() method. /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 |