#pragma once #include #include #include #include #include #include using namespace std; class directedGraph { private: class vertex { public: string data; //adjacency list vector neighbors; vertex(string x) { data = x; } }; //a container to hold the vertices unordered_map vertexMap; public: void addVertex(string x) { vertexMap[x] = new vertex(x); } void addDirectedEdge(string x, string y) { vertex* xVert = vertexMap[x]; vertex* yVert = vertexMap[y]; xVert->neighbors.push_back(yVert); } void addBasicEdge(string x, string y) { addDirectedEdge(x, y); addDirectedEdge(y, x); } };