lab_graphs
Gangnam-Style Graphs
graph_tools.h
Go to the documentation of this file.
1 
6 #ifndef _GRAPH_TOOLS_
7 #define _GRAPH_TOOLS_
8 
9 #include <algorithm>
10 #include <stack>
11 #include <queue>
12 #include <unordered_map>
13 #include "graph.h"
14 #include "dsets.h"
15 
16 using std::stack;
17 using std::queue;
18 using std::unordered_map;
19 
25 namespace GraphTools
26 {
30  int findMinWeight(Graph & graph);
31 
36  int findShortestPath(Graph & graph, Vertex start, Vertex end);
37 
41  void findMST(Graph & graph);
42 
43  // define any helper functions here:
44 
49  Edge BFS(Graph & graph, Vertex start);
50 }
51 
52 #endif
Represents a graph of vertices and edges and allows basic operations to be performed on it...
Definition: graph.h:49
void findMST(Graph &graph)
Finds a minimal spanning tree on a graph.
Definition: graph_tools.cpp:127
This is a namespace that provides various functions for operations on the Graph class.
Definition: graph_tools.h:25
Represents an edge in a graph; used by the Graph class.
Definition: edge.h:22
int findMinWeight(Graph &graph)
Finds the minimum edge weight in the Graph g.
Definition: graph_tools.cpp:26
Edge BFS(Graph &graph, Vertex start)
Does a BFS of a graph, keeping track of the minimum weight edge seen so far.
Definition: graph_tools.cpp:173
Graph Library Declarations.
int findShortestPath(Graph &graph, Vertex start, Vertex end)
Returns the shortest distance (in edges) between the Vertices start and end.
Definition: graph_tools.cpp:62