Department of Computing

Local Navigation

Week 11

Objectives : to learn more about graphs. Reference Carrano Chapter 13.
  1. * Trace through Dijkstra's single-source shortest path algorithm on the above graph, starting from vertex a. Show the vertex set and weight array at each step. Wherever there is a choice of vertex you should choose the smallest alphabetically.
  2. * Trace through Prim's MST algorithm on the above graph, starting from vertex a. REMEMBER to ignore directions for Prim's Algorithm. Wherever there is a choice of vertex you should choose the smallest alphabetically.
  3. * Write a c++ function which when passed an adjacency matrix representing an unweighted undirected graph will display the vertices in a depth-first search.
     void depthFirst(int matrix[n][n], int n)
    // matrix [0..n-1][0..n-1] is an adjacency matrix for a graph of n vertices
    // postcondition : displays the vertices in depth first order.
    
  4. Carrano Chap 13 exercise 4
  5. Carrano Chap 13 exercise 5
  6. Carrano Chap 13 exercise 10
  7. Carrano Chap 13 exercise 11
  8. Carrano Chap 13 Exercise 14
All enquiries to Ros Ballantyne