The.Algorithm.Design.Manual.Springer-Verlag.1998

The.Algorithm.Design.Manual.Springer-Verlag.1998 The.Algorithm.Design.Manual.Springer-Verlag.1998

18.04.2013 Views

Implementation Challenges Next: Combinatorial Search and Heuristic Up: Graph Algorithms Previous: Exercises Implementation Challenges 1. Airline flight schedules define a natural graph, where the vertices are the airports and there is an edge between any two airports with direct flights between them whose weight is proportional to the distance between them. An extensive airplane data set due to Roberto Tammasia is available from the Algorithm Repository WWW/CD-ROM. Write a program that explicitly constructs the airport graph from this data set. 2. This problem is a follow-up to the exercise above. Changing planes repeatedly on connecting flights can be a hassle. Develop and implement an algorithm that finds the fewest flights needed to get from airport A to B, regardless of waiting time. 3. (*) This problem is a follow-up to the exercise above. Develop and implement an algorithm that finds the flight plan from airport A to B that minimizes the total distance traveled. 4. (*) This problem is a follow-up to the exercise above. Suppose that we must arrive at airport B at time T for an important scheduled meeting. Develop and implement an algorithm that finds the latest time one can leave airport A in time to make the meeting. 5. (*) This problem is a follow-up to the exercise above. In order to take advantage of a frequent flyer program, we might want to fly only on a particular airline. How can we modify the above solutions so as to accommodate such queries? 6. (**) This problem is a follow-up to the exercise above. A really devout frequent flyer might want to find the longest flight plan between airports A and B, so as to maximize the number of miles they get credit for. Develop and implement an algorithm to find the longest such route. Algorithms Mon Jun 2 23:33:50 EDT 1997 file:///E|/BOOK/BOOK2/NODE82.HTM [19/1/2003 1:37:10]

Implementation Challenges Next: Intractable Problems and Approximations Up: Combinatorial Search and Heuristic Previous: Exercises Implementation Challenges 1. (*) Anagrams are rearrangements of the letters of a word or phrase into a different word or phrase. Sometimes the results are quite striking. For example, ``MANY VOTED BUSH RETIRED'' is an anagram of ``TUESDAY NOVEMBER THIRD,'' which correctly predicted the outcome of the 1992 U.S. presidential election. Design and implement an algorithm for finding anagrams using combinatorial search and a dictionary. 2. (*) For any of the exercises above, design and implement a simulated annealing heuristic to get reasonable solutions. How well does your program perform in practice? 3. (**) Design and implement a parallel sorting algorithm that distributes data across several processors. An appropriate variation of mergesort is a likely candidate. Measure the speedup of this algorithm as the number of processors increases. Later, compare the execution time to that of a purely sequential mergesort implementation. What are your experiences? Algorithms Mon Jun 2 23:33:50 EDT 1997 file:///E|/BOOK/BOOK3/NODE103.HTM [19/1/2003 1:37:11]

Implementation Challenges<br />

Next: Intractable Problems and Approximations Up: Combinatorial Search and Heuristic Previous:<br />

Exercises<br />

Implementation Challenges<br />

1. (*) Anagrams are rearrangements of the letters of a word or phrase into a different word or phrase.<br />

Sometimes the results are quite striking. For example, ``MANY VOTED BUSH RETIRED'' is an<br />

anagram of ``TUESDAY NOVEMBER THIRD,'' which correctly predicted the outcome of the<br />

1992 U.S. presidential election. <strong>Design</strong> and implement an algorithm for finding anagrams using<br />

combinatorial search and a dictionary.<br />

2. (*) For any of the exercises above, design and implement a simulated annealing heuristic to get<br />

reasonable solutions. How well does your program perform in practice?<br />

3. (**) <strong>Design</strong> and implement a parallel sorting algorithm that distributes data across several<br />

processors. An appropriate variation of mergesort is a likely candidate. Measure the speedup of<br />

this algorithm as the number of processors increases. Later, compare the execution time to that of<br />

a purely sequential mergesort implementation. What are your experiences?<br />

<strong>Algorithm</strong>s<br />

Mon Jun 2 23:33:50 EDT 1997<br />

file:///E|/BOOK/BOOK3/NODE103.HTM [19/1/2003 1:37:11]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!