+ Reply to Thread
Results 1 to 5 of 5

SOLVER precision settings

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    12-03-2008
    Location
    Key West, FL
    MS-Off Ver
    365 Apps for Enterprise
    Posts
    666

    SOLVER precision settings

    Not sure if this is the right forum to post a SOLVER question, so feel free to redirect me if there's a better place.

    I've created an "inputs" section of my worksheet specifically for Solver. It is a small table with two columns. The first column is the label. Second column is all integers. This is the "input" section. (where I need a real number in my formulas I simply multiply the # in the second column by .01 or other partial #).

    I created the second column with all integers so that Solver would not need to go through millions of real numbers to find the optimal inputs. I was hoping this would significantly reduce the amount of time Solver takes to reach the best possible combination of numbers.

    As an example: A constraint says find an integer with an upper bound of 300 and a lower bound of 0.

    What I'm discovering is that Solver is iterating real numbers even though I've specified integers. Instead of running from 0 to 300 in integers e.g. 0, 1, 2, 3 etc. It is running numbers with 12 decimal places (e.g. 1.019853879534).

    I'm using the Evolutionary method since that's the best approach for my workbook. I don't know what the two "precision" settings in Solver really do. I've reduced them from the default (about 8 decimal places?) to one. But that has no visible effect.

    Usually, when Solver finishes its work, it does stop at an integer. But there are times when it stops at a number with 12 decimal places even though I've set it to run just integers.

    Anyone have a suggestion? Thanks!

  2. #2
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,794

    Re: SOLVER precision settings

    Solver work by using real numbers but if integers are specified end result should be an integer.

    Still if Solver does not find a solution it may present a solution based on decimal numbers but it should specify that it has found no solution.

    Can you see from the numbers which constraint that causes the problem i.e. stopping solver from finding a solution?

    Perhaps you could upload a sample file with your model?

    Alf

  3. #3
    Forum Contributor
    Join Date
    12-03-2008
    Location
    Key West, FL
    MS-Off Ver
    365 Apps for Enterprise
    Posts
    666

    Re: SOLVER precision settings

    Thanks Alf. After posting this, I decided to try something new. I had been working on a large workbook for almost a year, saving it with a new version number each time I made a change. So as an experiment I did a copy/paste from the sluggish version to a fresh workbook, and this had an impressive effect on Solver. It runs very quickly now, and always stops at integers.

    So the old workbook must have had some hidden or unused data. I wonder if Solver itself has the equivalent of a "cache."

    I did note that with the old notebook, when Solver completed its run and left me with a number having 12 digits or so, I would manually change that number to an integer, which had no effect on the workbook's results. (But I can't remember if it also gave me the message that it couldn't improve the results).

    And, I would usually be fine with uploading a workbook but I'm unable to do this with the one causing issues, as it contains sensitive data.. for which I've signed a nondisclosure agreement.

    Maybe I'll leave this thread open another day or two in case someone else has a comment...?

    Thanks again!

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,879

    Re: SOLVER precision settings

    I found that in some problems with integer or binary constraints and larger number of changed values - like grouping into bins, checking combination of just some input values etc) macros trying to mimic human way to solve specific problem are more effective than solver. I've also heard some good rumours about https://opensolver.org/ effectiveness in such cases, but not tested it personaly.

    Anyway sample file (of course no real data) would facilitate helping - may be the model shall be constructed/structured anorher way? (See what I mean for instance here: https://www.excelforum.com/excel-gen...-solution.html - and my post #5 - may be it's not the best example, because it showed up that it was soleable without solver :-P)

    edit: I started writing, went to do something else - and after returned, finished the posty and published it. So the above addresses situation after post #2
    Last edited by Kaper; 11-01-2017 at 03:01 PM.
    Best Regards,

    Kaper

  5. #5
    Forum Contributor
    Join Date
    12-03-2008
    Location
    Key West, FL
    MS-Off Ver
    365 Apps for Enterprise
    Posts
    666

    Re: SOLVER precision settings

    I'm cleaning up my old threads and realized I hadn't marked this one as solved. Kaper to your post, I looked into opensolver but since it was a bit too far out of my comfort zone, I realized that there was a quite simple method to constrain Solver's iterations.

    When I know the general bounds of a variable involves binary numbers, I create two columns. Every row in Column A is always an integer (and defined as such in Solver setup). Rows in Column B are the actual "inputs" to be tested.

    If an input is a percentage then I decide how many decimal places are going to be meaningful. If I want to see results to two decimal points, (e.g. .01 to .99) then Column B becomes .01 x Col A.

    I make sure that Solver is configured to see Column A as an integer. When it runs, it will go through 99 iterations rather than thousands (at least, this is my perception of what its doing). I do note that it speeds up Solver significantly.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] One of the Settings in Options Trust Center Settings is Grayed out
    By zit1343 in forum Excel General
    Replies: 2
    Last Post: 06-28-2012, 09:18 AM
  2. Using precision as displayed: WKS vs. WKB
    By h2count in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-26-2012, 06:21 PM
  3. Formating and Precision...I think
    By Steven Cheng in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-18-2006, 05:20 AM
  4. Precision in Excle VBA
    By duane in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-17-2006, 02:15 PM
  5. [SOLVED] Number precision
    By Jake in forum Excel General
    Replies: 2
    Last Post: 05-05-2006, 06:30 PM
  6. Precision in formulas?
    By Chris W in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-11-2006, 11:35 AM
  7. Precision displayed does not match precision in cell
    By James Wilkerson in forum Excel General
    Replies: 10
    Last Post: 06-15-2005, 10:05 AM
  8. precision question
    By D in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-15-2005, 05:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1