Question: Please write anser in psudo code if possible. 11. Suppose you're consulting for a company that manufactures PC equip- ment and ships it to distributors

 Please write anser in psudo code if possible. 11. Suppose you're

Please write anser in psudo code if possible.

11. Suppose you're consulting for a company that manufactures PC equip- ment and ships it to distributors all over the country. For each of the next n weeks, they have a projected supply s1 of equipment (measured in pounds), which has to be shipped by an air freight carner Each week's supply can be caried by one of two airfreight companies A or B . Company A charges a fixed rate r per pound (so it costs r s, to ship a week's supply s). . Company B makes contracts for a fixed amount c per week, indepen dent of the weight. However, contracts with company B must be made in blocks of four consecutive weeks at a time. A schedule, for the PC company, is a choice of air freight company (A or B) for each of the n weeks, with the restriction that company B, whenever it is chosen, must be chosen for blocks of four contiguous weeks at a time. The cost of the schedule is the total amount paid to company A and B, according to the description above. Give a polynomial-time algorithm that takes a sequence of supply values s1, s2, ...Sn and returms a schedule of minimum cost. Example. Suppose r= 1, c= 10, and the sequence of values is 11, 9,9, 12, 12, 12, 12,9,9, 11. Then the optimal schedule would be to choose company A for the first three weeks, then company B for a block of four consecutive weeks, and then company A for the final three weeks

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!