+ Reply to Thread
Results 1 to 6 of 6

excel solver constraints

  1. #1
    Forum Contributor
    Join Date
    11-21-2013
    Location
    KL
    MS-Off Ver
    Excel 2010
    Posts
    168

    excel solver constraints

    Hi all,

    Good day!

    I am currently facing some difficulties in constructing the constraints for my solver model.

    Referring to the sample attached, I have to make an schedule for employees to attend training sessions, 2 times per month.

    I have 2 constraints that I am not very sure on how to add in:
    1) 2 sessions have to be at least 2 weeks apart. It doesn't have to be exactly 14 days. For example, if 1st session is on 1st week, 2nd session must be at least on 3rd week, anyday.

    2) The sessions must be scheduled on the day the are scheduled to work, as shown in the second table in my sample file.

    Hope that my request is clear.
    Appreciate any assistance!

    Thank you!!
    Attached Files Attached Files

  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,758

    Re: excel solver constraints

    The simple problem first

    sessions must be scheduled on the day the are scheduled to work
    I've set up a result grid i.e. multiplying solver binaries with the appropriate workday see example in range C20:AG22

    Your other problem is a bit more tricky but I'll have a go at it and see if I can solve it.

    Alf
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    11-21-2013
    Location
    KL
    MS-Off Ver
    Excel 2010
    Posts
    168

    Re: excel solver constraints

    Hi Alf,

    Thank you for your effort.

    On top your work, I added a another constraint using contif. The result generated is able to show 2 sessions on different week, however:
    1) Still haven't figured out how to have them at least 2 weeks apart - am thinking the logic would be another countif to capture continuous cell above zero using =frequency or something else.... not sure how...
    2) Solving method have to use GRC instead of simple linear (don't think is an issue though)

    Also, I found that by adding that one additional constraint, the calculation will take few seconds longer... can't imagine how long it will take when I apply them to my whole team which is around 20+ people

    I think the newly added constraints have to be improved....
    Attached Files Attached Files

  4. #4
    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: excel solver constraints

    Had a look at your new setup and tested it a bit but could not improve the time difference. Also had a go at using the "Evolutionary" solver but this was a "no go". After some time solver gave up i.e. did not find a setting that satisfies all constraints conclusion is that for this setup the "GRG Non-lineare" is the best setting.

    So I got back to my uploaded file and cheated, I just removed some of the formulas in in range C20:AG22 see result on my cheat sheet. One advantage using this technique is the the model is still linear so the one gets the result quite faste.

    There probably is a constraint setting that will give you the desired result but I have no idea at the moment how to formulate that.

    Alf
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    11-21-2013
    Location
    KL
    MS-Off Ver
    Excel 2010
    Posts
    168

    Re: excel solver constraints

    Hi Alf,

    Thank you so much for your effort.

    At least it save me a couple of steps for the scheduling though...

    I'll keep working on the constraints setting. However, there are some circumstances that the solver does not "react" to the constraints. Maybe the constraints are too complicated..

    Will continue to explore from here though.
    Thank you.

  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: excel solver constraints

    You are welcome.

    Maybe the constraints are too complicated
    If solver stopps saying "Solver can not find for which all constraints are fulfilled” then this could be the case but if the contraints are ignored without any error message I would suggest you check the logic for the constraints solver ignore to see if they are valid.

    You could also check with the solver help desk:

    http://www.solver.com/

    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. Excel Solver binary constraints
    By jharaldson in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-18-2014, 03:37 AM
  2. Excel Solver – Constraints referencing another sheet
    By Kondrat in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-29-2012, 03:49 AM
  3. using variables in excel solver constraints problem!
    By 77anders in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 02-12-2009, 08:49 PM
  4. Excel Solver Constraints
    By jcoleman52 in forum Excel General
    Replies: 2
    Last Post: 06-01-2006, 03:00 PM
  5. [SOLVED] Constraints in Excel Solver
    By Donna in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-04-2005, 06:30 PM

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