aboutsummaryrefslogtreecommitdiff
path: root/BreadthFirstPathfinder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'BreadthFirstPathfinder.cpp')
-rw-r--r--BreadthFirstPathfinder.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/BreadthFirstPathfinder.cpp b/BreadthFirstPathfinder.cpp
index c204387..e3a5430 100644
--- a/BreadthFirstPathfinder.cpp
+++ b/BreadthFirstPathfinder.cpp
@@ -18,9 +18,12 @@ void BreadthFirstPathfinder::find_between(const XY & start, const XY & end) {
vector<Path> trails = { { start } };
this->end = end;
+ int steps = -1;
while (trails.size() > 0) {
+ steps++;
trails = this->find_step(trails);
}
+ printf("BFS: %s (%d steps)\n", this->solution.empty() ? "no solution found" : "solution found", steps);
}
vector<BreadthFirstPathfinder::Path> BreadthFirstPathfinder::find_step(const vector<Path> & to_visit) {