#ifndef GRAPH_H_ #define GRAPH_H_ #include "vertex.h" #include #include #include #include namespace graph { template class Graph { public: Graph() = default; // Add vertex v void insert(Vertex& v); // Add edge between v and u void insert(Vertex v, Vertex u); // Delete vertex v void erase(Vertex& v); // Delete edge between v and u void erase(Vertex& v, Vertex& u); // Return true if v and u are connected bool connected(const Vertex& v, const Vertex& u) const; // Adjacency matrix representation std::vector> vertices; }; template inline void Graph::insert(Vertex& v) { vertices.push_back(v); } template inline void Graph::insert(Vertex v, Vertex u) { v.edges.push_back(u); vertices.push_back(v); } template inline void Graph::erase(Vertex& v) { // } template inline void Graph::erase(Vertex& v, Vertex& u) { // } template inline bool Graph::connected(const Vertex& v, const Vertex& u) const { return false; } } // namespace graph #endif