# Photoshop greedy algorithm

1. Problem Statement

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:

1. 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.

2. Analyse the time complexity of your algorithm.

3. 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 is taken in through a file called “[login to view URL]” which has the fixed format mentioned using the “/” as a field separator.

Note that the input/output 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 input/output data here is only for understanding and testing, the actual file used for testing will be different.

Display the output in outputPS7.txt.

Deliverables

3. [login to view URL] file used for testing

4. [login to view URL] file generated while testing

5. .py file containing the python code. Create a single *.py file for code. Do not fragment your

code into multiple files.

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, implement some functions to print the data structures or

other test data. But all such functions must be commented before submission.

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.

Instructions for use of Python:

1. Implement the 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.

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.

Skills: Data Science, Python