Automated Scheduling
Overview
Automated scheduling uses the Garman formula to efficiently assign match start times while respecting court availability, player recovery requirements, and daily match limits. The system processes matches in intelligent blocks to maximize court utilization and minimize scheduling conflicts.
Basic Usage
Once the schedulingProfile, matchUpFormatTiming and dailyLimits have been defined, automated assignment of scheduleTimes to matchUps is straightforward.
engine.scheduleProfileRounds({
scheduleDates, // optional array of dates to be scheduled
periodLength: 30, // optional - scheduling block size in minutes (default: 30)
});
Period Length: Scheduling Block Size
The periodLength parameter (default: 30 minutes) defines the granularity of time blocks used by the Garman scheduling algorithm. This is a critical parameter that affects how matches are grouped and scheduled.
What Period Length Does
Time Block Granularity: Divides the available court time into uniform blocks. For example:
periodLength: 30creates blocks at 9:00, 9:30, 10:00, 10:30, etc.periodLength: 15creates blocks at 9:00, 9:15, 9:30, 9:45, 10:00, etc.
Match Grouping: Matches are grouped by their duration relative to period length:
- Matches with similar durations (when divided by periodLength) are scheduled together in blocks
- Example: With
periodLength: 30, a 90-minute match (90/30 = 3 blocks) and an 85-minute match (rounded to 3 blocks) can be scheduled in the same time slot across different courts
Resource Optimization:
- Smaller period lengths (15 minutes) provide finer control but more complexity
- Larger period lengths (60 minutes) are simpler but may waste court time
- Standard 30 minutes balances efficiency and precision
Choosing the Right Period Length
Use 15-minute blocks when:
- Short format matches (fast4, no-ad, match tiebreaks)
- Very limited court availability requiring maximum efficiency
- Professional tournaments with tight TV scheduling windows
Use 30-minute blocks when (RECOMMENDED):
- Standard tournament formats (best of 3 sets)
- Typical club or regional tournaments
- Good balance of scheduling precision and algorithm performance
Use 60-minute blocks when:
- Long format matches (best of 5 sets)
- Championship events with extended match durations
- Fewer courts and matches, less need for fine-grained optimization
Examples
// Fast4 tournament - use 15-minute blocks for short matches
engine.scheduleMatchUps({
scheduleDate: '2024-06-15',
matchUpIds,
periodLength: 15, // Finer granularity for 30-40 minute matches
averageMatchUpMinutes: 35,
});
// Standard club tournament - use default 30-minute blocks
engine.scheduleProfileRounds({
periodLength: 30, // Most common - good for 60-90 minute matches
});
// Championship event - use 60-minute blocks
engine.scheduleMatchUps({
scheduleDate: '2024-06-15',
matchUpIds,
periodLength: 60, // Coarser blocks for 2-3 hour matches
averageMatchUpMinutes: 150,
});
Impact on Scheduling Results
Efficiency: Smaller period lengths can achieve ~5-10% better court utilization in tournaments with mixed match durations
Performance: Larger period lengths reduce algorithm complexity:
- 15 minutes: More computational work, detailed optimization
- 30 minutes: Optimal balance for most scenarios
- 60 minutes: Faster processing, acceptable for homogeneous schedules
Precision: Period length affects start time precision:
- 15 minutes: Matches can start at :00, :15, :30, :45
- 30 minutes: Matches can start at :00, :30
- 60 minutes: Matches can start at :00 only
Pseudocode
The highest level auto-scheduling method is engine.scheduleProfileRounds.
- Validate and filter
schedulingProfiledates by specifiedscheduleDates - Construct
matchUpDependenciesto ensure matchUps are scheduled before their dependents - Get an array of inContext
matchUpsfor all relevanttournamentRecords - Retrieve
matchUpDailyLimitsandpersonRequests - Sort
scheduleDatesand for each iterate through all venues - Construct hash tables of
matchUpNotBeforeTimesandmatchUpPotentialParticipantIds - Ensure
roundsspecified forscheduleDateare sorted as specified - Generate ordered array of
matchUpIdsderived from specifiedrounds - Build up a mapping of
matchUpIdstorecoveryMinutesso thatmatchUpswith equivalentaverageMatchUpMinutescan be block scheduled while still considering varyingrecoveryMinutes - Group ordered
matchUpIdsby averageMatchUpMinutes|periodLength - Loop through groups of
matchUpIds... - Calculate available scheduleTimes, considering court availability, already scheduled matchUps, and
remainingScheduleTimesfrom previous iteration - Construct per-participant hash tables of
matchUpsplayed andtimeAfterRecovery - Filter out
matchUpswhich are not appropriate for scheduling - Filter out
matchUpswhich include participants who have reached daily limits - Loop through available
scheduleTimesand build up mapping ofmatchUpIdstoscheduleTimes- Defer scheduling of matchUps where
timeAfterRecoveryhas not been reached - Defer scheduling of matchUps where
personRequestsinclude{ requestType: DO_NOT_SCHEDULE }conflicts
- Defer scheduling of matchUps where
- Group
matchUpIdsby eventId|drawId|structureId and assignscheduleTimestomatchUps - Return array of
remainingScheduleTimesfrom current iteration to seed next iteration of virtualCourtBookings