Assignment #5, CS 155, Section 1

due December 6, 2007
100 points

In this assignment there are nonprogramming options for all 100 points of the assignment.

  1. (75 points)

  2. (25 points) Trace the behavior of the approximation algorithm of Section 13.4.3 of the text on the TSP instance whose adjacency matrix is given below. Show at least the result of finding the minimum-cost spanning tree, of finding the Euler tour, and of finding the minimum-cost Hamiltonian cycle. Assume that the vertices are numbered from 0 through 5.

        0  5 27 35 40 45
        5  0 25 37 42 47
       27 25  0 60 65 70
       35 37 60  0 10 15
       40 42 65 10  0 20
       45 47 70 15 20  0
    
    You may obtain your answer by programming, or by hand. You need not use any particular algorithm for finding the minimum-cost spanning tree. If you write a program, you may use either of the algorithms of Section 7.3.1 or 7.3.2 of the text with appropriate credit.

    You are to test your classes by executing the (main method of) the BrancherAndBounder class. This partially defined class, along with the fully defined but abstract Node class, is available on the class web site. You are to turn in hard and soft copies of your any class definitions that you modify. You are also to turn in a hard copy of the results of your tests, and of any work that you do by hand (that is, any work that you are submitting for credit as part of a nonprogramming option).

As always, in your programs you may add any other public or private methods or classes you find useful. In particular, you may add to the Node class if you choose.