52 #ifndef HAVOQGT_MPI_SINGLE_SOURCE_SHORTEST_PATH_HPP_INCLUDED
53 #define HAVOQGT_MPI_SINGLE_SOURCE_SHORTEST_PATH_HPP_INCLUDED
60 namespace havoqgt {
namespace mpi {
63 template <
typename Visitor>
68 std::priority_queue< Visitor, std::vector<Visitor>,
73 bool push(Visitor
const & task)
91 return m_data.size();;
96 return m_data.empty();
106 template<
typename Graph,
typename PathData,
typename EdgeWeight>
127 template<
typename VisitorQueueHandle>
128 bool visit(Graph& g, VisitorQueueHandle vis_queue)
const {
131 typedef typename Graph::edge_iterator eitr_type;
132 for(eitr_type eitr = g.edges_begin(
vertex); eitr != g.edges_end(
vertex); ++eitr) {
133 vertex_locator neighbor = eitr.target();
137 vis_queue->queue_visitor(new_visitor);
155 static PathData* data;
162 static EdgeWeight* data;
171 template <
typename TGraph,
typename PathData,
typename EdgeWeight>
174 EdgeWeight& edge_data,
175 typename TGraph::vertex_locator s) {
178 visitor_type::set_path_data(&path_data);
179 visitor_type::set_edge_weight(&edge_data);
182 visitor_queue_type vq(&g);
183 vq.init_visitor_traversal(s);
193 #endif //HAVOQGT_MPI_SINGLE_SOURCE_SHORTEST_PATH_HPP_INCLUDED
friend bool operator<(const sssp_visitor &v1, const sssp_visitor &v2)
static PathData *& path_data()
bool push(Visitor const &task)
sssp_visitor(vertex_locator _vertex, path_type _level)
friend bool operator>(const sssp_visitor &v1, const sssp_visitor &v2)
static EdgeWeight *& edge_data()
void single_source_shortest_path(TGraph &g, PathData &path_data, EdgeWeight &edge_data, typename TGraph::vertex_locator s)
sssp_visitor(vertex_locator _vertex)
std::priority_queue< Visitor, std::vector< Visitor >, std::greater< Visitor > > m_data
PathData::value_type path_type
bool visit(Graph &g, VisitorQueueHandle vis_queue) const
static void set_edge_weight(EdgeWeight *_data)
Graph::vertex_locator vertex_locator
static void set_path_data(PathData *_data)