riboseinc / duty-scheduling-calendar

Open source, Duty Scheduling Calendar ("`DutyCal'")
2 stars 0 forks source link

== DutyCal: Duty Scheduling Calendar Integrated With Google Calendar

=== Problem

This is similar to the https://en.wikipedia.org/wiki/Nurse_scheduling_problem[Nurse Scheduling Problem].

The goal is to schedule duty for participants in a fair way, where each participants are only available some of the time, and each participant is only allowed to have a maximum of one duty per day.

=== Usage

. Click "Login to Google" to access calendar information. . Enter availability of persons on the Availability tab. . Enter: .. scheduling dates (FROM, TO) .. how many duties per day (TIME and NUMBER) .. number of iterations to calculate . Once the schedule is created, display it . Click "Send to Google Calendar" to store it at the linked Google Calendar

=== Google Calendar Integration

Google Calendar is used to:

=== Definitions

P:: Array of people to assign duty to. There are n number of people, represented by P_0 ...P_n.

S:: Array (continuous or disjoint) of schedulable days: S_0 ... S_m.

A:: Array of person availability. Each person P_i has available days A_p ... A_q, where each A_x is within S.

d:: Integer. The desired number of scheduled duties per day for every S_x day.

D_{u, x}:: A duty assignment for day S_u on the x-th slot, where S_u is within S and 0 <= x <= d.

=== Constraints

==== HARD Constraints

==== SOFT Constraints

Fairness:: The variance between number of duties of all P_i and P_j, i.e. Duties(P_i) => e, Duties (P_j) => f, |e - f| must be minimal for all pairs.

Distributed:: The number of days of duty should be as spread out as evenly as possible, such that for P_i's duty days, S_x ... S_y where x is between 0 and m.

Stable:: Changing (adding, removing) one P_i's A_x where p <= x <= q, should result in a minimal change in P_j's schedules (preferably only another P_j but not other P_). Intent: one person's update would cause minimal changes to other people's schedule, so the impact to others' duties would be minimal.

Order of importance: Stability >>> Fairness > Distributed.

=== Output

For each person P_i, output a schedule:


Li = D{u, x} ... D_{w, y}

Where 0 <= u < w <= m, 0 <= x, y <= d, u and w are elements in {p ... q}.

The goal is to find all L_{P_i} for all i, where 0 <= i <= n.

=== Potential Techniques