KShortestPaths4.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //
  2. // Created by wrede on 24.06.16.
  3. //
  4. #ifndef GBMOT_KSHORTESTPATHS4_H
  5. #define GBMOT_KSHORTESTPATHS4_H
  6. #include "../graph/Definitions.h"
  7. namespace algo
  8. {
  9. class KShortestPaths4
  10. {
  11. private:
  12. DirectedGraph graph_;
  13. Vertex source_;
  14. Vertex sink_;
  15. VertexDistanceMap vertex_labels_;
  16. VertexDistanceMap vertex_distances_;
  17. VertexVertexMap vertex_predecessors_;
  18. std::vector<Vertex> vertex_candidates_;
  19. std::vector<std::list<Vertex>> i_shortest_paths_;
  20. size_t max_paths_count_;
  21. size_t total_paths_count_;
  22. double total_paths_distance_;
  23. void Initialization();
  24. void InterlacingConstruction();
  25. void NeighborDistanceTest(Vertex r);
  26. void NegativeInterlacing(Vertex input);
  27. void FeasibleTermination();
  28. void NonFeasibleTermination();
  29. bool Contains(std::vector<Vertex>& vector, Vertex& element);
  30. bool Contains(std::list<Vertex>& list, Vertex& element);
  31. public:
  32. KShortestPaths4(DirectedGraph graph, Vertex source, Vertex sink, size_t max_paths_count);
  33. void Run();
  34. };
  35. }
  36. #endif //GBMOT_KSHORTESTPATHS4_H