Two-queue court access

Interleave two court queues under a declared allocation

Preserve two separate queue orders through an agreed allocation cycle, borrowed slots and an empty-queue finish.

4 min readPractical guide

Declare both the allocation cycle and the empty-queue rule

Two adult practice groups share one court for twelve five-minute slots. Each served slot includes four minutes of practice and one minute to clear. Each queued ID is one complete party ready to use its slot; no party belongs to both groups. All ten parties are ready at minute zero, and no new arrivals occur in this example.

The agreed nominal cycle is Red, Red, Blue, repeated four times. Within each group, take the oldest unserved party. If the nominal group is empty, serve the other group’s oldest party. If both are empty, leave that slot unused. Advance the cycle after every booked slot, including a borrowed or unused slot. Borrowing creates no later repayment or extra turn. These are declared club conditions, not a universal fairness rule.

Complete initial queues; leftmost is next
Group Ready parties in order Initial next pointer
Red R1, R2, R3, R4, R5 R1
Blue B1, B2, B3, B4, B5 B1
Full dispatch trace; next pointers are recorded after each dispatch
Slot Minutes Nominal group Served party Next Red / Blue
1 0–5 Red R1 R2 / B1
2 5–10 Red R2 R3 / B1
3 10–15 Blue B1 R3 / B2
4 15–20 Red R3 R4 / B2
5 20–25 Red R4 R5 / B2
6 25–30 Blue B2 R5 / B3
7 30–35 Red R5 Empty / B3
8 35–40 Red B3, borrowed Empty / B4
9 40–45 Blue B4 Empty / B5
10 45–50 Red B5, borrowed Empty / Empty
11 50–55 Red Unused Empty / Empty
12 55–60 Blue Unused Empty / Empty

Preserve each queue while advancing the shared cycle

Slots 1–7 serve R1/R2/B1/R3/R4/B2/R5. At slot 8, Red is empty, so B3 uses the Red allocation. The cycle still advances to Blue at slot 9, serving B4. Slot 10 is nominally Red again and lends its unused place to B5. Both lists are empty afterward, so slots 11 and 12 remain unused. There is no phantom party and no restart at R1.

Allocation reconciliation; nominal slots and actual service are different counts
Group Nominal slots Own-slot service Borrowed service received Actual served
Red 8 5 0 5
Blue 4 3 2 5

Red’s eight allocations comprise five Red services, two loans to Blue and one unused slot. Blue’s four comprise three Blue services and one unused slot. Ten parties receive one slot each: Red five and Blue five. The two-to-one nominal allocation therefore does not imply a two-to-one completed-service ratio when one queue empties.

Check the Red subsequence is R1–R5 and the Blue subsequence is B1–B5 with no duplicate or omission. Ten served slots occupy fifty minutes: forty of practice plus ten of clearing. The two unused slots add ten, matching the sixty-minute booking. Do not count an unused slot as practice or invent a missed result for either group.

Leave an auditable next-state record

Completed handover: “Twelve allocations processed; R1–R5 and B1–B5 each served once. Blue borrowed slots 8 and 10; slots 11 and 12 unused. Both queue pointers Empty; next cycle position Red if a new block is agreed.” A new arrival or an extension needs a fresh recorded input rather than silently changing this closed trace.

This policy preserves order inside each queue while honoring the declared allocation sequence when both groups have demand. It does not promise equal waits between groups or guarantee that this allocation suits a particular club. Agree the ratio, slot length and empty-queue rule before accepting the queues.

The challenge-court guide holds and rejoins parties in one winner-stays queue. This dispatch record combines two independent queues and checks how unused allocations are reassigned. The scheduling tools do not operate the live lists or enforce the allocation.