Tracore
KShortestPaths3.h
1 //
2 // Created by wrede on 24.06.16.
3 //
4 
5 #ifndef GBMOT_KSHORTESTPATHS3_H
6 #define GBMOT_KSHORTESTPATHS3_H
7 
8 #include "../graph/Definitions.h"
9 
10 namespace algo
11 {
13  {
14  private:
15  DirectedGraph graph_orig_;
16  DirectedGraph graph_copy_;
17  Vertex source_;
18  Vertex sink_;
19  std::unordered_map<Vertex, Vertex> orig_to_copy_;
20  std::unordered_map<Vertex, Vertex> copy_to_orig_;
21  std::unordered_map<Vertex, Vertex> in_to_out_;
22  std::unordered_map<Vertex, Vertex> out_to_in_;
23  std::vector<std::pair<std::pair<Vertex, Vertex>, double>> edges_to_add_;
24  std::vector<std::pair<Vertex, Vertex>> edges_to_remove_;
25  std::vector<std::unordered_map<Vertex, double>> i_distances_;
26  std::vector<MultiPredecessorMap> i_paths_;
27 
28  void CreateCopy();
29  void ExtendGraph(size_t iteration);
30  void TransformEdges(size_t iteration);
31  void FindAndAugment(size_t iteration);
32  void Interlace(size_t iteration);
33  MultiPredecessorMap MapPathToOrig(size_t iteration);
34  double PathCosts(size_t iteration);
35 
36  void QueueCopyEdges();
37  void ClearAllEdges();
38  void QueueRemoveEdge(Vertex source, Vertex target);
39  void QueueAddEdge(Vertex source, Vertex target, double weight);
40  void UpdateEdges();
41  public:
43  ~KShortestPaths3();
44  MultiPredecessorMap Run(DirectedGraph& graph_orig,
45  Vertex source, Vertex sink,
46  size_t iterations);
47  };
48 }
49 
50 
51 #endif //GBMOT_KSHORTESTPATHS3_H
Definition: Berclaz.cpp:13
Definition: KShortestPaths3.h:12