Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. 10 marks] Suppose you are scheduling jobs in a factory to maximize profit. In the ith week, you can choose not to do any

image text in transcribedimage text in transcribed

1. 10 marks] Suppose you are scheduling jobs in a factory to maximize profit. In the ith week, you can choose not to do any job, do an easy job with profit e20, or do a hand job with proft 0. In order to do a hard job, you must use all your manpower to gather resources for it in the previous week. That is, if you wish to do a hard job in week i, then you must choose not to do any job in week i -1. If you do an easy job in week i, then you are free to do any type of job (or no job at all) in week i - 1 Your task is to come up with a schedule of the jobs to be done in each week (i.e. choose among the easy job for this week, the hard job for this week, or no job), so that the total profit is maximized. A greedy algorithm is to compare h2 with e +e2. If h2 is larger, then do not do any job in week 1 and do the hard job in week 2. Otherwise, do easy jobs in both week 1 and week 2. Then consider h4 and use the same strategy, and so on. This will schedule jobs for all the weeks if n is an even number. If n is an odd number, then after scheduling all the weeks up to and including week n -1, do an easy job in week n. Give a counterexample to show that this greedy algorithm will not always yield an optimal solution. Argue carefully why it is a counterexample

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual Basic Net Database Programming

Authors: Rod Stephens

1st Edition

0789726815, 978-0789726810

More Books

Students also viewed these Databases questions

Question

What is database?

Answered: 1 week ago

Question

What are Mergers ?

Answered: 1 week ago

Question

Have roles been defined and assigned?

Answered: 1 week ago