Program Listing for File MultiTargetDijkstra.hpp

Return to documentation for file (include/networkit/distance/MultiTargetDijkstra.hpp)

#ifndef NETWORKIT_DISTANCE_MULTI_TARGET_DIJKSTRA_HPP_
#define NETWORKIT_DISTANCE_MULTI_TARGET_DIJKSTRA_HPP_

#include <networkit/auxiliary/VectorComparator.hpp>
#include <networkit/distance/STSP.hpp>

#include <tlx/container/d_ary_addressable_int_heap.hpp>

#include <vector>

namespace NetworKit {

class MultiTargetDijkstra final : public STSP {

public:
    template <class InputIt>
    MultiTargetDijkstra(const Graph &G, node source, InputIt targetsFirst, InputIt targetsLast)
        : STSP(G, source, targetsFirst, targetsLast) {}

    void run() override;

private:
    std::vector<edgeweight> distFromSource;
    tlx::d_ary_addressable_int_heap<node, 2, Aux::LessInVector<edgeweight>> heap{distFromSource};
};
} // namespace NetworKit

#endif // NETWORKIT_DISTANCE_MULTI_TARGET_DIJKSTRA_HPP_