KShortestPaths5.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. //
  2. // Created by wrede on 28.06.16.
  3. //
  4. #ifndef GBMOT_KSHORTESTPATHS5_H
  5. #define GBMOT_KSHORTESTPATHS5_H
  6. #include "../graph/Definitions.h"
  7. namespace algo
  8. {
  9. class KShortestPaths5
  10. {
  11. private:
  12. DirectedGraph orig_graph_;
  13. Vertex source_;
  14. Vertex sink_;
  15. VertexPredecessorMap paths_;
  16. std::vector<Vertex> sink_neighbors_;
  17. bool FindPath(DirectedGraph& graph, Vertex& source, Vertex& sink,
  18. VertexPredecessorMap& predecessors, VertexDistanceMap& distances);
  19. bool FindPath(DirectedGraph& graph, Vertex& source, Vertex& sink,
  20. VertexPredecessorMap& predecessors);
  21. void FindPathPair();
  22. void FindPaths(size_t count);
  23. void AddPath(VertexPredecessorMap& path);
  24. void AddPath(VertexPredecessorMap& in, MultiPredecessorMap& out);
  25. void AddPaths(MultiPredecessorMap& paths);
  26. public:
  27. KShortestPaths5(DirectedGraph input_graph, Vertex source, Vertex sink);
  28. void Run(size_t max_path_count);
  29. void GetPaths(std::vector<std::vector<Vertex>>& paths);
  30. };
  31. }
  32. #endif //GBMOT_KSHORTESTPATHS5_H