LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Divide into equal bins

    Employee
    Posted 06-03-2015 05:56

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: ryeh

    As usual, here's a posting that was inspired by a customer request.

    The problem goes like this - I have 100 tasks that I need to distribute across 10 people. Each task takes a certain amount of time. The idea is to assign the tasks in such a way that everyone has a relatively equal load. So if you add up each person's tasks, the time it takes to do them should be as close to each other as possible.

    My colleague, Kwan Lin, found that this is really a variation of the knapsack problem. (Got to love mathematicians and their naming conventions.) You can read about it here:
    http://en.wikipedia.org/wiki/Knapsack_problem

    As luck would have it, there's already such an implementation in R, which means that we can readily take advantage of it in Power R. (The R node will work as well.) The 'adagio' package has a 'knapsack' function, which performs the task described in the link above. It also has a 'mknapsack' function that does what we need for our problem. As you can probably guess, the 'm' stands for multiple.

    I've attached a graph showing the results. I've parameterized the number of people as 'n' so you can adjust that number as needed. The Quick Stats node groups the tasks by their task designation. As you would expect, the number of groups will equal the 'n' that was specified in the Power R node.
    Attachments:
    divideIntoEqualBins_adagio.brg