Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

All Bonkers games must have a referee, but the referee for each game cannot have any conflicts of interest for the game. In particular, the

All Bonkers games must have a referee, but the referee for each game cannot have any conflicts of interest for the game. In particular, the referee cannot be a player in the game, and the referee must also declare any other conflicts of interest (eg. cannot be a player's relative, friend, boss, etc..). In order to minimise the burden on any individual referee, the policy is to assign each referee at most one game.
Your task is to determine a method for assigning referees to games, given the games, referees, and conflicts of interest for each referee. You must assign at most one game to each referee, and exactly one referee to each game, or determine that it is impossible to do so.
Implement your solution as a Python function of the form
def referees(games, refereecsvfilename):
games is structured the same as in the previous question. refereecsvfilename is the name for a CSV file which you should read to obtain the list of referees and their declared conflicts of interest. Below is a sample CSV file showing the structure.You may assume that for each referee there is exactly one row giving their conflicts of interest. Your function should return a data structure of games and assigned referees similar to:# dictionary of all (player1, player2) : referee{('Ashley', 'Bob'): 'Rene' }or None if it is not possible.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Conceptual Database Design An Entity Relationship Approach

Authors: Carol Batini, Stefano Ceri, Shamkant B. Navathe

1st Edition

0805302441, 978-0805302448

More Books

Students also viewed these Databases questions