lab_graphs
Gangnam-Style Graphs
|
This is a namespace that provides various functions for operations on the Graph class. More...
Functions | |
int | findMinWeight (Graph &graph) |
Finds the minimum edge weight in the Graph graph. More... | |
int | findShortestPath (Graph &graph, Vertex start, Vertex end) |
Returns the shortest distance (in edges) between the Vertices start and end. More... | |
void | findMST (Graph &graph) |
Finds a minimal spanning tree on a graph. More... | |
This is a namespace that provides various functions for operations on the Graph class.
Your assignment this lab will be to implement these three functions.
int GraphTools::findMinWeight | ( | Graph & | graph | ) |
Finds the minimum edge weight in the Graph graph.
THIS FUNCTION IS GRADED.
graph | - the graph to search |
Initially label vertices and edges as unvisited.
Returns the shortest distance (in edges) between the Vertices start and end.
THIS FUNCTION IS GRADED.
graph | - the graph to search |
start | - the vertex to start the search from |
end | - the vertex to find a path to |
In order to draw (and correctly count) the edges between two vertices, you'll have to remember each vertex's parent somehow.
void GraphTools::findMST | ( | Graph & | graph | ) |
Finds a minimal spanning tree on a graph.
THIS FUNCTION IS GRADED.
graph | - the graph to find the MST of |