Question
A famous product photographer Xavier is in high demand and is being approached by various companies to get their products photographed. Xavier does all of
A famous product photographer Xavier is in high demand and is being approached by various companies to get their products photographed. Xavier does all of this product shoots at his studio and wants to make sure that he maximizes his returns by covering as many photoshoots in a day as possible. For a product shoot to be conducted, the product first has to be staged and then photographed. He has a team who stages the products and he does the photoshoots. Depending on the product, it takes different amounts of time to stage and varied time to complete the shoot. His team can stage another product in another part of the studio while Xavier is busy with a photoshoot of a previously staged product. Assuming that his team can work on only one product at a time before they move to staging another and Xavier also finishes one product photoshoot before moving to the next, you are expected to help Xavier make best use of his team and his time by deciding the order in which the products gets staged and photographed such that they finish the photoshoot of all products as quickly as possible.
Requirements:
-
- Formulate and effective algorithm using Greedy Method to arrange the product staging and photoshoot in such a way that total time taken for all products is minimized.
- Analyse the time complexity of your algorithm.
-
- Implement the above problem statement using Python 3.7.
Sample Input:
For example, if there are 6 different products in total the time (in minutes) for staging and photoshoot are mentioned as below:
Products: A / B / C / D / E / F
Staging: 20 / 30 / 45 / 60 / 20 / 10
Photo: 30 / 30 / 15 / 20 / 40 / 60
Input should be taken in through a file called inputPS1.txt which has the fixed format mentioned above using the / as a field separator:
Note that the input data shown here is only for understanding and testing, the actual file used for evaluation will be different.
Sample Output:
Product Sequence: F, A, E, B, C, D
Total time to complete photoshoot: 205 minutes
Idle time for Xavier: 10 minutes
Note that the output data shown here is only for understanding and testing, the actual file used for evaluation will be different. The output need not match the sample input provided earlier.
The output should be written to the file outputPS1.txt
- Deliverables
- Word document designPS1_.docx detailing your algorithm design and time complexity of the algorithm.
- [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.
- Zipped AS2_PS1_ProdShoot_[Group id].py package folder containing all the modules classes and functions and the main body of the program.
-
- inputPS1.txt file used for testing
-
- outputPS1.txt file generated while testing
- Instructions
a. It is compulsory to make use of the data structure(s) / algorithms mentioned in the problem statement.
b. Use only native data types like lists and tuples in Python. Use 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.
-
- It is compulsory to use Python 3.7 for implementation.
-
- Ensure that all data structure insert and delete operations throw appropriate messages when their capacity is empty or full.
-
- 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.
-
- Make sure that your read, understand, and follow all the instructions
-
- Ensure that the input, prompt and output file guidelines are adhered to. Deviations from the mentioned formats will not be entertained. If your program fails to read the input file used for evaluation, your program will not be evaluated.
-
- The input, prompt and output samples shown here are only a representation of the syntax to be used. Actual files used to test the submissions will be different. Hence, do not hard code any values into the code.
-
- Run time analysis is provided in asymptotic notations and not timestamp based runtimes in sec or milliseconds.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started