+ Reply to Thread
Results 1 to 6 of 6

Using Solver in Constrained Optimization Model

  1. #1
    Registered User
    Join Date
    06-29-2010
    Location
    Minneapolis, MN
    MS-Off Ver
    Excel 2016
    Posts
    75

    Question Using Solver in Constrained Optimization Model

    Hi all,

    I am trying to use solver to determine optimal assortment size by product to maximize sales while being below a space constraint.

    See attached example.

    However, when I try to use solver with the parameters:

    Maximize Total Sales while constrained to Total Space Units < Max Space Units Possible while changing Product Sizes (B7:B9) it does not understand and makes the values in B7:B9 1.05 (which do not correspond to anything and return sales/space values of 0.

    I want the solver to figure out while product size to reduce to fit the space requirement while maximizing sales. In this basic example, it would be by changing cell B9 to 4 and cell B8 to 3.

    Is that possible to do with Solver? Might be too complex I'm not sure!
    Attached Files Attached Files
    Last edited by Dynamo418; 02-10-2020 at 11:30 AM.

  2. #2
    Valued Forum Contributor Hydraulics's Avatar
    Join Date
    07-15-2018
    Location
    Udine - Italy
    MS-Off Ver
    Office 365
    Posts
    373

    Re: Basic (hopefully) Solver Challenge

    Here is a quick fix.

    - Added constraint to max space;
    - Added integer constraint to variables B7:B9;
    - Added max and min values to variables;
    - Switched to evolutionary engine, since there are LOOKUP functions.

    I'll post later a linear model.

    HTH,

    Francesco
    Attached Images Attached Images
    Attached Files Attached Files
    Aim high or don't even try.
    ---------------------------------
    If your question has been answered, don't forget to mark the thread as SOLVED.
    If you find an answer helpful, click on the star icon at the bottom of the post.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Basic (hopefully) Solver Challenge

    Administrative Note:

    We would very much like to help you with your query, however the thread title does not really convey what your request is about.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Registered User
    Join Date
    06-29-2010
    Location
    Minneapolis, MN
    MS-Off Ver
    Excel 2016
    Posts
    75

    Re: Basic (hopefully) Solver Challenge

    That is perfect; interested to see the linear model!

    One followup question. Is it possible to add the constraint that the entry cells B7:B9 cannot be more than 1 step (integer) more than their starting integer? I.E. if it started as 1, 1, 1 the final values could not be higher than 2, 2, 2.

    Not sure how to do that efficiently in solver!

  5. #5
    Valued Forum Contributor Hydraulics's Avatar
    Join Date
    07-15-2018
    Location
    Udine - Italy
    MS-Off Ver
    Office 365
    Posts
    373

    Re: Using Solver in Constrained Optimization Model

    A linear model can be built adding 12 binary variables. Then total space and sales can be expressed with simple SUMPRODUCT formulas.

    One additional constraint will force Solver to chose only one size for each product.

    For your last question, we must first define a starting size in column P, then find the ending one through max_size in Q; finally we instruct Solver that

    $R$8:$R$10 <= $Q$8:$Q$10
    $R$8:$R$10 >= $P$8:$P$10


    Using this formula in column Q

    =IF(AND(P8>=1,P8<=Max_size-1),P8+1,Max_size)

    if one size is set to 0, Solver is free to find any value that maximizes the objective function (i.e., the constraint does not apply).

    HTH,

    Francesco
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    06-29-2010
    Location
    Minneapolis, MN
    MS-Off Ver
    Excel 2016
    Posts
    75

    Re: Using Solver in Constrained Optimization Model

    Amazing. Thanks so much for your help and very well explained workbook.

+ 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] Solver De-bugging w/ Basic Product Ordering Table
    By rpicc in forum Excel General
    Replies: 2
    Last Post: 05-28-2019, 12:35 PM
  2. Solver VBA Loop Basic
    By james11011 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-24-2018, 01:54 PM
  3. [SOLVED] New to Visual Basic, Help designing Macro to Run Solver Automatically on Data Set
    By bellr10 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-18-2015, 06:26 PM
  4. Extreme Challenge : Solver to optimize a perfect combination/blend of supplier
    By chris1089 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-07-2015, 03:23 PM
  5. [SOLVED] Basic Solver Problem
    By Sige in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-06-2006, 12:00 PM
  6. Solver in Visual Basic
    By Cardiff Maths Student in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-05-2005, 11:06 AM

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