subject

Suppose you are consulting for a company that manufactures PC equipment and ships it to distributors all over the country. For each of the n next weeks, they have a projected supply si of equipment (measured in pounds), which has to be shipped by an air freight carrier. Each week’s supply can be carried by one of two air freight companies, A or B. − Company A charges a fixed rate r per pound, so it costs r ∗ si to ship a week’s supply (si) − Company B makes contracts for a fixed amount c per week, independent 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 companies A and B, according to the description above. You are asked to give a polynomial time algorithm that takes a sequence of supply values s1, s2,…, sn and returns a schedule of minimum cost. In order to achieve this, you need to answer the following questions:Determine and prove the optimal substructure of the problem and write a recursive formula of an optimal solution (i. e., define the variable that you wish to optimize and explain how a solution to computing it can be obtained from solutions to subproblems). Submit: the recursive formula, along with definitions and explanations on what is computed. Write an algorithm that computes an optimal solution to this problem, based on the recurrence above. Implement your algorithm in C/C++ and run it on the following values: - r = 1, c = 10, the sequence of si values: 11, 9, 9, 12, 12, 12, 12, 9, 9, 11.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 00:00
Suppose you have 9 coins and one of them is heavier than others. other 8 coins weight equally. you are also given a balance. develop and algorithm to determine the heavy coin using only two measurements with the of the balance. clearly write your algorithm in the form of a pseudocode using the similar notation that we have used in the class to represent sorting algorithms
Answers: 1
question
Computers and Technology, 23.06.2019 03:30
In vista and windows 7, the appearance and personalization option allows you to change the
Answers: 1
question
Computers and Technology, 24.06.2019 03:30
It is not necessary to develop strategies to separate good information and bad information on the internet. true or false
Answers: 1
question
Computers and Technology, 24.06.2019 06:30
Some peer-to-peer networks have a server and some don't. true false
Answers: 2
You know the right answer?
Suppose you are consulting for a company that manufactures PC equipment and ships it to distributors...
Questions
question
Social Studies, 06.09.2021 06:50
question
Mathematics, 06.09.2021 06:50
question
History, 06.09.2021 06:50
question
Spanish, 06.09.2021 06:50
question
Mathematics, 06.09.2021 06:50
Questions on the website: 13722360