首页 >
> 详细

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

- 辅导 program、讲解 python编程... 2024-02-19
- 辅导 cs2910、讲解cs2910 asse... 2024-02-19
- 讲解 cs 532、cs 532: homewor... 2024-02-19
- 讲解business decision analyt... 2024-02-18
- 辅导data structures project... 2024-02-18
- 辅导 hw2: shared memory part... 2024-02-18
- 辅导 econ 323、econ 323: eco... 2024-02-17
- b31se编程讲解 、image proces... 2024-02-17
- 辅导 discrete event systems、... 2024-02-16
- 辅导 ece438、讲解ece438: com... 2024-02-16
- 讲解 program、spatial networ... 2024-02-16
- a03.firstgit编程辅导 、pytho... 2024-02-16
- 辅导 cs9053、讲解introductio... 2024-02-15
- 辅导 comp26020、讲解comp2602... 2024-02-15
- 讲解 csci3280、辅导 introdu... 2024-02-14
- 讲解 consider the following ... 2024-02-14
- 辅导 ems5730、讲解homework #... 2024-02-14
- 辅导 cs 211编程、讲解compute... 2024-02-13
- 辅导assignment 1 – business... 2024-02-13
- prog10065讲解 、辅导interact... 2024-02-13