diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/graph.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/graph.h b/src/graph.h index 9df4b9f..8c04606 100644 --- a/src/graph.h +++ b/src/graph.h @@ -16,6 +16,17 @@ public: graph_[from].push_back(to); } + std::set<int> get_vertices() { + std::set<int> vertices; + + for (auto vertex : graph_) { + vertices.insert(vertex.first); + } + + return vertices; + } + + std::vector<int> const& get_neighbors(int vertex) { return graph_[vertex]; } |