Non-linear NOMAD integration

My student, Matthew, has just succeeded in getting OpenSolver running with the NOMAD non-linear solver from the Gerad group. Many thanks to Jonathon Currie & David Wilson, creators of the OPTI Matlab toolbox (which also includes NOMAD), for letting us learn from your experiences in compiling this (and the COIN-OR code) under Visual Studio.

Matthew’s code is very much beta, but it shows that we can make it all work to get a powerful non-linear solver working with Excel. The challenge has been getting our VBA code to call the NOMAD C++ code which then has to call back into a thin C++ layer which runs our VBA code which re-calculates the spreadsheet for each new set of variable values; trivial, really! We initially created an XLL Excel add-in to help with this, but it turns out any DLL can do this using the Microsoft XLL interface libraries, so we now simply create a DLL that is linked into our OpenSolver VBA add-in.

Well done, Matthew, in getting this all to work, given minimal previous experience in C (and none in C++)! It’s a real privilege to work with such excellent Engineering Science students.

This will be released in the next beta version, coming soon….

Masters thesis: OpenSolver for scheduling physicians

Bernhard Aeschbacher (University of Zurich, Department of Business Administration) has just finished his Masters thesis on using OpenSolver for scheduling physicians. His thesis and Excel model are available here. It was great to see Bernard using OpenSolver’s on-sheet highlighting in his appendix to show how his model was built. Bernhard also gave me most useful feedback on a problem with non-English systems; OpenSolver 2.1 fixes this.

Masters thesis using OpenSolver

Iain Dunning just sent me a link to Katherine Perry’s masters thesis on Call Center Scheduling Problem using Spreadsheet Optimization and VBA. (You will have to click past a broken certificate.) Katherine has been using OpenSolver to solve her call center problems. Her thesis includes an appendix giving step by step instructions on installing OpenSolver that might be useful for new users.

Licenses

Mike Trick recently blogged about OpenSolver winning the COIN-OR 2011 Cup, and commented that OpenSolver was now available under the CPL. This was what we had on our web site as something we were doing, but I must confess the change from the GPL has not yet happened. At the moment, the GPL seems to meet everyone’s needs that we are aware of. However, to ensure this matter is clear, we hereby specifically give approval for OpenSolver to be distributed in its unaltered state as part of a larger piece of software, which is effectively saying that we do not consider calling OpenSolver routines from a third party add-in or VBA module in Excel to be linking in the sense of OpenSolver being a “subroutine library”. As long as OpenSolver continues to be a standalone Excel add-in, we are happy for it to be included and used in other applications.

Thanks Mike for your positive comments.

Paul Jensen – Rest In Peace

I was saddened to read in the INFORMS news that Paul Jensen passed away last week. I met Paul at the 2010 Informs conference where he gave a great talk about his set of OR and MS teaching add-ins for Excel. (See also these supplements.) We also corresponded about OpenSolver. You can read about Paul’s contributions at his University of Textas site; his obituary is available here. Just as PuLP has been picked up and supported by Stuart Mitchell after its creator passed away, I hope that someone will pick up the maintenance of Paul’s Excel tools; they are a great online legacy which deserve a life beyond that of their creator.

OpenSolver speedups

We’ve worked hard in OpenSolver 1.1 to limit the number of reads from the spreadsheet as these are slow. Testing on a user-supplied airline problem with 70,000 variables and 76,000 constraints shows that we can build this model in 164 minutes on a 2.66GHz Core 2 Duo laptop; this used to take over 12 hours in the first version of our code! If we can parse the formulae, we can make it even faster…

Tinker Tailor Solver Spy

Have you ever wondered what calculations Excel Solver does to discover your model? Be curious no longer; this spreadsheet (ObserveCalculations.xlsm) will show you exactly what goes on. Be sure to bring up the VBA Immediate window (Alt-F11) to watch the calculations in real time. To make it easier, we’ve also copied some of this output into the sheets. You can, of course, also use this to watch OpenSolver doing its work. Enjoy. PS: You’ll see that things have changed quite a bit between Solver 2007 and Solver 2010…

Ranges and ‘Assume Non-Negative’ Quirks

I learnt a lot working on OpenSolver 1.1beta. For example, did you know that Excel’s union operator can produce ranges with duplicate cells!? Pearson describes the problem here. (We haven’t implemented this yet in OpenSolver as it may slow things down, but will do if it causes problems.) I also realised that Excel allows ranges (such as for the decision variables) like “A1:A5,A2:A6” that internally overlap; OpenSolver now internally fixes ranges like this when they occur.

I’ve always told my students that Solver’s “Assume Non-Negative” applies zero lower bounds to all the variables. I was wrong, as demonstrated by Solver’s new wording “Make Unconstrained Variables Non-Negative”. Lower bounds are only applied to variables that don’t have ‘explicit’ lower bounds set for them in the constraints. ‘Explicit’ here means the variable appears in the left hand side of a constraint which has a right hand side specified by a range or a constant. However, my preliminary tests suggest that Excel 2010 also requires that the left hand side of the constraint not include any non-decision variables. This can lead to different solutions when you move to Excel 2010, which seems rather strange. OpenSolver used to apply zero lower bounds to all the variables. The new version now implements the 2007 approach; you can see this in the new Bounds section in the .lp files.

Finally, did you know the right hand side of a constraint can contain a formula? This is a direct consequence of Excel allowing formulae to be entered as a “named range” (not that it is actually a range!). OpenSolver now handles these (not that I’d suggest you use this obscure feature).

Cited in Interfaces

OpenSolver has been mentioned in the latest INFORMS Interfaces journal in a COIN-OR article by Kipp Martin, who writes: 

Users of Excel should also be aware of OpenSolver. This is an Excel VBA add-in that extends the Excel built-in solver from Frontline Systems Inc. This add-in allows the user to formulate a model using the builtin Excel solver. However, rather than optimize the model with the built-in Excel solver engine, with the OpenSolver add-in, you can solve the problem using the COIN-OR Cbc mixed-integer linear programming solver. Thus, there are no size limitations based on license restrictions. Students can build and experiment with large realistic-sized models. Another feature of OpenSolver is that it has a command, View LP Model, which shows the algebraic statement of the model. This is a nice feature for debugging and actually seeing the underlying constraints and objective function in an easily readable format. Although built on COIN-OR software, OpenSolver is not available at the COIN-OR website; it must be obtained at http://opensolver.org/. 

Martin, Kipp: Tutorial: COIN-OR: Software for the OR Community, Interfaces 40(6), pp. 465–476, INFORMS 2011
http://interfaces.journal.informs.org/cgi/reprint/40/6/465 (subscription required) 

Blogged by Mike Trick

Mike Trick, who visited New Zealand a few years ago, has blogged about OpenSolver. This has generated an interesting discussion about the GPL license, and whether this will limit what people want to do with OpenSolver. I’ve been having similar discussions with Ted Ralphs, the CBC maintainer, and Stu Mitchell of PULP fame. If anyone wants OpenSolver to be available under another license, then please let me know.

As well as all the contributions Mike made to OR in New Zealand during his stay, I also have to thank him for his Travelling Umpire Problem (TUP) which kept my Heuristics class very busy.

I hadn’t come across Larry’s IEOR Tools site before following the link on his OpenSolver comment. He too has written about OpenSolver. He’s created an interesting site with a good open source emphasis that I’ll be visiting more often.

Andrew