首页 >
> 详细

Problem 1 [10 points]: In Lecture 10 (file lect 10.pdf) we argued that the Earliest-Finish-Time-First

greedy algorithm does not always work when weights are > 1. Give an example to show that the approach

of selecting the job/interval of least duration from among those that are compatible with previously selected

jobs/jobs does not work either.

Problem 2 [20 points]: Demonstrate how to use the MatrixChain algorithm presented in Lecture 10

(file lect 10b.pdf) to:

• [10 points] Fill table m for a matrix–chain product whose sequence of dimensions is 5, 10, 3, 12, 5, 50, 6.

• [10 points] Demonstrate how to retrieve the optimal parenthesization using table s.

Problem 3 [30 points]: Problem 15-3 (Bitonic Euclidean TSP) in your textbook. For full marks:

• Summarize the problem you are solving

• Describe the algorithm in English and, if helpful, pseudo–code

• Provide at least one worked example or diagram to show more precisely how your algorithm works.

• Prove (or indicate) the correctness of your algorithm.

Problem 4 [40 points]: Suppose you are working in a packaging business, and that you are given n

marbles, and an (arbitrary) number of packages. Your boss has asked you to maximize the total value of

all packages containing at least one marble, minus the cost of packaging, which is i for a package containing

i marbles. You may assume that array A[1 . . . n] is given, such that each entry A[i] ≥ i is the value of a

package containing exactly i marbles.

• [20 points] Describe an efficient algorithm that uses the principle of dynamic programming to package

marbles for a maximum profit.

• [10 points] Argue why your algorithm is correct.

• [10 points] Give a tight (asymptotic) upper bound for the running time of your algorithm and prove

that it is an upper bound for your solution.

1

In the euclidean traveling-salesman problem, we are given a set of n points in the plane, and we wish to find the

shortest closed tour that connects all n points. Figure 15.11(a) shows the solution to a 7-point problem. The general

problem is NP-hard, and its solution is therefore believed to require more than polynomial

time (see Chapter 34).

J. L. Bentley has suggested that we simplify the problem by restricting our attention to bitonic tours, that is, tours

that start at the leftmost point, go strictly rightward to the rightmost point, and then go strictly leftward back to the

starting point. Figure 15.11(b) shows the shortest bitonic tour of the same 7 points. In this case, a polynomial-time

algorithm is possible.

Describe an O.n2/-time algorithm for determining an optimal bitonic tour. You may assume that no two points

have the same x-coordinate and that all operations on real numbers take unit time. (Hint: Scan left to right,

maintaining optimal possibilities for the two parts of the tour.)

联系我们

- QQ：99515681
- 邮箱：99515681@qq.com
- 工作时间：8:00-21:00
- 微信：codinghelp

- 代写comp9012、辅导python程序语言 2023-01-23
- Comp9414: Artificial Intelligence Assi... 2023-01-05
- Comp9444 Assignment 1 Neural Networks ... 2023-01-05
- Final Assignment - Apply All Your Skil... 2023-01-05
- Data7202 Statistical Methods For Data ... 2023-01-04
- Comp307/Aiml420 Assignment 4: Planning... 2023-01-04
- Comp3170 Assignment 3 Moonlit Forest 2023-01-04
- Cs 179: Introduction To Graphical Mode... 2023-01-04
- Computer Vision Assignment 3: Deep L... 2023-01-03
- C++ Implementation Of Graph Algorithms 2023-01-03
- Computer Vision Assignment 3: Deep Le... 2023-01-03
- Cs 179: Introduction To Graphical Mode... 2023-01-03
- Comp Sci 3306, Comp Sci 7306 Assignmen... 2023-01-03
- Comp Sci 3306, Comp Sci 7306 Assignmen... 2023-01-03
- C++编程设计辅导、辅导program程序 2022-12-22
- Mthm002代做、辅导java/Python编程 2022-12-22
- Buss6002代做、辅导python编程 2022-12-22
- Cmpen 431代写、辅导c/C++语言编程 2022-12-20
- 辅导program、辅导java/C++编程 2022-12-19
- 代写engf0004、Matlab编程设计辅导 2022-12-19