The games now need to be scheduled, which will happen in two steps. Your first task is to group
together games that can be played simultaneously into game groups. The requirements for the game
groups are:
• People are not double-booked: each person is involved in at most one game in any game group.,
either as a player or referee
• Games are played once: each game is in exactly one game group
Each game group will be played in a single time slot, so the committee wants the smallest number of
game groups possible.
Implement your solution as a Python function of the form
def gameGroups ( assignedReferees ):
where assignedReferees is in the same format as you returned in the previous question, i.e. as a
dictionary with games as keys and referees as values. Your output should be a schedule in a data
structure of the form
Page 2
# list of timeslots
# each timeslot is a set of games
# each game is a pair ( player1 , player2 )
[
{ ( " Ashley " , " Bob " ) , ( " Charlie " , " Dave " ) } ,
{ ( " Bob " , " Charlie " ) , ( " Rene " , " Elaine " ) }
]
Not the question you are looking for? Ask here!
Enter question by text
Enter question by image
Upgrade to Asksia Pro
Join a AskSia's Pro Plan, and get 24/7 AI tutoring for your reviews, assignments, quizzes and exam preps.