Results 1 to 9 of 9

Need help with another optimization problem using VBA

Threaded View

  1. #1
    Registered User
    Join Date
    04-08-2022
    Location
    Montreal Canada
    MS-Off Ver
    Microsoft 365
    Posts
    15

    Post Need help with another optimization problem using VBA

    Hey guys, I have another optimization problem that I really need help with.

    To simplify things, I'm only going to give 10 dummy data points (instead of my 500+ that I have)

    Each data point has 2 values associated with it: The frequency (in days) and duration to complete the task (in minutes).

    There is going to be 2 user inputs: Number of slots and available time per slots

    You can imagine these 2 user inputs as a graph where the number of slots is the x-axis and available time is the y-axis.

    The number of slots corresponds to a year divided into slots.

    What I would like to do is to put all my data points into all the available slots and create a job plan, but make sure that the tasks in each slot don't go over the available time.

    Here's my approach: For this example, Number of slots = 12, Available time = 120 min [Attached file]
    1) Sort the frequency from lowest to largest.
    2) Divide 365days by the lowest frequency and round down. (i.e. 365 divided by 90 = 4 [rounded down])
    3) Divide the number of slots by the value found in 2) (i.e. 12 slots /4 = 3)
    With the number found in 3), I will only focus on that number of slots for a frequency of 90 days
    4) Populate each slot by putting only one task per slot and looping it until all tasks are in (i.e. There are 4 tasks with a frequency of 90 days [We'll call it A,B,C,D]. Task A will go in slot 1, Task B will go in slot 2, Task C will go in slot 3, Task D will loop and go back into slot 1. If there isn't enough available time, Task D will check in slot 2)
    5)Once all the tasks are in, slots 1,2, and 3 are copied to the other slots. Meaning that slots 1,2,3 = slots 4,5,6 = slots 7,8,9 = slots 10,11,12

    Repeat from step 1 with the next frequency (i.e. 180 days)
    1) 180 days
    2) 365 days / 180 = 2 rounded down
    3) 12 slots /2 = 6
    I will only focus on the first 6 slots
    4) Populate the slots with tasks having 180 days. But this time, there are already other tasks in it. It needs to check from slot 1 to 6 where is the next available slot to fit given the remaining time. (i.e. there are 3 tasks with frequency of 180 days, [we'll call if E,F,G]. Task E will check if there is available time in slot 1. If yes, put it in there, else check the next slot. Loop slots 1 to 6 until all tasks of 180 days frequency are in)
    5) Copy slots 1,2,3,4,5,6 to the other slots ==> slots 1,2,3,4,5,6 = slots 7,8,9,10,11,12.

    Repeat again with the next frequency.

    Sorry if it's difficult to understand by text. The attached file has the final solution included, so if you follow the steps, you should get the same thing.

    If you know an easier solution, feel free to share it.

    Thank you for your help.

    NOTE: I don't need to have the graph drawn. I just want to know in which slot does each task goes into (It can be another column next the the dataset)
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. optimization problem
    By kema in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-19-2020, 01:13 PM
  2. Need Help with an Optimization Packing Problem
    By Kaenon in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-11-2015, 06:18 PM
  3. Solver Optimization Problem
    By greywolf00 in forum Excel General
    Replies: 6
    Last Post: 10-13-2014, 12:43 PM
  4. Problem Using Solver with an optimization stock problem
    By Jagrubski in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-24-2013, 03:41 AM
  5. Complex Optimization problem through VBA
    By usmanzkhan in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-21-2012, 06:09 PM
  6. product mix optimization problem
    By lucabi in forum Excel General
    Replies: 2
    Last Post: 08-19-2012, 02:15 PM
  7. Optimization Problem
    By learningtoride in forum Excel General
    Replies: 0
    Last Post: 06-28-2011, 03:52 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