From b4b56aab5cf916ddb196678e5d1f1e0fb952dc82 Mon Sep 17 00:00:00 2001 From: Viktor T Date: Fri, 4 Jun 2021 00:18:27 +0300 Subject: [PATCH] Resolves #233 by moving call to `edge_relaxed` after updating the cost map --- include/boost/graph/astar_search.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/boost/graph/astar_search.hpp b/include/boost/graph/astar_search.hpp index 2d4f264fe..00e52c2ce 100644 --- a/include/boost/graph/astar_search.hpp +++ b/include/boost/graph/astar_search.hpp @@ -182,10 +182,10 @@ namespace detail if (m_decreased) { - m_vis.edge_relaxed(e, g); put(m_cost, target(e, g), m_combine( get(m_distance, target(e, g)), m_h(target(e, g)))); + m_vis.edge_relaxed(e, g); } else m_vis.edge_not_relaxed(e, g); @@ -203,8 +203,8 @@ namespace detail put(m_cost, target(e, g), m_combine( get(m_distance, target(e, g)), m_h(target(e, g)))); - m_Q.update(target(e, g)); m_vis.edge_relaxed(e, g); + m_Q.update(target(e, g)); } else m_vis.edge_not_relaxed(e, g); @@ -219,10 +219,10 @@ namespace detail if (m_decreased) { - m_vis.edge_relaxed(e, g); put(m_cost, target(e, g), m_combine( get(m_distance, target(e, g)), m_h(target(e, g)))); + m_vis.edge_relaxed(e, g); m_Q.push(target(e, g)); put(m_color, target(e, g), Color::gray()); m_vis.black_target(e, g);