You are on page 1of 6

1.

Problem Statement
Trainer recruitment process is going on for the Software Engineering post-graduation
programme at BITS Pilani University. The requirement is to hire the minimum number of trainers
who can handle the maximum number of topics that are part of the curriculum in the post-
graduation programme. Let us assume that a trainer can handle a maximum of 5 topics. The
topics are listed below:
1. Artificial Intelligence (AI)
2. Machine Learning (ML)
3. Database management (DBMS)
4. Data Science (DS)
5. Data Structures and Algorithm Design (DSAD)
6. Computer Organisation (CO)
7. Data Mining (DM)
8. Mathematical Foundation for Data science (MDS)

You are required to design a program that can help answer the below queries efficiently.
1. Display the list of names of trainers and the unique list of topics handled by all of them.
2. Calculate the least number of trainers to be recruited to handle all the subjects.
3. Find the list of trainers who can handle a specific topic.
4. If there is a requirement for a trainer who can handle any given topic, is there one single
trainer who can do that? If yes, whom?

Requirements
1. Model the following problem as Graphs based problem using Python 3.7. Clearly state how
the vertices and edges can be modelled such that this graph can be used to answer the
following queries efficiently.
2. Read the input from a file inputPS13.txt
3. You will output your answers to a file outputPS13.txt
4. Perform an analysis for the features above and give the running time in terms of input size: n.
The basic structure of the graph will be:
class trainersNetwork:
trainerSubjects=[] # list containing trainers and subjects
Edges=[[],[]] # matrix of edges/ associations
Operations:
1. def readInput(self, inputfile): This function reads the input file inputPS13.txt containing the
name of the trainer and the subjects they can handle separated by a slash.

AI / DM / DS / MDS
The function should create relevant vertices for both the trainers and the subjects they know
and relevant edges to indicate the connection between the trainer and the subjects they teach.
Ensure that the vertices are unique and there are no duplicates.
2. def showAll(self): This function displays the total number (count) of unique trainers and
subjects that have been fed into the system. It should also list out the trainer names and unique
list of subjects stored. The output of this function should be pushed into outputPS13.txt file.
The output format should be as mentioned below.

--------Function showAll--------
Total no. of trainers: 10
Total no. of subjects: 8
List of trainers:
George
Mario
Paul
Peter
Joesph
Mariam
Steeve
Martin
Stella
Merry
List of subjects:
AI
ML
DBMS
DS
DM
DSAD
MDS
-----------------------------------------
3. def displayRecruitList(self): This function displays the minimum number of trainers that
need to be hired to cover all the subjects that are fed into the system. The function also displays
the names of the trainers and the subjects they teach individually to the outputPS13.txt file.
The function is triggered when the following tag is found in the file promptsPS13.txt file.

showMinList
The output of this function should be appended into outputPS13.txt file. The output format
should be as mentioned below.
--------Function displayRecruitList --------
No of trainers required to cover all subjects: 5
Mariam/ AI / DS / ML
Steeve / DM / CO / DBMS / ML
Peter / DS / CO / MDS / ML
Stella / AI / DS / ML / DSAD
Martin / AI / ML / DS / MDS
-----------------------------------------
4. def displayTrainers(self, subj): This function displays all the trainers who can teach a
particular subject. The function reads the input subject from the file promptsPS13.txt with the
tag as shown below.

findSubject: AI
findSubject: ML
The output of this function should be appended into outputPS13.txt file.
--------Function displayTrainers --------
List of Trainers who can teach DS:
Mariam,
Peter
Stella
Martin
-----------------------------------------
Sample file formats
Sample Input file
The input file inputPS13.txt contains names of the trainers and the subjects they teach in one
line separated by a slash (/). There could be cases where one trainer can teach only one
subject.
Sample inputPS13.txt
Mariam/ AI / DS / ML
Steeve / DM / CO / DBMS / ML
Peter / DS / CO / MDS / ML
Stella / AI / DS / ML / DSAD
Martin / AI / ML / DS / MDS
Sample promptsPS13.txt
showMinList
findSubject: ML
findSubject: DS
Sample outputPS13.txt
Note: This is only an indicative output and not the actual output of the program.
--------Function showAll--------
Total no. of trainers: 10
Total no. of subjects: 8
List of Trainers:
George
Mario
Paul
Peter
Joesph
Mariam
Steeve
Martin
Stella
Merry
List of subjects:
AI
ML
DBMS
DS
DM
DSAD
MDS
CO
--------Function displayRecruitList --------
No of trainers required to cover all subjects: 5
Mariam/ AI / DS / ML
Steeve / DM / CO / DBMS / ML
Peter / DS / CO / MDS / ML
Stella / AI / DS / ML / DSAD
Martin / AI / ML / DS / MDS
--------Function displayTrainers --------
List of Trainers who can teach DS:
Mariam,
Peter
Stella
Martin
-----------------------------------------
Note that the input/output data shown here is only for understanding and testing, the
actual file used for evaluation will be different.
2. Deliverables
1. Word document designPS13_<group id>.docx detailing your design and time complexity of
the algorithm.
2. [Group id]_Contribution.xlsx mentioning the contribution of each student in terms of
percentage of work done. Download the Contribution.xlsx template from the link shared in the
Assignment Announcement.
3. inputPS13.txt file used for testing
4. promptsPS13.txt file used for testing
5. outputPS13.txt file generated while testing
6. .py file containing the python code. Create a single *.py file for code. Do not fragment your
code into multiple files

Zip all of the above files including the design document and contribution file in a folder
with the name:
[Group id]_A1_PS13_ TrainerRecruitment.zip and submit the zipped file.
Group Id should be given as Gxxx where xxx is your group number. For example, if your group
is 26, then you will enter G026 as your group id.
3. Instructions
1. It is compulsory to make use of the data structure(s) / algorithms mentioned in the problem
statement.
2. Ensure that all data structure insert and delete operations throw appropriate messages when
their capacity is empty or full. Also ensure basic error handling is implemented.
3. For the purposes of testing, you may implement some functions to print the data structures or
other test data. But all such functions must be commented before submission.
4. Make sure that your read, understand, and follow all the instructions
5. Ensure that the input, prompt and output file guidelines are adhered to. Deviations from the
mentioned formats will not be entertained.
6. The input, prompt and output samples shown here are only a representation of the syntax to
be used. Actual files used to evaluate the submissions will be different. Hence, do not hard code
any values into the code.
7. Run time analysis is to be provided in asymptotic notations and not timestamp based
runtimes in sec or milliseconds.
8. Please note that the design document must include a. The data structure model you
chose with justifications
b. Details of each operations with the time complexity and reasons why the chosen
operations are efficient for the given representation
c. One alternate way of modelling the problem with the cost implications.

9. Writing good technical report and well document code is an art. Your report cannot
exceed 4 pages. Your code must be modular and quite well documented.

Instructions for use of Python:


1. Implement the above problem statement using Python 3.7.
2. Use only native data types like lists and tuples in Python, do not use dictionaries provided in
Python. Use of external libraries like graph, numpy, pandas library etc. is not allowed. The
purpose of the assignment is for you to learn how these data structures are constructed and
how they work internally.
3. Create a single *.py file for code. Do not fragment your code into multiple files.
4. Do not submit a Jupyter Notebook (no *.ipynb). These submissions will not be evaluated.
5. Read the input file and create the output file in the root folder itself along with your .py file. Do
not create separate folders for input and output files.

You might also like