On Sat, Jul 14, 2012 at 10:53 PM, Tedd Sperling <tedd@xxxxxxxxxxxx> wrote: > Hi gang: > > Does anyone have a resource, or better yet code, to solve the scheduling problem described below? > > Let's say you have a week calendar that has openings between 8:00am to 5:00pm for Monday through Friday (40 hours). > > Then you have an assortment of appointments that must be scheduled into the week calendar. Some of the appointments are simply a one hour per week, while others may be two, three, four, or five times per week and each appointment for an hour or more (up to eight hours). > > The problem is, knowing what appointments (i.e., twice a week for 2 hours, three times a week for one hour, etc.) must be scheduled for the week, what is the most efficient way to schedule these appointments into that week? > > The most efficient way is defined as scheduling appointments with little, or no, gaps in between appointments. For example, four one-hour appointments on Monday between 8:00am to 12:00pm is better than four one-hour appointments spread out between 8:00am to 5:00pm. > > Anyone have any solutions, ideas, resources, code? > > Thanks, > > tedd Take a look at the knapsack problem, it could work for you too. - Matijn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php