Solutions to Assignment #5, CS 155, Section 1

December 6, 2007

  1. The nodes in the tree below are labeled with their weight so far, their benefit so far, their optimistic estimator, and the order in which they would be generated by the branchAndBound, solve, and lazySolve methods. For the first of these methods, 18 nodes are expanded and 30 are generated. For the second, 15 nodes are expanded and 27 generated. For the third, 11 nodes are expanded and 18 generated. The solution nodes returned by each method are given in bold face. Note that for the solve, and lazySolve methods. For the first of these methods, 18 nodes are expanded and 30 are generated. method, the solution node is not a leaf, is not put into the priority queue, and is not expanded.
                                               0
                                               0
                                              78
                                               1
                                               1
                                               1
                                 /                             \
                     7                                                        0
                    25                                                        0
                    78                                                       77 
                     2                                                        3
                     2                                                        3
                     2                                                        3
              /              \                                           /          \ 
      16                          7                                9                    0
      57                         25                               32                    0
      78                         76.8                             77                   74.8
       4                          5                               23                   24
       4                          5                                8                    9
       4                          5                                8                    9
          \                  /         \                      /        \              /   \
           16          15                    7           17                9         8      0
           57          53                   25           60               32        28      0
           77.4        76.8                 75           77               75.6      74.8   55
            6          11                   12           25               26         -      -
            6          13                   14           10               11        24     25
            6          13                   14           10               11         -      -
              \           \                /   \             \           /   \  
               16           15           17      7             17       19    9
               57           53           59     25             60       66   32
               75.5         74           75     46             76       75.6 53
                7           13           18     19             27        -    -
                7           15           22     23             12       18   19
                7           15            -      -             12        -    -
               / \         /   \        /  \                 /    \
            21   16       20    15    22    17             22      17
            73   57       69    53    75    59             76      60
            75.5 62       74    58    75    64             76      65      
             8    9       14    15    20    21             28      29
            20   21       26    27     -     -             16      17
             -    -        -     -     -     -             16      17
              \           / \           \                    \     
              21         22 20          22                    22
              73         74 69          75                    76
              73         74 69          75                    76
              10         16 17          22                    30
               -          -  -           -                     -
               -          -  -           -                    18
    

  2. The minimum-cost spanning tree has edges {0,1), {3,4), (3,5), {1,2}, and {0,3}, of respective costs 5, 10, 15, 25, and 35 (for a total cost of 90). One Euler tour for this spanning tree -- the one obtained by starting at vertex 0 and picking the lowest-numbered is (0 1 2 1 0 3 4 3 5 3 0). This tour has cost 180. Deleting second and subsequent occurrence of vertices from this tour gives (0 1 2 3 4 5 0), a tour of cost 5 + 25 + 60 + 10 + 20 + 45 = 165.