Tracore
KShortestPaths2.h
1 //
2 // Created by wrede on 15.06.16.
3 //
4 
5 #ifndef GBMOT_KSHORTESTPATHS2_H
6 #define GBMOT_KSHORTESTPATHS2_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  double PathCosts(size_t iteration);
34 
35  void QueueCopyEdges();
36  void ClearAllEdges();
37  void QueueRemoveEdge(Vertex source, Vertex target);
38  void QueueAddEdge(Vertex source, Vertex target, double weight);
39  void UpdateEdges();
40  public:
42  ~KShortestPaths2();
43  MultiPredecessorMap Run(DirectedGraph& graph_orig,
44  Vertex source, Vertex sink,
45  size_t iterations);
46  };
47 }
48 
49 
50 #endif //GBMOT_KSHORTESTPATHS2_H
Definition: KShortestPaths2.h:12
Definition: Berclaz.cpp:13