Non-Linear Solver Doesn't Complete with Found Min/Max Value

Discuss the spreadsheet application
Post Reply
Anagoge
Posts: 17
Joined: Mon Sep 15, 2008 9:19 pm

Non-Linear Solver Doesn't Complete with Found Min/Max Value

Post by Anagoge »

I'm using the latest beta of the Sun non-linear solver with OOO 3.1 under Windows Vista-64 working with a 8 MB .xls file:
http://wiki.services.openoffice.org/wiki/NLPSolver
http://extensions.services.openoffice.o ... /NLPSolver

I'm trying to maximize a value, and the solver runs and is able to improve and optimize my problem as the displayed Current Solution number in the enhanced Solver Status progress dialog states, but once either the solver computation completes the requested number of iterations, or after it hits the stagnation limits, the solver completes running and displays a much poorer (lower) result as the best one it asks to keep. So, the optimization progress dialog might have found an optimal solution with a value of 0.49 in the progress dialog (which is very reasonable and correct), but the final chosen solution is a value of 0.35 once the optimization completes.

The basic problem happens with both evolutionary solvers included in the extension, with various combinations of optimizer options, and something similar happens for both minimizations and maximizations of the target cell. It looks like it is finding a nice solution, but displaying a fairly bad one instead of the best one in the end.
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Non-Linear Solver Doesn't Complete with Found Min/Max Value

Post by acknak »

Maybe someone here can help, but if not, it might be best to report the problem through a comment on the extension's page. Providing a sample document so that others can test the same inputs would be invaluable, I'm sure.
AOO4/LO5 • Linux • Fedora 23
Anagoge
Posts: 17
Joined: Mon Sep 15, 2008 9:19 pm

Re: Non-Linear Solver Doesn't Complete with Found Min/Max Value

Post by Anagoge »

Here is an example of the maximization solver result using the DEPS solver. The selected cell is the one being maximized (R7915). BestFound.png is the claimed best found result in the progress dialog (0.16 or 16%) and CompletedResult.png is the result it eventually chooses as the maximum to display as the final solution (0.13 or 13.60%). I don't have a stripped down spreadsheet yet (the one I have is too large). I'm going to point the developers here and add an extension comment pointing here in case anyone knows of a workaround or what I might be doing wrong. The same problem happens with larger numbers, so it isn't due to use of smaller values in the target maximization cell.

Best Found:
BestFound.png
Completed Result:
CompletedResult.png
aksdb
Posts: 8
Joined: Tue May 26, 2009 10:08 pm
Location: Germany

Re: Non-Linear Solver Doesn't Complete with Found Min/Max Value

Post by aksdb »

It's nice to see more and more real world examples (and problems) popping up - that was one of the things missing during development of this extension. So unfortunately not all cases could have been tested deep enough. In that regard: thanks for giving the extension a try and most importantly: thanks for reporting problems!

I'm currently a bit short of time, so I probably can't look into it much deeper until end of next week. My first suspection however is the "Integer" constraint. Although the optimization model wouldn't be feasible for your needs any longer: could you try to optimize without that constraint? Does it also lead to such a discrepancy?
It would also be nice to have access to such a real world example which could be used to reproduce that problem. If you trust me enough (which I ofcourse can't expect you to) you can send me a copy. Otherwise I'll see what I can do to reproduce it otherwise (hopefully).
Andreas Schneider OOo 3.1.X on Linux-Other + Vista 64bit
Anagoge
Posts: 17
Joined: Mon Sep 15, 2008 9:19 pm

Re: Non-Linear Solver Doesn't Complete with Found Min/Max Value

Post by Anagoge »

The spreadsheet is resilient to floating point numbers in the integer fields, so I tested it, but I'm seeing similar problems without the integer constraint specified. I'm also seeing similar problems optimizing using a single variable at once, and a single variable with only a single >= constraint.

I just sent you an private message and email through the forum (sorry for both but the email failed, then apparently worked the second try). Reply with an email/FTP destination, and I'll send you a 2.8 MB .zip of the spreadsheet with the personal details removed and a few formula/data changes.

Some random solver thoughts:
- In general, the non-linear solver looks to be headed in a nice direction. It is easy to use and incorporates some cutting-edge algorithms.
- I love the tunable stagnation detection feature. I'm not certain it always works, since my optimizations seem shaky right now, but the idea itself is great.
- Allow resizing the constraints dialog
- Provide some way to export a list of the final (unique) candidate solutions, not just the single min/max, so I can analyze variable/parameter sensitivity
- In the "Solving Finished, Keep New Result" dialog, display the old min/max value as well as the new one, so I don't have to remember the old value and decide if the new one is better. Maybe also display the average time per iterataion, if that isn't too geeky?
- Provide a better error of the edit causing the problem when you type in a cell reference or range in an invalid format in the constraints or "changing cells" edits (I typed multiple cells with a ',' separator)
- Force the advanced solver status dialog to float above the other two modal solver dialogs that are generally below it (old status, constraints)
- Display a simple graph of the change in the min/max fitness function (over time) as the optimization runs (though stagnation detection prevents some of the need for this)
- If the spreadsheet is opened read-only, stagnation happens immediately, without a clear error explaining why (it took me a few minutes to realize the cause)
- If Tools, Cell Contents, AutoCalculate is off, the solver stagnates immediately for similar reasons (maybe warn the user for these cases?)
Post Reply