Question
1. Problem Statement You are planning to start an ecommerce shopping website for household items and need to purchase your inventory from another vendor. Through
1. Problem Statement You are planning to start an ecommerce shopping website for household items and need to purchase your inventory from another vendor. Through extensive research and surveys, you have identified certain products that are in high demand and profitable. You are preparing your product catalog and need to determine which products to purchase such that your profit is maximized and the total cost is within your budget. There are certain products which are priced low but may have higher profit margin as compared to other products. You have a total budget of x lakhs to be allocated to different products for the next shipment. Here your task would be to select as many products as possible with the budget constraints such that the total profit is maximized. If there are multiple solutions with the same profit, choose the one which results in maximum selection of products and minimum budget utilization. For this problem we can assume that there is no dependency of one product on the other. The budget, cost and profit values to be > 0 Requirements 1. Formulate an efficient algorithm using Dynamic Programming to determine how to select the products to be ordered 2. Implement the above problem statement using Python 3.7 3. Read the input from a file (inputPS05.txt) and Print the sequence of events and total time taken for the entire queue of processes to be executed.
4. You will output your answers to a file (outputPS05.txt) for each line. 5. Perform an analysis for the features above and give the running time in terms of input size: n along with justification.
Example Input: Sample Input: Input will be taken from the file(inputPS05.txt) . For example, if the budget is 20 lakhs and there are 10 different products in total and their fund requirements and values are given as shown. The profit % is percent of the cost so if cost is 3 lakhs and profit % is 65%, then the profit would be 0.65x3 = 1.95 Budget - 20 lakhs
The input file will have the total budget (in lakhs) for the shipment in one line and product details from second line which has the fixed format mentioned below using the / as a field separator.
Sample Input Example Budget - 20 1 / 3 / 65 2 / 2 / 20 3 / 1 / 25 .....
Sample Output: Display the output in outputPS05.txt. The output will consist of a list of products to be bought, Total profit (in lakhs) and any remaining funds. The products that can be bought: 1,4,5,7,8,9 Total profit: 11.9 Budget remaining: 0.9
\begin{tabular}{ccc} Products (i) & Cost Ci( lakhs) & PROFIT \% Pi \\ \hline 1 & 3 & 65 \\ 2 & 2 & 20 \\ 3 & 1 & 25 \\ 4 & 5 & 80 \\ 5 & 2.3 & 60.5 \\ 6 & 4 & 25 \\ 7 & 4.5 & 35.5 \\ 8 & 2.8 & 65 \\ 9 & 1.5 & 75 \\ 10 & 1 & 80 \end{tabular}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