Least Available Algorithm first

NT100

Registered User.
Local time
Today, 22:25
Joined
Jul 29, 2017
Messages
148
Hi,
I've a job of sorting a number of tutors whose available dates with "The least Available Algorithm First" mechanism.

The following is the example for tutors' availability dates

TutorA Date1
TutorB Date9
TutorC Date11
TutorB Date5
TutorA Date11
TutorE Date3
TutorE Date17
TutorD
TutorF Date13
TutorF Date18
TutorF Date22
TutorF Date23

What would you suggest to build a sorting algorithm to allow the allocation of the least availability first method to tutors.

Thanks.

NT100
 
Basically this is a timetabling problem.
You have at least 2 approaches depending on what you want to do with the data.

1. Create a query counting the number of days each tutor is available sorting in ascending order (least first)

2. Create a query counting the number of tutors available each day. Again sort in ascending order. You will also need the names for each day.

Tweak as necessary to suit your circumstances
 
This sounds like someone's homework for a class in queueing and scheduling. If it really is a class assignment, it is my policy to not write code. I'll give hints - but no code.

If I have to take the problem at face value, I might do a summation query based on the count of entries and group by the Tutor ID column, where you take the count of records where the date is not blank, then sort descending on the count column (which means you have to provide an actual column name so you can reference it in the WHERE clause.) It is possible that you might need to do a query of a query so that the counts and the sort occur in two phases.
 

Users who are viewing this thread

Back
Top Bottom