Re: Seeking a scheduling algorithm
| From: | Matijn Woudt | Date: | Sun, 15 Jul 2012 11:51:20 +0000 |
| Subject: | Re: Seeking a scheduling algorithm | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-318483@lists.php.net to get a copy of this message | ||
On Sat, Jul 14, 2012 at 10:53 PM, Tedd Sperling <tedd@sperling.com> 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