We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 905d024 commit 53a0a9aCopy full SHA for 53a0a9a
include/a_star.hpp
@@ -179,6 +179,13 @@ namespace utils
179
return true;
180
}
181
182
+ [[nodiscard]] const node<Tp> *get_parent(const node<Tp> &n) const noexcept
183
+ {
184
+ if (auto it = came_from.find(&n); it != came_from.end())
185
+ return it->second;
186
+ return nullptr;
187
+ }
188
+
189
[[nodiscard]] std::vector<std::shared_ptr<node<Tp>>> get_path() const noexcept
190
{
191
std::vector<std::shared_ptr<node<Tp>>> path;
0 commit comments