+ Reply to Thread
Results 1 to 8 of 8

Solver is too slow using LARGE function

  1. #1
    Forum Contributor
    Join Date
    03-11-2018
    Location
    Tampa, Florida
    MS-Off Ver
    365
    Posts
    105

    Solver is too slow using LARGE function

    I have a data array:

    A B C D
    1 75 84 96 45
    2 56 99 74 32
    3 32 93 56 55

    Which I rank using the RANK function:

    A B C D
    4 3 1 3 2
    5 2 3 2 1
    6 1 2 1 3

    I then set-up a 3rd array of weighted values:

    A B C D E F
    7 0 0 0 0 sum=(A7:D7) =E7/$E$10
    8 0 0 0 0 sum=(A8:D8) =E8/$E$10
    9 0 0 0 0 sum=(A9:D9) =E9/$E$10
    10 sum=(E7:E9)


    which is computed by 4 variables such that given:

    A B C D
    10 x1 x2 x3 x4

    then:

    A7 = A4 * $A$10
    B7 = B4 * $B$10 and so forth

    I then sum the rows of the weighted array and calculate the % of total row sum.

    Finally, I use Solver to calculate (Evolutionary) a max weighted row % in any order I define.

    Specific example: Let's say I want to solve for F8 > F9 > F7

    I would set up Solver to max F8
    using variables (A10:D10)

    subject to these constraints:
    all variables >= 0
    all variables <= 10
    sum of all variables = 10
    F8 = LARGE(F7:F9,1)
    F9 = LARGE(F7:F9,2)
    F7 = LARGE(F7:F9,3)

    This system works great with simple arrays. Can anyone suggest a method that is FAST on very large arrays with many variables to compute?

    Thanks!
    Attached Files Attached Files
    Last edited by dvess11; 03-12-2018 at 11:30 AM.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Need function/program to expeditie my array analysis

    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).

    1. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential information is removed first!!

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Contributor
    Join Date
    03-11-2018
    Location
    Tampa, Florida
    MS-Off Ver
    365
    Posts
    105

    Re: Solver is too slow using LARGE function

    Hopefully a sample file is attached to this message.
    Attached Files Attached Files
    Last edited by dvess11; 03-13-2018 at 06:51 AM.

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,598

    Re: Need function/program to expeditie my array analysis

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Ben Van Johnson

  5. #5
    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,758

    Re: Solver is too slow using LARGE function

    As you have changed the title of you thread as per forum Guru's request (strange by the way as the other postings in your thread did not get upgraded with the new title) I'll add some comments.

    First of all the "evolutionary" engine used in this solver setup is not one I'm that familiar with so I don't know how helpful my comments could be.

    Under options you have set the time for solver to run as 999999999999 seconds. Could that be the reason why solver is slow? I used a setting of 15 seconds and I still got a solution. You could probably reduce this time setting a bit more to get the result faster.

    As the range "C4:G4" is set with upper and lover constraint you could use the option "Require Bounds on Variables" If this improves things I don't know, you will have to test and see.

    The setting for cells in range I18:I22 where the result should be "=LARGE(I18:I22, 1)" I changed to "<=LARGE(I18:I22, 1)" as your original setting made solver unable find a solution where all constraints were fulfilled.

    With the new setting solver fond a solution where all constraints were satisfied.

    Alf
    Last edited by Alf; 03-13-2018 at 03:36 AM.

  6. #6
    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,758

    Re: Solver is too slow using LARGE function

    Testing your setup a bit more I've used the "GRG Nonlinear" engine that gave a similar solution to yours. Don't know if this could be of use to you.

    Main difference except from engine I used the H range (H18:H22) as I could clear range C4:G4 before the start of the solver run. I also added some extra constraints
    that H19 <= H22, H22 <= H20 and as H20 is set to max this will always be the highest value.

    Without the H19 <= H22 and H22 <= H20 constraint I got a similar result i.e. H19 <= H22 <= H20 but if this is just a coincidence or if it always be so I don't know

    Alf
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    03-11-2018
    Location
    Tampa, Florida
    MS-Off Ver
    365
    Posts
    105

    Re: Solver is too slow using LARGE function

    I tried your suggestion using the "GRG Nonlinear" engine. I have a large array and it worked almost instantly. The result looked good for the "objective", however, the remaining row values were equal. My goal is to determine the variables that cause H19 < H22 ... not H19 = H22.

  8. #8
    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,758

    Re: Solver is too slow using LARGE function

    As solver have only have the "<=" constraint there will be cases where H19 = H22 but this seems to happen when there are no values in the range C4:G4.

    If for instance you put a 1 in cell C4 you do get a result where H19 < H22 < H20. The other alternative if you get a result where H19 = H22 is to modify the constraint to
    Please Login or Register  to view this content.
    and do a rerun without clearing the range C4:G4.

    So the question is how much can you change the constraints and still give solver a sufficient degrees of freedom to give a meaningful answer?

    Alf

+ 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. best program to do purchasing analysis for multiple locations?
    By PAR in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 07:05 AM
  2. [SOLVED] best program to do purchasing analysis for multiple locations?
    By PAR in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 04:05 AM
  3. best program to do purchasing analysis for multiple locations?
    By Veglady in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  4. best program to do purchasing analysis for multiple locations?
    By Veglady in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  5. best program to do purchasing analysis for multiple locations?
    By Veglady in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  6. best program to do purchasing analysis for multiple locations?
    By Veglady in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM
  7. [SOLVED] best program to do purchasing analysis for multiple locations?
    By Veglady in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM
  8. best program to do purchasing analysis for multiple locations?
    By Veglady in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-09-2005, 09:05 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