#pragma once #include #include #include #include #include #include using namespace std; class directedGraph { private: class vertex { public: string data; //whatever type of item you have vector neighbors; //neighbor list bool marked; //for the bfs algorithm? vertex* bc; //for the bfs augmentation? vertex(string s) { data = s; marked = false; bc = nullptr; } }; //choose a container to hold all //vertices in the graph. What data structure? //Supportes O(1) a.c. search unordered_map vertexMap; public: //O(1) a.c. void addVertex(string s) { vertex * babyVertex = new vertex(s); vertexMap[s] = babyVertex; //O(1) a.c. } //O(1) a.c. void addDirectedEdge(string a, string b) { vertex* aptr = vertexMap[a]; //O(1) a.c. vertex* bptr = vertexMap[b]; //O(1) a.c. aptr->neighbors.push_back(bptr); } void addBasicEdge(string a, string b) { addDirectedEdge(a, b); addDirectedEdge(b, a); } };