CSCI 2300 Lab 6 Spring 2015, 3/18/15

This lab is about graphs, BFS and algorithms.
  1. The BFS procedure is already described in the above code. Modify the code to make it (shortest path algorithm) work on a weighted directed graph (i.e., edges have weights) You can use Priority queue from STL. Output will be the shortest path froma given source to a given destination. Test it with data6 Code Snippet that may be helpful:
      priority_queue < Vertex *, vector <Vertex *>, PrioritizeVertices> prior_q;
        for( int i = 0; i < allVertices.size( ); i++ ) {
            prior_q.push(allVertices[i]);
    			}
    
    class PrioritizeVertices {
    public :
        bool operator()(Vertex *x, Vertex *y )
        {
      if (x->dist > y->dist) return true;
        else return false;
        }
    };
    
    
  2. Modify the above code to produce minimum spannig tree of an undirected graph. Output will be the minimum spanning tree edges. Test it with data62
  3. Read about Hash fucntions and Bloom Filter and the youtube video
  4. In class (3/16/2015), we talked about getting a code for a tree and reconstruction from the code to a tree - It is called Prufer sequence. Please look at Prufer Sequence . For complete graphs with 4 vertices, there are 16 trees. The corresponding Prufer Sequences are: 1,1; 1,2; 1,3; 1,4; 2,1; 2,2; 2,3; 2,4; 3,1;3,2; 3,3; 3,4; 4,1; 4,2; 4,3; 4,4; Construct a tree for any two of them.