Question
A factory has N machines numbered 0 to n 1, the ith machine has a output score of wi, this is a non-negative integer. The
A factory has N machines numbered 0 to n 1, the ith machine has a output score of wi, this is a non-negative integer. The N is broken up into m groups, numbered 0 to m 1, the groups are specied by a sequence of non-negative integers d0 < d1 < ... < dm1. All machine numbered 0,...,d0 1 are in group 0. For j > 0 all machine numbered dj1,...dj 1 are in group j. It always holds that dm1 = n so every machine is in precisely one group. Create section consisting of k machines, maximizing their total output score. There is restriction that group of the machine is allowed to contribute more than 5 machines to the section. (a) Devise an algorithm that given n, m, k min(n,5m), w0,...,wn1 and d0,...,dm1 computes a valid section(with k machines so that no groups contributes more than 5 machines) with maximum total output score. For full score the running time of your algorithm should be O(nlogn). (b) Prove that your algorithm always outputs a valid section with maximum possible total score. (c) Analyze the time complexity of your algorithm (in terms of big-Oh).
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