From 58c07aeda7044f380342ef47255aa5ab27d0d4db Mon Sep 17 00:00:00 2001 From: Kilian Verhetsel <kilian.verhetsel@student.uclouvain.be> Date: Sun, 11 Dec 2016 18:24:07 +0000 Subject: [PATCH] Changed LNS Fragment selection to use the on_examine_vertex event The original code would only record vertices that were reached in two different ways (and thus the edge was already marked as black when visited a second time). --- Mesh/mwis.hpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Mesh/mwis.hpp b/Mesh/mwis.hpp index 9179f207a1..e5177cfb56 100644 --- a/Mesh/mwis.hpp +++ b/Mesh/mwis.hpp @@ -881,11 +881,17 @@ public: void operator()(edge e, const Graph &g) { _set.insert(boost::target(e, g)); } + + void operator()(vertex v, const Graph &g) { + _set.insert(v); + } }; template<typename Graph, typename WeightMap> lns_fragment<Graph> fragment_selector(const lns_state<Graph, WeightMap> &state) { typedef typename boost::graph_traits<Graph>::vertex_descriptor vertex; + typedef typename boost::graph_traits<Graph>::vertex_iterator vertex_iterator; + typedef typename boost::graph_traits<Graph>::out_edge_iterator out_edge_iterator; if (boost::num_vertices(state.graph) == 0) return lns_fragment<Graph>(std::set<vertex>()); @@ -898,7 +904,7 @@ lns_fragment<Graph> fragment_selector(const lns_state<Graph, WeightMap> &state) std::set<vertex> set; set.insert(v); - set_recorder<Graph, boost::on_black_target> recorder(set); + set_recorder<Graph, boost::on_examine_vertex> recorder(set); limited_queue<vertex> queue(neighborhood_size); -- GitLab