22

You may be familiar with Paul Graham's essay, "Maker's Schedule, Manager's Schedule". The crux of the essay is that for creative and technical professionals, meetings are anathema to productivity, because they tend to lead to "schedule fragmentation", breaking up free time into chunks that are too small to acquire the focus needed to solve difficult problems.

In my firm we've seen significant benefits by minimizing the amount of disruption caused, but the brute-force algorithm we use to decide schedules is not sophisticated enough to handle scheduling large groups of people well. (*)

What I'm looking for is if there's are any well-known algorithms which minimize this productivity disruption, among a group of N makers and managers.

In our model,

  • There are N people.
  • Each person pi is either a maker (Mk) or a manager (Mg).
  • Each person has a schedule si.
  • Everyone's schedule is H hours long.
  • A schedule consists of a series of non-overlapping intervals si = [h1, ..., hj].
  • An interval is either free or busy. Two adjacent free intervals are equivalent to a single free interval that spans both.
  • The productivity P for each person is a value between 0 and 1.
    • A maker's productivity is maximized when the number of free intervals is minimized.
    • A maker's productivity is equal to 1 / (max[1, the number of free intervals]).
    • A manager's productivity is maximized when the total length of free time is maximized, but they like long stretches between meetings more than short breaks.
    • A manager's productivity is equal to the sum of the squares of the lengths of each free interval as a proportion of the day. That is, (h1/si)2 + (h2/si)2 + ... , where each interval is a free interval.
  • Goal: Maximize the team's total productivity.

Notice that if there are no meetings, both the makers and the managers experience optimum productivity. If meetings must be scheduled, then makers prefer that meetings happen back-to-back, while managers don't care where the meeting goes. Note that because all disruptions are treated as equally harmful to makers, there's no difference between a meeting that lasts 1 second and a meeting that lasts 3 hours if it segments the available free time.

The problem is to decide how to schedule M different meetings involving arbitrary numbers of the N people, where each person in a given meeting must place a busy interval into their schedule such that it doesn't overlap with any other busy interval. For each meeting Mt the start time for the busy interval must be the same for all parties.

Does an algorithm exist to solve this problem or one similar to it? My first thought was that this looks really similar to defragmentation (minimize number of distinct chunks), and there are a lot of algorithms about that. But defragmentation doesn't have much to do with scheduling. Thoughts?


(*) Practically speaking this is not really a problem, because it's rare that we have meetings with more than ~5 people at once, so the space of possibilities is small.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
John Feminella
  • 303,634
  • 46
  • 339
  • 357
  • This looks suspiciously like an NP problem. (especially since you want to minimize - not just find a solution that fits the constraints) – Tim Apr 20 '10 at 19:24
  • It is NP since it's combinatoric (all permutations of meeting times must be considered), but that doesn't mean you can't write up a decent (possibly approximate) algorithm for it. – Victor Liu Apr 20 '10 at 19:30
  • 2
    I don't think that is quite the definition of NP... – Tim Apr 20 '10 at 21:17
  • the way the problem stated we can drop the manager's objective. managers cost is fixed given the number of meetings they need to attend. am i missing something? – derdo Apr 21 '10 at 04:49
  • The problem does not specify what an optimal outcome looks like: if one possibility has managers meet for 10 hours and makers have 10 free intervals, and another possibility has managers meet for 20 hours and makers have 5 free intervals, then which is better? One is better for managers, the other better for makers and there is no rule for trading off these different sorts of value. – Charles Stewart Apr 22 '10 at 15:04
  • @CharlesStewart: I leave that rule as a parameter to the model, since different firms will want to trade off differently. You can assume the existence of a function pair `[Mk(S), Mg(S)]` that computes the happiness of a maker or a manager with a particular schedule. – John Feminella Feb 29 '12 at 14:18
  • John: To avoid the higher-order parameter, it might be good to ask for not one best result, but a frontier of Pareto-optimal schedules. This suggests a dynamic-programming solution. You might be able to refine this to a reasonable approximation by asking for a frontier of close-to-Pareto-optimal solutions. Are you still interested in other approaches to this problem? – Charles Stewart Feb 29 '12 at 14:36

4 Answers4

12

A good approximation for this can be had by the use of a Genetic algorithm.

Write a function to create 1000 sample random schedules assigning makers and managers randomly.

Write another function (fitness function) that assigns demerits to schedules with problems (people working at the same time, not enough makers, not enough managers, someone not worked enough, someone worked too much).

foreach schedule assign calculate fitness keeping a reference to the lowest scoring (best) schedule.

while (best schedule > minimum fitness value)
    foreach schedule s in population of schedules
        foreach time slot
           if (random < .5)
               choose value from best schedule
           else
               choose value from schedule s
           end if
       end foreach
       score schedule s with fitness function
    end foreach
end while

While this method will not produce an optimal schedule and has the possibility of finding local minimums. It will always produce a schedule and you can always add more constraints to the fitness function for any conditions you don't want to see. This type of algorithm can handle many different types of constraint satisifaction problems.

I have personally used a similar algorithm to schedule my Wifes Co-Op preschool for the entire year in about two hours on my laptop.

Jeremy E
  • 3,704
  • 2
  • 28
  • 46
1

This problem looks hard enough to be NP, but I think it admits some decent approximations.

In particular, I think you can probably manage reasonably well with a meeting size optimization, where you optimally place the largest meeting (in terms of the number of makers who must attend, since they are the ones you're trying not to disrupt), and then do so successively with smaller meetings. To break ties in smaller meetings of the same length, you could weight the meetings by the meeting-load of the makers asked to participate (so that you will get a chance to optimize over them and not make their lives too much worse).

Now you've broken the problem down to schedule a single meeting, since any already-scheduled meeting will effectively just reduce a person's schedule to shorter. And the solution is pretty straightforward: the optimal solution is the one aligned with a maximal number of edges of schedules of makers such that everyone can make that time. You should be able to solve this problem even with brute force in something like O((k+g)*k*n) where k is the number of makers, g the number of managers, and n the typical number of intervals in a maker's schedule.

The only problem would be if this straightforward approach would lead to meetings that couldn't be satisfied. In this case, you could boost the priority of that meeting by one or more slots and try again.

Rex Kerr
  • 166,841
  • 26
  • 322
  • 407
0

Try taking a look at Simulated Annealing. It's similar to Genetic Algorithms as Jeremy E describes, but instead of randomly generating your starting set of schedules you start with some valid but non optimal schedule. The idea is to generate some "neighbor" of the original schedule by randomly shuffling around some meeting times, then testing fitness before iterating.

S' = Starting Schedule
S = S'    
while( Fitness( S ) < Minimum Fitness ) 
{
    NS = Neighbor( S )
    if( Fitness( NS ) > Fitness( F ) )
    {
         S = NS
    }
}
Return( S )

Instead of testing against some minimum fitness level, you could also specify a set number of iterations so you could deterministically tell when the program would finish executing.

The thing about this algorithm is the final result tends to look like the starting state, so if you wanted to weight say a large meeting (in terms of size of makers) early in the day, you could do so.

-1

I remember implementing something very similar to your problem with A* search algorithm. You will easily find several implementation of the algorithm available but in order to apply it to the scheduling problem you will have to construct distance and heuristic functions based on your model and split continuous time into chunks.

gleb
  • 143
  • 7