Comments on: Excel solver binary constraint help
http://ask.metafilter.com/94509/Excel-solver-binary-constraint-help/
Comments on Ask MetaFilter post Excel solver binary constraint helpThu, 19 Jun 2008 12:17:46 -0800Thu, 19 Jun 2008 12:17:46 -0800en-ushttp://blogs.law.harvard.edu/tech/rss60Question: Excel solver binary constraint help
http://ask.metafilter.com/94509/Excel-solver-binary-constraint-help
Why is Excel Solver not using the binary constraints I've set? <br /><br /> I've created a table which calculates an answer based on a set of binary flags (0,1) --- basically a sumproduct type function. I'm trying to minimize the answer. But when I run solver (setting a binary constraint on those cells), it doesn't actually use binary numbers and instead is using a whole bunch of fractions.post:ask.metafilter.com,2008:site.94509Thu, 19 Jun 2008 11:53:54 -0800mtstoverexcelsolverbinaryBy: Mike1024
http://ask.metafilter.com/94509/Excel-solver-binary-constraint-help#1381049
I assume you've double-checked the binary constraint is applied to the correct cells?comment:ask.metafilter.com,2008:site.94509-1381049Thu, 19 Jun 2008 12:17:46 -0800Mike1024By: mtstover
http://ask.metafilter.com/94509/Excel-solver-binary-constraint-help#1381102
yepcomment:ask.metafilter.com,2008:site.94509-1381102Thu, 19 Jun 2008 13:12:47 -0800mtstoverBy: Andrew Brinton
http://ask.metafilter.com/94509/Excel-solver-binary-constraint-help#1381205
Have you tried the same setup with TRUE / FALSE instead of 0 / 1 ?comment:ask.metafilter.com,2008:site.94509-1381205Thu, 19 Jun 2008 14:42:49 -0800Andrew BrintonBy: Mike1024
http://ask.metafilter.com/94509/Excel-solver-binary-constraint-help#1381249
How many binary flags are there in total?<br>
<br>
Is there any way you can post the spreadsheet for us to look at?<br>
<br>
(as you can tell, I'm rather at a loss as to what the problem could be)comment:ask.metafilter.com,2008:site.94509-1381249Thu, 19 Jun 2008 15:21:57 -0800Mike1024By: CruiseSavvy
http://ask.metafilter.com/94509/Excel-solver-binary-constraint-help#1381254
Best guesses...<br>
<br>
(1) Might be the settings in your Solver options. Start by making sure all the options are set to the defaults. If that doesn't work, experiment. E.g., Assume Linear Model? Search: Newton vs. Conjugate? Etc. Apparently <a href="http://archives.math.utk.edu/ICTCM/VOL13/C013/paper.html">logistic regressions are what you need for binary data</a> (see item #3 in that article). I think Solver is supposed to figure out what type of regression you need, but maybe one of the settings is causing a problem.<br>
<br>
(2) Might be a bug. I know this is a terrible answer, but when I took a mathematical-modeling-for-business class in grad school the professor told us lots of colorful stories about bugs in Excel. Solver is something Microsoft licenses from a 3rd party, so it can be extra-twitchy.<br>
<br>
If all else fails, you could try your formula on another version of Excel. If you like, private-message me for my email and I can give it a try on Excel 2007 (for Vista).comment:ask.metafilter.com,2008:site.94509-1381254Thu, 19 Jun 2008 15:27:55 -0800CruiseSavvyBy: mtstover
http://ask.metafilter.com/94509/Excel-solver-binary-constraint-help#1381255
Suggestions for place to post, and I'll drop it right up there?comment:ask.metafilter.com,2008:site.94509-1381255Thu, 19 Jun 2008 15:28:05 -0800mtstoverBy: Mike1024
http://ask.metafilter.com/94509/Excel-solver-binary-constraint-help#1381268
<i>Suggestions for place to post</i><br>
<br>
There's always places like http://rapidshare.com/ - you don't get much control, but it sure is simple.<br>
<br>
If you'd rather not put your spreadsheet online I can mefi mail you my e-mail address.comment:ask.metafilter.com,2008:site.94509-1381268Thu, 19 Jun 2008 15:45:32 -0800Mike1024By: mtstover
http://ask.metafilter.com/94509/Excel-solver-binary-constraint-help#1381274
Here you go!<br>
<br>
http://rapidshare.com/files/123676023/sitemodel.xls.htmlcomment:ask.metafilter.com,2008:site.94509-1381274Thu, 19 Jun 2008 15:50:34 -0800mtstoverBy: Mike1024
http://ask.metafilter.com/94509/Excel-solver-binary-constraint-help#1381310
Well, I'm not sure what the trouble with the solver is - but solving nonlinear, nondifferentiable problems like yours is pretty hard!<br>
<br>
However, I've made a few modifications to your spreadsheet and come up with a few results - 299 is the best I've got so far. Are you familiar with macros?comment:ask.metafilter.com,2008:site.94509-1381310Thu, 19 Jun 2008 16:51:39 -0800Mike1024By: Mike1024
http://ask.metafilter.com/94509/Excel-solver-binary-constraint-help#1381319
You can get my modified version of your spreadsheet here:<br>
<br>
http://michaelt.uwcs.co.uk/excelsolve/<br>
<br>
in sitemodel2.xls if you run macro1 then wait it will randomly try combinations not stopping until it finds a good solution which meets your criteria (definition of 'good enough to stop' you can set by editing the macro). Then capture the result with a printscreen!<br>
<br>
You can also see some of my best solutions in that directory too.<br>
<br>
If you aren't too happy running an internet stranger's macro (and why would you be?) I can run my solver for longer tomorrow - but for now it's 1am so I'm off to bed!comment:ask.metafilter.com,2008:site.94509-1381319Thu, 19 Jun 2008 16:59:47 -0800Mike1024By: mtstover
http://ask.metafilter.com/94509/Excel-solver-binary-constraint-help#1381518
Mike1024 -- you are so cool! How great is the green that you can have a stranger in the UK (why aren't you asleep?) futz with your spreadsheet and give it back to you. Good karma all around for you Mike!!!!<br>
<br>
I've got it down to 221 so far by reducing the target number in the macro. Nice and elegant - good work. Thanks so much.comment:ask.metafilter.com,2008:site.94509-1381518Thu, 19 Jun 2008 20:07:01 -0800mtstoverBy: Mike1024
http://ask.metafilter.com/94509/Excel-solver-binary-constraint-help#1382103
I've posted some modifications to that - sitemodel3.xls lets you set a time limit and sitemodel4.xls locks in some elements of a good solution. It also shows one of my best solutions, which has a distance of 167.comment:ask.metafilter.com,2008:site.94509-1382103Fri, 20 Jun 2008 12:09:32 -0800Mike1024