m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src/graph.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/graph.h')
-rw-r--r--src/graph.h11
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];
}