// // Created by wrede on 15.06.16. // #ifndef GBMOT_KSHORTESTPATHS2_H #define GBMOT_KSHORTESTPATHS2_H #include "../graph/Definitions.h" namespace algo { class KShortestPaths2 { private: DirectedGraph graph_orig_; DirectedGraph graph_copy_; Vertex source_; Vertex sink_; std::unordered_map orig_to_copy_; std::unordered_map copy_to_orig_; std::unordered_map in_to_out_; std::unordered_map out_to_in_; std::vector, double>> edges_to_add_; std::vector> edges_to_remove_; std::vector> i_distances_; std::vector i_paths_; void CreateCopy(); void ExtendGraph(size_t iteration); void TransformEdges(size_t iteration); void FindAndAugment(size_t iteration); void Interlace(size_t iteration); double PathCosts(size_t iteration); void QueueCopyEdges(); void QueueRemoveAll(); void QueueRemoveEdge(Vertex source, Vertex target); void QueueAddEdge(Vertex source, Vertex target, double weight); void UpdateEdges(); public: KShortestPaths2(); ~KShortestPaths2(); MultiPredecessorMap Run(DirectedGraph& graph_orig, Vertex source, Vertex sink, size_t iterations); }; } #endif //GBMOT_KSHORTESTPATHS2_H