UCR CS220, Fall 2000, Prof. Frank Vahid Homework 1, due 10/12/00 at the beginning of lecture 1. Represent the graph of Fig 2.5(b) of De Micheli's book (GDM) using: (a) An indicence matrix representation (b) An adjacency matrix representation 2. For GDM Fig 2.12(b): (a) List all paths from node 0 to 3, and the associated cost of each. Indicate the shortest path (i.e., the path with least cost). What is the complexity of this algorithm for finding the shortest path? (b) Trace Dijkstra's shortest path algorithm on the DAG, drawing a unique graph each time a vertex weight gets updated. What is the complexity of Dijkstra's algorithm (note: it's listed in the book!). 3. Partition the graph of GDM Fig 2.14(b) into a minimum number of non- overlapping cliques. (You don't have to trace any particular algorithm when doing this). 4. Provide a definition of a Pareto point. Indicate which of the following are not Pareto points, and for each explain why not. | a | b | | c | d | e | f g ----------------------- 5. (a) Design a greedy algorithm for solving the travelling salesman problem, assuming all pairs of vertices are connected. At each vertex, this algorithm should merely choose the lowest-cost adjacent city that hasn't already been visited. What is the complexity of this algorithm? (b) Trace your algorithm, and provide a final solution, for the graph described with the following adjacency matrix representing a five- vertex directed graph. Assume our tour starts and ends at vertex a. a b c d e --------------- a| 0 14 4 10 20 b| 14 0 7 8 7 c| 4 5 0 7 16 d| 11 7 9 0 2 e| 18 7 17 4 0 (c) Improve this algorithm by adding 1-level of look-ahead, i.e., choose the next vertex based on looking at all possible paths of length 2 (rather than 1 as in part a) leaving the city. What is the complexity of this algorithm? (d) Trace your algorithm again on the above graph and provide the solution. (e) Finally, trace a the branch-and-bound algorithm on the above graph. Show the solution tree and clearly indicate where pruning occurs. Use the bound described in class, where the bound on a visit to each city is half of the best arrival costs plus half of the best departure costs. Provide the final solution. What is the complexity of branch-and-bound algorithm? Does it guarantee an optimal solution?